diff --git a/Gatedge.K3.Pilot.PlugIn/.vs/Gatedge.K3.Pilot.PlugIn.csproj.dtbcache.json b/Gatedge.K3.Pilot.PlugIn/.vs/Gatedge.K3.Pilot.PlugIn.csproj.dtbcache.json
index bda20d2..88a1310 100644
--- a/Gatedge.K3.Pilot.PlugIn/.vs/Gatedge.K3.Pilot.PlugIn.csproj.dtbcache.json
+++ b/Gatedge.K3.Pilot.PlugIn/.vs/Gatedge.K3.Pilot.PlugIn.csproj.dtbcache.json
@@ -1 +1 @@
-{"RootPath":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\5.珠海派诺科技股份有限公司\\0.软件工程\\Pilot_KD_Parino_yuyubo\\Gatedge.K3.Pilot.PlugIn","ProjectFileName":"Gatedge.K3.Pilot.PlugIn.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"BOSPlugIn\\BD_CustPrice\\Bill.cs"},{"SourceFile":"BOSPlugIn\\BD_CustPrice\\ServicePlugIn\\Save.cs"},{"SourceFile":"BOSPlugIn\\BD_CustPrice\\ServicePlugIn\\SaveValidator.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Services\\DBService\\BaseDAL.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.App.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.App.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.Contracts.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.DataEntity.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.ServiceHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.VerificationHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.Web.HTML.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.Web.HTML.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.BOS.WebApi.FormService.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.K3.BD.Contracts.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.K3.BD.NewCode.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.K3.BD.ServiceHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\2.珠海英搏尔电气股份有限公司\\0.软件工程\\Gatedge.Enpower.BOS\\Library\\Kingdee.K3.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"E:\\Work\\珠海格致软件有限公司\\0.开发任务\\5.珠海派诺科技股份有限公司\\0.软件工程\\Pilot_KD_Parino_yuyubo\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Gatedge.K3.Pilot.PlugIn.dll","OutputItemRelativePath":"Gatedge.K3.Pilot.PlugIn.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
\ No newline at end of file
+{"RootPath":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn","ProjectFileName":"Gatedge.K3.Pilot.PlugIn.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"BOSPlugIn\\BD_CustPrice\\Bill.cs"},{"SourceFile":"BOSPlugIn\\BD_CustPrice\\ServicePlugIn\\Save.cs"},{"SourceFile":"BOSPlugIn\\BD_CustPrice\\ServicePlugIn\\SaveValidator.cs"},{"SourceFile":"BOSPlugIn\\CUST_PAYMENT_PERIOD\\List.cs"},{"SourceFile":"BOSPlugIn\\Sal_Order\\Bill.cs"},{"SourceFile":"Models\\Validate\\PeriodValidity.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Services\\DBService\\BaseDAL.cs"},{"SourceFile":"Services\\DBService\\BDCustPriceDAL.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.App.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.App.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.Contracts.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.DataEntity.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.ServiceHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.VerificationHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.Web.HTML.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.Web.HTML.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.BOS.WebApi.FormService.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.K3.BD.Contracts.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.K3.BD.NewCode.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.K3.BD.ServiceHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Kingdee.K3.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\pairuodaima\\Gatedge.K3.Pilot.PlugIn\\bin\\Debug\\Gatedge.K3.Pilot.PlugIn.dll","OutputItemRelativePath":"Gatedge.K3.Pilot.PlugIn.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
\ No newline at end of file
diff --git a/Gatedge.K3.Pilot.PlugIn/BOSPlugIn/AR_SalesVATInvoice/ServicePlugIn/AfterSave.cs b/Gatedge.K3.Pilot.PlugIn/BOSPlugIn/AR_SalesVATInvoice/ServicePlugIn/AfterSave.cs
new file mode 100644
index 0000000..6c06e5b
--- /dev/null
+++ b/Gatedge.K3.Pilot.PlugIn/BOSPlugIn/AR_SalesVATInvoice/ServicePlugIn/AfterSave.cs
@@ -0,0 +1,96 @@
+using Kingdee.BOS;
+using Kingdee.BOS.Core.DynamicForm.PlugIn;
+using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
+using Kingdee.BOS.Orm.DataEntity;
+using Kingdee.BOS.ServiceHelper;
+using Kingdee.BOS.Util;
+using System;
+using System.ComponentModel;
+using System.Linq;
+
+namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.AR_SalesVATInvoice.ServicePlugIn
+{
+ [HotUpdate, Description("销售增值税专用发票_保存后事件")]
+ public class AfterSave : AbstractOperationServicePlugIn
+ {
+ public override void OnPreparePropertys(PreparePropertysEventArgs e)
+ {
+ base.OnPreparePropertys(e);
+ // 添加需要加载的字段
+ e.FieldKeys.Add("FDENTRYID");
+ e.FieldKeys.Add("FIDD");
+ e.FieldKeys.Add("FSEQQ");
+ e.FieldKeys.Add("FSRCBILLTYPEID");
+ e.FieldKeys.Add("FSRCBILLNO");
+ }
+
+ public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e)
+ {
+ base.AfterExecuteOperationTransaction(e);
+
+ foreach (var dataEntity in e.DataEntitys)
+ {
+ var billObj = dataEntity as DynamicObject;
+ if (billObj == null)
+ continue;
+
+ // 获取单据体
+ var entrys = billObj["SALESICENTRY"] as DynamicObjectCollection;
+ if (entrys == null || entrys.Count == 0)
+ continue;
+
+ foreach (var entry in entrys)
+ {
+ var entryId = Convert.ToInt64(entry["FDENTRYID"]);
+ var fidd = entry["FIDD"];
+ var fiddValue = fidd == null ? 0 : Convert.ToInt64(fidd);
+
+ if (fiddValue > 0)
+ {
+ // FIDD > 0 时,判断是否需要回写
+ var srcBillNo = entry["FSRCBILLNO"]?.ToString() ?? "";
+
+ // FIDD != 当前行FENTRYID 且 源单编号为空 时才回写
+ if (fiddValue != entryId && string.IsNullOrWhiteSpace(srcBillNo))
+ {
+ // 查询源单据体信息(主键=FIDD的明细行)
+ var sql = $@"/*dialect*/
+SELECT FSRCBILLTYPEID, FSRCBILLNO, FSEQ
+FROM T_IV_SALESICENTRY
+WHERE FDENTRYID = {fiddValue}";
+
+ var result = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
+ if (result == null || result.Count == 0)
+ continue;
+
+ var srcData = result[0];
+ var srcBillTypeId = srcData["FSRCBILLTYPEID"];
+ var srcBillNoValue = srcData["FSRCBILLNO"];
+
+ // 回写当前单据体:源单类型、源单编号
+ var updateSql = $@"/*dialect*/
+UPDATE T_IV_SALESICENTRY
+SET FSRCBILLTYPEID = '{srcBillTypeId}',
+ FSRCBILLNO = '{srcBillNoValue}'
+WHERE FDENTRYID = {entryId}";
+
+ DBServiceHelper.Execute(this.Context, updateSql);
+ }
+ }
+ else
+ {
+ // FIDD <= 0 时,把当前行FENTRYID赋值给FIDD,同时把FSEQ赋值给FSEQQ
+ var updateSql = $@"/*dialect*/
+UPDATE T_IV_SALESICENTRY
+SET FIDD = FDENTRYID,
+ FSEQQ = FSEQ
+WHERE FDENTRYID = {entryId}";
+
+ DBServiceHelper.Execute(this.Context, updateSql);
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/Gatedge.K3.Pilot.PlugIn/Gatedge.K3.Pilot.PlugIn.csproj b/Gatedge.K3.Pilot.PlugIn/Gatedge.K3.Pilot.PlugIn.csproj
index 04e95dd..8097635 100644
--- a/Gatedge.K3.Pilot.PlugIn/Gatedge.K3.Pilot.PlugIn.csproj
+++ b/Gatedge.K3.Pilot.PlugIn/Gatedge.K3.Pilot.PlugIn.csproj
@@ -102,6 +102,6 @@
- copy $(TargetPath) "E:\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin"
+ copy $(TargetPath) "D:\Program Files (x86)\Kingdee\K3Cloud\WebSite\Bin\$(TargetFileName)"
\ No newline at end of file
diff --git a/Gatedge.K3.Pilot.PlugIn/bin/Debug/Oracle.DataAccess.dll b/Gatedge.K3.Pilot.PlugIn/bin/Debug/Oracle.DataAccess.dll
new file mode 100644
index 0000000..910c9c5
Binary files /dev/null and b/Gatedge.K3.Pilot.PlugIn/bin/Debug/Oracle.DataAccess.dll differ
diff --git a/Gatedge.K3.Pilot.PlugIn/obj/Debug/Gatedge..4146081E.Up2Date b/Gatedge.K3.Pilot.PlugIn/obj/Debug/Gatedge..4146081E.Up2Date
new file mode 100644
index 0000000..e69de29
diff --git a/NoPackageMachine/.vs/NoPackageMachine.csproj.dtbcache.json b/NoPackageMachine/.vs/NoPackageMachine.csproj.dtbcache.json
new file mode 100644
index 0000000..36bbfcb
--- /dev/null
+++ b/NoPackageMachine/.vs/NoPackageMachine.csproj.dtbcache.json
@@ -0,0 +1 @@
+{"RootPath":"D:\\pairuodaima\\NoPackageMachine","ProjectFileName":"NoPackageMachine.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"GetSingleLuoJi.cs"},{"SourceFile":"GetSonMachines.cs"},{"SourceFile":"Model\\SalOrderEntryModel.cs"},{"SourceFile":"Model\\SalOrderModel.cs"},{"SourceFile":"NoPackageMaterialForm.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Model\\SonMachine.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\pairuodaima\\Component\\EZ.DB.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\K3Cloud.WebApi.Client.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.App.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.App.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.ApprovalFlow.PlugIns.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.BusinessEntity.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.Contracts.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.DataEntity.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.ServiceHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.VerificationHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.WebApi.Client.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.WebApi.FormService.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.BOS.WebApi.ServicesStub.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.FIN.App.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.FIN.CB.App.Report.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.FIN.HS.App.Report.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.MFG.App.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.MFG.PLN.App.MrpModel.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.App.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.App.Credit.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.App.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.App.Sal.ServicePlugIn.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.App.Stock.Report.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.Business.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.Common.BusinessEntity.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.Contracts.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.ServiceHelper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\Component\\Kingdee.K3.SCM.Stock.Business.PlugIn.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\pairuodaima\\packages\\Newtonsoft.Json.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\pairuodaima\\NoPackageMachine\\bin\\Debug\\NoPackageMachine.dll","OutputItemRelativePath":"NoPackageMachine.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
\ No newline at end of file
diff --git a/Pilot_KD_Parino.zip b/Pilot_KD_Parino.zip
new file mode 100644
index 0000000..0e58555
Binary files /dev/null and b/Pilot_KD_Parino.zip differ
diff --git a/Pilot_KD_Parino/AR_SalesVATInvoice/ServicePlugIn/AfterSave.cs b/Pilot_KD_Parino/AR_SalesVATInvoice/ServicePlugIn/AfterSave.cs
new file mode 100644
index 0000000..8f412d2
--- /dev/null
+++ b/Pilot_KD_Parino/AR_SalesVATInvoice/ServicePlugIn/AfterSave.cs
@@ -0,0 +1,102 @@
+using Kingdee.BOS;
+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.ServiceHelper;
+using Kingdee.BOS.Util;
+using Pilot_KD_Parino.Common;
+using System;
+using System.ComponentModel;
+using System.Linq;
+
+namespace Pilot_KD_Parino.AR_SalesVATInvoice.ServicePlugIn
+{
+ [HotUpdate, Description("销售增值税专用发票_保存后事件")]
+ public class AfterSave : AbstractOperationServicePlugIn
+ {
+ public override void OnPreparePropertys(PreparePropertysEventArgs e)
+ {
+ base.OnPreparePropertys(e);
+ // 添加需要加载的字段
+ e.FieldKeys.Add("FENTRYID");
+ e.FieldKeys.Add("FIDD");
+ e.FieldKeys.Add("FSEQQ");
+ e.FieldKeys.Add("FSRCBILLTYPEID");
+ e.FieldKeys.Add("FSRCBILLNO");
+ }
+
+ public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e)
+ {
+ base.AfterExecuteOperationTransaction(e);
+
+
+ foreach (var dataEntity in e.DataEntitys)
+ {
+ var billObj = dataEntity as DynamicObject;
+ if (billObj == null)
+ continue;
+ var sdsas = JsonHelper.ToJson(billObj);
+ Logger.Error("销售增值税专用发票", sdsas, new Exception());
+ // 获取单据体
+ var entrys = billObj["SALESICENTRY"] as DynamicObjectCollection;
+ if (entrys == null || entrys.Count == 0)
+ continue;
+
+ foreach (var entry in entrys)
+ {
+ var entryId = Convert.ToInt64(entry["FENTRYID"]);
+ var fidd = entry["FIDD"];
+ var fiddValue = fidd == null ? 0 : Convert.ToInt64(fidd);
+
+ if (fiddValue > 0)
+ {
+ // FIDD > 0 时,判断是否需要回写
+ var srcBillNo = entry["FSRCBILLNO"]?.ToString() ?? "";
+ Logger.Error("销售增值税专用发票", "56", new Exception());
+ // FIDD != 当前行FENTRYID 且 源单编号为空 时才回写
+ if (fiddValue != entryId && string.IsNullOrWhiteSpace(srcBillNo))
+ {
+ // 查询源单据体信息(主键=FIDD的明细行)
+ var sql = $@"/*dialect*/
+SELECT FSRCBILLTYPEID, FSRCBILLNO, FSEQ
+FROM T_IV_SALESICENTRY
+WHERE FENTRYID = {fiddValue}";
+ Logger.Error("销售增值税专用发票", sql, new Exception());
+ var result = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
+ if (result == null || result.Count == 0)
+ continue;
+ Logger.Error("销售增值税专用发票", "69", new Exception());
+ var srcData = result[0];
+ var srcBillTypeId = srcData["FSRCBILLTYPEID"];
+ var srcBillNoValue = srcData["FSRCBILLNO"];
+
+ // 回写当前单据体:源单类型、源单编号
+ var updateSql = $@"/*dialect*/
+UPDATE T_IV_SALESICENTRY
+SET FSRCBILLTYPEID = '{srcBillTypeId}',
+ FSRCBILLNO = '{srcBillNoValue}'
+WHERE FENTRYID = {entryId}";
+ Logger.Error("销售增值税专用发票", updateSql, new Exception());
+ Logger.Error("销售增值税专用发票", "80", new Exception());
+ DBServiceHelper.Execute(this.Context, updateSql);
+ }
+ }
+ else
+ {
+ Logger.Error("销售增值税专用发票", "", new Exception());
+ // FIDD <= 0 时,把当前行FENTRYID赋值给FIDD,同时把FSEQ赋值给FSEQQ
+ var updateSql = $@"/*dialect*/
+UPDATE T_IV_SALESICENTRY
+SET FIDD = FENTRYID,
+ FSEQQ = FSEQ
+WHERE FENTRYID = {entryId}";
+ Logger.Error("销售增值税专用发票", "93", new Exception());
+ DBServiceHelper.Execute(this.Context, updateSql);
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/Pilot_KD_Parino/Pilot_KD_Parino.csproj b/Pilot_KD_Parino/Pilot_KD_Parino.csproj
index 5e86c30..ce960a0 100644
--- a/Pilot_KD_Parino/Pilot_KD_Parino.csproj
+++ b/Pilot_KD_Parino/Pilot_KD_Parino.csproj
@@ -322,6 +322,7 @@
+