Compare commits

...

4 Commits

10 changed files with 70 additions and 11 deletions

@ -3,6 +3,23 @@ Changelog
========= =========
[v0.10.7][v0.10.7] (2024-09-02) {#v0.10.7}
------------------------------------------
### Neue Funktionen {#v0.10.7-features}
* Im Anmeldungen-Fenster (`DeliveryAncmtAdminWindow`) wird der Anmeldezeitpunkt angezeigt; in der Anmeldeliste als `ok` oder `verspät.`. (141086673f)
* Im Lieferungen-Fenster (`DeliveryAdminWindow`) kann nach dem Gesamtgewicht einer Lieferung gefiltert werden (z.B. `<500kg`, `>8000kg`). (543185d48e)
### Behobene Fehler {#v0.10.7-bugfixes}
* 2. Versuch: Fehler bei automatischer Daten-Erneuerung bei längerer Benutzung. (6627ab6d12)
[v0.10.7]: https://git.necronda.net/winzer/elwig/releases/tag/v0.10.7
[v0.10.6][v0.10.6] (2024-08-30) {#v0.10.6} [v0.10.6][v0.10.6] (2024-08-30) {#v0.10.6}
------------------------------------------ ------------------------------------------

@ -202,7 +202,9 @@ namespace Elwig {
} }
public static async Task HintContextChange() { public static async Task HintContextChange() {
CurrentApp.LastChanged = CurrentLastWrite; var ch = CurrentLastWrite;
if (ch > CurrentApp.LastChanged)
CurrentApp.LastChanged = ch;
foreach (Window w in CurrentApp.Windows) { foreach (Window w in CurrentApp.Windows) {
if (w is not ContextWindow c) continue; if (w is not ContextWindow c) continue;
await c.HintContextChange(); await c.HintContextChange();

@ -10,8 +10,9 @@
<colgroup> <colgroup>
<col style="width: 18mm;"/> <col style="width: 18mm;"/>
<col style="width: 12mm;"/> <col style="width: 12mm;"/>
<col style="width: 81mm;"/> <col style="width: 70mm;"/>
<col style="width: 40mm;"/> <col style="width: 40mm;"/>
<col style="width: 11mm;"/>
<col style="width: 14mm;"/> <col style="width: 14mm;"/>
</colgroup> </colgroup>
<thead> <thead>
@ -20,6 +21,7 @@
<th rowspan="2">MgNr.</th> <th rowspan="2">MgNr.</th>
<th rowspan="2" style="text-align: left;">Mitglied</th> <th rowspan="2" style="text-align: left;">Mitglied</th>
<th rowspan="2" style="text-align: left;">Sorte</th> <th rowspan="2" style="text-align: left;">Sorte</th>
<th rowspan="2">Anmldg.</th>
<th>Gewicht</th> <th>Gewicht</th>
</tr> </tr>
<tr> <tr>
@ -33,13 +35,14 @@
<td class="number">@a.MgNr</td> <td class="number">@a.MgNr</td>
<td>@a.AdministrativeName</td> <td>@a.AdministrativeName</td>
<td>@a.Variety</td> <td>@a.Variety</td>
<td class="small">@(a.Status ?? "-")</td>
<td class="number">@($"{a.Weight:N0}")</td> <td class="number">@($"{a.Weight:N0}")</td>
</tr> </tr>
} }
<tr class="sum bold"> <tr class="sum bold">
<td colspan="2">Gesamt:</td> <td colspan="2">Gesamt:</td>
<td colspan="2">Anmeldungen: @($"{Model.Announcements.Count():N0}")</td> <td colspan="2">Anmeldungen: @($"{Model.Announcements.Count():N0}")</td>
<td class="number">@($"{Model.Announcements.Sum(a => a.Weight):N0}")</td> <td colspan="2" class="number">@($"{Model.Announcements.Sum(a => a.Weight):N0}")</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

@ -7,7 +7,7 @@
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon> <ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
<Version>0.10.6</Version> <Version>0.10.7</Version>
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages> <SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>

@ -17,6 +17,9 @@ namespace Elwig.Models.Dtos {
("Name2", "Vorname", null, 40), ("Name2", "Vorname", null, 40),
("SortId", "Sorte", null, 10), ("SortId", "Sorte", null, 10),
("Weight", "Gewicht", "kg", 20), ("Weight", "Gewicht", "kg", 20),
("CreatedTimestamp", "Angemeldet", null, 35),
("ModifiedTimestamp", "Geändert", null, 35),
("Status", "Status", null, 20),
]; ];
public DeliveryAncmtListData(IEnumerable<DeliveryAncmtListRow> rows, List<string> filterNames) : public DeliveryAncmtListData(IEnumerable<DeliveryAncmtListRow> rows, List<string> filterNames) :
@ -42,7 +45,10 @@ namespace Elwig.Models.Dtos {
public string AdministrativeName; public string AdministrativeName;
public string SortId; public string SortId;
public string Variety; public string Variety;
public DateTime CreatedTimestamp;
public DateTime? ModifiedTimestamp;
public int Weight; public int Weight;
public string? Status;
public DeliveryAncmtListRow(DeliveryAncmt a) { public DeliveryAncmtListRow(DeliveryAncmt a) {
var s = a.Schedule; var s = a.Schedule;
@ -56,7 +62,10 @@ namespace Elwig.Models.Dtos {
AdministrativeName = m.AdministrativeName; AdministrativeName = m.AdministrativeName;
SortId = a.SortId; SortId = a.SortId;
Variety = a.Variety.Name; Variety = a.Variety.Name;
CreatedTimestamp = a.CreatedTimestamp;
ModifiedTimestamp = a.ModifiedTimestamp == a.CreatedTimestamp ? null : a.ModifiedTimestamp;
Weight = a.Weight; Weight = a.Weight;
Status = s.AncmtTo == null ? null : a.CreatedTimestamp >= s.AncmtTo ? "verspät." : "ok";
} }
} }
} }

