|
|
|
@ -48,7 +48,6 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
|
InvoiceHeader = x.InvoiceHeader,
|
|
|
|
|
Currency = x.Currency,
|
|
|
|
|
ApplyAmount = x.ApplyAmount,
|
|
|
|
|
InvoiceCurrency = x.InvoiceCurrency,
|
|
|
|
|
InvoiceAmount = x.InvoiceAmount,
|
|
|
|
|
CreateTime = x.CreateTime, //申请时间
|
|
|
|
|
CreateBy = x.CreateBy, //申请人ID
|
|
|
|
@ -280,21 +279,20 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
|
public async Task<DataResult<InvoiceApplicationDto>> GetAsync(long id)
|
|
|
|
|
{
|
|
|
|
|
var dto = await TenantDb.Queryable<InvoiceApplication>().Where(a => a.Id == id)
|
|
|
|
|
.LeftJoin<InfoClientBank>((a, b) => a.CustomerBankId == b.Id)
|
|
|
|
|
.Select((a, b) => new InvoiceApplicationDto
|
|
|
|
|
.LeftJoin<InfoClientBank>((a, b1) => a.CustomerBankId == b1.Id)
|
|
|
|
|
.LeftJoin<InfoClientBank>((a, b1, b2) => a.USDCustomerBankId == b2.Id)
|
|
|
|
|
.Select((a, b1, b2) => new InvoiceApplicationDto
|
|
|
|
|
{
|
|
|
|
|
Id = a.Id,
|
|
|
|
|
ApplicationNO = a.ApplicationNO,
|
|
|
|
|
Currency = a.Currency,
|
|
|
|
|
CustomerId = a.CustomerId,
|
|
|
|
|
CustomerName = a.CustomerName,
|
|
|
|
|
CustomerBankId = a.CustomerBankId,
|
|
|
|
|
Status = a.Status,
|
|
|
|
|
CreateTime = a.CreateTime,
|
|
|
|
|
CreateBy = a.CreateBy,
|
|
|
|
|
InvoiceDate = a.InvoiceDate,
|
|
|
|
|
InvoiceAmount = a.InvoiceAmount,
|
|
|
|
|
InvoiceCurrency = a.InvoiceCurrency,
|
|
|
|
|
InvoiceHeader = a.InvoiceHeader,
|
|
|
|
|
InvoiceNO = a.InvoiceNO,
|
|
|
|
|
InvoiceBillNO = a.InvoiceBillNO,
|
|
|
|
@ -305,13 +303,21 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
|
OtherCurrencyAmount = a.OtherCurrencyAmount,
|
|
|
|
|
Category = a.Category,
|
|
|
|
|
CustomerAddTel = a.CustomerAddTel,
|
|
|
|
|
CustomerBank = b.BankName,
|
|
|
|
|
CustomerAccount = b.Account,
|
|
|
|
|
|
|
|
|
|
CustomerBankId = a.CustomerBankId,
|
|
|
|
|
CustomerBankName = b1.BankName,
|
|
|
|
|
CustomerAccount = b1.Account,
|
|
|
|
|
|
|
|
|
|
USDCustomerBankId = a.USDCustomerBankId,
|
|
|
|
|
USDCustomerBankName = b2.BankName,
|
|
|
|
|
USDCustomerAccount = b2.Account
|
|
|
|
|
}).FirstAsync();
|
|
|
|
|
|
|
|
|
|
if (dto != null)
|
|
|
|
|
{
|
|
|
|
|
dto.InvoiceDetails = await TenantDb.Queryable<InvoiceDetail>().Where(x => x.ApplicationId == dto.Id).ToListAsync();
|
|
|
|
|
dto.CreateByName = await Db.Queryable<SysUser>().Where(x => x.Id == dto.CreateBy).Select(x => x.UserName).FirstAsync();
|
|
|
|
|
|
|
|
|
|
dto.InvoiceDetails = await TenantDb.Queryable<InvoiceDetail>().Where(x => x.ApplicationId == dto.Id && x.Category == DetailCategory.InvoiceApplication).ToListAsync();
|
|
|
|
|
|
|
|
|
|
dto.Details = await TenantDb.Queryable<ApplicationDetail>().LeftJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
|
|
|
|
|
.Where(d => d.ApplicationId == id).Select((d, f) => new InvoiceApplicationDetailDto
|
|
|
|
@ -524,9 +530,6 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
|
.UpdateColumns(x => new { x.OrderInvoiceAmount })
|
|
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
//if (application.InvoiceCurrency.IsNullOrEmpty())
|
|
|
|
|
// application.InvoiceCurrency = FeeCurrency.RMB_CODE;
|
|
|
|
|
|
|
|
|
|
await base.OnSaveAsync(application, fees);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|