|
|
@@ -261,29 +261,29 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
int CodeCount = 0;
|
|
|
//如果单位是KPCS则需要除1000
|
|
|
- float CollectNum = 0;
|
|
|
+ double CollectNum = 0;
|
|
|
if (CurrentUnit == "KPCS")
|
|
|
{
|
|
|
//如果单位是KPCS则必须是1000的整数倍
|
|
|
- if ((int.Parse(Data["QTY"]) > 1000 && int.Parse(Data["QTY"]) % 1000 != 0) || int.Parse(Data["QTY"]) / 1000 % float.Parse(CurrentZXBZ) != 0)
|
|
|
+ if ((int.Parse(Data["QTY"]) > 1000 && int.Parse(Data["QTY"]) % 1000 != 0) || int.Parse(Data["QTY"]) / 1000 % double.Parse(CurrentZXBZ) != 0)
|
|
|
{
|
|
|
MessageBox.Show("物料" + Data["PRCODE"] + "采集数量无法按照最小包装数拆分", "提示");
|
|
|
Input.SelectAll();
|
|
|
return;
|
|
|
}
|
|
|
- CodeCount = int.Parse((float.Parse(Data["QTY"]) / 1000 / float.Parse(CurrentZXBZ)).ToString());
|
|
|
- CollectNum = float.Parse(Data["QTY"]) / 1000;
|
|
|
+ CodeCount = int.Parse((double.Parse(Data["QTY"]) / 1000 / double.Parse(CurrentZXBZ)).ToString());
|
|
|
+ CollectNum = double.Parse(Data["QTY"]) / 1000;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (float.Parse(Data["QTY"]) % float.Parse(CurrentZXBZ) != 0)
|
|
|
+ if (double.Parse(Data["QTY"]) % double.Parse(CurrentZXBZ) != 0)
|
|
|
{
|
|
|
MessageBox.Show("采集【数量】无法按照最小包装数拆分", "提示");
|
|
|
Input.SelectAll();
|
|
|
return;
|
|
|
}
|
|
|
- CodeCount = int.Parse((float.Parse(Data["QTY"]) / float.Parse(CurrentZXBZ)).ToString());
|
|
|
- CollectNum = float.Parse(Data["QTY"]);
|
|
|
+ CodeCount = int.Parse((double.Parse(Data["QTY"]) / double.Parse(CurrentZXBZ)).ToString());
|
|
|
+ CollectNum = double.Parse(Data["QTY"]);
|
|
|
}
|
|
|
string pib_barcode = Data.ContainsKey("SERIAL") ? Data["SERIAL"] : "";
|
|
|
//获取ID
|
|
|
@@ -308,8 +308,8 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
//计算当前采集数量
|
|
|
string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
|
|
|
- float CollectQty = (collectqty == "" ? 0 : float.Parse(collectqty));
|
|
|
- if (CollectQty + CollectNum > float.Parse(CurrentPrCount))
|
|
|
+ double CollectQty = (collectqty == "" ? 0 : double.Parse(collectqty));
|
|
|
+ if (CollectQty + CollectNum > double.Parse(CurrentPrCount))
|
|
|
{
|
|
|
MessageBox.Show("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount, "提示");
|
|
|
Input.SelectAll();
|
|
|
@@ -364,16 +364,16 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
//采集后重新计数,自动跳到下一行
|
|
|
collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
|
|
|
- CollectQty = (collectqty == "" ? 0 : float.Parse(collectqty));
|
|
|
+ CollectQty = (collectqty == "" ? 0 : double.Parse(collectqty));
|
|
|
//采集达到了数量进行换行
|
|
|
- if (CollectQty == float.Parse(CurrentPrCount))
|
|
|
+ if (CollectQty == double.Parse(CurrentPrCount))
|
|
|
{
|
|
|
for (int i = 0; i < GridPrcode.Rows.Count; i++)
|
|
|
{
|
|
|
string outqty = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
|
|
|
string collectnum = GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString();
|
|
|
//采集之前的行,如后续行有物料编号相同的并且编号较大的跳到这样
|
|
|
- if (GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString() == CurrentPrCode && float.Parse(outqty) > float.Parse(collectnum == "" ? "0" : collectnum))
|
|
|
+ if (GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString() == CurrentPrCode && double.Parse(outqty) > double.Parse(collectnum == "" ? "0" : collectnum))
|
|
|
{
|
|
|
if (int.Parse(GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString()) > int.Parse(CurrentPDNO))
|
|
|
{
|
|
|
@@ -389,7 +389,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
string outqty = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
|
|
|
string collectnum = GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString();
|
|
|
- if (float.Parse(outqty) > float.Parse(collectnum == "" ? "0" : collectnum))
|
|
|
+ if (double.Parse(outqty) > double.Parse(collectnum == "" ? "0" : collectnum))
|
|
|
{
|
|
|
GridPrcode.Rows[i].Selected = true;
|
|
|
GridPrcode.FirstDisplayedScrollingRowIndex = i;
|
|
|
@@ -583,7 +583,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
string outqty = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
|
|
|
string collectnum = GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString();
|
|
|
- if (float.Parse(outqty) > float.Parse(collectnum == "" ? "0" : collectnum))
|
|
|
+ if (double.Parse(outqty) > double.Parse(collectnum == "" ? "0" : collectnum))
|
|
|
{
|
|
|
GridPrcode.Rows[i].Selected = true;
|
|
|
GridPrcode.FirstDisplayedScrollingRowIndex = i;
|
|
|
@@ -1066,7 +1066,7 @@ namespace UAS_LabelMachine
|
|
|
string CurrentPDNO = GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString();
|
|
|
string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
|
|
|
GridPrcode.Rows[i].Cells["CollectedNum"].Value = collectqty;
|
|
|
- GridPrcode.Rows[i].Cells["UnCollectedNum"].Value = float.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - float.Parse(collectqty == "" ? "0" : collectqty);
|
|
|
+ GridPrcode.Rows[i].Cells["UnCollectedNum"].Value =Convert.ToDouble( double.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - double.Parse(collectqty == "" ? "0" : collectqty)).ToString("0.00");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1287,7 +1287,7 @@ namespace UAS_LabelMachine
|
|
|
string CurrentPDNO = GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString();
|
|
|
string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
|
|
|
GridPrcode.Rows[i].Cells["CollectedNum"].Value = collectqty;
|
|
|
- GridPrcode.Rows[i].Cells["UnCollectedNum"].Value = float.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - float.Parse(collectqty == "" ? "0" : collectqty);
|
|
|
+ GridPrcode.Rows[i].Cells["UnCollectedNum"].Value =Convert.ToDouble( double.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - double.Parse(collectqty == "" ? "0" : collectqty)).ToString("0.00");
|
|
|
}
|
|
|
if (GridPrcode.Rows.Count > 0)
|
|
|
{
|