using BWP.B3Frameworks.Utils;
|
|
using BWP.B3Sale.BO;
|
|
using Forks.EnterpriseServices.BusinessInterfaces;
|
|
using Forks.EnterpriseServices.DomainObjects2;
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery;
|
|
using Forks.EnterpriseServices.SqlDoms;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using TSingSoft.WebPluginFramework;
|
|
using TSingSoft.WebPluginFramework.BIPlugins.BLEvents;
|
|
using BWP.B3Sale.Utils;
|
|
using Forks.Utils;
|
|
using BWP.B3Frameworks.BO.MoneyTemplate;
|
|
|
|
namespace BWP.B3_YunKen.BLActions
|
|
{
|
|
public class OrderFreightData : IBLMethodAction
|
|
{
|
|
public string Description
|
|
{
|
|
get { return "若{计价方式}为计重,则运费金额=【销售订单】明细中{报价数量}合计*{运费单价};若{计价方式}为包车,则运费单价=【销售订单】的{运费金额}/【销售订单】明细中{报价数量}合计"; }
|
|
}
|
|
|
|
public void Execute(IDmoContext context, object dmo, object parameter)
|
|
{
|
|
var bill = dmo as Order;
|
|
if (bill == null)
|
|
return;
|
|
if (bill.FreightPayment == 运费支付方式.计重) {
|
|
bill.FreightPrice = (Money<金额>?)((bill.AllUnitNum/1000) * (bill.FreightUnitPrice??0).Value);
|
|
} else if (bill.FreightPayment == 运费支付方式.包车) {
|
|
if (bill.AllUnitNum == 0 || bill.AllUnitNum == null)
|
|
bill.FreightUnitPrice = null;
|
|
else
|
|
bill.FreightUnitPrice = bill.FreightPrice / (bill.AllUnitNum.Value.Value/1000);
|
|
}
|
|
}
|
|
|
|
public IList<string> Features
|
|
{
|
|
get { return new List<string>(); }
|
|
}
|
|
|
|
public string Name
|
|
{
|
|
get { return "B3_YunKen.根据计价方式算运费相关"; }
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|