From 86b80d530cef50d2cfc103ab7ee9926e693580b1 Mon Sep 17 00:00:00 2001 From: zhaoxinyu Date: Thu, 4 Jan 2024 13:54:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/INVOICE_SERVICE.cs | 24 +++++++++++-------- .../Entities/BQ/VmiAppService.cs | 12 ---------- 2 files changed, 14 insertions(+), 22 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 900bb6d1..65c90274 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 @@ -518,10 +518,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //红冲发票提交QAD - if (!string.IsNullOrEmpty(invoiceGrp.ParentInvbillNum)) - { - await SubmitToQadHongChongAsync(invoiceGrp.ParentInvbillNum,_detail).ConfigureAwait(false); - } + await _exChangeCenterDbContext.BulkInsertAsync(new List() { teaTaskSub }).ConfigureAwait(false); foreach (var itm in tedsaInvs1) { @@ -587,18 +584,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ LINE = (i + 1).ToString() }); } - tedSaInvs.FirstOrDefault().InvoiceTaxAmount += invoiceGrp.TaxDiff; - //红冲发票提交QAD - if (!string.IsNullOrEmpty(invoiceGrp.ParentInvbillNum)) - { - await SubmitToQadHongChongAsync(invoiceGrp.ParentInvbillNum).ConfigureAwait(false); - } + var invbefore = invoiceGrp.RealAmt + invoiceGrp.TaxDiff;// + var invafter = tedSaInvs.Sum(p => p.InvoiceTaxAmount); + var invdiff = invbefore - invafter; + + tedSaInvs.FirstOrDefault().InvoiceTaxAmount += invdiff; + + //await _exChangeCenterDbContext.Set().AddAsync(teaTaskSub).ConfigureAwait(false); //await _exChangeCenterDbContext.Set().AddRangeAsync(tedSaInvs).ConfigureAwait(false); //invoiceGrp.State = SettleBillState.已提交QAD; ////构建发票同步Qad状态表数据 //await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false); await _exChangeCenterDbContext.BulkInsertAsync(new List() { teaTaskSub }).ConfigureAwait(false); + foreach (var itm in tedSaInvs) + { + itm.InvoiceQuatity = -itm.InvoiceQuatity; + itm.InvoiceNetAmount = -itm.InvoiceNetAmount; + itm.InvoiceTaxAmount = -itm.InvoiceTaxAmount; + } await _exChangeCenterDbContext.BulkInsertAsync(tedSaInvs).ConfigureAwait(false); invoiceGrp.State = SettleBillState.已提交QAD; await _repository.DbContext.BulkUpdateAsync(new List() { invoiceGrp }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index 313b49ee..048754bd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -221,28 +221,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task BalanceSumByVersionExport(RequestDto input) { var entities = await _balanceSumRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount, true).ConfigureAwait(false); - - IExporter _excel = new ExcelExporter(); - byte[] result = null; - result = await _excel.ExportAsByteArray(entities).ConfigureAwait(false); result.ShouldNotBeNull(); - - - var fileName = $"库存余额_期间_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; - await _fileContainer.SaveAsync(fileName, result, true).ConfigureAwait(false); return fileName; } - - - - /// /// 1.库存余额查询 ///