1
zrg
2025-05-17 c4c02944532a9bfda6de9a0cd85a9dfa631ed003
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill_automaticallyByPLC_New.cs
@@ -846,6 +846,7 @@
                        HWhID = ClsPub.isLong(grdSub.Rows[i].Cells[HWhID2Col].Value);
                        HSPID = ClsPub.isLong(grdSub.Rows[i].Cells[HSPID2Col].Value);
                        HRemark = ClsPub.isStrNull(grdSub.Rows[i].Cells[HRemark2Col].Value);
                        HRemark = "PLC自动生成";
                        HMaterName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterName2Col].Value);
                        HMaterModel = ClsPub.isStrNull(grdSub.Rows[i].Cells[HMaterModel2Col].Value);
                        HPinfan = ClsPub.isStrNull(grdSub.Rows[i].Cells[HPinfan2Col].Value);
@@ -952,14 +953,14 @@
                string LIU = "";
                int LEN = 4;
                DataSet ds;
                string sql = "select * from h_v_IF_BarCodeBillList Where HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " and HSTOCKORGID = " + HOrgID + " and CONVERT(varchar(100),条码日期, 23) = '" + HDate + "' order by æ‰¹å· desc";
                string sql = "select * from h_v_IF_BarCodeBillList Where HMaterID = " + grdMain.Rows[0].Cells[HMaterIDCol].Value + " and HSTOCKORGID = " + HOrgID + " and CONVERT(varchar(100),条码日期, 23) = '" + HDate + "' and å¤‡æ³¨ = 'PLC自动生成' order by æ‰¹å· desc";
                ds = oCn.RunProcReturn(sql, "h_v_IF_BarCodeBillList");
                if (ds != null)
                {
                    long count = 0;
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        count = ClsPub.isLong(ds.Tables[0].Rows[0]["批号"].ToString().Replace(sYear + sPeriod + sDay, ""));
                        count = ClsPub.isLong(ds.Tables[0].Rows[0]["批号"].ToString().Replace(sYear + sPeriod + sDay+" ", ""));
                    }
                    LIU += count + 1;
                    while (LIU.Length < LEN)  //如果流水号小于6位数前面补0
@@ -973,7 +974,7 @@
                }
                //拼接批号
                HBatchNo = sYear + sPeriod + sDay + LIU;
                HBatchNo = sYear + sPeriod + sDay+" " + LIU;
            }
@@ -2243,6 +2244,7 @@
                {
                    sMoney = ClsPub.isDoule(grdMain.Rows[sRow].Cells[HQtyCol].Value) / ClsPub.isDoule(grdMain.Rows[sRow].Cells[HMinQtyCol].Value);
                }
                sMoney = Math.Round(sMoney, 10);    // ä¿ç•™10位小数进行四舍五入
                sMoney = Math.Ceiling(sMoney);
                grdMain.Rows[sRow].Cells[HBQtyCol].Value = sMoney;
            }