| | |
| | | public const Int16 HQtyCol = 22; |
| | | public const Int16 HMinQtyCol = 23; |
| | | public const Int16 HBQtyCol = 24; |
| | | public const Int16 HDeptIDCol = 25; |
| | | public const Int16 HDeptNumberCol = 26; |
| | | public const Int16 HDeptNameCol = 27; |
| | | public const Int16 HSourceIDCol = 28; |
| | | public const Int16 HSourceNumberCol = 29; |
| | | public const Int16 HSourceNameCol = 30; |
| | | public const Int16 HDateCol = 31; |
| | | public const Int16 HEndDateCol = 32; |
| | | public const Int16 HSupIDCol = 33; |
| | | public const Int16 HSupNumberCol = 34; |
| | | public const Int16 HSupNameCol = 35; |
| | | public const Int16 HCusIDCol = 36; |
| | | public const Int16 HCusNumberCol = 37; |
| | | public const Int16 HCusNameCol = 38; |
| | | public const Int16 HCusTypeCol = 39; |
| | | public const Int16 HSourceInterIDCol = 40; |
| | | public const Int16 HSourceEntryIDCol = 41; |
| | | public const Int16 HSourceBillNoCol = 42; |
| | | public const Int16 HSourceBillTypeCol = 43; |
| | | public const Int16 HInstructIDCol = 44; |
| | | public const Int16 HInstructNoCol = 45; |
| | | public const Int16 HSeOrderBillIDCol = 46; |
| | | public const Int16 HSeOrderBillNoCol = 47; |
| | | public const Int16 HWhIDCol = 48; |
| | | public const Int16 HWhNumberCol = 49; |
| | | public const Int16 HWhNameCol = 50; |
| | | public const Int16 HSPIDCol = 51; |
| | | public const Int16 HSPNumberCol = 52; |
| | | public const Int16 HSPNameCol = 53; |
| | | public const Int16 HinitQtyCol = 54; |
| | | public const Int16 HRemarkCol = 55; |
| | | public const Int16 HPinfanBarCodeCol = 56; |
| | | public const Int16 HMTONoCol = 57; |
| | | public const Int16 HShowDateCol = 58; |
| | | public const Int16 HInnerBillNoCol = 59; |
| | | public const Int16 HMakerCol = 60; |
| | | public const Int16 HPackQtyCol = 25; |
| | | public const Int16 HDeptIDCol = 26; |
| | | public const Int16 HDeptNumberCol = 27; |
| | | public const Int16 HDeptNameCol = 28; |
| | | public const Int16 HSourceIDCol = 29; |
| | | public const Int16 HSourceNumberCol = 30; |
| | | public const Int16 HSourceNameCol = 31; |
| | | public const Int16 HDateCol = 32; |
| | | public const Int16 HEndDateCol = 33; |
| | | public const Int16 HSupIDCol = 34; |
| | | public const Int16 HSupNumberCol = 35; |
| | | public const Int16 HSupNameCol = 36; |
| | | public const Int16 HCusIDCol = 37; |
| | | public const Int16 HCusNumberCol = 38; |
| | | public const Int16 HCusNameCol = 39; |
| | | public const Int16 HCusTypeCol = 40; |
| | | public const Int16 HSourceInterIDCol = 41; |
| | | public const Int16 HSourceEntryIDCol = 42; |
| | | public const Int16 HSourceBillNoCol = 43; |
| | | public const Int16 HSourceBillTypeCol = 44; |
| | | public const Int16 HInstructIDCol = 45; |
| | | public const Int16 HInstructNoCol = 46; |
| | | public const Int16 HSeOrderBillIDCol = 47; |
| | | public const Int16 HSeOrderBillNoCol = 48; |
| | | public const Int16 HWhIDCol = 49; |
| | | public const Int16 HWhNumberCol = 50; |
| | | public const Int16 HWhNameCol = 51; |
| | | public const Int16 HSPIDCol = 52; |
| | | public const Int16 HSPNumberCol = 53; |
| | | public const Int16 HSPNameCol = 54; |
| | | public const Int16 HinitQtyCol = 55; |
| | | public const Int16 HRemarkCol = 56; |
| | | public const Int16 HPinfanBarCodeCol = 57; |
| | | public const Int16 HMTONoCol = 58; |
| | | public const Int16 HShowDateCol = 59; |
| | | public const Int16 HInnerBillNoCol = 60; |
| | | public const Int16 HMakerCol = 61; |
| | | |
| | | public Int16 HSelectCol = 0; |
| | | public Int16 HSno2Col = 1; |
| | |
| | | public Int16 HShowDate2Col = 55; |
| | | public Int16 HInnerBillNo2Col = 56; |
| | | public Int16 HMaker2Col = 57; |
| | | public Int16 HEntryID2Col = 58; |
| | | // |
| | | public string ModName = "85"; |
| | | public string ModCaption = "æ¡ç çæ"; |
| | |
| | | return; |
| | | } |
| | | grdSub.Rows[i].Cells[HTMCol].Value = TM; |
| | | grdSub.Rows[i].Cells[HEntryID2Col].Value = j + 1; |
| | | grdSub.Rows[i].Cells[HMaterID2Col].Value = grdMain.Rows[j].Cells[HMaterIDCol].Value; |
| | | grdSub.Rows[i].Cells[HMaterNumber2Col].Value = grdMain.Rows[j].Cells[HMaterNumberCol].Value; |
| | | grdSub.Rows[i].Cells[HMaterName2Col].Value = grdMain.Rows[j].Cells[HMaterNameCol].Value; |
| | |
| | | string HSeOrderBillNo = ""; |
| | | string HInnerBillNo = ""; |
| | | bool HGiveAwayFlag = false; |
| | | Int64 HEntryID = 0; |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | |
| | | } |
| | | // |
| | | HMaterID = ClsPub.isLong(grdSub.Rows[i].Cells[HMaterID2Col].Value); |
| | | HEntryID = ClsPub.isLong(grdSub.Rows[i].Cells[HEntryID2Col].Value); |
| | | HAuxPropID = ClsPub.isLong(grdSub.Rows[i].Cells[HAuxPropID2Col].Value); |
| | | HUnitID = ClsPub.isLong(grdSub.Rows[i].Cells[HUnitID2Col].Value); |
| | | HQty2 = ClsPub.isDoule(grdSub.Rows[i].Cells[HQty2Col].Value); |
| | |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'" |
| | | + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'" |
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() |
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + "" |
| | | + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')"); |
| | | |
| | |
| | | // |
| | | grdMain.RowCount = 0; |
| | | grdSub.RowCount = 0; |
| | | grdMain.ColumnCount = 61; //æ»åæ° |
| | | grdMain.ColumnCount = 62; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name); |
| | | grdMain.Columns[HSnoCol].HeaderText = "åºå·"; |
| | | grdMain.Columns[HMainIDCol].HeaderText = "æºå主ID"; |
| | |
| | | grdMain.Columns[HGiveAwayFlagCol].HeaderText = "æ¯å¦èµ å"; |
| | | grdMain.Columns[HQtyCol].HeaderText = "æ°é"; |
| | | grdMain.Columns[HMinQtyCol].HeaderText = "æå°å
è£
æ°"; |
| | | grdMain.Columns[HPackQtyCol].HeaderText = "å¤ç®±æ°"; |
| | | grdMain.Columns[HBQtyCol].HeaderText = "ç®±æ°"; |
| | | grdMain.Columns[HSupIDCol].HeaderText = "ä¾åºåID"; |
| | | grdMain.Columns[HSupNumberCol].HeaderText = "ä¾åºå代ç "; |
| | |
| | | "," + HSeOrderBillNoCol.ToString() + |
| | | "," + HBatchNoCol.ToString() + |
| | | "," + HCusNumberCol.ToString() + |
| | | "," + HPackQtyCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | //设置å计å |
| | | string sTotalCol = HQtyCol.ToString(); |
| | |
| | | DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid); |
| | | //---------------------------- |
| | | |
| | | grdSub.ColumnCount = 58; //æ»åæ° |
| | | grdSub.ColumnCount = 59; //æ»åæ° |
| | | DBUtility.Xt_BaseBillFun.initGridFst(grdSub, this.Name); |
| | | grdSub.Columns[HSelectCol].HeaderText = "éæ©"; |
| | | grdSub.Columns[HTMCol].HeaderText = "æ¡ç ç¼å·"; |
| | |
| | | grdSub.Columns[HShowDate2Col].HeaderText = "æ¥æ"; |
| | | grdSub.Columns[HInnerBillNo2Col].HeaderText = "å
é¨éè´è®¢åå·"; |
| | | grdSub.Columns[HMaker2Col].HeaderText = "å¶å人"; |
| | | grdSub.Columns[HEntryID2Col].HeaderText = "è¡å·"; |
| | | //æ ¼å¼å |
| | | grdSub.Columns[HMaterID2Col].Visible = false; |
| | | grdSub.Columns[HModel2Col].Visible = false; |
| | |
| | | "," + HMinQtyCol.ToString() + |
| | | "," + HAuxPropNumberCol.ToString() + |
| | | "," + HBatchNoCol.ToString() + |
| | | "," + HPackQtyCol.ToString() + |
| | | "," + HRemarkCol.ToString(); |
| | | grdMain.Columns[HBillNoCol].ReadOnly = true; |
| | | //设置å计å |
| | |
| | | //çæå¤ç®±ç |
| | | private void wxm_Click(object sender, EventArgs e) |
| | | { |
| | | try |
| | | { |
| | | Int64 iInterID = 0; |
| | | Int64 dPackQty = 0; //å¤ç®±æ°é |
| | | Int64 dPackLeftQty = 0; //å¤ç®±å©ä½æ°é |
| | | Int64 dLabelQty = 0; //å°ç®±æ°é |
| | | Int64 dQty = 0; //æ»æ°é |
| | | Int64 dEntryID = 0; //è¡å· |
| | | string sPackBarCode = ""; //å¤ç®±ç |
| | | string sBarCode = ""; //å¯ä¸ç |
| | | Int64 LSH = 0; |
| | | DataSet Ds; |
| | | string sYear = DateTime.Today.Year.ToString().Substring(2, 2); |
| | | string sPeriod = "0" + DateTime.Today.Month.ToString(); |
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2); |
| | | string sDay = "0" + DateTime.Today.Day.ToString(); |
| | | sDay = sDay.Substring(sDay.Length - 2, 2); |
| | | // |
| | | string sPackStr = "ZXM" + sYear + sPeriod + sDay; //å¤ç®±ç åç¼ |
| | | |
| | | //å¿
é¡»æ¡ç çææé®æ¯ç°åº¦æå¯ä»¥çæç®±æ¡ç |
| | | if(bc.Enabled != false) |
| | | { |
| | |
| | | return; |
| | | } |
| | | //-------------------æ ¹æ®HINTERIDçæç®±æ¡ç |
| | | |
| | | //çæå夿ï¼å¾ªç¯ç©æç½æ ¼ï¼å¤æ æ¯å¦è®¾ç½®äºåçç å¤ç®±æ°éã å¤ç®±æ°é å¿
é¡»æ¯ æå°å
è£
æ°ç åæ° å¹¶å¿
须大äº0å大äºçäºæå°å
è£
æ°éã |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value) != 0) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value) <= 0) |
| | | { |
| | | MessageBox.Show("请å½å
¥åççå¤ç®±æ°éï¼ç¬¬" + Convert.ToString(i + 1) + "è¡"); |
| | | return; |
| | | } |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value) |
| | | % DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMinQtyCol].Value) != 0 |
| | | || DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value) |
| | | < DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMinQtyCol].Value)) |
| | | { |
| | | MessageBox.Show("å¤ç®±æ°éå¿
é¡»æ¯æå°å
è£
æ°çåæ°ï¼ä¸å¤§äºçäºæå°å
è£
æ°ï¼ç¬¬" + Convert.ToString(i + 1) + "è¡"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | //oCn.BeginTran(); |
| | | //ä»0è¡è¿è¡å¾ªç¯ ç©æç½æ ¼ï¼è·åå¤ç®±æ°é |
| | | |
| | | for (int i = 0; i < grdMain.Rows.Count; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value) != 0) |
| | | { |
| | | //è·åæ»æ°éãå¤ç®±æ°é |
| | | dPackQty = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value); |
| | | dQty = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HQtyCol].Value); |
| | | dEntryID = i + 1; |
| | | dPackLeftQty = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value); |
| | | //çæä¸ä¸ªå¤ç®±ç |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]) + 1; |
| | | sPackBarCode = sPackStr + LSH.ToString(); |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | //åå¾ªç¯ æ¡ç ç½æ ¼ |
| | | |
| | | //æ ¹æ®å¤ç®±æ°é æ£åï¼ç´å° å¤ç®±æ°éæ£åå®ï¼çæ å¤ç®±æ¡ç åç»æå |
| | | |
| | | |
| | | //ç»æå¾ªç¯ |
| | | |
| | | //å·æ°æå°é¡µç¾ï¼-S ç èææ¡ç 䏿¾ç¤º ï¼ |
| | | |
| | | |
| | | for (int j = 0; j < grdSub.Rows.Count; j++) |
| | | { |
| | | if (dEntryID == DBUtility.ClsPub.isLong(grdSub.Rows[j].Cells[HEntryID2Col].Value)) |
| | | { |
| | | if (dQty <= 0) |
| | | { |
| | | continue; |
| | | } |
| | | if (dPackLeftQty > 0) //å½å©ä½å¤ç®±æ°éå°äºçäº0æ¶ï¼éæ°çæå¤ç®±ç |
| | | { |
| | | } |
| | | else |
| | | { |
| | | //çæä¸ä¸ªå¤ç®±ç |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]) + 1; |
| | | sPackBarCode = sPackStr + LSH.ToString(); |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'"); |
| | | dPackLeftQty = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPackQtyCol].Value); |
| | | } |
| | | sBarCode = DBUtility.ClsPub.isStrNull(grdSub.Rows[j].Cells[HTMCol].Value); // æ¡ç |
| | | dLabelQty = DBUtility.ClsPub.isLong(grdSub.Rows[j].Cells[HQty2Col].Value); // å°ç®±æ°é |
| | | oCn.RunProc("update Gy_BarCodebill set HInnerBillNo= '" + sPackBarCode + "' Where HbarCode='" + sBarCode + "'"); |
| | | dPackLeftQty = dPackLeftQty - dLabelQty; |
| | | dQty = dQty - dLabelQty; |
| | | if (dPackLeftQty <= 0)//å½ç®±å©ä½æ°éå°äºçäº0æ¶ æ§è¡ ç»æå |
| | | { |
| | | //è·åç»æåå
ç |
| | | iInterID = DBUtility.ClsPub.CreateBillID("3783", ref DBUtility.ClsPub.sExeReturnInfo); ;//å¾å°æ°åå·; |
| | | //æ ¹æ®å¤ç®±ç åå
¥ ç»æå主表ï¼ç»æåå表ï¼SUMï¼å¤ç®±ç æ¡£æ¡ï¼SUMæ¡£æ¡ |
| | | oCn.RunProc("exec h_p_WMS_PackUnionBill_AddNew '" + sPackBarCode + "'," + iInterID.ToString() + ",'" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ 主表ï¼å表 ï¼ç®±æ¡ç æ¡£æ¡ |
| | | oCn.RunProc("exec h_p_WMS_PackUnionBill_SumSubBill " + iInterID.ToString() + ",'" + sPackBarCode + "','3783','" + DBUtility.ClsPub.CurUserName + "'," + HInterID.ToString()); //æ ¹æ®ç®±æ¡ç ï¼åå
¥ SUM表ï¼SUMæ¡ç æ¡£æ¡ |
| | | } |
| | | } |
| | | else |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | wxm.Enabled = false; |
| | | //oCn.Commit(); |
| | | MessageBox.Show("çæç®±ç 宿¯ï¼"); |
| | | //å·æ°æ°æ® |
| | | Display(); |
| | | } |
| | | catch(Exception e1) |
| | | { |
| | | //oCn.RollBack(); |
| | | MessageBox.Show("çæç®±ç 失败ï¼" + e1.Message ); |
| | | } |
| | | } |
| | | } |
| | | } |