From f26557a66e7daa7c418f10f52cc27cd9570f7f13 Mon Sep 17 00:00:00 2001 From: DeepnaPooja Date: Wed, 21 Oct 2026 12:46:56 +0530 Subject: [PATCH] Enhance invoice processing by adding items and versioning --- Distribution/Features/ShopPO/ShopPOService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Distribution/Features/ShopPO/ShopPOService.cs b/Distribution/Features/ShopPO/ShopPOService.cs index 5f32def..e427f9e 100644 --- a/Distribution/Features/ShopPO/ShopPOService.cs +++ b/Distribution/Features/ShopPO/ShopPOService.cs @@ -217,6 +217,9 @@ public class ShopPOService( try { await invoiceRepo.AddAsync(invoice); + var lines = InvoiceService.BuildItemsFromShopPO(po, invoice.Id); + await invoiceRepo.AddItemsAsync(lines); + await invoiceRepo.AddVersionAsync(InvoiceService.BuildVersion(invoice, lines, 1, InvoiceVersionStage.Created, userId)); po.InvoiceId = invoice.Id; repo.Update(po); await uow.CommitAsync(ct);