1
This commit is contained in:
parent
62490f5fcf
commit
a7305ee24c
@ -337,6 +337,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\FUpdateAmount.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\HeXiaoJiLu.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\HeXiaoJiLuSave.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\UpdateAmount.cs" />
|
||||
<Compile Include="QPHY_AutoWrire\Bill.cs" />
|
||||
<Compile Include="QPHY_AutoWrire\Bill2.cs" />
|
||||
|
||||
65
Pilot_KD_Parino/QPHY_AutoWrireRecord/HeXiaoJiLuSave.cs
Normal file
65
Pilot_KD_Parino/QPHY_AutoWrireRecord/HeXiaoJiLuSave.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.App.Core;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Log;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.Util;
|
||||
using Pilot_KD_Parino.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilot_KD_Parino.QPHY_AutoWrireRecord
|
||||
{
|
||||
[Description("核销记录单保存前校验插件"), HotUpdate]
|
||||
public class HeXiaoJiLuSave : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void BeforeDoSaveExecute(BeforeDoSaveExecuteEventArgs e)
|
||||
{
|
||||
base.BeforeDoSaveExecute(e);
|
||||
var dd = e.DataEntities[0];
|
||||
var sssd = JsonHelper.ToJson(dd);
|
||||
Logger.Error("核销记录单", sssd, new Exception());
|
||||
var list1 = dd["FEntity"] as DynamicObjectCollection;
|
||||
var list2 = dd["FEntity2"] as DynamicObjectCollection;
|
||||
var amount1 = list1.Sum(t => decimal.Parse(t["FALLAMOUNT22"]?.ToString()));
|
||||
var amount2 = list2.Sum(t => decimal.Parse(t["FALLAMOUNT33"]?.ToString()));
|
||||
//throw new KDBusinessException("", $@"销售单明细本次核销合计金额{amount1},收款单明细本次核销合计金额{amount2},{amount1}不等于{amount2},不允许保存");
|
||||
if (amount1 != amount2)
|
||||
{
|
||||
throw new KDBusinessException("", $@"销售单明细本次核销合计金额{amount1.ToString("F2")},收款单明细本次核销合计金额{amount2.ToString("F2")},{amount1.ToString("F2")}不等于{amount2.ToString("F2")},不允许保存");
|
||||
}
|
||||
//// 保存前,提前填充主键数据
|
||||
//var seqReader = new SequenceReader(this.Context);
|
||||
//seqReader.AutoSetPrimaryKey(e.DataEntities, e.DataEntities[0].DynamicObjectType);
|
||||
//// 保存前,提前生成单据编号
|
||||
//var billNoFiled = this.BusinessInfo.GetBillNoField();
|
||||
//if (billNoFiled == null)
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
//var options = new Dictionary<string, object>();
|
||||
//options["CodeTime"] = 1;
|
||||
//options["UpdateMaxNum"] = 1;
|
||||
//var service = new BusinessDataService();
|
||||
//var billNos = service.GetBillNo(this.Context, this.BusinessInfo, e.DataEntities, options);
|
||||
//if (billNos != null && billNos.Count == e.DataEntities.Length)
|
||||
//{
|
||||
// for (var i = 0; i < e.DataEntities.Length; i++)
|
||||
// {
|
||||
// if (!string.IsNullOrEmpty(billNos[i].BillNo))
|
||||
// {
|
||||
// var prefix = (billNos[i].BillNo.StartsWith("XXX-") ? "" : "XXX-");
|
||||
// e.DataEntities[i][billNoFiled.PropertyName] = prefix + billNos[i].BillNo;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user