|
|
@ -1,5 +1,7 @@
|
|
|
|
using DS.Module.Core;
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
|
|
|
using DS.WMS.Core.Application.Entity;
|
|
|
|
using DS.WMS.Core.Application.Method;
|
|
|
|
using DS.WMS.Core.Application.Method;
|
|
|
|
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
using DS.WMS.Core.Sys.Entity;
|
|
|
|
using DS.WMS.Core.Sys.Entity;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
@ -37,9 +39,13 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
var userInfo = await Db.Queryable<SysUser>().Where(x => x.Id == userId).Select(x => new
|
|
|
|
var userInfo = await Db.Queryable<SysUser>().Where(x => x.Id == userId).Select(x => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x.Id,
|
|
|
|
x.UserName,
|
|
|
|
|
|
|
|
x.IdCardNo
|
|
|
|
}).FirstAsync();
|
|
|
|
}).FirstAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(userInfo.IdCardNo))
|
|
|
|
|
|
|
|
return DataResult<string>.FailedWithDesc(MultiLanguageConst.DrawerIDNumberIsNull);
|
|
|
|
|
|
|
|
|
|
|
|
//请求参数设置
|
|
|
|
//请求参数设置
|
|
|
|
InvoiceIssuanceRequest request = new()
|
|
|
|
InvoiceIssuanceRequest request = new()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -62,11 +68,12 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
hjse = x.InvoiceAmount * x.TaxRate,
|
|
|
|
hjse = x.InvoiceAmount * x.TaxRate,
|
|
|
|
hjje = x.InvoiceAmount - x.InvoiceAmount * x.TaxRate,
|
|
|
|
hjje = x.InvoiceAmount - x.InvoiceAmount * x.TaxRate,
|
|
|
|
jshj = x.InvoiceAmount,
|
|
|
|
jshj = x.InvoiceAmount,
|
|
|
|
clerk = x.CreateUserName, //开票人
|
|
|
|
clerk = userInfo.UserName, //开票人
|
|
|
|
kprzjhm = "", //证件号
|
|
|
|
kprzjhm = userInfo.IdCardNo, //证件号
|
|
|
|
kprzjlx = "201", //身份证,
|
|
|
|
kprzjlx = "201", //身份证,
|
|
|
|
//---------发票明细---------
|
|
|
|
//---------发票明细---------
|
|
|
|
invoiceDetail = x.InvoiceDetails.Select(y => new InvoiceDetailInfo
|
|
|
|
invoiceDetail = SqlFunc.Subqueryable<InvoiceDetail>().Where(y => y.ApplicationId == x.Id)
|
|
|
|
|
|
|
|
.LeftJoin<CodeInvoice>((y, z) => y.CodeId == z.Id).ToList((y, z) => new InvoiceDetailInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mxxh = SqlFunc.RowNumber(y.Id), //x.InvoiceDetails.IndexOf(y) + 1,
|
|
|
|
mxxh = SqlFunc.RowNumber(y.Id), //x.InvoiceDetails.IndexOf(y) + 1,
|
|
|
|
xmmc = y.Name,
|
|
|
|
xmmc = y.Name,
|
|
|
@ -78,9 +85,10 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
taxRate = y.TaxRate.ToString(),
|
|
|
|
taxRate = y.TaxRate.ToString(),
|
|
|
|
tax = y.TaxAmount,
|
|
|
|
tax = y.TaxAmount,
|
|
|
|
taxIncludedAmount = y.TaxUnitPrice,
|
|
|
|
taxIncludedAmount = y.TaxUnitPrice,
|
|
|
|
goodsCode = "", //商品和服务税收分类合并编码
|
|
|
|
goodsCode = z.Code, //商品和服务税收分类合并编码
|
|
|
|
invoiceLineProperty = "00"
|
|
|
|
invoiceLineProperty = "00",
|
|
|
|
}).ToList()
|
|
|
|
favouredPolicyFlag = z.PreferentialPolicyDescription
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}).ToListAsync()
|
|
|
|
}).ToListAsync()
|
|
|
|
};
|
|
|
|
};
|
|
|
|