条码生成模块,增加是否赠品列,选源单收料通知单时从源单带出写入条码表
1个文件已修改
217 ■■■■■ 已修改文件
WarM/条码打印/Gy_BarCodeBill.cs 217 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -39,45 +39,46 @@
        public const Int16 HBarCodeTypeCol = 18;
        public const Int16 HBatchManagerCol = 19;
        public const Int16 HBatchNoCol = 20;
        public const Int16 HQtyCol = 21;
        public const Int16 HMinQtyCol = 22;
        public const Int16 HBQtyCol = 23;
        public const Int16 HDeptIDCol = 24;
        public const Int16 HDeptNumberCol = 25;
        public const Int16 HDeptNameCol = 26;
        public const Int16 HSourceIDCol = 27;
        public const Int16 HSourceNumberCol = 28;
        public const Int16 HSourceNameCol = 29;
        public const Int16 HDateCol = 30;
        public const Int16 HEndDateCol = 31;
        public const Int16 HSupIDCol = 32;
        public const Int16 HSupNumberCol = 33;
        public const Int16 HSupNameCol = 34;
        public const Int16 HCusIDCol = 35;
        public const Int16 HCusNumberCol = 36;
        public const Int16 HCusNameCol = 37;
        public const Int16 HCusTypeCol = 38;
        public const Int16 HSourceInterIDCol = 39;
        public const Int16 HSourceEntryIDCol = 40;
        public const Int16 HSourceBillNoCol = 41;
        public const Int16 HSourceBillTypeCol = 42;
        public const Int16 HInstructIDCol = 43;
        public const Int16 HInstructNoCol = 44;
        public const Int16 HSeOrderBillIDCol = 45;
        public const Int16 HSeOrderBillNoCol = 46;
        public const Int16 HWhIDCol = 47;
        public const Int16 HWhNumberCol = 48;
        public const Int16 HWhNameCol = 49;
        public const Int16 HSPIDCol = 50;
        public const Int16 HSPNumberCol = 51;
        public const Int16 HSPNameCol = 52;
        public const Int16 HinitQtyCol = 53;
        public const Int16 HRemarkCol = 54;
        public const Int16 HPinfanBarCodeCol = 55;
        public const Int16 HMTONoCol = 56;
        public const Int16 HShowDateCol = 57;
        public const Int16 HInnerBillNoCol = 58;
        public const Int16 HMakerCol = 59;
        public const Int16 HGiveAwayFlagCol = 21;
        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 Int16 HSelectCol = 0;
        public Int16 HSno2Col = 1;
