DeliveryAncmtList: Add status to indicate late ancmts
This commit is contained in:
@ -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>
|
||||||
|
@ -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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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"],
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user