@ -124,6 +124,7 @@ namespace Elwig.Services {
var filterNotCult = new List<string>(); var filterNotCult = new List<string>();
var filterDate = new List<(string?, string?)>(); var filterDate = new List<(string?, string?)>();
var filterTime = new List<(string?, string?)>(); var filterTime = new List<(string?, string?)>();
int filterWeightGt = 0, filterWeightLt = 0;
int filterYearGt = 0, filterYearLt = 0; int filterYearGt = 0, filterYearLt = 0;
double filterKmwGt = 0, filterKmwLt = 0; double filterKmwGt = 0, filterKmwLt = 0;
double filterOeGt = 0, filterOeLt = 0; double filterOeGt = 0, filterOeLt = 0;
@ -250,6 +251,15 @@ namespace Elwig.Services {
filterZwst.Add(b.ZwstId); filterZwst.Add(b.ZwstId);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add($"Zweigstelle {b.Name}"); 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 (e.StartsWith('>') || e.StartsWith('<')) { } else if (e.StartsWith('>') || e.StartsWith('<')) {
if (double.TryParse(e[1..], out var num)) { if (double.TryParse(e[1..], out var num)) {
switch ((e[0], num)) { switch ((e[0], num)) {
@ -347,6 +357,8 @@ namespace Elwig.Services {
} }
} }
if (filterWeightGt > 0) prd = prd.And(p => p.Delivery.Parts.Sum(p => p.Weight) >= filterWeightGt);
if (filterWeightLt > 0) prd = prd.And(p => p.Delivery.Parts.Sum(p => p.Weight) <= filterWeightLt);
if (filterYearGt > 0) prd = prd.And(p => p.Year >= filterYearGt); if (filterYearGt > 0) prd = prd.And(p => p.Year >= filterYearGt);
if (filterYearLt > 0) prd = prd.And(p => p.Year < filterYearLt); if (filterYearLt > 0) prd = prd.And(p => p.Year < filterYearLt);
if (filterMgNr.Count > 0) prd = prd.And(p => filterMgNr.Contains(p.Delivery.MgNr)); if (filterMgNr.Count > 0) prd = prd.And(p => filterMgNr.Contains(p.Delivery.MgNr));
@ -376,6 +388,13 @@ namespace Elwig.Services {
if (filterOeGt > 0) prd = prd.And(p => p.Kmw * (4.54 + 0.022 * p.Kmw) >= filterOeGt); if (filterOeGt > 0) prd = prd.And(p => p.Kmw * (4.54 + 0.022 * p.Kmw) >= filterOeGt);
if (filterOeLt > 0) prd = prd.And(p => p.Kmw * (4.54 + 0.022 * p.Kmw) < filterOeLt); if (filterOeLt > 0) prd = prd.And(p => p.Kmw * (4.54 + 0.022 * p.Kmw) < filterOeLt);
if (filterWeightGt > 0 && filterWeightLt > 0) {
filterNames.Insert(0, $"{filterWeightGt:N0}{filterWeightLt:N0} kg");
} else if (filterWeightGt > 0) {
filterNames.Insert(0, $"ab {filterWeightGt:N0} kg");
} else if (filterWeightLt > 0) {
filterNames.Insert(0, $"unter {filterWeightLt:N0} kg");
}
if (filterYearGt > 0 && filterYearLt > 0) { if (filterYearGt > 0 && filterYearLt > 0) {
filterNames.Insert(0, $"{filterYearGt}{filterYearLt - 1}"); filterNames.Insert(0, $"{filterYearGt}{filterYearLt - 1}");
} else if (filterYearGt > 0) { } else if (filterYearGt > 0) {

@ -176,6 +176,7 @@
<Bold>Zweigstelle</Bold>: z.B. musterort, ...<LineBreak/> <Bold>Zweigstelle</Bold>: z.B. musterort, ...<LineBreak/>
<Bold>Attribut</Bold>: z.B. kabinett, !kabinett (alle außer kabinett), ...<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>Bewirtschaftung</Bold>: z.B. bio, !kip (alle außer KIP), ...<LineBreak/>
<Bold>Gewicht</Bold>: z.B. &lt;500kg, &gt;6000kg, ... (gilt für Gewicht der gesamten Lieferung)<LineBreak/>
<Bold>Datum</Bold>: z.B. 1.9., 15.9.-10.10., -15.10.2020, ...<LineBreak/> <Bold>Datum</Bold>: z.B. 1.9., 15.9.-10.10., -15.10.2020, ...<LineBreak/>
<Bold>Uhrzeit</Bold>: z.B. 06:00-08:00, 18:00-, ...<LineBreak/> <Bold>Uhrzeit</Bold>: z.B. 06:00-08:00, 18:00-, ...<LineBreak/>
<Bold>Handwiegung</Bold>: handw[iegung], !Handw[iegung] (alle ohne Handwiegung)<LineBreak/> <Bold>Handwiegung</Bold>: handw[iegung], !Handw[iegung] (alle ohne Handwiegung)<LineBreak/>

@ -167,6 +167,13 @@
</Style> </Style>
</DataGridTextColumn.CellStyle> </DataGridTextColumn.CellStyle>
</DataGridTextColumn> </DataGridTextColumn>
<DataGridTextColumn Header="Angemeldet" Binding="{Binding CreatedTimestamp, StringFormat='{}{0:HH:mm, dd.MM.}'}" Width="100">
<DataGridTextColumn.CellStyle>
<Style>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>

@ -85,14 +85,15 @@ namespace Elwig.Windows {
using var ctx = new AppDbContext(); using var ctx = new AppDbContext();
var deliverySchedules = await ctx.DeliverySchedules var deliverySchedules = await ctx.DeliverySchedules
.Where(s => s.Year == ViewModel.FilterSeason) .Where(s => s.Year == ViewModel.FilterSeason)
.Where(s => !ViewModel.FilterOnlyUpcoming || s.DateString.CompareTo(Utils.Today.ToString("yyyy-MM-dd")) >= 0)
.Include(s => s.Branch) .Include(s => s.Branch)
.Include(s => s.Announcements) .Include(s => s.Announcements)
.OrderBy(s => s.DateString) .OrderBy(s => s.DateString)
.ThenBy(s => s.Branch.Name) .ThenBy(s => s.Branch.Name)
.ThenBy(s => s.Description) .ThenBy(s => s.Description)
.ToListAsync(); .ToListAsync();
ControlUtils.RenewItemsSource(DeliveryScheduleList, deliverySchedules, DeliveryScheduleList_SelectionChanged, ControlUtils.RenewSourceDefault.First); ControlUtils.RenewItemsSource(DeliveryScheduleList, deliverySchedules
.Where(s => !ViewModel.FilterOnlyUpcoming || s.DateString.CompareTo(Utils.Today.ToString("yyyy-MM-dd")) >= 0)
.ToList(), DeliveryScheduleList_SelectionChanged, ControlUtils.RenewSourceDefault.First);
ControlUtils.RenewItemsSource(DeliveryScheduleInput, deliverySchedules, DeliveryScheduleInput_SelectionChanged); ControlUtils.RenewItemsSource(DeliveryScheduleInput, deliverySchedules, DeliveryScheduleInput_SelectionChanged);
} }

@ -18,11 +18,11 @@ namespace Tests.DocumentTests {
Assert.That(text, Contains.Substring("Anmeldeliste")); Assert.That(text, Contains.Substring("Anmeldeliste"));
Assert.That(text, Contains.Substring("01.10.2020 Matzen GV Kabinettaktion")); Assert.That(text, Contains.Substring("01.10.2020 Matzen GV Kabinettaktion"));
Assert.That(table, Is.EqualTo(new string[][] { Assert.That(table, Is.EqualTo(new string[][] {
["01.10.2020", "101 MUSTERMANN Max", "Grüner Veltliner", "5 000"], ["01.10.2020", "101 MUSTERMANN Max", "Grüner Veltliner", "-", "5 000"],
["01.10.2020", "102 WEINBAUER Wernhardt", "Grüner Veltliner", "10 000"], ["01.10.2020", "102 WEINBAUER Wernhardt", "Grüner Veltliner", "-", "10 000"],
["01.10.2020", "103 MUSTERBAUER Matthäus", "Grüner Veltliner", "8 000"], ["01.10.2020", "103 MUSTERBAUER Matthäus", "Grüner Veltliner", "-", "8 000"],
["01.10.2020", "104 WINZER Waltraud", "Grüner Veltliner", "2 000"], ["01.10.2020", "104 WINZER Waltraud", "Grüner Veltliner", "-", "2 000"],
["Gesamt:", "Anmeldungen: 4", "25 000"], ["Gesamt:", "Anmeldungen: 4", "25 000"],
})); }));
}); });
} }