Browse Source

接口编写差额算法

master
学 赵 11 months ago
parent
commit
85b6d7262d
  1. 20
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

20
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -158,6 +158,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
List<INVOICE_WAIT_DETAIL> invdetials = new List<INVOICE_WAIT_DETAIL>(); List<INVOICE_WAIT_DETAIL> invdetials = new List<INVOICE_WAIT_DETAIL>();
foreach (var itm in invoiceGrpDetails) foreach (var itm in invoiceGrpDetails)
{ {
itm.SetProperty("ErpToLoc",$"C{invoiceGrp.ClientCode}");
invdetials.Add(itm);//添加发票明细 invdetials.Add(itm);//添加发票明细
var first = _detail.FirstOrDefault(p => p.ContractDocID == itm.Extend1 && p.PartCode == itm.PartCode ); var first = _detail.FirstOrDefault(p => p.ContractDocID == itm.Extend1 && p.PartCode == itm.PartCode );
if (first == null) if (first == null)
@ -203,14 +204,29 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
InvoiceNetAmount = invoiceGrpDetail.Amt, InvoiceNetAmount = invoiceGrpDetail.Amt,
InvoiceTaxAmount = Math.Round(invoiceGrpDetail.Amt * 0.13m, 2), InvoiceTaxAmount = Math.Round(invoiceGrpDetail.Amt * 0.13m, 2),
TaxRate = 0.13m, TaxRate = 0.13m,
Location = invoiceGrp.GetProperty("ErpToLoc", string.Empty), Location = invoiceGrpDetail.GetProperty("ErpToLoc", string.Empty),
begintime = invoiceGrpDetail.BeginDate, begintime = invoiceGrpDetail.BeginDate,
endtime = invoiceGrpDetail.EndDate, endtime = invoiceGrpDetail.EndDate,
domain = "BJBMPT", domain = "BJBMPT",
LINE = (i + 1).ToString() LINE = (i + 1).ToString()
}); });
} }
tedSaInvs.FirstOrDefault().InvoiceTaxAmount += invoiceGrp.TaxDiff;
var invbefore = invoiceGrp.TaxAmt + invoiceGrp.TaxDiff;
var invafter=tedSaInvs.Sum(p => p.InvoiceNetAmount) + tedSaInvs.Sum(p => p.InvoiceTaxAmount);
var invdiff = invbefore - invafter;
tedSaInvs.FirstOrDefault(p => p.LINE == "2").InvoiceTaxAmount +=invdiff;
tedSaInvs.FirstOrDefault(p => p.LINE == "1").InvoiceTaxAmount += invoiceGrp.TaxDiff;
//红冲发票提交QAD //红冲发票提交QAD
if (!string.IsNullOrEmpty(invoiceGrp.ParentInvbillNum)) if (!string.IsNullOrEmpty(invoiceGrp.ParentInvbillNum))
{ {

Loading…
Cancel
Save