Browse Source

精度处理

章政 7 years ago
parent
commit
87e24cc5ac
1 changed files with 4 additions and 4 deletions
  1. 4 4
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

+ 4 - 4
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -266,7 +266,7 @@ namespace UAS_LabelMachine
             if (CurrentUnit == "KPCS")
             {
                 //如果单位是KPCS则必须是1000的整数倍
-                if ((int.Parse(Data["QTY"]) > 1000 && int.Parse(Data["QTY"]) % 1000 != 0) || int.Parse(Data["QTY"]) / 1000 % double.Parse(CurrentZXBZ) != 0)
+                if (Convert.ToDouble((double.Parse(Data["QTY"]) / 1000).ToString("0.000")) % Convert.ToDouble(double.Parse(CurrentZXBZ).ToString("0.000")) != 0)
                 {
                     MessageBox.Show("物料" + Data["PRCODE"] + "采集数量无法按照最小包装数拆分", "提示");
                     Input.SelectAll();
@@ -310,7 +310,7 @@ namespace UAS_LabelMachine
             //计算当前采集数量
             string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
             double CollectQty = (collectqty == "" ? 0 : double.Parse(collectqty));
-            if (Convert.ToDouble((CollectQty + CollectNum).ToString("0.000")) > double.Parse(CurrentPrCount))
+            if (Convert.ToDouble((CollectQty + CollectNum).ToString("0.000")) > Convert.ToDouble(double.Parse(CurrentPrCount).ToString("0.000")))
             {
                 MessageBox.Show("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount, "提示");
                 Input.SelectAll();
@@ -925,11 +925,11 @@ namespace UAS_LabelMachine
                 DataTable dt;
                 if (MidLabelAutoPrint.Checked)
                 {
-                    dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号 in("+ pib_outboxcode1 + ")", "select");
+                    dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号 in(" + pib_outboxcode1 + ")", "select");
                 }
                 else
                 {
-                    dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号 in("+ pib_outboxcode1 + ") and 中盒标识='外'", "select");
+                    dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 出货单号='" + pi_inoutno.Text + "' and 中盒号 in(" + pib_outboxcode1 + ") and 中盒标识='外'", "select");
                 }
                 if (dt.Rows.Count > 0)
                 {