From 2609bffee3a8de0d1e08b1b2c3fa3cfe13064f4e Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 24 三月 2025 11:40:14 +0800
Subject: [PATCH] 1
---
DAL/销售管理/ClsXs_ReceivableBill.cs | 273 +++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 218 insertions(+), 55 deletions(-)
diff --git "a/DAL/\351\224\200\345\224\256\347\256\241\347\220\206/ClsXs_ReceivableBill.cs" "b/DAL/\351\224\200\345\224\256\347\256\241\347\220\206/ClsXs_ReceivableBill.cs"
index 3691193..b509474 100644
--- "a/DAL/\351\224\200\345\224\256\347\256\241\347\220\206/ClsXs_ReceivableBill.cs"
+++ "b/DAL/\351\224\200\345\224\256\347\256\241\347\220\206/ClsXs_ReceivableBill.cs"
@@ -9,11 +9,11 @@
{
public Model.ClsXs_ReceivableBillMain omodel = new Model.ClsXs_ReceivableBillMain();
public List<Model.ClsXs_ReceivableBillSub> DetailColl = new List<Model.ClsXs_ReceivableBillSub>();
-
+ public List<Model.ClsXs_ReceivableBillSub> DetailCol2 = new List<Model.ClsXs_ReceivableBillSub>();//瀛愯〃浜�
public ClsXs_ReceivableBill()
{
base.MvarItemKeySub = "Xs_ReceivableBillSub";
- base.MvarItemKeySub2 = "";
+ base.MvarItemKeySub2 = "Xs_ReceivableBillSub_Entry";
base.MvarItemKeySub3 = "";
base.MvarItemKeySub4 = "";
base.MvarItemKey= "Xs_ReceivableBillMain";
@@ -36,52 +36,52 @@
#region 鍏宠仈鏁伴噺
//鍒犻櫎鍏宠仈
- //public override void DeleteRelation(ref string sReturn, Int64 lngBillKey)
- //{
- // //閿�鍞鍗� 閿�鍞嚭搴撳崟 鍏宠仈鏁伴噺
- // try
- // {
- // if (DetailColl[0].HSourceBillType == "1401") //閿�鍞鍗�
- // {
- // oCn.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToPOStockIn_Del " + lngBillKey.ToString());
- // }
- // else if (DetailColl[0].HSourceBillType == "1205") //閿�鍞嚭搴撳崟
- // {
- // oCn.RunProc("exec h_p_Xs_UpDateRelation_ICStockoPOStockIn_Del " + lngBillKey.ToString());
- // }
- // else
- // {
- // }
- // }
- // catch (Exception e)
- // {
- // throw (e);
- // }
- //}
- ////鏂板鍏宠仈
- //public override void AddNewRelation(ref string sReturn, Int64 lngBillKey)
- //{
- // //閿�鍞鍗� 閿�鍞嚭搴撳崟 鍏宠仈鏁伴噺
- // try
- // {
- // if (DetailColl[0].HSourceBillType == "1401") //閿�鍞鍗�
- // {
- // oCn.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToPOStockIn_Add " + lngBillKey.ToString());
- // }
- // else if (DetailColl[0].HSourceBillType == "1205") //閿�鍞嚭搴撳崟
- // {
- // oCn.RunProc("exec h_p_Xs_UpDateRelation_ICStockToPOStockIn_Add " + lngBillKey.ToString());
- // }
- // else
- // {
+ public override void DeleteRelation(ref string sReturn, Int64 lngBillKey)
+ {
+ //閿�鍞鍗� 閿�鍞嚭搴撳崟 鍏宠仈鏁伴噺
+ try
+ {
+ if (DetailColl[0].HSourceBillType == "1401") //閿�鍞鍗�
+ {
+ oCn.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToPOStockIn_Del " + lngBillKey.ToString());
+ }
+ else if (DetailColl[0].HSourceBillType == "1205") //閿�鍞嚭搴撳崟
+ {
+ oCn.RunProc("exec h_p_Xs_UpDateRelation_ICStockoPOStockIn_Del " + lngBillKey.ToString());
+ }
+ else
+ {
+ }
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
+ //鏂板鍏宠仈
+ public override void AddNewRelation(ref string sReturn, Int64 lngBillKey)
+ {
+ //閿�鍞鍗� 閿�鍞嚭搴撳崟 鍏宠仈鏁伴噺
+ try
+ {
+ if (DetailColl[0].HSourceBillType == "1401") //閿�鍞鍗�
+ {
+ oCn.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToPOStockIn_Add " + lngBillKey.ToString());
+ }
+ else if (DetailColl[0].HSourceBillType == "1205") //閿�鍞嚭搴撳崟
+ {
+ oCn.RunProc("exec h_p_Xs_UpDateRelation_ICStockToPOStockIn_Add " + lngBillKey.ToString());
+ }
+ else
+ {
- // }
- // }
- // catch (Exception e)
- // {
- // throw (e);
- // }
- //}
+ }
+ }
+ catch (Exception e)
+ {
+ throw (e);
+ }
+ }
#endregion
@@ -115,6 +115,8 @@
",HExplanation = '" + omodel.HExplanation + "'" +
",HInnerBillNo = '" + omodel.HInnerBillNo + "'" +
",HRemark = '" + omodel.HRemark + "'" +
+ ",HPriceType = '" + omodel.HPriceType + "'" +
+ ",HProjectID = '" + omodel.HProjectID + "'" +
" where HInterID = " + omodel.HInterID;
oCn.RunProc(mainSql);
@@ -122,7 +124,8 @@
DeleteRelation(ref sReturn, lngBillKey);
//鍒犻櫎瀛愯〃
DeleteBillSub(lngBillKey);
-
+ //鍒犻櫎瀛愯〃2
+ DeleteBillSub2(lngBillKey);
//鎻掑叆瀛愯〃
omodel.HInterID = lngBillKey;
//鎻掑叆瀛愯〃
@@ -169,8 +172,53 @@
oCn.RunProc(subSql);
}
- ////鏇存柊璁㈠崟鍏宠仈鏁伴噺
- //AddNewRelation(ref sReturn, omodel.HInterID);
+ //鏇存柊璁㈠崟鍏宠仈鏁伴噺
+ AddNewRelation(ref sReturn, omodel.HInterID);
+
+ //鎻掑叆瀛愯〃Entry
+ foreach (Model.ClsXs_ReceivableBillSub oSub in DetailCol2)
+ {
+ string subSql = "insert into Xs_ReceivableBillSub_Entry" +
+ "(HInterID,HEntryID,HBillNo_bak,HMaterID,HUnitID,HQty,HPrice,HTaxPrice,HDiscountRate,HRelTaxPrice,HTaxRate,HTaxMoney" +
+ ",HlineTotal,HlineTotalBB,HMoney,HMoneyBB,HRemark" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+ ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" +
+ ",HSeOrderTaxPrice,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo) " +
+ " values(" +
+ "" + omodel.HInterID + "" +
+ "," + oSub.HEntryID + "" +
+ ",'" + omodel.HBillNo + "'" +
+ "," + oSub.HMaterID + "" +
+ "," + oSub.HUnitID + "" +
+ "," + oSub.HQty + "" +
+ "," + oSub.HPrice + "" +
+ "," + oSub.HTaxPrice + "" +
+ "," + oSub.HDiscountRate + "" +
+ "," + oSub.HRelTaxPrice + "" +
+ "," + oSub.HTaxRate + "" +
+ "," + oSub.HTaxMoney + "" +
+ "," + oSub.HlineTotal + "" +
+ "," + oSub.HlineTotalBB + "" +
+ "," + oSub.HMoney + "" +
+ "," + oSub.HMoneyBB + "" +
+ ",'" + oSub.HRemark + "'" +
+ "," + oSub.HSourceInterID + "" +
+ "," + oSub.HSourceEntryID + "" +
+ ",'" + oSub.HSourceBillNo + "'" +
+ ",'" + oSub.HSourceBillType + "'" +
+ "," + oSub.HRelationQty + "" +
+ "," + oSub.HRelationMoney + "" +
+ "," + oSub.HPOOrderInterID + "" +
+ "," + oSub.HPOOrderEntryID + "" +
+ ",'" + oSub.HPOOrderBillNo + "'" +
+ "," + oSub.HSeOrderTaxPrice + "" +
+ "," + oSub.HSeOrderInterID + "" +
+ "," + oSub.HSeOrderEntryID + "" +
+ ",'" + oSub.HSeOrderBillNo + "'" +
+ ")";
+ oCn.RunProc(subSql);
+ }
+
sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
oCn.Commit();
@@ -213,7 +261,7 @@
string mainSql = "insert into Xs_ReceivableBillMain" +
"(HInterID,HBillNo,HDate,HYear,HPeriod,HBillType,HBillSubType" +
",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
- ",HMaker,HMakeDate,HSSID,HSellSID,HReceiveDate,HCusID,HCurID,HExRate,HEmpID,HMangerID,HDeptID,HExplanation,HInnerBillNo,HRemark) " +
+ ",HMaker,HMakeDate,HSSID,HSellSID,HReceiveDate,HCusID,HCurID,HExRate,HEmpID,HMangerID,HDeptID,HExplanation,HInnerBillNo,HRemark,HPriceType,HProjectID) " +
"values(" +
"" + omodel.HInterID + "" +
",'" + omodel.HBillNo + "'" +
@@ -240,6 +288,8 @@
",'" + omodel.HExplanation + "'" +
",'" + omodel.HInnerBillNo + "'" +
",'" + omodel.HRemark + "'" +
+ ",'" + omodel.HPriceType + "'" +
+ ",'" + omodel.HProjectID + "'" +
")";
oCn.RunProc(mainSql);
@@ -288,10 +338,72 @@
oCn.RunProc(subSql);
}
- ////鏇存柊璁㈠崟鍏宠仈鏁伴噺
- //AddNewRelation(ref sReturn, omodel.HInterID);
+ //鏇存柊璁㈠崟鍏宠仈鏁伴噺
+ AddNewRelation(ref sReturn, omodel.HInterID);
+
+ //鎻掑叆瀛愯〃Entry
+ foreach (Model.ClsXs_ReceivableBillSub oSub in DetailCol2)
+ {
+ string subSql = "insert into Xs_ReceivableBillSub_Entry" +
+ "(HInterID,HEntryID,HBillNo_bak,HMaterID,HUnitID,HQty,HPrice,HTaxPrice,HDiscountRate,HRelTaxPrice,HTaxRate,HTaxMoney" +
+ ",HlineTotal,HlineTotalBB,HMoney,HMoneyBB,HRemark" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+ ",HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo" +
+ ",HSeOrderTaxPrice,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo) " +
+ " values(" +
+ "" + omodel.HInterID + "" +
+ "," + oSub.HEntryID + "" +
+ ",'" + omodel.HBillNo + "'" +
+ "," + oSub.HMaterID + "" +
+ "," + oSub.HUnitID + "" +
+ "," + oSub.HQty + "" +
+ "," + oSub.HPrice + "" +
+ "," + oSub.HTaxPrice + "" +
+ "," + oSub.HDiscountRate + "" +
+ "," + oSub.HRelTaxPrice + "" +
+ "," + oSub.HTaxRate + "" +
+ "," + oSub.HTaxMoney + "" +
+ "," + oSub.HlineTotal + "" +
+ "," + oSub.HlineTotalBB + "" +
+ "," + oSub.HMoney + "" +
+ "," + oSub.HMoneyBB + "" +
+ ",'" + oSub.HRemark + "'" +
+ "," + oSub.HSourceInterID + "" +
+ "," + oSub.HSourceEntryID + "" +
+ ",'" + oSub.HSourceBillNo + "'" +
+ ",'" + oSub.HSourceBillType + "'" +
+ "," + oSub.HRelationQty + "" +
+ "," + oSub.HRelationMoney + "" +
+ "," + oSub.HPOOrderInterID + "" +
+ "," + oSub.HPOOrderEntryID + "" +
+ ",'" + oSub.HPOOrderBillNo + "'" +
+ "," + oSub.HSeOrderTaxPrice + "" +
+ "," + oSub.HSeOrderInterID + "" +
+ "," + oSub.HSeOrderEntryID + "" +
+ ",'" + oSub.HSeOrderBillNo + "'" +
+ ")";
+ oCn.RunProc(subSql);
+ }
sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
+
+ //淇濆瓨鍚庢帶鍒�=========================================
+ ds = oCn.RunProcReturn("exec h_p_Xs_ReceivableBill_AfterSaveCtrl " + omodel.HInterID, "h_p_Xs_ReceivableBill_AfterSaveCtrl");
+
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+ oCn.RollBack();
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ oCn.RollBack();
+ return false;
+ }
+ //=========================================================
+
oCn.Commit();
return true;
}
@@ -359,8 +471,8 @@
omodel.HExRate = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HExRate"]);
omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]);
- omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
-
+ omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
+ omodel.HProjectID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProjectID"]);
omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
omodel.HHookMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HHookMan"]);
@@ -423,6 +535,57 @@
DetailColl.Add(oSub);
}
+
+ //寰幆
+ DataSet DsSub2;
+ DsSub2 = oCn.RunProcReturn("select * from Xs_ReceivableBillSub_Entry where HInterID = " + lngBillKey.ToString() + "order by HEntryID", "Xs_ReceivableBillSub_Entry");
+ DetailCol2.Clear();//娓呯┖
+ for (int i = 0; i < DsSub2.Tables[0].Rows.Count; i++)
+ {
+ Model.ClsXs_ReceivableBillSub oSub = new Model.ClsXs_ReceivableBillSub();
+ // 鍥哄畾璧嬪��===============================================
+ oSub.HInterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HInterID"]);
+ oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HEntryID"]);
+ oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HBillNo_bak"]);
+ oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HCloseMan"]);
+ oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub2.Tables[0].Rows[i]["HCloseType"]);
+ oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub2.Tables[0].Rows[i]["HEntryCloseDate"]);
+
+ oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HSourceInterID"]);
+ oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HSourceEntryID"]);
+ oSub.HSourceBillType = DsSub2.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
+ oSub.HSourceBillNo = DsSub2.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
+ oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[i]["HRelationQty"]);
+ oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[i]["HRelationMoney"]);
+
+ oSub.HRemark = DsSub2.Tables[0].Rows[i]["HRemark"].ToString().Trim();
+ //===================================================
+ oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HMaterID"]);
+ oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HUnitID"]);
+ oSub.HQty = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HQty"]);
+ oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HPrice"]);
+ oSub.HTaxPrice = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HTaxPrice"]);
+ oSub.HDiscountRate = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HDiscountRate"]);
+ oSub.HRelTaxPrice = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HRelTaxPrice"]);
+ oSub.HTaxRate = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HTaxRate"]);
+ oSub.HTaxMoney = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HTaxMoney"]);
+ oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HMoney"]);
+ oSub.HMoneyBB = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HMoneyBB"]);
+ oSub.HlineTotal = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HlineTotal"]);
+ oSub.HlineTotalBB = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HlineTotalBB"]);
+
+ oSub.HPOOrderInterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[0]["HPOOrderInterID"]);
+ oSub.HPOOrderEntryID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[0]["HPOOrderEntryID"]);
+ oSub.HPOOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[0]["HPOOrderBillNo"]);
+
+ oSub.HSeOrderTaxPrice = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[0]["HSeOrderTaxPrice"]);
+ oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[0]["HSeOrderInterID"]);
+ oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[0]["HSeOrderEntryID"]);
+ oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[0]["HSeOrderBillNo"]);
+
+ DetailCol2.Add(oSub);
+ }
+
sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
return true;
}
--
Gitblit v1.9.1