From 8b9beff236b475cc9654f99b099cd333e40b08ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Sat, 2 Nov 2024 20:38:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E7=94=B3=E8=AF=B7=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Application/Method/InvoiceApplicationService.cs | 3 +++ .../DS.WMS.Core/Invoice/Dtos/InvoiceIssuance.cs | 2 +- .../Invoice/Method/InvoiceIssuanceService.cs | 6 ++---- .../DS.WMS.Core/Invoice/Method/InvoiceService`1.cs | 13 ++++++++++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs index 6da3b0e9..c8bf5546 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/InvoiceApplicationService.cs @@ -249,6 +249,9 @@ namespace DS.WMS.Core.Application.Method FeeType = f.FeeType, Amount = f.Amount, Currency = f.Currency, + OriginalAmount = f.Amount, + OriginalCurrency = f.Currency, + TaxRate = f.TaxRate, RestAmount = f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount, Remark = f.Remark, CreateBy = f.CreateBy diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InvoiceIssuance.cs b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InvoiceIssuance.cs index 651bc289..9bbf0511 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InvoiceIssuance.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Dtos/InvoiceIssuance.cs @@ -137,7 +137,7 @@ /// /// 购买方自然人标志 /// - public string gmfzrrbz { get; set; } = "Y"; + public string? gmfzrrbz { get; set; } /// /// 特定要素 /// diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceIssuanceService.cs b/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceIssuanceService.cs index 36443813..5566cb21 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceIssuanceService.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceIssuanceService.cs @@ -1,5 +1,4 @@ -using System.Reflection.Emit; -using DS.Module.Core; +using DS.Module.Core; using DS.Module.Core.Enums; using DS.WMS.Core.Application.Entity; using DS.WMS.Core.Application.Method; @@ -12,7 +11,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json.Linq; using SqlSugar; -using static AnyDiff.DifferenceLines; namespace DS.WMS.Core.Invoice.Method { @@ -158,7 +156,7 @@ namespace DS.WMS.Core.Invoice.Method { var result2 = DataResult.Success; var invoices = await TenantDb.Queryable() - .Where(x => x.SN == sn) + .Where(x => x.SN == sn && !SqlFunc.IsNullOrEmpty(x.PDFUrl)) .Select(x => new Entity.Invoice { SN = x.SN, diff --git a/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceService`1.cs b/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceService`1.cs index b964dfc0..bbead9ec 100644 --- a/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceService`1.cs +++ b/ds-wms-service/DS.WMS.Core/Invoice/Method/InvoiceService`1.cs @@ -186,7 +186,6 @@ namespace DS.WMS.Core.Invoice.Method return Task.FromResult(DataResult.Success(new InvoiceApplicaitonBiz([]))); } - #pragma warning disable CS4014 /// @@ -223,6 +222,7 @@ namespace DS.WMS.Core.Invoice.Method if (invoice.PushModeValues.Length > 0) invoice.PushMode = string.Join(",", invoice.PushModeValues.Select(x => (int)x)); + string? invRemark = null; //按申请开票 if (request.Invoice.Mode == InvoiceMode.Applcation && request.Applications?.Count > 0) { @@ -262,11 +262,11 @@ namespace DS.WMS.Core.Invoice.Method z.BankName }).ToListAsync(); + invRemark = string.Join(" | ", details.Where(x => !string.IsNullOrEmpty(x.InvoiceRemark)).Select(x => x.InvoiceRemark)); //税率不一致 if (details.GroupBy(x => x.TaxRate).Select(x => x.Key).Count() > 1) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.InconsistentTaxRates)); - invoice.InvoiceRemark = string.Join(" | ", details.Where(x => !string.IsNullOrEmpty(x.InvoiceRemark)).Select(x => x.InvoiceRemark)); invoice.Details ??= new List(details.Count); foreach (var item in details) { @@ -450,7 +450,7 @@ namespace DS.WMS.Core.Invoice.Method invoice.CustomerAccount = clientBank.Account; invoice.CustomerBankName = clientBank.BankName; } - } + } //补充销方信息 //var org = await Db.Queryable().Where(x => x.Id == User.OrgId).Select(x => new { x.OrgFullName, x.LicenseCode }).FirstAsync(); @@ -470,6 +470,12 @@ namespace DS.WMS.Core.Invoice.Method invoice.BankName = orgBank.BankName; invoice.Account = orgBank.BankAccountNo; } + + //生成默认备注 + //invoice.InvoiceRemark = $"购买方地址电话:" + Environment.NewLine + invoice.CustomerAddressTel + Environment.NewLine + // + "购买方开户行/账号:" + invoice.CustomerBankName + " " + invoice.CustomerAccount; + if (!string.IsNullOrEmpty(invRemark)) + invoice.Note += Environment.NewLine + invRemark; } //筛选出新增的费用明细 @@ -525,6 +531,7 @@ namespace DS.WMS.Core.Invoice.Method x.PushMode, x.CellPhoneNO, x.Email, + //x.InvoiceRemark, x.Note }).ExecuteCommandAsync();