|
|
@ -160,37 +160,44 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取结算单费用明细
|
|
|
|
/// 根据申请获取费用明细
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ids">申请单明细ID</param>
|
|
|
|
/// <param name="ids">申请单ID</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<DataResult<List<PaymentApplicationDetailDto>>> GetSettlementDetailsAsync(long[] ids)
|
|
|
|
public async Task<DataResult<List<PaymentApplicationDetailDto>>> GetSettlementFeeDetailsAsync(params long[] ids)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var details = await TenantDb.Queryable<ApplicationDetail>().Where(d => ids.Contains(d.Id))
|
|
|
|
var details = await CreateApplicationDetailQuery((d, f, s) => ids.Contains(d.ApplicationId))
|
|
|
|
.LeftJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
|
|
|
|
.LeftJoin<PaymentApplication>((d, pa) => d.ApplicationId == pa.Id)
|
|
|
|
.LeftJoin<BusinessFeeStatus>((d, f, b) => f.BusinessId == b.BusinessId && f.BusinessType == b.BusinessType)
|
|
|
|
.Select((d, pa) => new PaymentApplicationDetailDto
|
|
|
|
.LeftJoin<PaymentApplication>((d, f, b, p) => d.ApplicationId == p.Id)
|
|
|
|
|
|
|
|
.Select((d, f, b, p) => new PaymentApplicationDetailDto
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = d.Id,
|
|
|
|
Id = d.Id,
|
|
|
|
ApplicationId = d.ApplicationId,
|
|
|
|
ApplicationId = d.ApplicationId,
|
|
|
|
BusinessId = f.BusinessId,
|
|
|
|
BusinessId = d.BusinessId,
|
|
|
|
BusinessType = f.BusinessType,
|
|
|
|
BusinessType = d.BusinessType,
|
|
|
|
RecordId = d.RecordId,
|
|
|
|
RecordId = d.RecordId,
|
|
|
|
FeeName = d.FeeName,
|
|
|
|
FeeName = d.FeeName,
|
|
|
|
FeeType = d.FeeType, //收付
|
|
|
|
FeeType = d.FeeType,
|
|
|
|
ApplyAmount = d.ApplyAmount, //结算金额
|
|
|
|
Amount = d.Amount, //总金额
|
|
|
|
CustomerId = f.CustomerId,
|
|
|
|
ApplyAmount = d.ApplyAmount, //已结算金额
|
|
|
|
|
|
|
|
RestAmount = d.ApplyAmount - d.ProcessedAmount, //剩余结算金额
|
|
|
|
|
|
|
|
CustomerId = d.CustomerId,
|
|
|
|
CustomerName = d.CustomerName,
|
|
|
|
CustomerName = d.CustomerName,
|
|
|
|
OriginalCurrency = d.OriginalCurrency, //原始币别
|
|
|
|
OriginalCurrency = d.OriginalCurrency, //原始币别
|
|
|
|
OriginalRate = f.ExchangeRate, //原始汇率
|
|
|
|
OriginalRate = d.ExchangeRate, //原始汇率
|
|
|
|
ExchangeRate = d.ExchangeRate, //折算汇率
|
|
|
|
ExchangeRate = d.ExchangeRate, //折算汇率
|
|
|
|
OriginalAmount = d.OriginalAmount, //原始金额
|
|
|
|
OriginalAmount = d.OriginalAmount, //原始金额
|
|
|
|
InvoiceNO = p.InvoiceNO //发票号
|
|
|
|
CustomerNo = d.CustomerNo,
|
|
|
|
|
|
|
|
MBLNO = d.MBLNO,
|
|
|
|
|
|
|
|
HBLNO = d.HBLNO,
|
|
|
|
|
|
|
|
ETD = d.ETD,
|
|
|
|
|
|
|
|
SourceName = d.SourceName,
|
|
|
|
|
|
|
|
SaleName = d.SaleName,
|
|
|
|
|
|
|
|
AccountDate = d.AccountDate,
|
|
|
|
|
|
|
|
Vessel = d.Vessel,
|
|
|
|
|
|
|
|
Voyage = d.Voyage,
|
|
|
|
|
|
|
|
InvoiceNO = pa.InvoiceNO
|
|
|
|
}).ToListAsync();
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
await FulfillDetailsAsync(details);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult<List<PaymentApplicationDetailDto>>.Success(details);
|
|
|
|
return DataResult<List<PaymentApplicationDetailDto>>.Success(details);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -268,7 +275,7 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
public async Task<DataResult<List<PaymentApplicationDetailDto>>> GetApplicationDetailsAsync(long id)
|
|
|
|
public async Task<DataResult<List<PaymentApplicationDetailDto>>> GetApplicationDetailsAsync(long id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var details = await TenantDb.Queryable<ApplicationDetail>().Where(d => d.ApplicationId == id && (d.ApplyAmount - d.ProcessedAmount) != 0)
|
|
|
|
var details = await TenantDb.Queryable<ApplicationDetail>().Where(d => d.ApplicationId == id && (d.ApplyAmount - d.ProcessedAmount) != 0)
|
|
|
|
.LeftJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
|
|
|
|
.InnerJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
|
|
|
|
.Select((d, f) => new PaymentApplicationDetailDto
|
|
|
|
.Select((d, f) => new PaymentApplicationDetailDto
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = d.Id,
|
|
|
|
Id = d.Id,
|
|
|
|