| | |
| | | long HSCWHID = mainList[0].HSCWHID;//调出仓库 |
| | | long HSecManagerID = mainList[0].HSecManagerID;//验收 |
| | | long HKeeperID = mainList[0].HKeeperID;//保管员 |
| | | long HProjectID = mainList[0].HProjectID;//项目 |
| | | |
| | | |
| | | |
| | | |
| | | string HInvoiceBillNo = mainList[0].HInvoiceBillNo;//发票编号 |
| | | string HExplanation = mainList[0].HExplanation;//摘要 |
| | | string HInnerBillNo = mainList[0].HInnerBillNo;//内部单据号 |
| | | |
| | |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid=" + HInterID + " and 单据号='" + HBillNo + "'", "h_v_Kf_POStockInBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//新增 |
| | | if ((OperationType == 1 || OperationType == 2 || OperationType == 4) && ds.Tables[0].Rows.Count == 0)//新增 |
| | | { |
| | | //保存前控制========================================= |
| | | ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBill_BeforeSaveCtrl " + HInterID, "h_p_Kf_POStockInBill_BeforeSaveCtrl"); |
| | |
| | | String sql =$@"Insert Into Kf_ICStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark |
| | | ,HInnerBillNo,HSTOCKORGID,HOWNERID,HMaker,HMakeDate) |
| | | ,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()" +")"; |
| | | + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HMaker + "',getdate(),"+ HProjectID + ",'"+ HInvoiceBillNo + "')"; |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | |
| | | "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + |
| | | ",HSupID=" + HSupID + ",HCurID=" + HCurID + ",HSecManagerID=" + HSecManagerID + ", HSTOCKORGID=" + HSTOCKORGID + ",HKeeperID=" + HKeeperID + ",HWHID = " + HWHID |
| | | + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID + ",HOWNERID=" + HOWNERID |
| | | + ",HAddress='" + HAddress + "',HInnerBillNo='" + HInnerBillNo + "' where HInterID=" + HInterID; |
| | | + ",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") |
| | | { |
| | |
| | | ,HMoney,HOrderPrice,HWHID,HSPID,HRelationQty,HBatchNo |
| | | ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType |
| | | ,HPOOrderInterID,HPOOrderEntryID ,HPOOrderBillNo |
| | | ,HPropertyID,HSecUnitID,HSecUnitRate,HPlanMode,HRemark,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo) |
| | | ,HPropertyID,HSecUnitID,HSecUnitRate,HPlanMode,HRemark,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo |
| | | ,HTaxRate,HTaxPrice,HlineTotal) |
| | | values({HInterID},{NewHEntryID},{oSub.HMaterID},{oSub.HUnitID} |
| | | ,{oSub.HQtyMust},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HPrice},{oSub.HMoney},{oSub.HOrderPrice},{oSub.HWHID},{oSub.HSPID},{oSub.HRelationQty} |
| | | ,'{oSub.HBatchNo}',{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}' |
| | | ,{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}' |
| | | ,{(oSub.HPropertyID == null ? 0 : oSub.HPropertyID)},{(oSub.HSecUnitID == null ? 0 : oSub.HSecUnitID)},{(oSub.HSecUnitRate == null ? 0 : oSub.HSecUnitRate)} |
| | | ,{(oSub.HPlanMode == null ? 0 : oSub.HPlanMode)},'{oSub.HRemark}',{oSub.HSeOrderInterID},{oSub.HSeOrderEntryID},'{oSub.HSeOrderBillNo}')"; |
| | | ,{(oSub.HPlanMode == null ? 0 : oSub.HPlanMode)},'{oSub.HRemark}',{oSub.HSeOrderInterID},{oSub.HSeOrderEntryID},'{oSub.HSeOrderBillNo}' |
| | | ,{(oSub.HTaxRate == null ? 0 : oSub.HTaxRate)},{(oSub.HTaxPrice == null ? 0 : oSub.HTaxPrice)},{(oSub.HlineTotal == null ? 0 : oSub.HlineTotal)})"; |
| | | |
| | | //string sReturn = ""; |
| | | //ds = oCN.RunProcReturn("exec h_p_Cg_POInStockBillMain " + oSub.HQty + ", '" +oSub.HSourceInterID + "', '" + oSub.HSourceEntryID + "','" + user+" '", "h_p_Cg_POInStockBillMain"); |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region 删除功能 |
| | | /// <summary> |
| | | ///删除功能 |
| | | /// </summary> |
| | |
| | | |
| | | 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(); |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region 查找记录功能 |
| | | /// <summary> |
| | | /// 根据基础资料ID 查找记录 |
| | | ///参数:string sql。 |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 根据物料内码获取物料信息 |
| | | [Route("Kf_POStockInBill/getMaterialByMaterID")] |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region 采购入库单 根据主内码与子内码获取采购入库单数据 |
| | | #region 采购入库单 根据主内码与子内码获取采购入库单数据 |
| | | [Route("Kf_POStockInBill/loadKf_POStockInBill_Push")] |
| | | [HttpGet] |
| | | public object loadKf_POStockInBill_Push(long HInterID, long HSubID) |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POStockInBillList where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_POStockInBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_Kf_POStockInBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | | #endregion |
| | | } |