|
|
@ -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();
|
|
|
|
|
|
|
|
|
|
|
|