Commit cd7dce2c authored by mmhatre's avatar mmhatre

Purchase order protect when item code!=null and exp and mfg date auto set by...

Purchase order protect when item code!=null and  exp and mfg date auto set by item code and lot number

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205818 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ba39f818
...@@ -2516,9 +2516,10 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -2516,9 +2516,10 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
String convQtyStdm="",cctr="",acct=""; String convQtyStdm="",cctr="",acct="";
String accCodeInv="",cctrCodeInv="",grossRate="",grade="",dimension="",noArt="",unitAlt="",potencyPerc=""; String accCodeInv="",cctrCodeInv="",grossRate="",grade="",dimension="",noArt="",unitAlt="",potencyPerc="";
String tranDate="",unit="",itemSer="",acctCodeCr="",acctCodeAr="",cctrCodeAr=""; String tranDate="",unit="",itemSer="",acctCodeCr="",acctCodeAr="",cctrCodeAr="";
String ldtmfgdate1="",ldtexpirydate1="",ldtretestdate1=""; //added by manish on 22-aug-2019
int cnt = 0,stock=0; int cnt = 0,stock=0;
double rate=0.0; double rate=0.0;
Timestamp mfgDate=null,expDate=null; Timestamp mfgDate=null,expDate=null,retestDate=null; //added by manish on 22-aug-2019
FinCommon finCommon=new FinCommon(); FinCommon finCommon=new FinCommon();
DistCommon distCommon=new DistCommon(); DistCommon distCommon=new DistCommon();
...@@ -2536,6 +2537,45 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -2536,6 +2537,45 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
System.out.println("tranType>>>>"+tranType); System.out.println("tranType>>>>"+tranType);
if(lotSl==null || lotSl.trim().length()==0) if(lotSl==null || lotSl.trim().length()==0)
{ {
//added by manish mhatre on 22-aug-2019 [For Expiry and mfg date pick up in item_lot_info table]
//start manish
sql="select mfg_date, exp_date, retest_date from item_lot_info where item_code = ? and lot_no = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode);
pstmt1.setString(2, lotNo);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
mfgDate = rs1.getTimestamp(1);
expDate =rs1.getTimestamp(2);
retestDate = rs1.getTimestamp(3);
if( mfgDate != null ){
ldtmfgdate1 = sdf.format(mfgDate);
System.out.println("ldtmfgdate1"+ldtmfgdate1);
valueXmlString.append("<mfg_date protect =\"1\">").append("<![CDATA[" + ldtmfgdate1 + "]]>").append("</mfg_date>");
}
if(expDate != null)
{
ldtexpirydate1=sdf.format(expDate);
System.out.println("ldtexpirydate1"+ldtexpirydate1);
valueXmlString.append("<exp_date protect =\"1\">").append("<![CDATA[" + ldtexpirydate1 + "]]>").append("</exp_date>");
}
if(retestDate != null)
{
ldtretestdate1=sdf.format(retestDate);
System.out.println("ldtretestdate1"+ldtretestdate1);
valueXmlString.append("<retest_date protect =\"1\">").append("<![CDATA[" + ldtretestdate1 + "]]>").append("</retest_date>");
}
} //end manish
else
{
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
sql="SELECT ACCT_CODE__INV, CCTR_CODE__INV, RATE,GROSS_RATE ,GRADE,DIMENSION,NO_ART," + sql="SELECT ACCT_CODE__INV, CCTR_CODE__INV, RATE,GROSS_RATE ,GRADE,DIMENSION,NO_ART," +
"UNIT__ALT,CONV__QTY_STDUOM,POTENCY_PERC,MFG_DATE,EXP_DATE,SITE_CODE__MFG,PACK_CODE " + "UNIT__ALT,CONV__QTY_STDUOM,POTENCY_PERC,MFG_DATE,EXP_DATE,SITE_CODE__MFG,PACK_CODE " +
"FROM STOCK where item_code = ? and site_code = ? AND LOC_CODE = ? and lot_no = ? "; "FROM STOCK where item_code = ? and site_code = ? AND LOC_CODE = ? and lot_no = ? ";
...@@ -2648,10 +2688,16 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -2648,10 +2688,16 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
stock=0;*/ stock=0;*/
//Commented part by sarita as the code will execute if(cnt ==0) on 03 SEPT 2018 [END] //Commented part by sarita as the code will execute if(cnt ==0) on 03 SEPT 2018 [END]
} }
rs1.close(); if(rs1 != null )
rs1 = null; {
pstmt1.close(); rs1.close();
pstmt1=null; rs1 = null;
}
if(pstmt1!=null)
{
pstmt1.close();
pstmt1=null;
}
System.out.println("cnt@@@@@@@@@1"+cnt); System.out.println("cnt@@@@@@@@@1"+cnt);
...@@ -2843,8 +2889,48 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -2843,8 +2889,48 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
//Added by sarita to store acct_code__cr and cctr_code__cr values in dom on 03 SEP 2018 [START] //Added by sarita to store acct_code__cr and cctr_code__cr values in dom on 03 SEP 2018 [START]
} }
} }
}
else else
{ {
//added by manish mhatre on 22-aug-2019 [For Expiry and mfg date pick up in item_lot_info table]
//start manish
sql="select mfg_date, exp_date, retest_date from item_lot_info where item_code = ? and lot_no = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode);
pstmt1.setString(2, lotNo);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
mfgDate = rs1.getTimestamp(1);
expDate =rs1.getTimestamp(2);
retestDate = rs1.getTimestamp(3);
if( mfgDate != null ){
ldtmfgdate1 = sdf.format(mfgDate);
System.out.println("ldtmfgdate1"+ldtmfgdate1);
valueXmlString.append("<mfg_date protect =\"1\">").append("<![CDATA[" + ldtmfgdate1 + "]]>").append("</mfg_date>");
}
if(expDate != null)
{
ldtexpirydate1=sdf.format(expDate);
System.out.println("ldtexpirydate1"+ldtexpirydate1);
valueXmlString.append("<exp_date protect =\"1\">").append("<![CDATA[" + ldtexpirydate1 + "]]>").append("</exp_date>");
}
if(retestDate != null)
{
ldtretestdate1=sdf.format(retestDate);
System.out.println("ldtretestdate1"+ldtretestdate1);
valueXmlString.append("<retest_date protect =\"1\">").append("<![CDATA[" + ldtretestdate1 + "]]>").append("</retest_date>");
}
} //end manish
else
{
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
sql="SELECT ACCT_CODE__INV,CCTR_CODE__INV,RATE,GROSS_RATE,GRADE,DIMENSION,NO_ART,UNIT__ALT,CONV__QTY_STDUOM," + sql="SELECT ACCT_CODE__INV,CCTR_CODE__INV,RATE,GROSS_RATE,GRADE,DIMENSION,NO_ART,UNIT__ALT,CONV__QTY_STDUOM," +
"POTENCY_PERC,MFG_DATE,EXP_DATE,SITE_CODE__MFG,PACK_CODE FROM STOCK " + "POTENCY_PERC,MFG_DATE,EXP_DATE,SITE_CODE__MFG,PACK_CODE FROM STOCK " +
"WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? AND LOT_NO = ? AND LOT_SL = ? "; "WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? AND LOT_NO = ? AND LOT_SL = ? ";
...@@ -2945,10 +3031,16 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -2945,10 +3031,16 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
stock=0;*/ stock=0;*/
//Commented part by sarita as the code will execute if(cnt ==0) on 03 SEPT 2018 [END] //Commented part by sarita as the code will execute if(cnt ==0) on 03 SEPT 2018 [END]
} }
rs1.close(); if(rs1 != null )
rs1 = null; {
pstmt1.close(); rs1.close();
pstmt1=null; rs1 = null;
}
if(pstmt1!=null)
{
pstmt1.close();
pstmt1=null;
}
System.out.println("cnt@@@@@@@@@2"+cnt); System.out.println("cnt@@@@@@@@@2"+cnt);
//Added above commented code for cnt is 0 on 03 SEP 2018 [START] //Added above commented code for cnt is 0 on 03 SEP 2018 [START]
...@@ -3272,6 +3364,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -3272,6 +3364,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
//Commented and added by sarita to set acct_code__dr & cctr_code__dr values using dom on 03 SEP 2018 [END] //Commented and added by sarita to set acct_code__dr & cctr_code__dr values using dom on 03 SEP 2018 [END]
} }
} }
}
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment