DeliveryAdminWindow: Fix extraction error
All checks were successful
Test / Run tests (push) Successful in 1m47s

This commit is contained in:
2024-09-25 22:51:06 +02:00
parent 4a7c95e250
commit 8a61747538
3 changed files with 8 additions and 6 deletions

View File

@ -203,10 +203,10 @@ namespace Elwig.Helpers {
return c + 1;
}
public async Task<int> NextLNr(DateOnly date) {
public async Task<int> NextLNr(DateOnly date, string zwstid) {
var dateStr = date.ToString("yyyy-MM-dd");
int c = 0;
(await Deliveries.Where(d => d.DateString == dateStr).Select(d => d.LNr).ToListAsync())
(await Deliveries.Where(d => d.DateString == dateStr && d.ZwstId == zwstid).Select(d => d.LNr).ToListAsync())
.ForEach(a => { if (a <= c + 100) c = a; });
return c + 1;
}