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