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 ===================================================================