Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
5dc725620b | |||
27d8a5cfb6 | |||
642fb3a625 | |||
3f7cd2a6ff | |||
21a1b11d68 | |||
d8beb03b96 | |||
eee90c784b | |||
74200083ab | |||
871bc299bd | |||
a18b58f438 | |||
cadb5515ea | |||
d8a10152b3 | |||
f09c43c1bd | |||
5c08f61963 |
43
CHANGELOG.md
43
CHANGELOG.md
@ -3,6 +3,49 @@ Changelog
|
||||
=========
|
||||
|
||||
|
||||
[v0.11.1][v0.11.1] (2024-09-19) {#v0.11.1}
|
||||
------------------------------------------
|
||||
|
||||
### Neue Funktionen {#v0.11.1-features}
|
||||
|
||||
* Im Anmeldungen-Fenster (`DeliveryAncmtAdminWindow`) mehr Filter hinzugefügt; das Gewicht wird (wie im Lieferungen-Fenster) aufgeschlüsselt. (27d8a5cfb6)
|
||||
|
||||
### Behobene Fehler {#v0.11.1-bugfixes}
|
||||
|
||||
* Beim Export der BKI-Liste werden Namen von Rechnungsadressen _immer_ richtig getrennt. (871bc299bd)
|
||||
* Flächenbindungen ohne Startsaison werden ohne Fehler gehandhabt. (21a1b11d68)
|
||||
|
||||
### Sonstiges {#v0.11.1-misc}
|
||||
|
||||
* Im Anmeldungen-Fenster (`DeliveryAncmtAdminWindow`)...
|
||||
* die Liste der Lesepläne vergrößert. (a18b58f438)
|
||||
* sind abgesagte Lesepläne durchgestrichen. (74200083ab)
|
||||
* wird beim Erstellen das Feld für die MgNr direkt fokussiert. (3f7cd2a6ff)
|
||||
* Abhängigkeiten aktualisiert. (eee90c784b, d8beb03b96)
|
||||
* Kleinigkeiten in `DeliveryService`. (642fb3a625)
|
||||
|
||||
[v0.11.1]: https://git.necronda.net/winzer/elwig/releases/tag/v0.11.1
|
||||
|
||||
|
||||
|
||||
|
||||
[v0.11.0][v0.11.0] (2024-09-16) {#v0.11.0}
|
||||
------------------------------------------
|
||||
|
||||
### Neue Funktionen {#v0.11.0-features}
|
||||
|
||||
* Im Rundschreiben-Fenster (`MailWindow`) können jetzt auch Funktionäre, Bio-Betriebe oder angemeldete Mitglieder für einen Leseplan adressiert werden. (5c08f61963)
|
||||
* Im Leseplan-Fenster (`DeliveryScheduleAdminWindow`) können nun auch Attribut, Bewirtschaftungsart, und ob der Leseplan abgesagt ist angegeben werden. (d8a10152b3)
|
||||
|
||||
### Sonstiges {#v0.11.0-misc}
|
||||
|
||||
* `App.HintContextChange()` ist synchron und fügt Arbeitsaufträge dem Dispatcher hinzu. (f09c43c1bd)
|
||||
|
||||
[v0.11.0]: https://git.necronda.net/winzer/elwig/releases/tag/v0.11.0
|
||||
|
||||
|
||||
|
||||
|
||||
[v0.10.8][v0.10.8] (2024-09-05) {#v0.10.8}
|
||||
------------------------------------------
|
||||
|
||||
|
@ -79,7 +79,7 @@ namespace Elwig {
|
||||
}
|
||||
|
||||
private static void OnContextChanged() {
|
||||
MainDispatcher.BeginInvoke(async () => await HintContextChange());
|
||||
MainDispatcher.BeginInvoke(HintContextChange);
|
||||
}
|
||||
|
||||
private static void OverrideCulture() {
|
||||
@ -201,13 +201,13 @@ namespace Elwig {
|
||||
BranchMobileNr = entry.Item8;
|
||||
}
|
||||
|
||||
public static async Task HintContextChange() {
|
||||
public static void HintContextChange() {
|
||||
var ch = CurrentLastWrite;
|
||||
if (ch > CurrentApp.LastChanged)
|
||||
CurrentApp.LastChanged = ch;
|
||||
foreach (Window w in CurrentApp.Windows) {
|
||||
if (w is not ContextWindow c) continue;
|
||||
await c.HintContextChange();
|
||||
MainDispatcher.BeginInvoke(c.HintContextChange);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@
|
||||
<td class="text">@areaCom.GstNr.Replace(",", ", ").Replace("-", "–")</td>
|
||||
<td class="number">@($"{areaCom.Area:N0}")</td>
|
||||
<td class="center">@areaCom.WineCult?.Name</td>
|
||||
<td class="center">@(areaCom.YearTo == null ? $"ab {areaCom.YearFrom}" : $"{areaCom.YearFrom}–{areaCom.YearTo}")</td>
|
||||
<td class="center">@(areaCom.YearTo == null ? (areaCom.YearFrom == null ? "unbefristet" : $"ab {areaCom.YearFrom}") : (areaCom.YearFrom == null ? $"bis {areaCom.YearTo}" : $"{areaCom.YearFrom}–{areaCom.YearTo}"))</td>
|
||||
</tr>
|
||||
lastContract = contractType.AreaComType.DisplayName;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
|
||||
<Version>0.10.8</Version>
|
||||
<Version>0.11.1</Version>
|
||||
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
@ -25,17 +25,17 @@
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.1" />
|
||||
<PackageReference Include="LinqKit" Version="1.3.0" />
|
||||
<PackageReference Include="MailKit" Version="4.7.1.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.32" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.33" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2739.15" />
|
||||
<PackageReference Include="NJsonSchema" Version="11.0.2" />
|
||||
<PackageReference Include="RazorLight" Version="2.3.1" />
|
||||
<PackageReference Include="ScottPlot.WPF" Version="5.0.36" />
|
||||
<PackageReference Include="ScottPlot.WPF" Version="5.0.39" />
|
||||
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
@ -9,7 +9,7 @@ namespace Elwig.Helpers {
|
||||
public static class AppDbUpdater {
|
||||
|
||||
// Don't forget to update value in Tests/fetch-resources.bat!
|
||||
public static readonly int RequiredSchemaVersion = 28;
|
||||
public static readonly int RequiredSchemaVersion = 30;
|
||||
|
||||
private static int VersionOffset = 0;
|
||||
|
||||
|
@ -274,7 +274,7 @@ namespace Elwig.Helpers.Export {
|
||||
await ctx.SaveChangesAsync();
|
||||
await AddImportedFiles(Path.GetFileName(meta.FileName));
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
MessageBox.Show(
|
||||
$"Das importieren der Daten war erfolgreich!\n" +
|
||||
@ -565,7 +565,7 @@ namespace Elwig.Helpers.Export {
|
||||
KgNr = kgnr,
|
||||
GstNr = json["gstnr"]?.AsValue().GetValue<string>() ?? "-",
|
||||
RdNr = rd?.RdNr,
|
||||
YearFrom = json["year_from"]!.AsValue().GetValue<int>(),
|
||||
YearFrom = json["year_from"]?.AsValue().GetValue<int>(),
|
||||
YearTo = json["year_to"]?.AsValue().GetValue<int>(),
|
||||
Comment = json["comment"]?.AsValue().GetValue<string>(),
|
||||
}, newRd ? rd : null);
|
||||
|
@ -348,7 +348,7 @@ namespace Elwig.Helpers {
|
||||
}
|
||||
|
||||
public static (string, string?) SplitName(string fullName, string? familyName) {
|
||||
if (familyName == null || familyName == "") return (fullName, null);
|
||||
if (string.IsNullOrWhiteSpace(familyName)) return (fullName, null);
|
||||
var p0 = fullName.IndexOf(familyName, StringComparison.CurrentCultureIgnoreCase);
|
||||
if (p0 == -1) return (fullName, null);
|
||||
var p1 = fullName.IndexOf(" und ");
|
||||
@ -362,8 +362,10 @@ namespace Elwig.Helpers {
|
||||
var p3 = fullName.LastIndexOf(' ', p2 - 1);
|
||||
return (fullName[0..p3], fullName[(p3 + 1)..^0]);
|
||||
}
|
||||
} else {
|
||||
} else if (p0 + familyName.Length >= fullName.Length || fullName[p0 + familyName.Length] == ' ') {
|
||||
return (familyName, fullName.Replace(familyName, "").Replace(" ", " ").Trim());
|
||||
} else {
|
||||
return (fullName, null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -558,7 +560,7 @@ namespace Elwig.Helpers {
|
||||
|
||||
public static Expression<Func<AreaCom, bool>> ActiveAreaCommitments() => ActiveAreaCommitments(CurrentYear);
|
||||
public static Expression<Func<AreaCom, bool>> ActiveAreaCommitments(int year) =>
|
||||
c => (c.YearFrom <= year) && (c.YearTo == null || c.YearTo >= year);
|
||||
c => (c.YearFrom == null || c.YearFrom <= year) && (c.YearTo == null || c.YearTo >= year);
|
||||
|
||||
public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query) => ActiveAreaCommitments(query, CurrentYear);
|
||||
public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query, int year) =>
|
||||
|
@ -32,7 +32,7 @@ namespace Elwig.Models.Entities {
|
||||
public int? RdNr { get; set; }
|
||||
|
||||
[Column("year_from")]
|
||||
public int YearFrom { get; set; }
|
||||
public int? YearFrom { get; set; }
|
||||
|
||||
[Column("year_to")]
|
||||
public int? YearTo { get; set; }
|
||||
|
@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace Elwig.Models.Entities {
|
||||
[Table("delivery_schedule"), PrimaryKey("Year", "DsNr")]
|
||||
@ -29,6 +30,15 @@ namespace Elwig.Models.Entities {
|
||||
[Column("description")]
|
||||
public required string Description { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string Identifier => $"{Date:dd.MM.} - {ZwstId} - {Description}";
|
||||
|
||||
[Column("attrid")]
|
||||
public string? AttrId { get; set; }
|
||||
|
||||
[Column("cultid")]
|
||||
public string? CultId { get; set; }
|
||||
|
||||
[Column("max_weight")]
|
||||
public int? MaxWeight { get; set; }
|
||||
[NotMapped]
|
||||
@ -36,6 +46,11 @@ namespace Elwig.Models.Entities {
|
||||
[NotMapped]
|
||||
public double? Percent => (double)AnnouncedWeight / MaxWeight * 100;
|
||||
|
||||
[Column("cancelled")]
|
||||
public bool IsCancelled { get; set; }
|
||||
[NotMapped]
|
||||
public TextDecorationCollection? TextDecoration => IsCancelled ? TextDecorations.Strikethrough : null;
|
||||
|
||||
[Column("ancmt_from")]
|
||||
public long? AncmtFromUnix { get; set; }
|
||||
[NotMapped]
|
||||
@ -58,6 +73,12 @@ namespace Elwig.Models.Entities {
|
||||
[ForeignKey("ZwstId")]
|
||||
public virtual Branch Branch { get; private set; } = null!;
|
||||
|
||||
[ForeignKey("AttrId")]
|
||||
public virtual WineAttr? Attribute { get; private set; }
|
||||
|
||||
[ForeignKey("CultId")]
|
||||
public virtual WineCult? Cultivation { get; private set; }
|
||||
|
||||
[InverseProperty(nameof(DeliveryScheduleWineVar.Schedule))]
|
||||
public virtual ICollection<DeliveryScheduleWineVar> Varieties { get; private set; } = null!;
|
||||
|
||||
|
@ -167,6 +167,9 @@ namespace Elwig.Models.Entities {
|
||||
[InverseProperty(nameof(BillingAddr.Member))]
|
||||
public virtual BillingAddr? BillingAddress { get; private set; }
|
||||
|
||||
[InverseProperty(nameof(Delivery.Member))]
|
||||
public virtual ICollection<DeliveryAncmt> Announcements { get; private set; } = null!;
|
||||
|
||||
[InverseProperty(nameof(Delivery.Member))]
|
||||
public virtual ICollection<Delivery> Deliveries { get; private set; } = null!;
|
||||
|
||||
|
23
Elwig/Resources/Sql/28-29.sql
Normal file
23
Elwig/Resources/Sql/28-29.sql
Normal file
@ -0,0 +1,23 @@
|
||||
-- schema version 28 to 29
|
||||
|
||||
ALTER TABLE delivery_schedule ADD COLUMN attrid TEXT DEFAULT NULL;
|
||||
ALTER TABLE delivery_schedule ADD COLUMN cultid TEXT DEFAULT NULL;
|
||||
ALTER TABLE delivery_schedule ADD COLUMN cancelled INTEGER NOT NULL CHECK (cancelled IN (TRUE, FALSE)) DEFAULT FALSE;
|
||||
UPDATE delivery_schedule SET cultid = 'B' WHERE UPPER(description) LIKE '%BIO%';
|
||||
UPDATE delivery_schedule SET cancelled = TRUE WHERE zwstid = 'M' AND date IN ('2024-09-14', '2024-09-16');
|
||||
|
||||
PRAGMA writable_schema = ON;
|
||||
|
||||
UPDATE sqlite_schema SET sql = REPLACE(sql, '
|
||||
) STRICT', ',
|
||||
CONSTRAINT fk_delivery_schedule_wine_attribute FOREIGN KEY (attrid) REFERENCES wine_attribute (attrid)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE RESTRICT,
|
||||
CONSTRAINT fk_delivery_schedule_wine_cultivation FOREIGN KEY (cultid) REFERENCES wine_cultivation (cultid)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE RESTRICT
|
||||
) STRICT')
|
||||
WHERE type = 'table' AND name = 'delivery_schedule';
|
||||
|
||||
PRAGMA schema_version = 2801;
|
||||
PRAGMA writable_schema = OFF;
|
18
Elwig/Resources/Sql/29-30.sql
Normal file
18
Elwig/Resources/Sql/29-30.sql
Normal file
@ -0,0 +1,18 @@
|
||||
-- schema version 29 to 30
|
||||
|
||||
PRAGMA writable_schema = ON;
|
||||
|
||||
DROP VIEW v_bki_member;
|
||||
CREATE VIEW v_bki_member AS
|
||||
SELECT s.year, m.mgnr, m.lfbis_nr, m.name,
|
||||
(COALESCE(m.prefix || ' ', '') || m.given_name || COALESCE(' ' || m.middle_names, '') || COALESCE(' ' || m.suffix, '')) AS other_names,
|
||||
a.name AS billing_name, COALESCE(a.address, m.address) AS address,
|
||||
COALESCE(a.country, m.country) AS country, COALESCE(a.postal_dest, m.postal_dest) AS postal_dest,
|
||||
SUM(COALESCE(IIF((c.year_from IS NULL OR c.year_from <= s.year) AND (c.year_to IS NULL OR c.year_to >= s.year), c.area, NULL), 0)) AS area
|
||||
FROM season s, member m
|
||||
LEFT JOIN member_billing_address a ON a.mgnr = m.mgnr
|
||||
LEFT JOIN area_commitment c ON c.mgnr = m.mgnr
|
||||
GROUP BY s.year, m.mgnr;
|
||||
|
||||
PRAGMA schema_version = 2901;
|
||||
PRAGMA writable_schema = OFF;
|
@ -106,7 +106,7 @@ namespace Elwig.Services {
|
||||
var a = new AreaCom {
|
||||
FbNr = oldFbNr ?? newFbNr,
|
||||
MgNr = (int)vm.MgNr!,
|
||||
YearFrom = (int)vm.YearFrom!,
|
||||
YearFrom = vm.YearFrom,
|
||||
YearTo = vm.YearTo,
|
||||
VtrgId = vm.AreaComType!.VtrgId,
|
||||
CultId = vm.WineCult?.CultId,
|
||||
@ -136,7 +136,7 @@ namespace Elwig.Services {
|
||||
}
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
return newFbNr;
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ using Microsoft.Win32;
|
||||
using System.Windows.Input;
|
||||
using System.Windows;
|
||||
using System;
|
||||
using LinqKit;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Elwig.Services {
|
||||
public static class DeliveryAncmtService {
|
||||
@ -53,11 +55,21 @@ namespace Elwig.Services {
|
||||
var filterVar = new List<string>();
|
||||
var filterNotVar = new List<string>();
|
||||
var filterMgNr = new List<int>();
|
||||
var filterZwst = new List<string>();
|
||||
var filterAttr = new List<string>();
|
||||
var filterNotAttr = new List<string>();
|
||||
var filterCult = new List<string>();
|
||||
var filterNotCult = new List<string>();
|
||||
var filterDate = new List<(string?, string?)>();
|
||||
int filterWeightGt = 0, filterWeightLt = 0;
|
||||
|
||||
var filter = vm.TextFilter;
|
||||
if (filter.Count > 0) {
|
||||
var var = await ctx.WineVarieties.ToDictionaryAsync(v => v.SortId, v => v);
|
||||
var mgnr = await ctx.Members.ToDictionaryAsync(m => m.MgNr.ToString(), m => m);
|
||||
var zwst = await ctx.Branches.ToDictionaryAsync(b => b.Name.ToLower().Split(' ')[0], b => b);
|
||||
var attr = await ctx.WineAttributes.ToDictionaryAsync(a => a.Name.ToLower().Split(' ')[0], a => a);
|
||||
var cult = await ctx.WineCultivations.ToDictionaryAsync(c => c.Name.ToLower().Split(' ')[0], c => c);
|
||||
|
||||
for (int i = 0; i < filter.Count; i++) {
|
||||
var e = filter[i];
|
||||
@ -81,6 +93,82 @@ namespace Elwig.Services {
|
||||
filterMgNr.Add(int.Parse(e));
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add(member.AdministrativeName);
|
||||
} else if (attr.ContainsKey(e.ToLower())) {
|
||||
var a = attr[e.ToLower()];
|
||||
filterAttr.Add(a.AttrId);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add($"Attribut {a.Name}");
|
||||
} else if (e[0] == '!' && attr.ContainsKey(e[1..].ToLower())) {
|
||||
var a = attr[e[1..].ToLower()];
|
||||
filterNotAttr.Add(a.AttrId);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add($"ohne Attribut {a.Name}");
|
||||
} else if (cult.ContainsKey(e.ToLower())) {
|
||||
var c = cult[e.ToLower()];
|
||||
filterCult.Add(c.CultId);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add($"Bewirtschaftung {c.Name}");
|
||||
} else if (e[0] == '!' && cult.ContainsKey(e[1..].ToLower())) {
|
||||
var c = cult[e[1..].ToLower()];
|
||||
filterNotCult.Add(c.CultId);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add($"ohne Bewirtschaftung {c.Name}");
|
||||
} else if (zwst.ContainsKey(e.ToLower())) {
|
||||
var b = zwst[e.ToLower()];
|
||||
filterZwst.Add(b.ZwstId);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add($"Zweigstelle {b.Name}");
|
||||
} else if ((e.StartsWith('>') || e.StartsWith('<')) && e.EndsWith("kg")) {
|
||||
if (int.TryParse(e[1..^2], out var num)) {
|
||||
switch (e[0]) {
|
||||
case '>': filterWeightGt = num; break;
|
||||
case '<': filterWeightLt = num; break;
|
||||
}
|
||||
filter.RemoveAt(i--);
|
||||
}
|
||||
if (e.Length == 3) filter.RemoveAt(i--);
|
||||
} else if (DateOnly.TryParse(e, out var date)) {
|
||||
var str = date.ToString("yyyy-MM-dd");
|
||||
filterDate.Add((str, str));
|
||||
filter.RemoveAt(i--);
|
||||
if (filterNames.Contains($"{vm.FilterSeason}") && vm.FilterSeason == date.Year)
|
||||
filterNames.Remove($"{vm.FilterSeason}");
|
||||
filterNames.Add(date.ToString("dd.MM.yyyy"));
|
||||
} else if (Utils.DateFromToRegex.IsMatch(e)) {
|
||||
var parts = e.Split("-");
|
||||
if (parts.Length == 1) {
|
||||
// single date
|
||||
var dParts = parts[0].Split('.');
|
||||
var str = $"{dParts[2]}-{dParts[1].PadLeft(2, '0')}-{dParts[0].PadLeft(2, '0')}";
|
||||
filterDate.Add((str, str));
|
||||
filter.RemoveAt(i--);
|
||||
var n = string.Join('.', str.Split('-').Reverse());
|
||||
if (dParts[2] == "") {
|
||||
filterNames.Remove($"{vm.FilterSeason}");
|
||||
filterNames.Add(n + $"{vm.FilterSeason}");
|
||||
} else {
|
||||
if ($"{vm.FilterSeason}" == dParts[2])
|
||||
filterNames.Remove($"{vm.FilterSeason}");
|
||||
filterNames.Add(n);
|
||||
}
|
||||
} else if (parts.Length == 2) {
|
||||
// from/to date
|
||||
var d1Parts = parts[0].Split('.');
|
||||
var d2Parts = parts[1].Split('.');
|
||||
var s1 = d1Parts.Length < 2 ? null : $"{d1Parts.ElementAtOrDefault(2)}-{d1Parts[1].PadLeft(2, '0')}-{d1Parts[0].PadLeft(2, '0')}";
|
||||
var s2 = d2Parts.Length < 2 ? null : $"{d2Parts.ElementAtOrDefault(2)}-{d2Parts[1].PadLeft(2, '0')}-{d2Parts[0].PadLeft(2, '0')}";
|
||||
filterDate.Add((s1, s2));
|
||||
filter.RemoveAt(i--);
|
||||
var n1 = s1 == null ? null : string.Join('.', s1.Split('-').Reverse());
|
||||
var n2 = s2 == null ? null : string.Join('.', s2.Split('-').Reverse());
|
||||
if (n1 != null && n2 != null) {
|
||||
filterNames.Add($"{n1}–{n2}");
|
||||
} else if (n1 != null) {
|
||||
filterNames.Add($"ab dem {n1}");
|
||||
} else if (n2 != null) {
|
||||
filterNames.Add($"bis zum {n2}");
|
||||
}
|
||||
}
|
||||
} else if (e.Length > 2 && e.StartsWith('"') && e.EndsWith('"')) {
|
||||
filter[i] = e[1..^1];
|
||||
} else if (e.Length <= 2) {
|
||||
@ -88,9 +176,30 @@ namespace Elwig.Services {
|
||||
}
|
||||
}
|
||||
|
||||
if (filterWeightGt > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => a.Weight >= filterWeightGt);
|
||||
if (filterWeightLt > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => a.Weight <= filterWeightLt);
|
||||
if (filterMgNr.Count > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => filterMgNr.Contains(a.MgNr));
|
||||
if (filterDate.Count > 0) {
|
||||
var pr = PredicateBuilder.New<DeliveryAncmt>(false);
|
||||
foreach (var (d1, d2) in filterDate)
|
||||
pr.Or(a => (d1 == null || d1.CompareTo(a.Schedule.DateString.Substring(10 - d1.Length)) <= 0) && (d2 == null || d2.CompareTo(a.Schedule.DateString.Substring(10 - d2.Length)) >= 0));
|
||||
deliveryAncmtQuery = deliveryAncmtQuery.Where(pr);
|
||||
}
|
||||
if (filterVar.Count > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => filterVar.Contains(a.SortId));
|
||||
if (filterNotVar.Count > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => !filterNotVar.Contains(a.SortId));
|
||||
if (filterZwst.Count > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => filterZwst.Contains(a.Schedule.ZwstId));
|
||||
if (filterAttr.Count > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => a.Schedule.AttrId != null && filterAttr.Contains(a.Schedule.AttrId));
|
||||
if (filterNotAttr.Count > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => a.Schedule.AttrId == null || !filterNotAttr.Contains(a.Schedule.AttrId));
|
||||
if (filterCult.Count > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => a.Schedule.CultId != null && filterCult.Contains(a.Schedule.CultId));
|
||||
if (filterNotCult.Count > 0) deliveryAncmtQuery = deliveryAncmtQuery.Where(a => a.Schedule.CultId == null || !filterNotCult.Contains(a.Schedule.CultId));
|
||||
|
||||
if (filterWeightGt > 0 && filterWeightLt > 0) {
|
||||
filterNames.Add($"{filterWeightGt:N0}–{filterWeightLt:N0} kg");
|
||||
} else if (filterWeightGt > 0) {
|
||||
filterNames.Add($"ab {filterWeightGt:N0} kg");
|
||||
} else if (filterWeightLt > 0) {
|
||||
filterNames.Add($"bis {filterWeightLt:N0} kg");
|
||||
}
|
||||
}
|
||||
|
||||
return (filterNames, deliveryAncmtQuery, filter);
|
||||
@ -125,7 +234,7 @@ namespace Elwig.Services {
|
||||
}
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
return (year, dsnr, newMgNr, newSortId);
|
||||
}
|
||||
@ -182,5 +291,108 @@ namespace Elwig.Services {
|
||||
Mouse.OverrideCursor = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddToolTipCell(Grid grid, string text, int row, int col, int colSpan = 1, bool bold = false, bool alignRight = false, bool alignCenter = false) {
|
||||
var tb = new TextBlock() {
|
||||
Text = text,
|
||||
TextAlignment = alignRight ? TextAlignment.Right : alignCenter ? TextAlignment.Center : TextAlignment.Left,
|
||||
Margin = new(0, 12 * row, 0, 0),
|
||||
FontWeight = bold ? FontWeights.Bold : FontWeights.Normal,
|
||||
};
|
||||
tb.SetValue(Grid.ColumnProperty, col);
|
||||
tb.SetValue(Grid.ColumnSpanProperty, colSpan);
|
||||
grid.Children.Add(tb);
|
||||
}
|
||||
|
||||
private static void AddToolTipRow(Grid grid, int row, string? h1, string? h2, int weight, int? total1, int total2) {
|
||||
var bold = h2 == null;
|
||||
if (h1 != null) AddToolTipCell(grid, h1 + ":", row, 0, (h2 == null) ? 2 : 1, bold);
|
||||
if (h2 != null) AddToolTipCell(grid, h2 + ":", row, 1, 1, bold);
|
||||
AddToolTipCell(grid, $"{weight:N0} kg", row, 2, 1, bold, true);
|
||||
if (total1 != null && total1 != 0)
|
||||
AddToolTipCell(grid, $"{weight * 100.0 / total1:N1} %", row, 3, 1, bold, true);
|
||||
if (total2 != 0)
|
||||
AddToolTipCell(grid, $"{weight * 100.0 / total2:N1} %", row, 4, 1, bold, true);
|
||||
}
|
||||
|
||||
public static async Task<(string, Grid)> GenerateToolTip(IQueryable<DeliveryAncmt> deliveryAncmts) {
|
||||
var grid = new Grid();
|
||||
grid.ColumnDefinitions.Add(new() { Width = new(10) });
|
||||
grid.ColumnDefinitions.Add(new() { Width = new(60) });
|
||||
grid.ColumnDefinitions.Add(new() { Width = new(80) });
|
||||
grid.ColumnDefinitions.Add(new() { Width = new(50) });
|
||||
grid.ColumnDefinitions.Add(new() { Width = new(50) });
|
||||
var text = "-";
|
||||
|
||||
var weight = await deliveryAncmts.SumAsync(p => p.Weight);
|
||||
text = $"{weight:N0} kg";
|
||||
AddToolTipRow(grid, 0, "Gewicht", null, weight, null, weight);
|
||||
|
||||
if (await deliveryAncmts.AnyAsync()) {
|
||||
var attrGroups = await deliveryAncmts
|
||||
.GroupBy(a => new { Attr = a.Schedule.Attribute!.Name, Cult = a.Schedule.Cultivation!.Name })
|
||||
.Select(g => new {
|
||||
g.Key.Attr,
|
||||
g.Key.Cult,
|
||||
Weight = g.Sum(a => a.Weight)
|
||||
})
|
||||
.OrderByDescending(g => g.Weight)
|
||||
.ThenBy(g => g.Attr)
|
||||
.ThenBy(g => g.Cult)
|
||||
.ToListAsync();
|
||||
var sortGroups = await deliveryAncmts
|
||||
.GroupBy(a => a.SortId)
|
||||
.Select(g => new {
|
||||
SortId = g.Key,
|
||||
Weight = g.Sum(a => a.Weight)
|
||||
})
|
||||
.OrderByDescending(g => g.Weight)
|
||||
.ThenBy(g => g.SortId)
|
||||
.ToListAsync();
|
||||
var groups = await deliveryAncmts
|
||||
.GroupBy(a => new {
|
||||
Attr = a.Schedule.Attribute!.Name,
|
||||
Cult = a.Schedule.Cultivation!.Name,
|
||||
a.SortId,
|
||||
})
|
||||
.Select(g => new {
|
||||
g.Key.Attr,
|
||||
g.Key.Cult,
|
||||
g.Key.SortId,
|
||||
Weight = g.Sum(p => p.Weight)
|
||||
})
|
||||
.OrderByDescending(g => g.Weight)
|
||||
.ThenBy(g => g.Attr)
|
||||
.ThenBy(g => g.Cult)
|
||||
.ThenBy(g => g.SortId)
|
||||
.ToListAsync();
|
||||
|
||||
int rowNum = 1;
|
||||
foreach (var attrG in attrGroups) {
|
||||
rowNum++;
|
||||
var name = attrG.Attr == null && attrG.Cult == null ? null : attrG.Attr + (attrG.Attr != null && attrG.Cult != null ? " / " : "") + attrG.Cult;
|
||||
AddToolTipRow(grid, rowNum++, name, null, attrG.Weight, attrG.Weight, weight);
|
||||
foreach (var g in groups.Where(g => g.Attr == attrG.Attr && g.Cult == attrG.Cult).OrderByDescending(g => g.Weight).ThenBy(g => g.SortId)) {
|
||||
AddToolTipRow(grid, rowNum++, null, g.SortId, g.Weight, attrG.Weight, weight);
|
||||
}
|
||||
}
|
||||
|
||||
if (attrGroups.Count == 1) {
|
||||
var g = attrGroups.First();
|
||||
var name = g.Attr == null && g.Cult == null ? null : g.Attr + (g.Attr != null && g.Cult != null ? " / " : "") + g.Cult;
|
||||
if (name != null) {
|
||||
text += $" [{name}]";
|
||||
}
|
||||
if (sortGroups.Count > 1 && sortGroups.Count <= 4) {
|
||||
text += $" = {string.Join(" + ", sortGroups.Select(g => $"{g.Weight:N0} kg ({(double)g.Weight / weight:0%})" + (g.SortId == null ? "" : $" [{g.SortId}]")))}";
|
||||
|
||||
}
|
||||
} else if (attrGroups.Count <= 4) {
|
||||
text += $" = {string.Join(" + ", attrGroups.Select(g => $"{g.Weight:N0} kg ({(double)g.Weight / weight:0%})" + (g.Attr == null && g.Cult == null ? "" : $" [{g.Attr}{(g.Attr != null && g.Cult != null ? " / " : "")}{g.Cult}]")))}";
|
||||
}
|
||||
}
|
||||
|
||||
return (text, grid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ namespace Elwig.Services {
|
||||
vm.Branch = (Branch?)ControlUtils.GetItemFromSourceWithPk(vm.BranchSource, s.ZwstId);
|
||||
vm.Description = s.Description;
|
||||
vm.MaxWeight = s.MaxWeight;
|
||||
vm.IsCancelled = s.IsCancelled;
|
||||
vm.MainVarieties.Clear();
|
||||
foreach (var v in s.Varieties.Where(v => v.Priority == 1)) {
|
||||
vm.MainVarieties.Add((WineVar)ControlUtils.GetItemFromSourceWithPk(vm.MainVarietiesSource, v.SortId)!);
|
||||
@ -34,6 +35,8 @@ namespace Elwig.Services {
|
||||
foreach (var v in s.Varieties.Where(v => v.Priority != 1)) {
|
||||
vm.OtherVarieties.Add((WineVar)ControlUtils.GetItemFromSourceWithPk(vm.OtherVarietiesSource, v.SortId)!);
|
||||
}
|
||||
vm.Attribute = ControlUtils.GetItemFromSourceWithPk(vm.AttributeSource, s.AttrId) as WineAttr;
|
||||
vm.Cultivation = ControlUtils.GetItemFromSourceWithPk(vm.CultivationSource, s.CultId) as WineCult;
|
||||
vm.AncmtFrom = s.AncmtFrom;
|
||||
vm.AncmtTo = s.AncmtTo?.AddSeconds(-1);
|
||||
}
|
||||
@ -156,7 +159,10 @@ namespace Elwig.Services {
|
||||
DateString = $"{vm.Date:yyyy-MM-dd}",
|
||||
ZwstId = vm.Branch!.ZwstId,
|
||||
Description = vm.Description,
|
||||
AttrId = vm.Attribute?.AttrId,
|
||||
CultId = vm.Cultivation?.CultId,
|
||||
MaxWeight = vm.MaxWeight,
|
||||
IsCancelled = vm.IsCancelled,
|
||||
AncmtFrom = vm.AncmtFrom,
|
||||
AncmtTo = vm.AncmtTo?.AddMinutes(1),
|
||||
};
|
||||
@ -177,7 +183,7 @@ namespace Elwig.Services {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ namespace Elwig.Services {
|
||||
var var = await ctx.WineVarieties.ToDictionaryAsync(v => v.SortId, v => v);
|
||||
var qual = await ctx.WineQualityLevels.Where(q => !q.IsPredicate).ToDictionaryAsync(q => q.QualId, q => q);
|
||||
var mgnr = await ctx.Members.ToDictionaryAsync(m => m.MgNr.ToString(), m => m);
|
||||
var zwst = await ctx.Branches.ToDictionaryAsync(b => b.Name.ToLower().Split(" ")[0], b => b);
|
||||
var zwst = await ctx.Branches.ToDictionaryAsync(b => b.Name.ToLower().Split(' ')[0], b => b);
|
||||
var attr = await ctx.WineAttributes.ToDictionaryAsync(a => a.Name.ToLower().Split(' ')[0], a => a);
|
||||
var cult = await ctx.WineCultivations.ToDictionaryAsync(c => c.Name.ToLower().Split(' ')[0], c => c);
|
||||
|
||||
@ -183,11 +183,11 @@ namespace Elwig.Services {
|
||||
} else if (e.ToLower() == "!gerebelt") {
|
||||
prd = prd.And(p => p.IsNetWeight == false);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("brutto Wiegung");
|
||||
filterNames.Add("nicht gerebelt gewogen");
|
||||
} else if (e.ToLower() == "gerebelt") {
|
||||
prd = prd.And(p => p.IsNetWeight == true);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("netto Wiegung");
|
||||
filterNames.Add("gerebelt gewogen");
|
||||
} else if (e.Length >= 5 && e.Length <= 9 && "lesewagen".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.IsLesewagen == true);
|
||||
filter.RemoveAt(i--);
|
||||
@ -763,6 +763,7 @@ namespace Elwig.Services {
|
||||
})
|
||||
.OrderByDescending(g => g.Weight)
|
||||
.ThenBy(g => g.Attr)
|
||||
.ThenBy(g => g.Cult)
|
||||
.ToListAsync();
|
||||
var sortGroups = await deliveryParts
|
||||
.GroupBy(p => p.SortId)
|
||||
@ -791,8 +792,9 @@ namespace Elwig.Services {
|
||||
Avg = g.Sum(p => p.Kmw * p.Weight) / g.Sum(p => p.Weight),
|
||||
Max = g.Max(p => p.Kmw)
|
||||
})
|
||||
.OrderByDescending(g => g.SortId)
|
||||
.OrderByDescending(g => g.Weight)
|
||||
.ThenBy(g => g.Attr)
|
||||
.ThenBy(g => g.Cult)
|
||||
.ThenBy(g => g.SortId)
|
||||
.ToListAsync();
|
||||
|
||||
|
@ -338,7 +338,7 @@ namespace Elwig.Services {
|
||||
var b = new Billing(year);
|
||||
await b.FinishSeason();
|
||||
await b.CalculateBuckets();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
using var ctx = new AppDbContext();
|
||||
var data = await DeliveryConfirmationDeliveryData.ForMember(ctx.DeliveryParts, year, m);
|
||||
@ -626,7 +626,7 @@ namespace Elwig.Services {
|
||||
}
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
return newMgNr;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ using Elwig.Models.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Elwig.ViewModels {
|
||||
public partial class DeliveryAncmtAdminViewModel : ObservableObject {
|
||||
@ -73,6 +74,9 @@ namespace Elwig.ViewModels {
|
||||
[ObservableProperty]
|
||||
private string _statusAncmtModified = "-";
|
||||
|
||||
[ObservableProperty]
|
||||
private Grid? _statusWeightToolTip;
|
||||
|
||||
[ObservableProperty]
|
||||
private Visibility _controlButtonsVisibility = Visibility.Visible;
|
||||
[ObservableProperty]
|
||||
|
@ -47,12 +47,30 @@ namespace Elwig.ViewModels {
|
||||
get => int.TryParse(MaxWeightString, out var w) ? w : null;
|
||||
set => MaxWeightString = $"{value}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private bool _isCancelled;
|
||||
public ObservableCollection<WineVar> MainVarieties { get; set; } = [];
|
||||
[ObservableProperty]
|
||||
private IEnumerable<WineVar> _mainVarietiesSource = [];
|
||||
public ObservableCollection<WineVar> OtherVarieties { get; set; } = [];
|
||||
[ObservableProperty]
|
||||
private IEnumerable<WineVar> _otherVarietiesSource = [];
|
||||
[ObservableProperty]
|
||||
private IEnumerable<object> _attributeSource = [];
|
||||
[ObservableProperty]
|
||||
private object? _attributeObj;
|
||||
public WineAttr? Attribute {
|
||||
get => AttributeObj as WineAttr;
|
||||
set => AttributeObj = value ?? AttributeSource.FirstOrDefault();
|
||||
}
|
||||
[ObservableProperty]
|
||||
private IEnumerable<object> _cultivationSource = [];
|
||||
[ObservableProperty]
|
||||
private object? _cultivationObj;
|
||||
public WineCult? Cultivation {
|
||||
get => CultivationObj as WineCult;
|
||||
set => CultivationObj = value ?? CultivationSource.FirstOrDefault();
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
private string _ancmtFromDateString = "";
|
||||
|
@ -209,7 +209,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(a);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -196,7 +196,7 @@ namespace Elwig.Windows {
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
MessageBox.Show(str, "Saison anlegen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
SeasonList.SelectedIndex = 0;
|
||||
}
|
||||
@ -219,7 +219,7 @@ namespace Elwig.Windows {
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
MessageBox.Show(str, "Saison löschen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
}
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ namespace Elwig.Windows {
|
||||
LockInputs();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
}
|
||||
|
||||
private void FillInputs(ClientParameters p, Season? s) {
|
||||
|
@ -672,7 +672,7 @@ namespace Elwig.Windows {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
LockContext = false;
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank gespeichert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -84,7 +84,7 @@
|
||||
<RowDefinition Height="42"/>
|
||||
<RowDefinition Height="1*" MinHeight="100"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="2*" MinHeight="100"/>
|
||||
<RowDefinition Height="1*" MinHeight="100"/>
|
||||
<RowDefinition Height="42"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -105,7 +105,12 @@
|
||||
Filtern nach:<LineBreak/>
|
||||
<Bold>Sorte</Bold>: z.B. GV, ZW, rr, sa, !gv (ausgenommen GV), ...<LineBreak/>
|
||||
<Bold>Rot/Weiß</Bold>: z.B. r, Rot, w, weiß, ...<LineBreak/>
|
||||
<Bold>Mitglied</Bold>: z.B. 1234, 987, ...
|
||||
<Bold>Mitglied</Bold>: z.B. 1234, 987, ...<LineBreak/>
|
||||
<Bold>Zweigstelle</Bold>: z.B. musterort, ...<LineBreak/>
|
||||
<Bold>Attribut</Bold>: z.B. kabinett, !kabinett (alle außer kabinett), ...<LineBreak/>
|
||||
<Bold>Bewirtschaftung</Bold>: z.B. bio, !kip (alle außer KIP), ...<LineBreak/>
|
||||
<Bold>Gewicht</Bold>: z.B. <500kg, >6000kg, ...<LineBreak/>
|
||||
<Bold>Datum</Bold>: z.B. 1.9., 15.9.-10.10., -15.10.2020, ...
|
||||
</TextBlock>
|
||||
</TextBox.ToolTip>
|
||||
</TextBox>
|
||||
@ -129,7 +134,7 @@
|
||||
<TextBlock Text="{Binding Date, StringFormat='ddd.'}" Width="24"/>
|
||||
<TextBlock Text="{Binding Date, StringFormat='dd.MM.'}" Width="32"/>
|
||||
<TextBlock Text="{Binding ZwstId}" Width="25" TextAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Description}" Width="200"/>
|
||||
<TextBlock Text="{Binding Description}" Width="200" TextDecorations="{Binding TextDecoration}"/>
|
||||
<TextBlock TextAlignment="Right">
|
||||
<TextBlock Text="{Binding AnnouncedWeight, StringFormat='{}{0:N0}'}" Width="42" TextAlignment="Right"/> kg
|
||||
/ <TextBlock Text="{Binding MaxWeight, StringFormat='{}{0:N0}'}" Width="42" TextAlignment="Right"/> kg
|
||||
@ -288,7 +293,7 @@
|
||||
<TextBlock Text="{Binding Date, StringFormat='ddd.'}" Width="28"/>
|
||||
<TextBlock Text="{Binding Date, StringFormat='dd.MM.'}" Width="35"/>
|
||||
<TextBlock Text="{Binding ZwstId}" Width="30" TextAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Description}"/>
|
||||
<TextBlock Text="{Binding Description}" TextDecorations="{Binding TextDecoration}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
@ -324,11 +329,11 @@
|
||||
<ItemsPanelTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" MinWidth="120"/>
|
||||
<ColumnDefinition Width="0.5*" MinWidth="120"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*" MinWidth="150"/>
|
||||
<ColumnDefinition Width="1.75*" MinWidth="150"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="2.25*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
@ -342,7 +347,7 @@
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="1"/>
|
||||
<StatusBarItem Grid.Column="2">
|
||||
<TextBlock>
|
||||
<TextBlock ToolTip="{Binding StatusWeightToolTip}">
|
||||
Gewicht: <Run Text="{Binding StatusWeight}"/>
|
||||
</TextBlock>
|
||||
</StatusBarItem>
|
||||
|
@ -134,7 +134,14 @@ namespace Elwig.Windows {
|
||||
DeliveryAncmtList.ScrollIntoView(DeliveryAncmtList.SelectedItem);
|
||||
|
||||
ViewModel.StatusAncmts = $"{deliveryAncmts.Count:N0}";
|
||||
ViewModel.StatusWeight = $"{deliveryAncmts.Sum(a => a.Weight):N0} kg";
|
||||
if (filter.Count == 0) {
|
||||
var (text, grid) = await DeliveryAncmtService.GenerateToolTip(deliveryAncmtQuery);
|
||||
ViewModel.StatusWeight = text;
|
||||
ViewModel.StatusWeightToolTip = grid;
|
||||
} else {
|
||||
ViewModel.StatusWeight = $"{deliveryAncmts.Sum(a => a.Weight):N0} kg";
|
||||
ViewModel.StatusWeightToolTip = null;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RefreshInputs(bool validate = false) {
|
||||
@ -276,6 +283,9 @@ namespace Elwig.Windows {
|
||||
InitInputs();
|
||||
ViewModel.MgNr = mgnr;
|
||||
ViewModel.EnableSearchInputs = false;
|
||||
|
||||
MgNrInput.Focus();
|
||||
MgNrInput.SelectAll();
|
||||
}
|
||||
|
||||
protected override void ShortcutEdit() {
|
||||
@ -313,7 +323,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(a);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -195,29 +195,34 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="110"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Content="Datum/Zwst.:" Margin="10,10,0,10"/>
|
||||
<TextBox x:Name="DateInput" Text="{Binding DateString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,10,10,10" Width="77" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"
|
||||
Margin="0,10,10,10" Width="77" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Left" TextAlignment="Right"
|
||||
TextChanged="ScheduleDateInput_TextChanged" LostFocus="DateInput_LostFocus"/>
|
||||
<ComboBox x:Name="BranchInput" SelectedItem="{Binding Branch, Mode=TwoWay}" ItemsSource="{Binding BranchSource, Mode=TwoWay}"
|
||||
DisplayMemberPath="Name" TextSearch.TextPath="Name"
|
||||
Margin="82,10,10,10" Width="150" Grid.Column="1" HorizontalAlignment="Left"/>
|
||||
Margin="82,10,10,10" Width="150" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Left"/>
|
||||
|
||||
<Label Content="Beschreibung:" Margin="10,40,0,10"/>
|
||||
<TextBox x:Name="DescriptionInput" Text="{Binding Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,40,10,10" Grid.Column="1"
|
||||
Margin="0,40,10,10" Grid.Column="1" Grid.ColumnSpan="2"
|
||||
TextChanged="TextBox_TextChanged"/>
|
||||
|
||||
<Label Content="Max. Gewicht:" Margin="10,70,0,10"/>
|
||||
<ctrl:UnitTextBox x:Name="MaxWeightInput" Unit="kg" Text="{Binding MaxWeightString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,70,10,10" Grid.Column="1" Width="68" HorizontalAlignment="Left"
|
||||
Margin="0,70,10,10" Grid.Column="1" Grid.ColumnSpan="2" Width="68" HorizontalAlignment="Left"
|
||||
TextChanged="MaxWeightInput_TextChanged"/>
|
||||
|
||||
<CheckBox x:Name="CancelledInput" Content="Abgesagt" IsChecked="{Binding IsCancelled, Mode=TwoWay}"
|
||||
Grid.Column="1" Grid.ColumnSpan="2" Margin="80,75,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"/>
|
||||
|
||||
<Label Content="Sorten:" Margin="10,100,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MainWineVarietiesInput" SelectedItems="{Binding MainVarieties}" ItemsSource="{Binding MainVarietiesSource, Mode=TwoWay}"
|
||||
Grid.Column="1" Margin="0,100,10,10"
|
||||
Grid.Column="1" Grid.ColumnSpan="2" Margin="0,100,10,10"
|
||||
Delimiter=", " AllItemsSelectedContent="Alle Sorten" ListDisplayMemberPath="SortId" TextSearch.TextPath="Name">
|
||||
<ctrl:CheckComboBox.ItemTemplateSelector>
|
||||
<ctrl:WineVarietyTemplateSelector/>
|
||||
@ -226,12 +231,20 @@
|
||||
|
||||
<Label Content="Weitere Sorten:" Margin="10,130,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="OtherWineVarietiesInput" SelectedItems="{Binding OtherVarieties}" ItemsSource="{Binding OtherVarietiesSource, Mode=TwoWay}"
|
||||
Grid.Column="1" Margin="0,130,10,10"
|
||||
Grid.Column="1" Grid.ColumnSpan="2" Margin="0,130,10,10"
|
||||
Delimiter=", " AllItemsSelectedContent="Alle Sorten" ListDisplayMemberPath="SortId" TextSearch.TextPath="Name">
|
||||
<ctrl:CheckComboBox.ItemTemplateSelector>
|
||||
<ctrl:WineVarietyTemplateSelector/>
|
||||
</ctrl:CheckComboBox.ItemTemplateSelector>
|
||||
</ctrl:CheckComboBox>
|
||||
|
||||
<Label Content="Attribut/Bewirt.:" Margin="10,160,0,10"/>
|
||||
<ComboBox x:Name="AttributeInput" SelectedItem="{Binding AttributeObj, Mode=TwoWay}" ItemsSource="{Binding AttributeSource, Mode=TwoWay}"
|
||||
Grid.Column="1" Margin="0,160,5,10"
|
||||
DisplayMemberPath="Name"/>
|
||||
<ComboBox x:Name="CultivationInput" SelectedItem="{Binding CultivationObj, Mode=TwoWay}" ItemsSource="{Binding CultivationSource, Mode=TwoWay}"
|
||||
Grid.Column="2" Margin="0,160,10,10"
|
||||
DisplayMemberPath="Name"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
|
@ -103,6 +103,12 @@ namespace Elwig.Windows {
|
||||
var varieties = await ctx.WineVarieties.OrderBy(v => v.Name).ToListAsync();
|
||||
ControlUtils.RenewItemsSource(MainWineVarietiesInput, varieties);
|
||||
ControlUtils.RenewItemsSource(OtherWineVarietiesInput, varieties);
|
||||
var attrList = await ctx.WineAttributes.OrderBy(a => a.Name).Cast<object>().ToListAsync();
|
||||
attrList.Insert(0, new NullItem("- Keine Angabe -"));
|
||||
ControlUtils.RenewItemsSource(AttributeInput, attrList, null, ControlUtils.RenewSourceDefault.First);
|
||||
var cultList = await ctx.WineCultivations.OrderBy(a => a.Name).Cast<object>().ToListAsync();
|
||||
cultList.Insert(0, new NullItem("- Kein Angabe -"));
|
||||
ControlUtils.RenewItemsSource(CultivationInput, cultList, null, ControlUtils.RenewSourceDefault.First);
|
||||
|
||||
await RefreshList();
|
||||
}
|
||||
@ -177,7 +183,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(s);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -108,36 +108,67 @@
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsAreaComMembersInput" Content="Mitglieder mit Flächenbindung"
|
||||
Margin="10,30,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsDeliveryMembersInput" Content="Lieferanten der Saison"
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsDeliveryAncmtMembersInput" Content="Mitglieder mit Anmeldung"
|
||||
Margin="10,50,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsNonDeliveryMembersInput" Content="Nicht-Lieferanten der Saison"
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsDeliveryMembersInput" Content="Lieferanten der Saison"
|
||||
Margin="10,70,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsCustomInput" Content="Benutzerdefiniert"
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsNonDeliveryMembersInput" Content="Nicht-Lieferanten der Saison"
|
||||
Margin="10,90,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsCustomInput" Content="Benutzerdefiniert"
|
||||
Margin="10,110,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
|
||||
<Label Content="Zwst.:" x:Name="MemberBranchLabel" Margin="10,120,0,10"/>
|
||||
<Label Content="Zwst.:" x:Name="MemberBranchLabel" Margin="10,140,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MemberBranchInput" AllItemsSelectedContent="Alle Stammzweigstellen" Delimiter=", " DisplayMemberPath="Name"
|
||||
Margin="50,120,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
Margin="50,140,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
|
||||
<Label Content="Gem.:" x:Name="MemberKgLabel" Margin="10,150,0,10"/>
|
||||
<Label Content="Gem.:" x:Name="MemberKgLabel" Margin="10,170,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MemberKgInput" AllItemsSelectedContent="Alle Stammgemeinden" Delimiter=", " DisplayMemberPath="Name"
|
||||
IsSelectAllActive="True" SelectAllContent="Alle Stammgemeinden"
|
||||
Margin="50,150,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
Margin="50,170,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
|
||||
<Label Content="Vtrg.:" x:Name="MemberAreaComLabel" Margin="10,180,0,10"/>
|
||||
<Label Content="Bio-Betrieb:" x:Name="MemberOrganicLabel" Margin="10,200,0,10"/>
|
||||
<RadioButton x:Name="MemberOrganicYesInput" Content="Ja" GroupName="MemberOrganic"
|
||||
Margin="80,205,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
<RadioButton x:Name="MemberOrganicNoInput" Content="Nein" GroupName="MemberOrganic"
|
||||
Margin="125,205,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
<RadioButton x:Name="MemberOrganicIndifferentInput" Content="Egal" GroupName="MemberOrganic"
|
||||
Margin="180,205,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
|
||||
<Label Content="Funktionär:" x:Name="MemberFunktionärLabel" Margin="10,230,0,10"/>
|
||||
<RadioButton x:Name="MemberFunktionärYesInput" Content="Ja" GroupName="MemberFunktionär"
|
||||
Margin="80,235,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
<RadioButton x:Name="MemberFunktionärNoInput" Content="Nein" GroupName="MemberFunktionär"
|
||||
Margin="125,235,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
<RadioButton x:Name="MemberFunktionärIndifferentInput" Content="Egal" GroupName="MemberFunktionär"
|
||||
Margin="180,235,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
|
||||
<Label Content="Vtrg.:" x:Name="MemberAreaComLabel" Margin="10,260,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MemberAreaComInput" AllItemsSelectedContent="Alle Vertragsarten" Delimiter=", " DisplayMemberPath="VtrgId"
|
||||
IsSelectAllActive="True" SelectAllContent="Alle Vertragsarten"
|
||||
Margin="50,180,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
Margin="50,260,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
|
||||
<Label Content="Tag:" x:Name="MemberDeliveryAncmtLabel" Margin="10,260,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MemberDeliveryAncmtInput" AllItemsSelectedContent="Alle Lesepläne" Delimiter=", " DisplayMemberPath="Identifier"
|
||||
IsSelectAllActive="True" SelectAllContent="Alle Lesepläne"
|
||||
Margin="50,260,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
|
||||
<ctrl:CheckComboBox x:Name="MemberCustomInput" AllItemsSelectedContent="Alle Mitglieder" Delimiter=", " DisplayMemberPath="AdministrativeName"
|
||||
IsSelectAllActive="True" SelectAllContent="Alle Mitglieder"
|
||||
Margin="10,120,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
Margin="10,140,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
@ -116,6 +116,9 @@ namespace Elwig.Windows {
|
||||
CreditNoteFooterInput.Visibility = Visibility.Hidden;
|
||||
RecipientsActiveMembersInput.IsChecked = true;
|
||||
|
||||
MemberOrganicIndifferentInput.IsChecked = true;
|
||||
MemberFunktionärIndifferentInput.IsChecked = true;
|
||||
|
||||
DeliveryConfirmationFooterInput.Text = App.Client.TextDeliveryConfirmation;
|
||||
CreditNoteFooterInput.Text = App.Client.TextCreditNote;
|
||||
|
||||
@ -164,6 +167,17 @@ namespace Elwig.Windows {
|
||||
MemberAreaComInput.SelectAll();
|
||||
MemberAreaComInput.SelectionChanged += MemberInput_SelectionChanged;
|
||||
}
|
||||
ControlUtils.RenewItemsSource(MemberDeliveryAncmtInput, await ctx.DeliverySchedules
|
||||
.Where(s => s.Year == Year)
|
||||
.OrderBy(s => s.DateString)
|
||||
.ThenBy(s => s.Branch.Name)
|
||||
.ThenBy(s => s.Description)
|
||||
.ToListAsync(), MemberInput_SelectionChanged);
|
||||
if (MemberDeliveryAncmtInput.SelectedItems.Count == 0) {
|
||||
MemberDeliveryAncmtInput.SelectionChanged -= MemberInput_SelectionChanged;
|
||||
MemberDeliveryAncmtInput.SelectAll();
|
||||
MemberDeliveryAncmtInput.SelectionChanged += MemberInput_SelectionChanged;
|
||||
}
|
||||
ControlUtils.RenewItemsSource(MemberCustomInput, await ctx.Members
|
||||
.Where(m => m.IsActive)
|
||||
.OrderBy(m => m.Name)
|
||||
@ -291,8 +305,18 @@ namespace Elwig.Windows {
|
||||
MemberBranchInput.Visibility = vis;
|
||||
MemberKgLabel.Visibility = vis;
|
||||
MemberKgInput.Visibility = vis;
|
||||
MemberOrganicLabel.Visibility = vis;
|
||||
MemberOrganicYesInput.Visibility = vis;
|
||||
MemberOrganicNoInput.Visibility = vis;
|
||||
MemberOrganicIndifferentInput.Visibility = vis;
|
||||
MemberFunktionärLabel.Visibility = vis;
|
||||
MemberFunktionärYesInput.Visibility = vis;
|
||||
MemberFunktionärNoInput.Visibility = vis;
|
||||
MemberFunktionärIndifferentInput.Visibility = vis;
|
||||
MemberAreaComInput.Visibility = RecipientsAreaComMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
MemberAreaComLabel.Visibility = RecipientsAreaComMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
MemberDeliveryAncmtInput.Visibility = RecipientsDeliveryAncmtMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
MemberDeliveryAncmtLabel.Visibility = RecipientsDeliveryAncmtMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
MemberCustomInput.Visibility = RecipientsCustomInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
using var ctx = new AppDbContext();
|
||||
await UpdateRecipients(ctx);
|
||||
@ -303,6 +327,11 @@ namespace Elwig.Windows {
|
||||
await UpdateRecipients(ctx);
|
||||
}
|
||||
|
||||
private async void MemberInput_Checked(object sender, RoutedEventArgs evt) {
|
||||
using var ctx = new AppDbContext();
|
||||
await UpdateRecipients(ctx);
|
||||
}
|
||||
|
||||
private void Date_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
Validator.CheckDate((TextBox)sender, true);
|
||||
}
|
||||
@ -325,10 +354,23 @@ namespace Elwig.Windows {
|
||||
var kgs = MemberKgInput.SelectedItems.Cast<AT_Kg>().Select(k => k.KgNr).ToList();
|
||||
query = query.Where(m => kgs.Contains((int)m.DefaultKgNr!));
|
||||
}
|
||||
if (MemberOrganicYesInput.IsChecked == true) {
|
||||
query = query.Where(m => m.IsOrganic);
|
||||
} else if (MemberOrganicNoInput.IsChecked == true) {
|
||||
query = query.Where(m => !m.IsOrganic);
|
||||
}
|
||||
if (MemberFunktionärYesInput.IsChecked == true) {
|
||||
query = query.Where(m => m.IsFunktionär);
|
||||
} else if (MemberFunktionärNoInput.IsChecked == true) {
|
||||
query = query.Where(m => !m.IsFunktionär);
|
||||
}
|
||||
|
||||
if (RecipientsAreaComMembersInput.IsChecked == true) {
|
||||
var vtrg = MemberAreaComInput.SelectedItems.Cast<AreaComType>().Select(a => a.VtrgId).ToList();
|
||||
query = query.Where(m => m.IsActive && m.AreaCommitments.AsQueryable().Where(Utils.ActiveAreaCommitments(Year)).Any(c => vtrg.Contains(c.VtrgId)));
|
||||
} else if (RecipientsDeliveryAncmtMembersInput.IsChecked == true) {
|
||||
var dsnrs = MemberDeliveryAncmtInput.SelectedItems.Cast<DeliverySchedule>().Select(s => s.DsNr).ToList();
|
||||
query = query.Where(m => m.Announcements.Any(a => a.Year == Year && dsnrs.Contains(a.DsNr)));
|
||||
} else if (RecipientsDeliveryMembersInput.IsChecked == true) {
|
||||
query = query.Where(m => m.Deliveries.Any(d => d.Year == Year));
|
||||
} else if (RecipientsNonDeliveryMembersInput.IsChecked == true) {
|
||||
@ -473,7 +515,7 @@ namespace Elwig.Windows {
|
||||
var b = new Billing(year);
|
||||
await b.FinishSeason();
|
||||
await b.CalculateBuckets();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
dcData[year] = await DeliveryConfirmationDeliveryData.ForSeason(ctx.DeliveryParts, year);
|
||||
} catch (Exception exc) {
|
||||
|
@ -287,7 +287,7 @@ namespace Elwig.Windows {
|
||||
var b = new Billing(year);
|
||||
await b.FinishSeason();
|
||||
await b.CalculateBuckets();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
using var ctx = new AppDbContext();
|
||||
var tbl1 = await OverUnderDeliveryData.ForSeason(ctx.OverUnderDeliveryRows, year);
|
||||
@ -326,7 +326,7 @@ namespace Elwig.Windows {
|
||||
var b = new Billing(year);
|
||||
await b.FinishSeason();
|
||||
await b.CalculateBuckets();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
using var ctx = new AppDbContext();
|
||||
using var ods = new OdsFile(d.FileName);
|
||||
|
@ -374,7 +374,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(l);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -191,7 +191,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
ControlUtils.SelectItemWithPk(WbGlKgs, k.KgNr);
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
@ -211,7 +211,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(k.WbKg);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
ControlUtils.SelectItemWithPk(WbKgs, k.KgNr);
|
||||
} catch (Exception exc) {
|
||||
await HintContextChange();
|
||||
|
@ -173,7 +173,7 @@ namespace Elwig.Windows {
|
||||
|
||||
var b = new Billing(Year);
|
||||
await b.AutoAdjustBusinessShares(new DateOnly(Year, 11, 30), kg ?? default, bs ?? default, kgPerBs ?? default, percent / 100.0 ?? default, minBs ?? default);
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
@ -187,7 +187,7 @@ namespace Elwig.Windows {
|
||||
try {
|
||||
var b = new Billing(Year);
|
||||
await b.UnAdjustBusinessShares();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
@ -309,7 +309,7 @@ namespace Elwig.Windows {
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
MessageBox.Show(str, "Benutzerdefinierten Zu-/Abschlag speichern", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
}
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ namespace Elwig.Windows {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
ControlUtils.SelectItem(PaymentVariantList, v);
|
||||
} catch (Exception exc) {
|
||||
@ -268,7 +268,7 @@ namespace Elwig.Windows {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
ControlUtils.SelectItem(PaymentVariantList, n);
|
||||
} catch (Exception exc) {
|
||||
@ -285,7 +285,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(v);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
@ -304,7 +304,7 @@ namespace Elwig.Windows {
|
||||
} catch (Exception exc) {
|
||||
MessageBox.Show(exc.Message, "Berechnungsfehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
CalculateButton.IsEnabled = true;
|
||||
}
|
||||
@ -399,7 +399,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
Mouse.OverrideCursor = null;
|
||||
RevertButton.IsEnabled = true;
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
}
|
||||
|
||||
private async void RevertButton_Click(object sender, RoutedEventArgs evt) {
|
||||
@ -415,7 +415,7 @@ namespace Elwig.Windows {
|
||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||
var b = new BillingVariant(v.Year, v.AvNr);
|
||||
await b.Revert();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
CommitButton.IsEnabled = true;
|
||||
}
|
||||
@ -507,7 +507,7 @@ namespace Elwig.Windows {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
CommentInput_TextChanged(null, null);
|
||||
ConsiderModifiersInput_Changed(null, null);
|
||||
ConsiderPenaltiesInput_Changed(null, null);
|
||||
|
@ -19,12 +19,12 @@
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
|
||||
<PackageReference Include="Appium.WebDriver" Version="4.4.5" />
|
||||
<PackageReference Include="NReco.PdfRenderer" Version="1.5.3" />
|
||||
<PackageReference Include="NUnit" Version="4.1.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
|
||||
<PackageReference Include="NReco.PdfRenderer" Version="1.5.4" />
|
||||
<PackageReference Include="NUnit" Version="4.2.2" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="4.3.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@ -1 +1 @@
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=28" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=30" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
|
Reference in New Issue
Block a user