| | |
| | | int HCostItemID = int.Parse(item["HCostItemID"].ToString()); //成本项目ID |
| | | int HMaterID = int.Parse(item["HMaterID"].ToString()); //物料ID |
| | | int HProcID = int.Parse(item["HProcID"].ToString()); //工序ID |
| | | int HBeginQty = int.Parse(item["期初数量"].ToString()); |
| | | int HBeginBal = int.Parse(item["期初金额"].ToString()); |
| | | |
| | | Double HBeginQty = Double.Parse(item["期初数量"].ToString()); |
| | | Double HBeginBal = Double.Parse(item["期初金额"].ToString()); |
| | | Double HPanelQty = Double.Parse(item["拼板数"].ToString()); |
| | | // 1. 检查主表是否存在记录 |
| | | string checkMainSql = $"select HInterID from Kf_WIPBalMain where HOrgID='{HOrgID}' and HWorkShopID={HWorkShopID} and HCostObjID={HCostObjID}"; |
| | | string checkMainSql = $"select HInterID from Kf_WIPBalMain where HOrgID='{HOrgID}' and HWorkShopID={HWorkShopID} and HCostObjID={HCostObjID} and HYear ={HYear} and HPeriod = {HPeriod}"; |
| | | DataSet ds = oCN.RunProcReturn(checkMainSql, "Kf_WIPBalMain"); |
| | | |
| | | int HInterID; |
| | |
| | | // 插入主表 |
| | | string insertMainSql = $@" |
| | | insert into Kf_WIPBalMain |
| | | ( HYear, HPeriod, HCostCenterID, HWorkShopID, HCostObjID, |
| | | (HInterID, HYear, HPeriod, HCostCenterID, HWorkShopID, HCostObjID, |
| | | HICMOInterID, HProcExchInterID, HProcExchEntryID, HIsBack, HBatchNo, |
| | | HMaker, HMakeDate, HOrgID) |
| | | values |
| | | ( {HYear}, {HPeriod}, 0, {HWorkShopID}, {HCostObjID}, |
| | | ({HInterID},{HYear}, {HPeriod}, 0, {HWorkShopID}, {HCostObjID}, |
| | | 0, 0, 0, 0, '', |
| | | '{user}', getdate(), '{HOrgID}')"; |
| | | |
| | |
| | | HBeginBal, HCnangeBal, HDebit, HDebit_Sum, HCredit, |
| | | HEndBal, HEndBal_Rel, HYtdDebit, HYtdCredit, |
| | | HBeginDiff, HReceiveDiff, HSendDiff, HEndDiff, |
| | | HYtdReceiveDiff, HYtdSendDiff) |
| | | HYtdReceiveDiff, HYtdSendDiff,HPanelQty) |
| | | values |
| | | ({HInterID}, {HEntryID}, {HCostItemID}, {HMaterID}, {HProcID}, 0, |
| | | {HBeginQty}, 0, 0, 0, 0, |
| | |
| | | {HBeginBal}, 0, 0, 0, 0, |
| | | 0, 0, 0, 0, |
| | | 0, 0, 0, 0, |
| | | 0, 0)"; |
| | | 0, 0,{HPanelQty})"; |
| | | |
| | | oCN.RunProc(insertSubSql); |
| | | |