发票结算的币别处理

dev
嵇文龙 2 months ago
parent 2a2f64b2e1
commit 634b88896d

@ -172,7 +172,7 @@ namespace DS.WMS.Core.Settlement.Method
ExchangeRate = x.ExchangeRate
}).ToListAsync();
if (settlement.Currency == FeeCurrency.RMB_CODE) //指定结算币别
if (settlement.Currency != FeeCurrency.RMB_CODE) //发票结算非人民币需做转换
{
var details2 = details1.FindAll(x => x.OriginalCurrency != settlement.Currency);
foreach (var detail in details2)
@ -185,7 +185,7 @@ namespace DS.WMS.Core.Settlement.Method
var exchange = doc.ExchangeRates?.Find(x => x.Currency == settlement.Currency);
if (exchange == null)
return DataResult<TEntity>.Failed($"未传入结算币别 {settlement.Currency} 与费用原币别 {detail.OriginalCurrency} 之间的汇率信息");
return DataResult<TEntity>.Failed($"使用发票做结算时,非 {FeeCurrency.RMB_CODE} 的费用必须指定汇率");
detail.ExchangeRate = exchange.ExchangeRate;
detail.ApplyAmount = Math.Round(exchange.ExchangeRate.GetValueOrDefault() * detail.OriginalAmount, 2, MidpointRounding.AwayFromZero);

Loading…
Cancel
Save