From 85b6d7262d11ef8ba61c6d4d0a9af237f7a926a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 7 Dec 2023 16:02:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=BC=96=E5=86=99=E5=B7=AE?= =?UTF-8?q?=E9=A2=9D=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/INVOICE_SERVICE.cs | 24 +++++++++++++++---- .../BalanceSum/BalanceSumDapperRepository.cs | 6 ++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index c535ee0d..99923bfa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/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() - .Where(t => t.InvbillNum == invbillNum) - .ToList(); + .Where(t => t.InvbillNum == invbillNum) + .ToList(); if (invoiceGrpDetails.Any()) { var tedSaInvs = new List(); @@ -158,6 +158,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ List invdetials = new List(); 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)) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs index e3e2cf73..a53559f4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs +++ b/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)]