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.
 

54 lines
1.8 KiB

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.根据计价方式算运费相关"; }
}
}
}