|
|
|
@ -323,7 +323,7 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
if (settlement.Details.Exists(x => x.OriginalCurrency.IsNullOrEmpty()))
|
|
|
|
|
return DataResult<TEntity>.FailedWithDesc(nameof(MultiLanguageConst.OriginalCurrencyCanNotNull));
|
|
|
|
|
|
|
|
|
|
settlement.Amount = settlement.Details.Sum(x => x.ApplyAmount);
|
|
|
|
|
//settlement.Amount = settlement.Details.Sum(x => x.ApplyAmount);
|
|
|
|
|
result = await PreSaveAsync(settlement);
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
return DataResult<TEntity>.Failed(result.Message, result.MultiCode);
|
|
|
|
@ -380,6 +380,11 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//重新计算结算总金额
|
|
|
|
|
settlement.Amount = await TenantDb.Queryable<ApplicationDetail>().Where(x => x.ApplicationId == settlement.Id)
|
|
|
|
|
.SumAsync(x => x.ApplyAmount);
|
|
|
|
|
await TenantDb.Updateable(settlement).UpdateColumns(x => x.Amount).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
await TenantDb.Ado.CommitTranAsync();
|
|
|
|
|
await PostSaveAsync(settlement);
|
|
|
|
|
return DataResult<TEntity>.Success(settlement);
|
|
|
|
|