DeliveryService: Fix duplicate LsNr error
All checks were successful
Test / Run tests (push) Successful in 1m49s
All checks were successful
Test / Run tests (push) Successful in 1m49s
This commit is contained in:
@ -444,6 +444,7 @@ namespace Elwig.Services {
|
||||
|
||||
var date = DateOnly.ParseExact(vm.Date!, "dd.MM.yyyy");
|
||||
int? newLnr = (deliveryNew || dateHasChanged) ? await ctx.NextLNr(date) : null;
|
||||
string? newLsNr = (newLnr != null) ? Utils.GenerateLsNr(date, vm.Branch!.ZwstId, newLnr.Value) : null;
|
||||
|
||||
string? newTimeString = null;
|
||||
if (partNew && timeIsDefault) {
|
||||
@ -459,7 +460,7 @@ namespace Elwig.Services {
|
||||
TimeString = newTimeString ?? oldDelivery?.TimeString,
|
||||
LNr = newLnr ?? oldDelivery!.LNr,
|
||||
ZwstId = vm.Branch!.ZwstId,
|
||||
LsNr = vm.LsNr!,
|
||||
LsNr = newLsNr ?? vm.LsNr!,
|
||||
MgNr = (int)vm.MgNr!,
|
||||
Comment = string.IsNullOrEmpty(vm.Comment) ? null : vm.Comment,
|
||||
};
|
||||
|
Reference in New Issue
Block a user