Update delivery task invoice flow
This commit is contained in:
@@ -187,9 +187,9 @@ public class DeliveryTaskService(
|
|||||||
repo.Update(task);
|
repo.Update(task);
|
||||||
orderRepo.Update(order);
|
orderRepo.Update(order);
|
||||||
|
|
||||||
if (fullyDelivered)
|
if (fullyDelivered && order.FK_SaleId is Guid saleId)
|
||||||
{
|
{
|
||||||
var sale = await saleRepo.GetByIdAsync(order.FK_SaleId)
|
var sale = await saleRepo.GetByIdAsync(saleId)
|
||||||
?? throw new KeyNotFoundException("Sale not found");
|
?? throw new KeyNotFoundException("Sale not found");
|
||||||
sale.Status = SaleStatus.Completed;
|
sale.Status = SaleStatus.Completed;
|
||||||
sale.CompletedAt = DateTime.Now;
|
sale.CompletedAt = DateTime.Now;
|
||||||
|
|||||||
Reference in New Issue
Block a user