From 1746cf030067d0ff9bc3ff453a343e044efc24d1 Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Mon, 1 Dec 2025 10:00:41 +0530 Subject: [PATCH] Changed the condition to check the new attachments --- Marco.Pms.Services/Service/PurchaseInvoiceService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marco.Pms.Services/Service/PurchaseInvoiceService.cs b/Marco.Pms.Services/Service/PurchaseInvoiceService.cs index 70a8b0b..1a50d0b 100644 --- a/Marco.Pms.Services/Service/PurchaseInvoiceService.cs +++ b/Marco.Pms.Services/Service/PurchaseInvoiceService.cs @@ -749,7 +749,7 @@ namespace Marco.Pms.Services.Service await context.SaveChangesAsync(ct); // 5. Handle attachments update. - var newAttachments = model.Attachments.Where(a => a.IsActive).ToList(); + var newAttachments = model.Attachments.Where(a => !a.DocumentId.HasValue && a.IsActive).ToList(); var deleteAttachmentIds = model.Attachments .Where(a => a.DocumentId.HasValue && !a.IsActive) .Select(a => a.DocumentId!.Value) @@ -1134,6 +1134,7 @@ namespace Marco.Pms.Services.Service #endregion #region =================================================================== Purchase Invoice History Functions =================================================================== + #endregion #region =================================================================== Helper Functions ===================================================================