采购流程的测试并完善功能; 采购订单-》收料通知单-》采购入库单-》应付单 (注意: 源单类型的下拉框 需要 根据数据库 表动态加载, 关联数量 要准确 , 审核 且 未关闭 未行关闭的行 才能下推 ,关联数量超额后,要 反写 关闭 源单 )
| | |
| | | #endregion |
| | | #endregion |
| | | |
| | | //å é¤å
³è |
| | | public override void DeleteRelation(ref string sReturn, Int64 lngBillKey) |
| | | { |
| | | //éè´å
¥åºå éè´è®¢å å
³èæ°é |
| | | try |
| | | { |
| | | if (DetailColl[0].HSourceBillType == "1201") //éè´å
¥åºå |
| | | { |
| | | oCn.RunProc("exec h_p_Cg_UpDateRelation_POStockInToPayable_Del " + lngBillKey.ToString()); |
| | | } |
| | | else if (DetailColl[0].HSourceBillType == "1102") //éè´è®¢å |
| | | { |
| | | oCn.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPayable_Del " + lngBillKey.ToString()); |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //æ°å¢å
³è |
| | | public override void AddNewRelation(ref string sReturn, Int64 lngBillKey) |
| | | { |
| | | //æ¶æéç¥å éæéç¥å å
³èæ°é |
| | | //éè´å
¥åºå éè´è®¢å å
³èæ°é |
| | | try |
| | | { |
| | | if (DetailColl[0].HSourceBillType == "1201") //éè´å
¥åºå |
| | |
| | | ",HCurID = " + omodel.HCurID + "" + |
| | | ",HExRate = " + omodel.HExRate + "" + |
| | | ",HEmpID = " + omodel.HEmpID + "" + |
| | | ",HManagerID = " + omodel.HManagerID + "" + |
| | | ",HMangerID = " + omodel.HMangerID + "" + |
| | | ",HDeptID = " + omodel.HDeptID + "" + |
| | | ",HExplanation = '" + omodel.HExplanation + "'" + |
| | | ",HInnerBillNo = '" + omodel.HInnerBillNo + "'" + |
| | |
| | | string mainSql = "insert into Cg_PayableBillMain" + |
| | | "(HInterID,HBillNo,HDate,HYear,HPeriod,HBillType,HBillSubType" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" + |
| | | ",HMaker,HMakeDate,HSSID,HPSStyleID,HReceiveDate,HSupID,HCurID,HExRate,HEmpID,HManagerID,HDeptID,HExplanation,HInnerBillNo,HRemark) " + |
| | | ",HMaker,HMakeDate,HSSID,HPSStyleID,HReceiveDate,HSupID,HCurID,HExRate,HEmpID,HMangerID,HDeptID,HExplanation,HInnerBillNo,HRemark) " + |
| | | "values(" + |
| | | "" + omodel.HInterID + "" + |
| | | ",'" + omodel.HBillNo + "'" + |
| | |
| | | "," + omodel.HCurID + "" + |
| | | "," + omodel.HExRate + "" + |
| | | "," + omodel.HEmpID + "" + |
| | | "," + omodel.HManagerID + "" + |
| | | "," + omodel.HMangerID + "" + |
| | | "," + omodel.HDeptID + "" + |
| | | ",'" + omodel.HExplanation + "'" + |
| | | ",'" + omodel.HInnerBillNo + "'" + |
| | |
| | | omodel.HCurID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCurID"]); |
| | | omodel.HExRate = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HExRate"]); |
| | | omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]); |
| | | omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]); |
| | | omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]); |
| | | omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); |
| | | |
| | | omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); |
| | |
| | | public Int64 HCurID; //int --å¸å« |
| | | public double HExRate; //money --æ±ç |
| | | public Int64 HDeptID; //int --é¨é¨ |
| | | public Int64 HManagerID; //int --主管 |
| | | public Int64 HMangerID; //int --主管 |
| | | public Int64 HEmpID; //int --ä¸å¡å |
| | | public string HReceiveDate; |
| | | public string HExplanation; |
| | |
| | | |
| | | oCN.BeginTran(); //å¼å§äºå¡ |
| | | //æ¥è¯¢æ°æ® |
| | | ds = oCN.RunProcReturn("select * from Cg_POInStockBillMain a inner join Cg_POInStockBillSub b on a.HInterID=b.HInterID where a.HInterID= '" + HInterID + "'", "Kf_ICStockBillMain"); |
| | | //æ§è¡åå¨è¿ç¨è¿è¡åå |
| | | dss = oCN.RunProcReturn("exec h_p_Cg_POOrderBillMain_Delete " + HQty + ", '" + HSourceInterID + "', '" + HSourceEntryID + "','" + user + " '", "h_p_Cg_POInStockBillMain"); |
| | | ds = oCN.RunProcReturn("select * from Cg_POInStockBillMain a inner join Cg_POInStockBillSub b on a.HInterID=b.HInterID where a.HInterID= '" + HInterID + "'", "Cg_POInStockBillMain"); |
| | | |
| | | //æ¶æéç¥åå é¤åå¡«éè´è®¢åå
³èæ°é |
| | | oCN.RunProc("exec h_p_Cg_UpDatePOOrderRelation_Del " + HInterID); |
| | | |
| | | ////æ§è¡åå¨è¿ç¨è¿è¡åå 该è¡ä¹æ¯ æ¶æéç¥å åå éè´è®¢å |
| | | // dss = oCN.RunProcReturn("exec h_p_Cg_POOrderBillMain_Delete " + HQty + ", '" + HSourceInterID + "', '" + HSourceEntryID + "','" + user + " '", "h_p_Cg_POInStockBillMain"); |
| | | var sReturn = ""; |
| | | if (DBUtility.ClsPub.isLong(dss.Tables[0].Rows[0]["HBack"]) != 0) |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBacker"]) != 0) |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(dss.Tables[0].Rows[0]["HBackRemark"]).ToString(); |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]).ToString(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = sReturn; |
| | |
| | | NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()); |
| | | NewHEntryID += 1; |
| | | } |
| | | //ååéè´å
¥åºå |
| | | //ååéè´è®¢åå ä¸é¢æ¹æ³ä¸ä¹æåå æ¤è¡ç»æ³¨é |
| | | string sReturn = ""; |
| | | ds = oCN.RunProcReturn("exec h_p_Cg_POOrderBillMain " + oSub.HQty + ", '" + oSub.HSourceInterID + "', '" + oSub.HSourceEntryID + "','" + user + " '", "h_p_Cg_POOrderBillMain"); |
| | | //ds = oCN.RunProcReturn("exec h_p_Cg_POOrderBillMain " + oSub.HQty + ", '" + oSub.HSourceInterID + "', '" + oSub.HSourceEntryID + "','" + user + " '", "h_p_Cg_POOrderBillMain"); |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0) |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]).ToString(); |
| | |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | //åºä»å å é¤ æ¤é éè´å
¥åºå å
³èæ°é |
| | | oCN.RunProc("exec h_p_Cg_UpDateRelation_POStockInToPayable_Del " + HInterID); |
| | | |
| | | //åºä»å å é¤ æ¤é éè´è®¢å å
³èæ°é |
| | | oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPayable_Del " + HInterID); |
| | | |
| | | oCN.RunProc("delete from Cg_PayableBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("delete from Cg_PayableSub where HInterID= " + HInterID); |
| | | |
| | |
| | | ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark |
| | | ,HInnerBillNo,HSTOCKORGID,HOWNERID,HMaker,HMakeDate,HProjectID,HInvoiceBillNo) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1201 + "','" + |
| | | HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress + |
| | | 1201 + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress + |
| | | "'," + HSupID + "," + HCurID + "," + HWHID + "," + HEmpID + "," + HManagerID + "," + |
| | | HSecManagerID + ","+ HKeeperID +"," + HDeptID + ",'" + HExplanation + "','" + HRemark |
| | | + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HMaker + "',getdate(),"+ HProjectID + ",'"+ HInvoiceBillNo + "')"; |
| | |
| | | + ",HAddress='" + HAddress + "',HInnerBillNo='" + HInnerBillNo + "',HProjectID="+ HProjectID + ",HInvoiceBillNo='"+ HInvoiceBillNo + "' where HInterID=" + HInterID; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | //éè´å
¥åºå ç¼è¾ æ¤éåå¡« éè´è®¢å å
³èæ°é |
| | | oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPOStockIn_Del " + HInterID); |
| | | |
| | | //éè´å
¥åºå ç¼è¾ æ¤éåå¡« æ¶æéç¥å å
³èæ°é |
| | | oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Del " + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Kf_ICStockBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | |
| | | |
| | | //éè´å
¥åºåæ°å¢åå¡«æ¶æéç¥åå
³èæ°é |
| | | oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Add " + HInterID); |
| | | |
| | | |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | |
| | | |
| | | string sReturn = ""; |
| | | oCN.BeginTran(); |
| | | |
| | | //éè´å
¥åºå å é¤ æ¤éåå¡« éè´è®¢å å
³èæ°é |
| | | oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPOStockIn_Del " + HInterID); |
| | | |
| | | //éè´å
¥åºå å é¤ æ¤éåå¡« æ¶æéç¥å å
³èæ°é |
| | | oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Del " + HInterID); |
| | | |
| | | oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region éè´å
¥åºå æ ¹æ®ä¸»å
ç ä¸åå
ç è·åéè´å
¥åºåæ°æ® |
| | | #region éè´å
¥åºå æ ¹æ®ä¸»å
ç ä¸åå
ç è·åéè´å
¥åºåæ°æ® |
| | | [Route("Kf_POStockInBill/loadKf_POStockInBill_Push")] |
| | | [HttpGet] |
| | | public object loadKf_POStockInBill_Push(long HInterID, long HSubID) |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 忥å¼è°å
¥å æ ¹æ®ä¸»å
ç ä¸åå
ç è·ååå¸å¼è°åºåæ°æ® |
| | | [Route("Kf_StepFoldInBill/loadKf_ICStockBillMain_Push")] |
| | | [HttpGet] |
| | | public object loadKf_POStockInBill_Push(long HInterID, long HSubID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_StepFoldOutBillList where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_StepFoldOutBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªæ¥è¯¢å°æºåä¿¡æ¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |