You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

42 lines
1.2 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BWP.B3ButcherManage.BL;
using BWP.B3ButcherManage.BO;
using BWP.B3ButcherManage.NamedValueTemplate;
using BWP.B3Frameworks;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.Utils;
using TSingSoft.WebPluginFramework;
namespace BWP.B3QingDaoWanFu.TypeIOCs
{
[TypeIOC(typeof(StatPayBL), typeof(StatPayBL.BaseBLIOCs.AfterSave))]
public class StatPayAfterSaveBLTypeIoc : StatPayBL.BaseBLIOCs.AfterSave
{
public void Invoke(IDmoContext context, StatPay dmo)
{
//自定义单价
if (dmo.UpdateActualPrice)
{
return;
}
if (dmo.PurchaseType == .)
{
dmo.ActualMoney = (dmo.ShackMoney.EToDecimal() ?? 0) + (dmo.JingJianFee.EToDecimal() ?? 0) - (dmo.DiscontMoney.EToDecimal() ?? 0);
Money<decimal>? 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);
}
}
}
}