1
duhe
2023-07-17 9c5051325cd94551b24c729f57ed5474063e9a1d
1
2个文件已修改
132 ■■■■■ 已修改文件
WarM/条码打印/Gy_BarCodeBill.cs 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/条码打印/Kf_WeighToBarCode.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -81,6 +81,11 @@
        public const Int16 HShowDateCol = 60;
        public const Int16 HInnerBillNoCol = 61;
        public const Int16 HMakerCol = 62;
        public const Int16 HProduceDateCol = 63;
        public const Int16 HExpiryDateCol = 64;
        public const Int16 HISKFPERIODCol = 65;
        public const Int16 HEXPUNITCol = 66;
        public const Int16 HEXPPERIODCol = 67;
        public Int16 HSelectCol = 0;
        public Int16 HSno2Col = 1;
@@ -142,6 +147,11 @@
        public Int16 HInnerBillNo2Col = 57; 
        public Int16 HMaker2Col = 58;
        public Int16 HEntryID2Col = 59;
        public Int16 HProduceDate2Col = 60;
        public Int16 HExpiryDate2Col = 61;
        public Int16 HISKFPERIOD2Col = 62;
        public Int16 HEXPUNIT2Col = 63;
        public Int16 HEXPPERIOD2Col = 64;
        //
        public  string ModName = "85";
        public  string ModCaption = "条码生成";
@@ -626,6 +636,45 @@
                    {
                        sHRemark= sHRemark+DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]);
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isBool(oDsCheck.Tables[0].Rows[0]["HISKFPERIOD"]))
                        {
                            DateTime HProduceDate;  //生产日期
                            string HEXPUNIT;        //保质期单位
                            int HEXPPERIOD;         //保质期
                            HProduceDate = dtpHDate.Value;
                            HEXPUNIT = DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HEXPUNIT"]);
                            HEXPPERIOD = DBUtility.ClsPub.isInt(oDsCheck.Tables[0].Rows[0]["HEXPPERIOD"]);
                            grdMain.Rows[j].Cells[HISKFPERIODCol].Value = 1;
                            grdMain.Rows[j].Cells[HEXPUNITCol].Value = HEXPUNIT;
                            grdMain.Rows[j].Cells[HEXPPERIODCol].Value = HEXPPERIOD.ToString();
                            grdMain.Rows[j].Cells[HProduceDateCol].Value = HProduceDate.ToShortDateString();
                            if (HEXPUNIT == "Y")
                            {
                                grdMain.Rows[j].Cells[HExpiryDateCol].Value = HProduceDate.AddYears(HEXPPERIOD).ToShortDateString();
                            }
                            else if (HEXPUNIT == "M")
                            {
                                grdMain.Rows[j].Cells[HExpiryDateCol].Value = HProduceDate.AddMonths(HEXPPERIOD).ToShortDateString();
                            }
                            else
                            {
                                grdMain.Rows[j].Cells[HExpiryDateCol].Value = HProduceDate.AddDays(HEXPPERIOD).ToShortDateString();
                            }
                        }
                        else
                        {
                            grdMain.Rows[j].Cells[HISKFPERIODCol].Value = 0;
                            grdMain.Rows[j].Cells[HEXPUNITCol].Value = "";
                            grdMain.Rows[j].Cells[HEXPPERIODCol].Value = 0;
                            grdMain.Rows[j].Cells[HProduceDateCol].Value = "";
                            grdMain.Rows[j].Cells[HExpiryDateCol].Value = "";
                        }
                    }
                }
            }
            if(sHRemark!="")
