| | |
| | | { |
| | | try |
| | | { |
| | | string sql = string.Format(@"select a.HInterID,a.HBillNo,a.HMaterID,m.HName HMaterName, a.HUnitID,u.HName HUnitName,a.HPlanQty,a.HCusID, c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty |
| | | string sql = string.Format(@"select a.HInterID,a.HBillNo,a.HMaterID,m.HName HMaterName, a.HUnitID,u.HName HUnitName,b.HQty HPlanQty,a.HCusID, c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty |
| | | from Sc_ICMOBillMain a |
| | | left join Gy_Material m on a.HMaterID=m.HItemID |
| | | left join Gy_Unit u on a.HUnitID=u.HItemID |
| | | left join Sc_ICMOBillSub b on a.HInterID=b.HInterID |
| | | left join Gy_Material m on b.HMaterID=m.HItemID |
| | | left join Gy_Unit u on b.HUnitID=u.HItemID |
| | | left join Gy_Customer c on a.HCusID=c.HItemID |
| | | left join Gy_Employee e on a.HEmpID=e.HItemID |
| | | left join Gy_Department d on a.HDeptID=d.HItemID |
| | | where HSeOrderInterID=(select HSeOrderInterID from Sc_ICMOBillMain where HBillNo='" + HBillNo + "')"); |
| | | where b.HSeOrderInterID=(select HSeOrderInterID from Sc_ICMOBillMain where HBillNo='" + HBillNo + "')"); |
| | | |
| | | ds = oCN.RunProcReturn(sql, "Sc_ICMOBillMain"); |
| | | if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | |
| | | + ",0" |
| | | + ",'" + oItemSub.HMaterName + "','','',0,'','')"); |
| | | |
| | | string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID); |
| | | oCN.RunProc(sql1); |
| | | } |
| | | } |
| | |
| | | "0,0,"+ oItemSub.HMaterID+","+ oItemSub.HUnitID+","+ oItemSub.HPlanQty+", 0,0,0,0,"+ |
| | | "getdate(),'"+ LSH + "','" +HBillNo+"')"); |
| | | //æ´æ¹ç产订åçæ°é |
| | | string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID); |
| | | |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc(sql1); |
| | |
| | | |
| | | #region[å¢åè£
ç®±å表] |
| | | /// <summary> |
| | | /// 模å
·ä¿å
»è®°å½è¡¨å表 |
| | | /// å¢åè£
ç®±å表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_ICMOBillController/QK_GetPackingBillList")] |
| | |
| | | ds = oCN.RunProcReturn("select * from Gy_BarCodeBill where HItemID=" + HInterID, "Gy_BarCodeBill"); |
| | | DataRow dr = ds.Tables[0].Rows[0]; |
| | | string sql = string.Format(@"delete from Gy_BarCodeBill where HItemID=" + HInterID); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=HPlanQty+" + dr["HQty"] +" where HInterID=(select HSourceInterID from Gy_BarCodeBill where HItemID="+ HInterID + ")"); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=HPlanQty+" + dr["HQty"] +" where HInterID=(select HSourceInterID from Gy_BarCodeBill where HItemID="+ HInterID + ")"); |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc(sql1); |
| | | } |
| | |
| | | DataRow dr1 = ds.Tables[0].Rows[0]; |
| | | |
| | | string sql = string.Format(@"delete from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString()+"'"); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=HPlanQty+" + dr1["HQty"] + " where HInterID=(select HSourceInterID from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString() + "')"); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=HPlanQty+" + dr1["HQty"] + " where HInterID=(select HSourceInterID from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString() + "')"); |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc(sql1); |
| | | } |