|
|
@@ -2279,33 +2279,48 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
private void GetOutBoxCode_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- int Current = 0;
|
|
|
- sql.Clear();
|
|
|
- sql.Append("select pr_qtyperplace,pd_qty,packingdetail.pd_cartonno,pr_zxbzs,packingdetail.pd_cartons from packingdetail left join packing on pd_piid=pi_id left join prodinout on ");
|
|
|
- sql.Append("pi_packingcode=packing.pi_code left join product on pd_prodcode=pr_code where pi_inoutno='" + pi_inoutno.Text + "' order by pr_code,pd_detno");
|
|
|
- dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
- {
|
|
|
- try { OutboxCapacity.Value = (decimal)dt.Rows[0]["pr_qtyperplace"] / (decimal)dt.Rows[0]["pr_zxbzs"]; }
|
|
|
- catch (Exception) { }
|
|
|
- }
|
|
|
- try
|
|
|
+ if (dh.GetConfig("UsingPacking", "ProdInOut!Sale").ToString() != "")
|
|
|
{
|
|
|
- for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ int Current = 0;
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select pr_qtyperplace,pd_qty,packingdetail.pd_cartonno,pr_zxbzs,packingdetail.pd_cartons from packingdetail left join packing on pd_piid=pi_id left join prodinout on ");
|
|
|
+ sql.Append("pi_packingcode=packing.pi_code left join product on pd_prodcode=pr_code where pi_inoutno='" + pi_inoutno.Text + "' order by pr_code,pd_detno");
|
|
|
+ dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ try { OutboxCapacity.Value = (decimal)dt.Rows[0]["pr_qtyperplace"] / (decimal)dt.Rows[0]["pr_zxbzs"]; }
|
|
|
+ catch (Exception) { }
|
|
|
+ }
|
|
|
+ try
|
|
|
{
|
|
|
- int pd_qty = int.Parse(dt.Rows[i]["pd_qty"].ToString());
|
|
|
- int pr_zxbzs = int.Parse(dt.Rows[i]["pr_zxbzs"].ToString());
|
|
|
- int pd_cartons = int.Parse(dt.Rows[i]["pd_cartons"].ToString());
|
|
|
- for (int j = 0; j < pd_qty * pd_cartons / pr_zxbzs; j++)
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- LabelInf.Rows[Current].Cells["pib_outboxcode2"].Value = dt.Rows[i]["pd_cartonno"].ToString();
|
|
|
- Current++;
|
|
|
+ int pd_qty = int.Parse(dt.Rows[i]["pd_qty"].ToString());
|
|
|
+ int pr_zxbzs = int.Parse(dt.Rows[i]["pr_zxbzs"].ToString());
|
|
|
+ int pd_cartons = int.Parse(dt.Rows[i]["pd_cartons"].ToString());
|
|
|
+ for (int j = 0; j < pd_qty * pd_cartons / pr_zxbzs; j++)
|
|
|
+ {
|
|
|
+ LabelInf.Rows[Current].Cells["pib_outboxcode2"].Value = dt.Rows[i]["pd_cartonno"].ToString();
|
|
|
+ Current++;
|
|
|
+ }
|
|
|
}
|
|
|
+ GetPackingCode = true;
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
}
|
|
|
- GetPackingCode = true;
|
|
|
}
|
|
|
- catch (Exception)
|
|
|
+ else
|
|
|
{
|
|
|
+ int BoxCode = 0;
|
|
|
+ for (int i = 0; i < LabelInf.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ if (i % OutboxCapacity.Value == 0)
|
|
|
+ {
|
|
|
+ BoxCode = BoxCode + 1;
|
|
|
+ }
|
|
|
+ LabelInf.Rows[i].Cells["pib_outboxcode2"].Value = BoxCode;
|
|
|
+ }
|
|
|
}
|
|
|
SaveGrid_Click(sender, e);
|
|
|
}
|