@@ -993,12 +1042,24 @@
                        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;
                        grdSub.Rows[i].Cells[HProduceDate2Col].Value = grdMain.Rows[j].Cells[HProduceDateCol].Value;
                        grdSub.Rows[i].Cells[HExpiryDate2Col].Value = grdMain.Rows[j].Cells[HExpiryDateCol].Value;
                        grdSub.Rows[i].Cells[HISKFPERIOD2Col].Value = grdMain.Rows[j].Cells[HISKFPERIODCol].Value;
                        grdSub.Rows[i].Cells[HEXPUNIT2Col].Value = grdMain.Rows[j].Cells[HEXPUNITCol].Value;
                        grdSub.Rows[i].Cells[HEXPPERIOD2Col].Value = grdMain.Rows[j].Cells[HEXPPERIODCol].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;
                        //是否启用保质期
                        DataGridViewCheckBoxCell oCell2 = new DataGridViewCheckBoxCell();
                        oCell2.ThreeState = false;
                        oCell2.Value = grdSub.Rows[i].Cells[HISKFPERIOD2Col].Value;
                        oCell2.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                        grdSub.Rows[i].Cells[HISKFPERIOD2Col] = oCell2;
                        k = k + 1;
                        n = n + 1;
                        //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
@@ -1042,6 +1103,11 @@
            string HInnerBillNo = "";
            bool HGiveAwayFlag = false;
            Int64 HEntryID = 0;
            string HProduceDate;
            string HExpiryDate;
            bool HISKFPERIOD = false;
            string HEXPUNIT = "";
            double HEXPPERIOD = 0;
            try
            {
                oCn.BeginTran();
@@ -1087,6 +1153,25 @@
                        HSeOrderSEQ = ClsPub.isLong(grdSub.Rows[i].Cells[HSeOrderSEQ2Col].Value);
                        HInnerBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HInnerBillNo2Col].Value);
                        HGiveAwayFlag = ClsPub.isBool(grdSub.Rows[i].Cells[HGiveAwayFlag2Col].Value);
                        if (ClsPub.isDate(grdSub.Rows[i].Cells[HProduceDate2Col].Value) < Convert.ToDateTime("1950-01-01"))
                        {
                            HProduceDate = "";
                        }
                        else
                        {
                            HProduceDate = ClsPub.isStrNull(grdSub.Rows[i].Cells[HProduceDate2Col].Value);
                        }
                        if (ClsPub.isDate(grdSub.Rows[i].Cells[HExpiryDate2Col].Value) < Convert.ToDateTime("1950-01-01"))
                        {
                            HExpiryDate = "";
                        }
                        else
                        {
                            HExpiryDate = ClsPub.isStrNull(grdSub.Rows[i].Cells[HExpiryDate2Col].Value);
                        }
                        HISKFPERIOD = ClsPub.isBool(grdSub.Rows[i].Cells[HISKFPERIOD2Col].Value);
                        HEXPUNIT = ClsPub.isStrNull(grdSub.Rows[i].Cells[HEXPUNIT2Col].Value);
                        HEXPPERIOD = ClsPub.isDoule(grdSub.Rows[i].Cells[HEXPPERIOD2Col].Value);
                        oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -1094,6 +1179,8 @@
                                    ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                                    ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
                                    ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " +
                                    ",HProduceDate,HExpiryDate " +
                                    ",HISKFPERIOD,HEXPUNIT,HEXPPERIOD " +
                                    ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                    ") values ("
                                    + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
@@ -1101,8 +1188,10 @@
                                    + ", " + 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() + "," + HEntryID.ToString() + ""
                                    + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString()
                                    + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + HSeOrderSEQ.ToString() + "," + HSourceEntryID.ToString()
                                    + ", " + (HProduceDate == "" ? "NULL" : "'" + HProduceDate + "'") + "," + (HExpiryDate == "" ? "NULL" : "'" + HExpiryDate + "'")
                                    + ", " + DBUtility.ClsPub.BoolToString(HISKFPERIOD) + ",'" + HEXPUNIT + "'," + HEXPPERIOD.ToString()
                                    + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')");
@@ -1509,7 +1598,7 @@
            //
            grdMain.RowCount = 0;
            grdSub.RowCount = 0;
            grdMain.ColumnCount = 63;                       //总列数
            grdMain.ColumnCount = 68;                       //总列数
            DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
            grdMain.Columns[HSnoCol].HeaderText = "序号";
            grdMain.Columns[HMainIDCol].HeaderText = "源单主ID";
