B3代宰模块
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.
 

47 lines
1.3 KiB

using BWP.B3Frameworks.BL;
using BWP.B3SubstituteKill.BO;
using BWP.B3SubstituteKill.Rpcs;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3SubstituteKill.BL
{
[BusinessInterface(typeof(StatPayBL))]
[LogicName("代宰结算")]
public interface IStatPayBL : IDepartmentWorkFlowBillBL<StatPay>
{ }
public class StatPayBL : DepartmentWorkFlowBillBL<StatPay>, IStatPayBL
{
protected override void beforeSave(StatPay dmo)
{
if (dmo.SourceBillID == null || dmo.PriceBill_ID == null)
{
dmo.PriceBill_ID = null;
if (dmo.Date.HasValue && dmo.Supplier_ID.HasValue)
dmo.PriceBill_ID = SupplierRpc.GetPriceBillID(dmo.Supplier_ID.Value, dmo.Date.Value);
}
foreach (var d in dmo.CostDetails)
d.Money = d.Price * d.Number;
foreach (var d in dmo.CallbackPayDetails)
d.Money = d.Price * d.Number;
dmo.ReceiveMoney = dmo.CostDetails.CostMoney - dmo.CallbackPayDetails.CallbackPayMoney;
base.beforeSave(dmo);
}
protected override List<string> MinDmoProperties
{
get
{
var b = base.MinDmoProperties;
b.Add("SourceBillID");
b.Add("SourceBillType");
return b;
}
}
}
}