@@ -93,49 +94,50 @@
        public Int16 HAuxPropNumber2Col = 11;
        public Int16 HAuxPropName2Col = 12;
        public Int16 HBatchNo2Col = 13;
        public Int16 HUnitID2Col = 14;
        public Int16 HUnitNumber2Col = 15;
        public Int16 HUnitName2Col = 16;
        public Int16 HQty2Col = 17;
        public Int16 HWeiCol = 18;
        public Int16 HPrintCol = 19;
        public Int16 HDeptID2Col = 20;
        public Int16 HDeptNumber2Col = 21;
        public Int16 HDeptName2Col = 22;
        public Int16 HSourceID2Col = 23;
        public Int16 HSourceNumber2Col = 24;
        public Int16 HSourceName2Col = 25;
        public Int16 HDate2Col = 26;
        public Int16 HEndDate2Col = 27;
        public Int16 HBarcodeNoCol = 28;
        public Int16 HBarcodeQtysCol = 29;
        public Int16 HSupID2Col = 30;
        public Int16 HSupNumber2Col = 31;
        public Int16 HSupName2Col = 32;
        public Int16 HCusID2Col = 33;
        public Int16 HCusNumber2Col = 34;
        public Int16 HCusName2Col = 35;
        public Int16 HCusType2Col = 36;
        public Int16 HSourceInterID2Col = 37;
        public Int16 HSourceEntryID2Col = 38;
        public Int16 HSourceBillNo2Col = 39;
        public Int16 HSourceBillType2Col = 40;
        public Int16 HInstructID2Col = 41;
        public Int16 HInstructNo2Col = 42;
        public Int16 HSeOrderBillID2Col = 43;
        public Int16 HSeOrderBillNo2Col = 44;
        public Int16 HWhID2Col = 45;
        public Int16 HWhNumber2Col = 46;
        public Int16 HWhName2Col = 47;
        public Int16 HSPID2Col = 48;
        public Int16 HSPNumber2Col = 49;
        public Int16 HSPName2Col = 50;
        public Int16 HRemark2Col = 51;
        public Int16 HPinfanBarCode2Col = 52;
        public Int16 HMTONo2Col = 53;
        public Int16 HShowDate2Col = 54;
        public Int16 HInnerBillNo2Col = 55;
        public Int16 HMaker2Col = 56;
        public Int16 HGiveAwayFlag2Col = 14;
        public Int16 HUnitID2Col = 15;
        public Int16 HUnitNumber2Col = 16;
        public Int16 HUnitName2Col = 17;
        public Int16 HQty2Col = 18;
        public Int16 HWeiCol = 19;
        public Int16 HPrintCol = 20;
        public Int16 HDeptID2Col = 21;
        public Int16 HDeptNumber2Col = 22;
        public Int16 HDeptName2Col = 23;
        public Int16 HSourceID2Col = 24;
        public Int16 HSourceNumber2Col = 25;
        public Int16 HSourceName2Col = 26;
        public Int16 HDate2Col = 27;
        public Int16 HEndDate2Col = 28;
        public Int16 HBarcodeNoCol = 29;
        public Int16 HBarcodeQtysCol = 30;
        public Int16 HSupID2Col = 31;
        public Int16 HSupNumber2Col = 32;
        public Int16 HSupName2Col = 33;
        public Int16 HCusID2Col = 34;
        public Int16 HCusNumber2Col = 35;
        public Int16 HCusName2Col = 36;
        public Int16 HCusType2Col = 37;
        public Int16 HSourceInterID2Col = 38;
        public Int16 HSourceEntryID2Col = 39;
        public Int16 HSourceBillNo2Col = 40;
        public Int16 HSourceBillType2Col = 41;
        public Int16 HInstructID2Col = 42;
        public Int16 HInstructNo2Col = 43;
        public Int16 HSeOrderBillID2Col = 44;
        public Int16 HSeOrderBillNo2Col = 45;
        public Int16 HWhID2Col = 46;
        public Int16 HWhNumber2Col = 47;
        public Int16 HWhName2Col = 48;
        public Int16 HSPID2Col = 49;
        public Int16 HSPNumber2Col = 50;
        public Int16 HSPName2Col = 51;
        public Int16 HRemark2Col = 52;
        public Int16 HPinfanBarCode2Col = 53;
        public Int16 HMTONo2Col = 54;
        public Int16 HShowDate2Col = 55;
        public Int16 HInnerBillNo2Col = 56;
        public Int16 HMaker2Col = 57;
        //
        public  string ModName = "85";
        public  string ModCaption = "条码生成";
@@ -830,6 +832,13 @@
                        grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value = grdMain.Rows[j].Cells[HSeOrderBillNoCol].Value;
                        grdSub.Rows[i].Cells[HInnerBillNo2Col].Value = grdMain.Rows[j].Cells[HInnerBillNoCol].Value;
                        grdSub.Rows[i].Cells[HMaker2Col].Value = grdMain.Rows[j].Cells[HMakerCol].Value;
                        grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value = grdMain.Rows[j].Cells[HGiveAwayFlagCol].Value;
                        //网格打勾
                        DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell();
                        oCell.ThreeState = false;
                        oCell.Value = grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value;
                        oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                        grdSub.Rows[i].Cells[HGiveAwayFlag2Col] = oCell;
                        k = k + 1;
                        n = n + 1;
                        oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
@@ -867,6 +876,7 @@
            string HWorkLineName = "";
            string HSeOrderBillNo = "";
            string HInnerBillNo = "";
            bool HGiveAwayFlag = false;
            try
            {
                oCn.BeginTran();
@@ -903,12 +913,14 @@
                        HWorkLineName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSourceName2Col].Value);
                        HSeOrderBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSeOrderBillNo2Col].Value);
                        HInnerBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HInnerBillNo2Col].Value);
                        HGiveAwayFlag = ClsPub.isBool(grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value);
                        oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                                    ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                                    ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                                    ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " +
                                    ",HGiveAwayFlag " +
                                    ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                    ") values ("
                                    + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
@@ -917,6 +929,7 @@
                                    + ", " + 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()
                                    + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag)
                                    + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')");
@@ -975,7 +988,7 @@
            //
            grdMain.RowCount = 0;
            grdSub.RowCount = 0;
            grdMain.ColumnCount = 60;                       //总列数
            grdMain.ColumnCount = 61;                       //总列数
            DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
            grdMain.Columns[HSnoCol].HeaderText = "序号";
            grdMain.Columns[HMainIDCol].HeaderText = "源单主ID";
@@ -998,6 +1011,7 @@
            grdMain.Columns[HBarCodeTypeCol].HeaderText = "条码类型";
            grdMain.Columns[HBatchManagerCol].HeaderText = "是否启用批次";
            grdMain.Columns[HBatchNoCol].HeaderText = "批号";
            grdMain.Columns[HGiveAwayFlagCol].HeaderText = "是否赠品";
            grdMain.Columns[HQtyCol].HeaderText = "数量";
            grdMain.Columns[HMinQtyCol].HeaderText = "最小包装数";
            grdMain.Columns[HBQtyCol].HeaderText = "箱数";
@@ -1089,12 +1103,23 @@
                                "," + HRemarkCol.ToString();
            //设置合计列
            string sTotalCol = HQtyCol.ToString();
            //设置特殊列
            for (int i = 0; i < grdMain.Rows.Count; i++)
            {
                //网格打勾
                DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell();
                oCell.ThreeState = false;
                oCell.Value = 0;
                oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                grdMain.Rows[i].Cells[HGiveAwayFlagCol] = oCell;
            }
            //
            DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid);
            //----------------------------
            grdSub.ColumnCount = 57;                       //总列数
            grdSub.ColumnCount = 58;                       //总列数
            DBUtility.Xt_BaseBillFun.initGridFst(grdSub, this.Name);
            grdSub.Columns[HSelectCol].HeaderText = "选择";
            grdSub.Columns[HTMCol].HeaderText = "条码编号";
@@ -1111,6 +1136,7 @@
            grdSub.Columns[HPinfan2Col].HeaderText = "品番";
            grdSub.Columns[HPinfanBarCode2Col].HeaderText = "HPinfanBarCode";
            grdSub.Columns[HBatchNo2Col].HeaderText = "批号";
            grdSub.Columns[HGiveAwayFlag2Col].HeaderText = "是否赠品";
            grdSub.Columns[HUnitID2Col].HeaderText = "计量单位ID";
            grdSub.Columns[HUnitNumber2Col].HeaderText = "计量单位代码";
            grdSub.Columns[HUnitName2Col].HeaderText = "计量单位";
@@ -1194,6 +1220,17 @@
            grdSub.Columns[HSourceID2Col].Visible = false;
            grdSub.Columns[HSourceNumber2Col].Visible = false;
            grdSub.Columns[HSourceName2Col].Visible = false;
            //设置特殊列
            for (int i = 0; i < grdSub.Rows.Count; i++)
            {
                //网格打勾
                DataGridViewCheckBoxCell oCell = new DataGridViewCheckBoxCell();
                oCell.ThreeState = false;
                oCell.Value = 0;
                oCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                grdSub.Rows[i].Cells[HGiveAwayFlag2Col] = oCell;
            }
            DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name);
            DBUtility.Xt_BaseBillFun.GetGrid(grdSub, this.Name + "grdSub");
@@ -1905,6 +1942,18 @@
                grdMain.Rows[i].Cells[HSupIDCol].Value = oTable.Rows[0]["hsupid"].ToString();
                grdMain.Rows[i].Cells[HSupNumberCol].Value = oTable.Rows[0]["供应商代码"].ToString();
                grdMain.Rows[i].Cells[HSupNameCol].Value = oTable.Rows[0]["供应商"].ToString();
                if (cmbSourceBillType.Text.Trim() == "收料通知单")
                {
                    if (oTable.Rows[0]["是否赠品"].ToString() == "是")
                    {
                        grdMain.Rows[i].Cells[HGiveAwayFlagCol].Value = 1;
                    }
                    else
                    {
                        grdMain.Rows[i].Cells[HGiveAwayFlagCol].Value = 0;
                    }
                }
            }
            if (cmbSourceBillType.Text.Trim() == "退货通知单")
            {