|
@@ -361,6 +361,29 @@ namespace UAS_LabelMachine
|
|
|
string close = MessageBox.Show(this.ParentForm, "物料" + Data["PRCODE"] + "【DateCode】超出校验日期\n", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
if (close.ToString() != "Yes")
|
|
|
return;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (CheckDC.Checked)
|
|
|
+ {
|
|
|
+ string datecode = dh.getFieldDataByCondition("prodiobarcode", "max(case when length(pib_datecode)=4 then pib_datecode else to_char(to_date(custdate(pib_datecode),'yyyy-mm-dd'),'yyiw') end )", "PIB_CUSTCODE='" + pi_cardcode.Text + "' and pib_inoutno<>'" + pi_inoutno.Text + "' and pib_prodcode='" + Data["PRCODE"] + "'").ToString();
|
|
|
+ string datecod1 = dh.getFieldDataByCondition("dual", "case when length('" + Data["DATECODE"] + "')=4 then '" + Data["DATECODE"] + "' else to_char(to_date(custdate('" + Data["DATECODE"] + "'),'yyyy-mm-dd'),'yyiw') end", "1=1").ToString();
|
|
|
+ //客户已经出货的最大年周
|
|
|
+ string Year = datecode.Substring(0, 2);
|
|
|
+ System.DateTime dt = new DateTime(int.Parse("20" + Year), 01, 01);
|
|
|
+ string Week = datecode.Substring(2, 2);
|
|
|
+ System.DateTime dt1 = dt.AddDays(int.Parse(Week) * 7);
|
|
|
+
|
|
|
+ //当前扫码的年周
|
|
|
+ string Year1 = datecod1.Substring(0, 2);
|
|
|
+ System.DateTime dt2 = new DateTime(int.Parse("20" + Year1), 01, 01);
|
|
|
+ string Week1 = datecod1.Substring(2, 2);
|
|
|
+ System.DateTime dt3 = dt2.AddDays(int.Parse(Week1) * 7);
|
|
|
+ //当前扫码的年周
|
|
|
+ if (dt1 > dt3)
|
|
|
+ {
|
|
|
+ MessageBox.Show("客户出货日期最近DC【" + datecode + "】,不允许采集【" + Data["DATECODE"] + "】");
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
if (Data["BRAND"] != CurrentBrand)
|
|
@@ -864,7 +887,7 @@ namespace UAS_LabelMachine
|
|
|
LoadCheck = true;
|
|
|
Input.Clear();
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pi_id,pi_cardcode,pi_combine_user,pi_title,to_char(pi_date,'yyyymmdd')pi_date,nvl(pi_combine_user,0)pi_combine_user from prodinout where pi_inoutno='" + pi_inoutno.Text + "' and pi_invostatuscode='AUDITED'");
|
|
|
+ sql.Append("select pi_id,pi_cardcode,pi_combine_user,pi_title,to_char(pi_date,'yyyymmdd')pi_date,nvl(pi_combine_user,0)pi_combine_user,nvl(cu_controlinout,0)cu_controlinout from prodinout left join customer on pi_cardcode=cu_code where pi_inoutno='" + pi_inoutno.Text + "' and pi_invostatuscode='AUDITED'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
@@ -872,6 +895,7 @@ namespace UAS_LabelMachine
|
|
|
pi_title.Text = dt.Rows[0]["pi_title"].ToString();
|
|
|
pi_date.Text = dt.Rows[0]["pi_date"].ToString();
|
|
|
PI_ID = dt.Rows[0]["pi_id"].ToString();
|
|
|
+ cu_controlinout.Text = dt.Rows[0]["cu_controlinout"].ToString();
|
|
|
switch (dt.Rows[0]["pi_combine_user"].ToString())
|
|
|
{
|
|
|
case "1":
|
|
@@ -2149,7 +2173,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
//根据DateCode计算的日期
|
|
|
string Year = DateCode.Substring(0, 2);
|
|
|
- System.DateTime dt = new System.DateTime(int.Parse("20" + Year), 01, 01);
|
|
|
+ System.DateTime dt = new DateTime(int.Parse("20" + Year), 01, 01);
|
|
|
string Week = DateCode.Substring(2, 2);
|
|
|
System.DateTime dt1 = dt.AddDays(int.Parse(Week) * 7);
|
|
|
|