@@ -1566,6 +1655,11 @@
            grdMain.Columns[HShowDateCol].HeaderText = "日期";
            grdMain.Columns[HInnerBillNoCol].HeaderText = "内部采购订单号";
            grdMain.Columns[HMakerCol].HeaderText = "制单人";
            grdMain.Columns[HProduceDateCol].HeaderText = "生产日期";
            grdMain.Columns[HExpiryDateCol].HeaderText = "有效期至";
            grdMain.Columns[HISKFPERIODCol].HeaderText = "是否启用保质期";
            grdMain.Columns[HEXPUNITCol].HeaderText = "保质期单位";
            grdMain.Columns[HEXPPERIODCol].HeaderText = "保质期";
            ////
            //格式化 
            grdMain.Columns[HTagCol].Visible = false;                           //隐藏列
@@ -1613,7 +1707,12 @@
            grdMain.Columns[HSourceIDCol].Visible = false;
            grdMain.Columns[HSourceNumberCol].Visible = false;
            grdMain.Columns[HSourceNameCol].Visible = false;
            grdMain.Columns[HProduceDateCol].Visible = false;
            grdMain.Columns[HExpiryDateCol].Visible = false;
            grdMain.Columns[HISKFPERIODCol].Visible = false;
            grdMain.Columns[HEXPUNITCol].Visible = false;
            grdMain.Columns[HEXPPERIODCol].Visible = false;
            //设置可编辑列
            string sAllowCol =  HQtyCol.ToString()+
                                "," + HMinQtyCol.ToString() +
@@ -1643,7 +1742,7 @@
            DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol,oSumGrid);
            //----------------------------
            grdSub.ColumnCount = 60;                       //总列数
            grdSub.ColumnCount = 65;                       //总列数
            DBUtility.Xt_BaseBillFun.initGridFst(grdSub, this.Name);
            grdSub.Columns[HSelectCol].HeaderText = "选择";
            grdSub.Columns[HTMCol].HeaderText = "条码编号";
@@ -1703,6 +1802,11 @@
            grdSub.Columns[HInnerBillNo2Col].HeaderText = "内部采购订单号";
            grdSub.Columns[HMaker2Col].HeaderText = "制单人";
            grdSub.Columns[HEntryID2Col].HeaderText = "行号";
            grdSub.Columns[HProduceDate2Col].HeaderText = "生产日期";
            grdSub.Columns[HExpiryDate2Col].HeaderText = "有效期至";
            grdSub.Columns[HISKFPERIOD2Col].HeaderText = "是否启用保质期";
            grdSub.Columns[HEXPUNIT2Col].HeaderText = "保质期单位";
            grdSub.Columns[HEXPPERIOD2Col].HeaderText = "保质期";
            //格式化 
            grdSub.Columns[HMaterID2Col].Visible = false;
            grdSub.Columns[HModel2Col].Visible = false;
@@ -1751,11 +1855,18 @@
            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;
                //是否启用保质期
                DataGridViewCheckBoxCell oCell2 = new DataGridViewCheckBoxCell();
                oCell2.ThreeState = false;
                oCell2.Value = 0;
                oCell2.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                grdSub.Rows[i].Cells[HISKFPERIOD2Col] = oCell2;
            }
            DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name);
WarM/ÌõÂë´òÓ¡/Kf_WeighToBarCode.cs
@@ -309,6 +309,19 @@
        private bool Sub_SaveBill()
        {
            //称重记录列表是否有记录判断
            bool b = false;
            for (int i = 0; i < grdMain.RowCount; i++)
            {
                    b = true;
                    break;
            }
            if (b == false)
            {
                MessageBox.Show("当前称重记录列表无数据,不允许换班生成单据!", "提示");
                return false;
            }
            //判断会计期是否合理
            string s = "";
            int sYear = 0;