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); + } + } } }