This commit is contained in:
mmrbnjd
2025-01-24 19:18:17 +03:30
parent 505adf6ab2
commit 48072d6e00
14 changed files with 389 additions and 67 deletions

View File

@@ -83,6 +83,23 @@ namespace Back.Services.Warehouse
return await _ReceiptRepo.UpdateAsync(model);
}
public async Task<bool> DeleteByInvoiceID(int InvoiceID, int CompanyID)
{
var models = await _ReceiptRepo.Get(w => w.InvoiceID == InvoiceID && w.cODItem.CompanyID == CompanyID && !w.Deleted).ToListAsync();
foreach (var model in models)
model.Deleted = true;
return await _ReceiptRepo.UpdateRangeAsync(models);
}
//public async Task<bool> DeleteByCODIDAndInvoiceID(int InvoiceID,int CODID, int CompanyID)
//{
// var model = await _ReceiptRepo.Get(w => w.InvoiceID == InvoiceID && w.CODID==CODID && w.cODItem.CompanyID == CompanyID && !w.Deleted).FirstOrDefaultAsync();
// model.Deleted = true;
// return await _ReceiptRepo.UpdateAsync(model);
//}
public async Task<ReceiptDto?> Get(int itemID, int CompanyID)
{
return await _ReceiptRepo.Get(w => w.ID == itemID && w.cODItem.CompanyID == CompanyID && !w.Deleted)