tax
This commit is contained in:
@@ -48,7 +48,7 @@ namespace Back.Services
|
||||
return inquiryResultModels[0];
|
||||
return null;
|
||||
}
|
||||
public async Task<TaxCollectData.Library.Dto.HttpResponse<AsyncResponseModel>> SendInvoice(int CompanyID,InvoiceHeaderDto header, List<InvoiceBodyDto> InvoiceBody, PaymentDto payment)
|
||||
public async Task<TaxCollectData.Library.Dto.HttpResponse<AsyncResponseModel>> SendInvoice(int CompanyID,InvoiceHeaderDto header, List<InvoiceBodyDto> InvoiceBody, List<PaymentDto> payments)
|
||||
{
|
||||
//return new TaxCollectData.Library.Dto.HttpResponse<AsyncResponseModel>
|
||||
// ( body: new AsyncResponseModel(
|
||||
@@ -62,7 +62,7 @@ namespace Back.Services
|
||||
{
|
||||
new()
|
||||
{
|
||||
Header =header,Body =InvoiceBody,Payments = new() {payment}
|
||||
Header =header,Body =InvoiceBody,Payments = payments
|
||||
}
|
||||
}
|
||||
, null);
|
||||
|
@@ -39,7 +39,7 @@ namespace Back.Services
|
||||
.ThenInclude(inc => inc.CODUnit)
|
||||
.Include(inc => inc.Customer)
|
||||
.Include(inc => inc.sentTax)
|
||||
//.Include(inc => inc.payments)
|
||||
.Include(inc => inc.payments)
|
||||
.Include(inc => inc.pattern)
|
||||
.ThenInclude(inc => inc.BillType)
|
||||
|
||||
@@ -92,22 +92,22 @@ namespace Back.Services
|
||||
vra = x.vra,
|
||||
prdis = x.prdis
|
||||
}).ToList(),
|
||||
payments = new List<InvoicePaymentDTO>()
|
||||
//s.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
||||
//{
|
||||
// ID = x.ID,
|
||||
// acn = x.acn,
|
||||
// iinn = x.acn,
|
||||
// pcn = x.acn,
|
||||
// pdt = x.pdt,
|
||||
// PaymentDateTime=x.PaymentDateTime,
|
||||
// pid = x.pid,
|
||||
// pmt = x.pmt,
|
||||
// pv = x.pv,
|
||||
// trmn = x.trmn,
|
||||
// trn = x.acn
|
||||
//}).ToList()
|
||||
};
|
||||
payments =
|
||||
item.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
||||
{
|
||||
ID = x.ID,
|
||||
acn = x.acn,
|
||||
iinn = x.acn,
|
||||
pcn = x.acn,
|
||||
pdt = x.pdt,
|
||||
PaymentDateTime = x.PaymentDateTime,
|
||||
pid = x.pid,
|
||||
pmt = x.pmt,
|
||||
pv = x.pv,
|
||||
trmn = x.trmn,
|
||||
trn = x.acn
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
@@ -15,13 +15,14 @@ namespace Back.Services
|
||||
private readonly IAsyncRepository<BillType> _repoBillType;
|
||||
private readonly IAsyncRepository<Invoice> _invoiceRepo;
|
||||
private readonly IAsyncRepository<InvoiceItem> _invoiceitemRepo;
|
||||
private readonly IAsyncRepository<InvoicePayment> _invoicePaymentRepo;
|
||||
private readonly IAsyncRepository<FildModeInPattern> _fildModeInPatternRepo;
|
||||
private readonly IAsyncRepository<Coding> _codingRepo;
|
||||
private readonly IAsyncRepository<SpecialCondition> _specialConditionRepo;
|
||||
public servTaxPayer(IAsyncRepository<SentTax> repoSentTax, IAsyncRepository<Pattern> repoPattern
|
||||
, IAsyncRepository<Invoice> invoiceRepo, IAsyncRepository<FildModeInPattern> fildModeInPatternRepo
|
||||
, IAsyncRepository<Coding> codingRepo, IAsyncRepository<SpecialCondition> specialConditionRepo
|
||||
, IAsyncRepository<InvoiceItem> invoiceitemRepo, IAsyncRepository<BillType> repoBillType)
|
||||
, IAsyncRepository<InvoiceItem> invoiceitemRepo, IAsyncRepository<BillType> repoBillType, IAsyncRepository<InvoicePayment> invoicePaymentRepo)
|
||||
{
|
||||
_repoSentTax = repoSentTax;
|
||||
_repoPattern = repoPattern;
|
||||
@@ -31,6 +32,7 @@ namespace Back.Services
|
||||
_specialConditionRepo = specialConditionRepo;
|
||||
_invoiceitemRepo = invoiceitemRepo;
|
||||
_repoBillType = repoBillType;
|
||||
_invoicePaymentRepo= invoicePaymentRepo;
|
||||
}
|
||||
public async Task<bool> ExistSuccessfulorSendorpendingInvoiceinCompanyID(int CompanyID)
|
||||
{
|
||||
@@ -214,6 +216,18 @@ namespace Back.Services
|
||||
if (!await _invoiceitemRepo.UpdateAsync(invoiceDetItem))
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var pitem in FildItems.Payments)
|
||||
{
|
||||
var invoicepayments = InvoiceItem.payments.Where(w => w.ID == pitem.ID).FirstOrDefault();
|
||||
foreach (var item in pitem.filds.Where(w => w.InputBox == "fild" || w.InputBox == "fromdb"))
|
||||
{
|
||||
if (invoicepayments != null)
|
||||
SetValue(item, ref invoicepayments);
|
||||
}
|
||||
if (!await _invoicePaymentRepo.UpdateAsync(invoicepayments))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else return false;
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user