aa
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args.WizardForm;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.Util;
|
||||
using Kingdee.K3.FIN.AP.Business.PlugIn;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Log;
|
||||
|
||||
namespace CYG.AutoWriteOffWizardEditPlugInEx
|
||||
{
|
||||
[HotUpdate, Description("转销处理EX")]
|
||||
public class AutoWriteOffWizardEditEx : AutoWriteOffWizardEdit
|
||||
{
|
||||
public override void WizardStepChanging(WizardStepChangingEventArgs e)
|
||||
{
|
||||
base.WizardStepChanging(e);
|
||||
if (e.OldWizardStep.Key.Equals("FWizard1") && e.NewWizardStep.Key.Equals("FWizard2") && !e.Cancel)
|
||||
{
|
||||
try
|
||||
{
|
||||
//获取进行转销的单据
|
||||
var dieObjs = this.DebitDate;
|
||||
foreach (var debitObj in dieObjs.Values)
|
||||
{
|
||||
var billId = debitObj.BillId;
|
||||
|
||||
var cSqlL = $@"/*dialect*/
|
||||
SELECT t1e.FSRCBILLID,t3.FBILLNO
|
||||
FROM T_AR_RECMACTHLOG t1
|
||||
INNER JOIN T_AR_RECMACTHLOGENTRY t1e on t1.FID = t1e.FID
|
||||
INNER JOIN T_AR_RECMACTHLOGENTRY t2e on t2e.FID = t1e.FID
|
||||
INNER JOIN T_AR_RECEIVABLE t3 on t3.FID = t1e.FSRCBILLID
|
||||
WHERE 1 = 1
|
||||
AND t2e.FSRCBILLID = {billId}
|
||||
AND t2e.FSOURCEFROMID = 'AR_receivable'
|
||||
AND t1e.FISADIBILL = 1
|
||||
AND t1.FMATCHFIELDNAME = 'FMatchAmount'
|
||||
";
|
||||
//判断是否转销成功
|
||||
var cResObjs = DBServiceHelper.ExecuteDynamicObject(this.Context, cSqlL);
|
||||
|
||||
if (cResObjs != null && cResObjs.Count == 2)
|
||||
{
|
||||
var sqlL = $@"/*dialect*/ EXEC PROC_UPDATE_AR_WRITEOFFMATCH {billId} ";
|
||||
DBServiceHelper.Execute(this.Context, sqlL);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error("应收转销后更新对应数据", ex.Message, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user