|
|
@ -13,7 +13,6 @@ using DS.WMS.Core.Settlement.Entity;
|
|
|
|
using DS.WMS.Core.Settlement.Interface;
|
|
|
|
using DS.WMS.Core.Settlement.Interface;
|
|
|
|
using DS.WMS.Core.Sys.Entity;
|
|
|
|
using DS.WMS.Core.Sys.Entity;
|
|
|
|
using SqlSugar;
|
|
|
|
using SqlSugar;
|
|
|
|
using static iText.StyledXmlParser.Jsoup.Select.Evaluator;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Settlement.Method
|
|
|
|
namespace DS.WMS.Core.Settlement.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -50,7 +49,7 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
CustomerBankName = x.CustomerBank.BankName,
|
|
|
|
CustomerBankName = x.CustomerBank.BankName,
|
|
|
|
//未开票
|
|
|
|
//未开票
|
|
|
|
UnInvoiceList = SqlFunc.Subqueryable<ApplicationDetail>().InnerJoin<FeeRecord>((d, f) => d.ApplicationId == x.Id && d.RecordId == f.Id)
|
|
|
|
UnInvoiceList = SqlFunc.Subqueryable<ApplicationDetail>().InnerJoin<FeeRecord>((d, f) => d.ApplicationId == x.Id && d.RecordId == f.Id)
|
|
|
|
.GroupBy((d, f) => f.Currency).ToList((d, f) => new CurrencyAmount { Currency = f.Currency, Amount = f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount }),
|
|
|
|
.GroupBy((d, f) => f.Currency).ToList((d, f) => new CurrencyAmount { Currency = f.Currency, Amount = SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount) }),
|
|
|
|
}, true);
|
|
|
|
}, true);
|
|
|
|
|
|
|
|
|
|
|
|
var whereList = request.GetConditionalModels(Db);
|
|
|
|
var whereList = request.GetConditionalModels(Db);
|
|
|
@ -167,7 +166,7 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<DataResult<List<PaymentApplicationDetailDto>>> GetSettlementDetailsAsync(long[] ids)
|
|
|
|
public async Task<DataResult<List<PaymentApplicationDetailDto>>> GetSettlementDetailsAsync(long[] ids)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var details = await TenantDb.Queryable<ApplicationDetail>().Where(d => ids.Contains(d.Id) && d.Category == DetailCategory.PaidApplicationSettlement)
|
|
|
|
var details = await TenantDb.Queryable<ApplicationDetail>().Where(d => ids.Contains(d.Id))
|
|
|
|
.LeftJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
|
|
|
|
.LeftJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
|
|
|
|
.LeftJoin<BusinessFeeStatus>((d, f, b) => f.BusinessId == b.BusinessId && f.BusinessType == b.BusinessType)
|
|
|
|
.LeftJoin<BusinessFeeStatus>((d, f, b) => f.BusinessId == b.BusinessId && f.BusinessType == b.BusinessType)
|
|
|
|
.LeftJoin<PaymentApplication>((d, f, b, p) => d.ApplicationId == p.Id)
|
|
|
|
.LeftJoin<PaymentApplication>((d, f, b, p) => d.ApplicationId == p.Id)
|
|
|
@ -268,7 +267,7 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
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.Category == DetailCategory.PaidApplication && (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)
|
|
|
|
.LeftJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
|
|
|
|
.Select((d, f) => new PaymentApplicationDetailDto
|
|
|
|
.Select((d, f) => new PaymentApplicationDetailDto
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -497,7 +496,6 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
return await base.PostSaveAsync(settlement);
|
|
|
|
return await base.PostSaveAsync(settlement);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override DataResult PreDelete(List<ApplicationSettlement> settlements)
|
|
|
|
protected override DataResult PreDelete(List<ApplicationSettlement> settlements)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (settlements.Any(x => x.IsLocked))
|
|
|
|
if (settlements.Any(x => x.IsLocked))
|
|
|
|