...
This commit is contained in:
@@ -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)
|
||||
|
@@ -24,6 +24,7 @@ namespace Back.Services.Warehouse
|
||||
Count = item.Count,
|
||||
info = item.info,
|
||||
Type = item.Type,
|
||||
InvoiceID = item.InvoiceID,
|
||||
Deleted=false
|
||||
};
|
||||
var returnmodel = await _ReceiptRepo.AddAsync(model);
|
||||
@@ -66,6 +67,22 @@ namespace Back.Services.Warehouse
|
||||
model.Deleted = true;
|
||||
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<RemittanceDto?> Get(int itemID, int CompanyID)
|
||||
{
|
||||
|
@@ -4,23 +4,28 @@ using Shared.DTOs.Serch;
|
||||
using Shared.DTOs;
|
||||
using Back.Common;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Back.Services.Warehouse;
|
||||
|
||||
namespace Back.Services
|
||||
{
|
||||
public class servInvoice
|
||||
{
|
||||
private readonly RemittanceService _remittanceService;
|
||||
|
||||
private readonly IAsyncRepository<Invoice> _invoiceRepo;
|
||||
private readonly IAsyncRepository<Coding> _CodingRepo;
|
||||
private readonly IAsyncRepository<InvoiceStatusChang> _invoiceStatusChangPaymentRepo;
|
||||
private readonly CheckPermission _checkPermission;
|
||||
public servInvoice(IAsyncRepository<Invoice> invoiceRepo, CheckPermission checkPermission
|
||||
, IAsyncRepository<InvoiceStatusChang> invoiceStatusChangPaymentRepo, IAsyncRepository<Coding> codingRepo)
|
||||
|
||||
public servInvoice(RemittanceService remittanceService, IAsyncRepository<Invoice> invoiceRepo, IAsyncRepository<Coding> codingRepo, IAsyncRepository<InvoiceStatusChang> invoiceStatusChangPaymentRepo, CheckPermission checkPermission)
|
||||
{
|
||||
_invoiceStatusChangPaymentRepo = invoiceStatusChangPaymentRepo;
|
||||
_remittanceService = remittanceService;
|
||||
_invoiceRepo = invoiceRepo;
|
||||
_checkPermission = checkPermission;
|
||||
_CodingRepo = codingRepo;
|
||||
_invoiceStatusChangPaymentRepo = invoiceStatusChangPaymentRepo;
|
||||
_checkPermission = checkPermission;
|
||||
}
|
||||
|
||||
public async Task<List<Coding>> GetCodingPMT()
|
||||
{
|
||||
return await _CodingRepo.Get(w => w.FildID == 71).ToListAsync();
|
||||
@@ -65,6 +70,7 @@ namespace Back.Services
|
||||
tbill = item.tbill,
|
||||
Des = item.Des,
|
||||
PreparedtoSendtoTax = item.PreparedtoSendtoTax,
|
||||
HasaRemittance= await _remittanceService.HasaRemittance(ID),
|
||||
tdis = item.tdis,
|
||||
tvam = item.tvam,
|
||||
Udate = item.Udate.ShamciToFormatShamci(),
|
||||
|
Reference in New Issue
Block a user