Compare commits

...

4 Commits

Author SHA1 Message Date
5eda25ed14 Bump version to 0.10.7
All checks were successful
Test / Run tests (push) Successful in 2m2s
Deploy / Build and Deploy (push) Successful in 3m42s
2024-09-02 23:42:00 +02:00
543185d48e DeliveryAdminWindow: Add weight filter
All checks were successful
Test / Run tests (push) Successful in 2m58s
2024-09-02 23:28:55 +02:00
141086673f DeliveryAncmtList: Add status to indicate late ancmts 2024-09-02 23:10:37 +02:00
6627ab6d12 App: Try to fix auto context renewal 2
All checks were successful
Test / Run tests (push) Successful in 2m57s
2024-09-01 11:44:38 +02:00
10 changed files with 70 additions and 11 deletions

View File

@ -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}
------------------------------------------

View File

@ -202,7 +202,9 @@ namespace Elwig {
}
public static async Task HintContextChange() {
CurrentApp.LastChanged = CurrentLastWrite;
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();

View File

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

View File

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

View File

@ -17,6 +17,9 @@ namespace Elwig.Models.Dtos {
("Name2", "Vorname", null, 40),
("SortId", "Sorte", null, 10),
("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) :
@ -42,7 +45,10 @@ namespace Elwig.Models.Dtos {
public string AdministrativeName;
public string SortId;
public string Variety;
public DateTime CreatedTimestamp;
public DateTime? ModifiedTimestamp;
public int Weight;
public string? Status;
public DeliveryAncmtListRow(DeliveryAncmt a) {
var s = a.Schedule;
@ -56,7 +62,10 @@ namespace Elwig.Models.Dtos {
AdministrativeName = m.AdministrativeName;
SortId = a.SortId;
Variety = a.Variety.Name;
CreatedTimestamp = a.CreatedTimestamp;
ModifiedTimestamp = a.ModifiedTimestamp == a.CreatedTimestamp ? null : a.ModifiedTimestamp;
Weight = a.Weight;
Status = s.AncmtTo == null ? null : a.CreatedTimestamp >= s.AncmtTo ? "verspät." : "ok";
}
}
}

View File

@ -124,6 +124,7 @@ namespace Elwig.Services {
var filterNotCult = new List<string>();
var filterDate = new List<(string?, string?)>();
var filterTime = new List<(string?, string?)>();
int filterWeightGt = 0, filterWeightLt = 0;
int filterYearGt = 0, filterYearLt = 0;
double filterKmwGt = 0, filterKmwLt = 0;
double filterOeGt = 0, filterOeLt = 0;
@ -250,6 +251,15 @@ namespace Elwig.Services {
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 (e.StartsWith('>') || e.StartsWith('<')) {
if (double.TryParse(e[1..], out var 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 (filterYearLt > 0) prd = prd.And(p => p.Year < filterYearLt);
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 (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) {
filterNames.Insert(0, $"{filterYearGt}{filterYearLt - 1}");
} else if (filterYearGt > 0) {

View File

@ -176,6 +176,7 @@
<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. &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>Uhrzeit</Bold>: z.B. 06:00-08:00, 18:00-, ...<LineBreak/>
<Bold>Handwiegung</Bold>: handw[iegung], !Handw[iegung] (alle ohne Handwiegung)<LineBreak/>

View File

@ -167,6 +167,13 @@
</Style>
</DataGridTextColumn.CellStyle>
</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>

View File

@ -85,14 +85,15 @@ namespace Elwig.Windows {
using var ctx = new AppDbContext();
var deliverySchedules = await ctx.DeliverySchedules
.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.Announcements)
.OrderBy(s => s.DateString)
.ThenBy(s => s.Branch.Name)
.ThenBy(s => s.Description)
.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);
}

View File

@ -18,10 +18,10 @@ namespace Tests.DocumentTests {
Assert.That(text, Contains.Substring("Anmeldeliste"));
Assert.That(text, Contains.Substring("01.10.2020 Matzen GV Kabinettaktion"));
Assert.That(table, Is.EqualTo(new string[][] {
["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", "103 MUSTERBAUER Matthäus", "Grüner Veltliner", "8 000"],
["01.10.2020", "104 WINZER Waltraud", "Grüner Veltliner", "2 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", "103 MUSTERBAUER Matthäus", "Grüner Veltliner", "-", "8 000"],
["01.10.2020", "104 WINZER Waltraud", "Grüner Veltliner", "-", "2 000"],
["Gesamt:", "Anmeldungen: 4", "25 000"],
}));
});