|
|
|
@ -131,7 +131,7 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
|
|
|
|
|
|
var list = await TenantDb.Queryable<FeeRecord>()
|
|
|
|
|
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId) &&
|
|
|
|
|
AllowedStatus.Contains(f.FeeStatus))
|
|
|
|
|
AllowedStatus.Contains(f.FeeStatus) && f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount != 0)
|
|
|
|
|
.Select(f => new FeeInvoiceDto
|
|
|
|
|
{
|
|
|
|
|
RecordId = f.Id,
|
|
|
|
@ -143,17 +143,17 @@ namespace DS.WMS.Core.Invoice.Method
|
|
|
|
|
FeeName = f.FeeName,
|
|
|
|
|
FeeType = f.FeeType,
|
|
|
|
|
Amount = f.Amount,
|
|
|
|
|
TaxRate = f.TaxRate,
|
|
|
|
|
Currency = f.Currency,
|
|
|
|
|
OriginalCurrency = f.Currency,
|
|
|
|
|
OriginalRate = f.ExchangeRate,
|
|
|
|
|
RestAmount = f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount,
|
|
|
|
|
ExchangeRate = f.ExchangeRate,
|
|
|
|
|
Remark = f.Remark,
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
//移除开票剩余金额为0的项
|
|
|
|
|
list.RemoveAll(f => f.RestAmount == 0);
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
item.ApplyAmount = item.RestAmount;
|
|
|
|
|
item.ApplyAmount = item.OriginalAmount = item.RestAmount;
|
|
|
|
|
|
|
|
|
|
return DataResult<InvoiceApplicaitonBiz>.Success(new InvoiceApplicaitonBiz(list));
|
|
|
|
|
}
|
|
|
|
|