Browse Source

接口编写差额算法

master
学 赵 11 months ago
parent
commit
85b6d7262d
  1. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  2. 6
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs

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

@ -136,8 +136,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var _detail = await _bbacMng.GetDetailAsync(invbillNum, EnumBusinessType.MaiDanJianBBAC).ConfigureAwait(false);//查出买单数量
var invoiceGrpDetails = _settleAccountDbContext.Set<INVOICE_WAIT_DETAIL>()
.Where(t => t.InvbillNum == invbillNum)
.ToList();
.Where(t => t.InvbillNum == invbillNum)
.ToList();
if (invoiceGrpDetails.Any())
{
var tedSaInvs = new List<TED_SAS_INVOICE>();
@ -158,6 +158,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
List<INVOICE_WAIT_DETAIL> invdetials = new List<INVOICE_WAIT_DETAIL>();
foreach (var itm in invoiceGrpDetails)
{
itm.SetProperty("ErpToLoc",$"C{invoiceGrp.ClientCode}");
invdetials.Add(itm);//添加发票明细
var first = _detail.FirstOrDefault(p => p.ContractDocID == itm.Extend1 && p.PartCode == itm.PartCode );
if (first == null)
@ -203,14 +204,29 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
InvoiceNetAmount = invoiceGrpDetail.Amt,
InvoiceTaxAmount = Math.Round(invoiceGrpDetail.Amt * 0.13m, 2),
TaxRate = 0.13m,
Location = invoiceGrp.GetProperty("ErpToLoc", string.Empty),
Location = invoiceGrpDetail.GetProperty("ErpToLoc", string.Empty),
begintime = invoiceGrpDetail.BeginDate,
endtime = invoiceGrpDetail.EndDate,
domain = "BJBMPT",
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
if (!string.IsNullOrEmpty(invoiceGrp.ParentInvbillNum))
{

6
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs

@ -16,10 +16,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public class BalanceSum
{
[ExporterHeader(DisplayName = "年份", IsBold = true)]
public string Year { set; get; }
[ExporterHeader(DisplayName = "年份", IsBold = true)]
public string Year { set; get; }
[ExporterHeader(DisplayName = "零件号", IsBold = true)]
[ExporterHeader(DisplayName = "零件号", IsBold = true)]
public string RealPartCode { set; get; }
[ExporterHeader(DisplayName = "零件名称", IsBold = true)]

Loading…
Cancel
Save