|
|
|
@ -186,7 +186,6 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
|
return Task.FromResult(DataResult<InvoiceApplicaitonBiz>.Success(new InvoiceApplicaitonBiz([])));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma warning disable CS4014
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -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<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);
|
|
|
|
|
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<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.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();
|
|
|
|
|
|
|
|
|
|