From 9f2713b968667720f9b5043795ae5f706beed2fa Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Mon, 20 Nov 2017 00:06:37 +0800 Subject: [PATCH] . --- B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs index 29d7b72..7809c09 100644 --- a/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/StatPayBLTypeIoc.cs @@ -17,19 +17,22 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs [TypeIOC(typeof(StatPayBL), typeof(StatPayBL.BaseBLIOCs.AfterSave))] - public class StatPayAfterSaveBLTypeIoc:StatPayBL.BaseBLIOCs.AfterSave + public class StatPayAfterSaveBLTypeIoc : StatPayBL.BaseBLIOCs.AfterSave { public void Invoke(IDmoContext context, StatPay dmo) { - if (dmo.PurchaseType == 收购类型.业务) - { - dmo.ActualMoney = (dmo.ShackMoney.EToDecimal() ?? 0) + (dmo.JingJianFee.EToDecimal() ?? 0) - (dmo.DiscontMoney.EToDecimal() ?? 0); - Money? we = null; - if (dmo.ShackWeight != 0) - we = dmo.ShackWeight; - dmo.ActualPrice = decimal.Round(dmo.ActualMoney.EToDecimal() ?? 0, 2) / we; - if (dmo.ActualPrice.HasValue) - dmo.ActualPrice = decimal.Round(dmo.ActualPrice.Value.Value, 2); - }} + if (dmo.ActualPrice.HasValue && dmo.ActualPrice != 0) + return; + if (dmo.PurchaseType == 收购类型.业务) + { + dmo.ActualMoney = (dmo.ShackMoney.EToDecimal() ?? 0) + (dmo.JingJianFee.EToDecimal() ?? 0) - (dmo.DiscontMoney.EToDecimal() ?? 0); + Money? we = null; + if (dmo.ShackWeight != 0) + we = dmo.ShackWeight; + dmo.ActualPrice = decimal.Round(dmo.ActualMoney.EToDecimal() ?? 0, 2) / we; + if (dmo.ActualPrice.HasValue) + dmo.ActualPrice = decimal.Round(dmo.ActualPrice.Value.Value, 2); + } + } } }