From fb9bd92c61ef82561ab126f909941984f1f399df Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 06 十一月 2024 12:11:42 +0800
Subject: [PATCH] 1

---
 DAL/车间管理/ClsSc_ProcExchWorkBackBill.cs |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcExchWorkBackBill.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcExchWorkBackBill.cs"
index 784aaf2..e3133ee 100644
--- "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcExchWorkBackBill.cs"
+++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcExchWorkBackBill.cs"
@@ -66,6 +66,7 @@
                 //========================================
                 ",HInnerBillNo='" + omodel.HInnerBillNo.ToString() +"'"+
                 ",HEmpID=" + omodel.HEmpID.ToString() +
+                ",HBillOperationType='" + omodel.HBillOperationType + "'" +
                 " where HInterID=" + lngBillKey.ToString());
                 //鍒犻櫎鍏宠仈
                 DeleteRelation(ref sReturn, lngBillKey);
@@ -75,13 +76,23 @@
                 omodel.HInterID = lngBillKey;
                 foreach (Model.ClsSc_ProcExchWorkBackBillSub oSub in DetailColl)
                 {
+                    if (oSub.HSourceInterID == 0)
+                    {
+                        oSub.HSourceInterID = omodel.HProcExchInterID;
+                    }
+
+                    if (oSub.HSourceEntryID == 0)
+                    {
+                        oSub.HSourceEntryID = omodel.HProcExchEntryID;
+                    }
+
                     oCn.RunProc("Insert into Sc_ProcExchWorkBackBillSub (HInterID, HEntryID, HCloseMan, HEntryCloseDate, HCloseType" +
                         ", HRemark, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType" +
                         ", HRelationQty, HRelationMoney, HBillNo_bak, HProcNo, HProcID" +
                         ", HWorkRemark, HCenterID, HDeptID, HSupID, HSupFlag" +
                         ", HQty, HICMOInterID, HICMOBillNo, HICMOEntryID)values(" +
                         $"{omodel.HInterID}, {oSub.HEntryID.ToString()}, '{oSub.HCloseMan.ToString()}', null, {(oSub.HCloseType == true ? 1 : 0)}" +
-                        $",'{oSub.HRemark.ToString()}', {omodel.HProcExchInterID.ToString()},{omodel.HProcExchEntryID.ToString()}, '{omodel.HProcExchBillNo.ToString()}', '3772'" +
+                        $",'{oSub.HRemark.ToString()}', {oSub.HSourceInterID},{oSub.HSourceEntryID}, '{omodel.HProcExchBillNo.ToString()}', '3772'" +
                         $",{oSub.HRelationQty.ToString()},{oSub.HRelationMoney.ToString()}, '{oSub.HBillNo_bak.ToString()}', '{oSub.HProcNo.ToString()}',{oSub.HProcID.ToString()}" +
                         $", '{oSub.HWorkRemark.ToString()}', {oSub.HCenterID.ToString()},{oSub.HDeptID.ToString()},{oSub.HSupID.ToString()},{(oSub.HSupFlag == true ? 1 : 0)}" +
                         $", {oSub.HQty.ToString()},{omodel.HICMOInterID},'{omodel.HICMOBillNo}',{omodel.HICMOEntryID}) ");
@@ -145,23 +156,33 @@
                     ", HICMOInterID, HICMOBillNo, HICMOEntryID, HProcExchInterID, HProcExchEntryID" +
                     ", HProcExchBillNo, HProcExchBegNO, HProcExchEndNO, HProcBegID, HProcEndID" +
                     ", HMaterID, HUnitID, HEmpID, HPlanQty, HQty" +
-                    ", HExplanation, HInnerBillNo, HWorkShopID, HOrderProcNo, HPRDORGID) values(" +
+                    ", HExplanation, HInnerBillNo, HWorkShopID, HOrderProcNo, HPRDORGID,HBillOperationType) values(" +
                     $"'{omodel.HBillType}','{omodel.HBillSubType}',{omodel.HInterID},'{omodel.HBillNo}','{omodel.HDate}',1" +
                     $",'{omodel.HMaker}','{omodel.HMakeDate}',{omodel.HYear},{omodel.HPeriod},'{omodel.HRemark}'" +
                     $",{omodel.HICMOInterID},'{omodel.HICMOBillNo}',{omodel.HICMOEntryID},{omodel.HProcExchInterID},{omodel.HProcExchEntryID}" +
                     $",'{omodel.HProcExchBillNo}',{omodel.HProcExchBegNO},{omodel.HProcExchEndNO},{omodel.HProcBegID},{omodel.HProcEndID}" +
                     $",{omodel.HMaterID},{omodel.HUnitID},{omodel.HEmpID},{omodel.HPlanQty},{omodel.HQty}" +
-                    $",'{omodel.HExplanation}','{omodel.HInnerBillNo}',{omodel.HWorkShopID},'{omodel.HOrderProcNo}',{omodel.HPRDORGID})");
+                    $",'{omodel.HExplanation}','{omodel.HInnerBillNo}',{omodel.HWorkShopID},'{omodel.HOrderProcNo}',{omodel.HPRDORGID},'{omodel.HBillOperationType}')");
                 //鎻掑叆瀛愯〃
                 foreach (Model.ClsSc_ProcExchWorkBackBillSub oSub in DetailColl)
                 {
+                    if (oSub.HSourceInterID == 0)
+                    {
+                        oSub.HSourceInterID = omodel.HProcExchInterID;
+                    }
+
+                    if (oSub.HSourceEntryID == 0)
+                    {
+                        oSub.HSourceEntryID = omodel.HProcExchEntryID;
+                    }
+
                     oCn.RunProc("Insert into Sc_ProcExchWorkBackBillSub (HInterID, HEntryID, HCloseMan, HEntryCloseDate, HCloseType" +
                         ", HRemark, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType" +
                         ", HRelationQty, HRelationMoney, HBillNo_bak, HProcNo, HProcID" +
                         ", HWorkRemark, HCenterID, HDeptID, HSupID, HSupFlag" +
                         ", HQty, HICMOInterID, HICMOBillNo, HICMOEntryID)values(" +
                         $"{omodel.HInterID}, {oSub.HEntryID.ToString()}, '{oSub.HCloseMan.ToString()}', null, {(oSub.HCloseType== true ? 1:0)}" +
-                        $",'{oSub.HRemark.ToString()}', {omodel.HProcExchInterID.ToString()},{omodel.HProcExchEntryID.ToString()}, '{omodel.HProcExchBillNo.ToString()}', '3772'" +
+                        $",'{oSub.HRemark.ToString()}', {oSub.HSourceInterID},{oSub.HSourceEntryID}, '{omodel.HProcExchBillNo.ToString()}', '3772'" +
                         $",{oSub.HRelationQty.ToString()},{oSub.HRelationMoney.ToString()}, '{oSub.HBillNo_bak.ToString()}', '{oSub.HProcNo.ToString()}',{oSub.HProcID.ToString()}" +
                         $", '{oSub.HWorkRemark.ToString()}', {oSub.HCenterID.ToString()},{oSub.HDeptID.ToString()},{oSub.HSupID.ToString()},{(oSub.HSupFlag== true?1:0)}" +
                         $", {oSub.HQty.ToString()},{omodel.HICMOInterID},'{omodel.HICMOBillNo}',{omodel.HICMOEntryID}) ");

--
Gitblit v1.9.1