|
|
@@ -257,7 +257,7 @@ namespace UAS_MES.Warehouse
|
|
|
{
|
|
|
string pa_makecode = "";
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pa_outboxcode,pa_status,nvl(pa_iostatus,0) pa_iostatus,pa_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + input.Text + "' and pa_type=3");
|
|
|
+ sql.Append("select pa_outboxcode,pa_status,nvl(pa_iostatus,0) pa_iostatus,pa_makecode,pa_mothercode,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + input.Text + "' and pa_type=3");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
@@ -748,7 +748,7 @@ namespace UAS_MES.Warehouse
|
|
|
sql.Clear();
|
|
|
sql.Append("select ms_prodcode,ms_salecode,cn from (select ms_prodcode,ms_salecode,count(1)cn from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode where v_outboxcode='" + input.Text + "' ");
|
|
|
sql.Append("and ms_outno is null group by ms_prodcode,ms_salecode) left join (select pd_ordercode,pd_prodcode,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode=pd_prodcode),0)ungetqty");
|
|
|
- sql.Append(" from (select pd_ordercode,pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid=" + pi_id.Text + " group by pd_prodcode,pd_ordercode)) on ms_prodcode=pd_prodcode and ms_salecode=pd_ordercode where nvl(pd_prodcode,' ')<>' ' or nvl(pd_ordercode,' ')<>' ' or( cn>nvl(ungetqty,0))");
|
|
|
+ sql.Append(" from (select pd_ordercode,pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid=" + pi_id.Text + " group by pd_prodcode,pd_ordercode)) on 1=1 where ms_prodcode<>pd_prodcode or ms_salecode<>pd_ordercode or (cn>nvl(ungetqty,0))");
|
|
|
DataTable dtAA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dtAA.Rows.Count > 0)
|
|
|
{
|
|
|
@@ -788,19 +788,10 @@ namespace UAS_MES.Warehouse
|
|
|
OperateResult.AppendText(type + inputmessage + "已出库,请重新输入\n", Color.Red, input);
|
|
|
return false;
|
|
|
}
|
|
|
- if (dt.Rows[0]["pa_iostatus"].ToString() == "2")
|
|
|
- {
|
|
|
- OperateResult.AppendText(type + inputmessage + "已经出货\n", Color.Red, input);
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (dt.Rows[0]["pa_iostatus"].ToString() == "3")
|
|
|
- {
|
|
|
- OperateResult.AppendText(type + inputmessage + "处于销售退货状态\n", Color.Red, input);
|
|
|
- return false;
|
|
|
- }
|
|
|
+
|
|
|
if (needMakeIn != "0")
|
|
|
{
|
|
|
- if (dt.Rows[0]["pa_iostatus"].ToString() != "1")
|
|
|
+ if (dt.Rows[0]["pa_iostatus"].ToString() != "1" && dt.Rows[0]["pa_mothercode"].ToString() == "")
|
|
|
{
|
|
|
OperateResult.AppendText(type + inputmessage + "必须完工入库才允许出库\n", Color.Red, input);
|
|
|
return false;
|
|
|
@@ -814,6 +805,16 @@ namespace UAS_MES.Warehouse
|
|
|
|
|
|
if (input.Text == inputmessage)
|
|
|
{
|
|
|
+ if (dt.Rows[0]["pa_iostatus"].ToString() == "2")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(type + inputmessage + "已经出货\n", Color.Red, input);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (dt.Rows[0]["pa_iostatus"].ToString() == "3")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(type + inputmessage + "处于销售退货状态\n", Color.Red, input);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
if (dt.Rows[0]["pa_outno"].ToString() != "")
|
|
|
{
|
|
|
OperateResult.AppendText(type + inputmessage + "已经被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集\n", Color.Red, input);
|