发票申请参数传递

dev
嵇文龙 4 weeks ago
parent 8eccfdec31
commit 8b9beff236

@ -249,6 +249,9 @@ namespace DS.WMS.Core.Application.Method
FeeType = f.FeeType, FeeType = f.FeeType,
Amount = f.Amount, Amount = f.Amount,
Currency = f.Currency, Currency = f.Currency,
OriginalAmount = f.Amount,
OriginalCurrency = f.Currency,
TaxRate = f.TaxRate,
RestAmount = f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount, RestAmount = f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount,
Remark = f.Remark, Remark = f.Remark,
CreateBy = f.CreateBy CreateBy = f.CreateBy

@ -137,7 +137,7 @@
/// <summary> /// <summary>
/// 购买方自然人标志 /// 购买方自然人标志
/// </summary> /// </summary>
public string gmfzrrbz { get; set; } = "Y"; public string? gmfzrrbz { get; set; }
/// <summary> /// <summary>
/// 特定要素 /// 特定要素
/// </summary> /// </summary>

@ -1,5 +1,4 @@
using System.Reflection.Emit; using DS.Module.Core;
using DS.Module.Core;
using DS.Module.Core.Enums; using DS.Module.Core.Enums;
using DS.WMS.Core.Application.Entity; using DS.WMS.Core.Application.Entity;
using DS.WMS.Core.Application.Method; using DS.WMS.Core.Application.Method;
@ -12,7 +11,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using SqlSugar; using SqlSugar;
using static AnyDiff.DifferenceLines;
namespace DS.WMS.Core.Invoice.Method namespace DS.WMS.Core.Invoice.Method
{ {
@ -158,7 +156,7 @@ namespace DS.WMS.Core.Invoice.Method
{ {
var result2 = DataResult.Success; var result2 = DataResult.Success;
var invoices = await TenantDb.Queryable<Entity.Invoice>() var invoices = await TenantDb.Queryable<Entity.Invoice>()
.Where(x => x.SN == sn) .Where(x => x.SN == sn && !SqlFunc.IsNullOrEmpty(x.PDFUrl))
.Select(x => new Entity.Invoice .Select(x => new Entity.Invoice
{ {
SN = x.SN, SN = x.SN,

@ -186,7 +186,6 @@ namespace DS.WMS.Core.Invoice.Method
return Task.FromResult(DataResult<InvoiceApplicaitonBiz>.Success(new InvoiceApplicaitonBiz([]))); return Task.FromResult(DataResult<InvoiceApplicaitonBiz>.Success(new InvoiceApplicaitonBiz([])));
} }
#pragma warning disable CS4014 #pragma warning disable CS4014
/// <summary> /// <summary>
@ -223,6 +222,7 @@ namespace DS.WMS.Core.Invoice.Method
if (invoice.PushModeValues.Length > 0) if (invoice.PushModeValues.Length > 0)
invoice.PushMode = string.Join(",", invoice.PushModeValues.Select(x => (int)x)); invoice.PushMode = string.Join(",", invoice.PushModeValues.Select(x => (int)x));
string? invRemark = null;
//按申请开票 //按申请开票
if (request.Invoice.Mode == InvoiceMode.Applcation && request.Applications?.Count > 0) if (request.Invoice.Mode == InvoiceMode.Applcation && request.Applications?.Count > 0)
{ {
@ -262,11 +262,11 @@ namespace DS.WMS.Core.Invoice.Method
z.BankName z.BankName
}).ToListAsync(); }).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) if (details.GroupBy(x => x.TaxRate).Select(x => x.Key).Count() > 1)
return DataResult<TEntity>.FailedWithDesc(nameof(MultiLanguageConst.InconsistentTaxRates)); return DataResult<TEntity>.FailedWithDesc(nameof(MultiLanguageConst.InconsistentTaxRates));
invoice.InvoiceRemark = string.Join(" | ", details.Where(x => !string.IsNullOrEmpty(x.InvoiceRemark)).Select(x => x.InvoiceRemark));
invoice.Details ??= new List<ApplicationDetail>(details.Count); invoice.Details ??= new List<ApplicationDetail>(details.Count);
foreach (var item in details) foreach (var item in details)
{ {
@ -450,7 +450,7 @@ namespace DS.WMS.Core.Invoice.Method
invoice.CustomerAccount = clientBank.Account; invoice.CustomerAccount = clientBank.Account;
invoice.CustomerBankName = clientBank.BankName; invoice.CustomerBankName = clientBank.BankName;
} }
} }
//补充销方信息 //补充销方信息
//var org = await Db.Queryable<SysOrg>().Where(x => x.Id == User.OrgId).Select(x => new { x.OrgFullName, x.LicenseCode }).FirstAsync(); //var org = await Db.Queryable<SysOrg>().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.BankName = orgBank.BankName;
invoice.Account = orgBank.BankAccountNo; 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.PushMode,
x.CellPhoneNO, x.CellPhoneNO,
x.Email, x.Email,
//x.InvoiceRemark,
x.Note x.Note
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();

Loading…
Cancel
Save