Commit 77f27f76 authored by ajadhav's avatar ajadhav

Changes in StockUpdate and DistorderRcpConf

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@182861 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f8160258
...@@ -7,7 +7,6 @@ import ibase.webitm.ejb.ActionHandlerEJB; ...@@ -7,7 +7,6 @@ import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.fin.FinCommon; import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.fin.FinCommonInvAcct; import ibase.webitm.ejb.fin.FinCommonInvAcct;
import ibase.webitm.ejb.fin.InvAcct;
import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator; import ibase.webitm.utility.TransIDGenerator;
...@@ -17,6 +16,7 @@ import java.sql.Connection; ...@@ -17,6 +16,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.sql.Types; import java.sql.Types;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -36,6 +36,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -36,6 +36,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
{ {
DistCommon distCommon =new DistCommon(); DistCommon distCommon =new DistCommon();
CommonConstants commonConstants = new CommonConstants();
/*public void ejbCreate() throws RemoteException,CreateException{ /*public void ejbCreate() throws RemoteException,CreateException{
} }
public void ejbRemove(){ public void ejbRemove(){
...@@ -115,7 +116,9 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -115,7 +116,9 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
connStatus = true; connStatus = true;
} }
errString = actionConfirm(tranID,xtraParams, forcedFlag, conn); errString = actionConfirm(tranID,xtraParams, forcedFlag,conn);
System.out.println("errString errString::::["+errString+"]");
if(errString !=null && errString.indexOf("Error") != -1 && errString.indexOf("VTCONF") == -1) if(errString !=null && errString.indexOf("Error") != -1 && errString.indexOf("VTCONF") == -1)
{ {
...@@ -141,10 +144,12 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -141,10 +144,12 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
{ {
if (conn != null && !isError) if (conn != null && !isError)
{ {
System.out.println("Transaction Commit::::");
conn.commit(); conn.commit();
} }
else else
{ {
System.out.println("Transaction Rollback::::");
conn.rollback(); conn.rollback();
} }
conn.close(); conn.close();
...@@ -158,9 +163,11 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -158,9 +163,11 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
} }
return errString; return errString;
} }
public String actionConfirm(String tranID,String xtraParams, String forcedFlag,Connection conn) throws Exception,ITMException
//Changes done by mayur on 3-1-18 [START] {
public String actionConfirm(String tranID,String xtraParams, String forcedFlag, Connection conn) throws Exception,ITMException return actionConfirm(tranID,xtraParams, forcedFlag,"N", conn);
}
public String actionConfirm(String tranID,String xtraParams, String forcedFlag,String verifyPassword, Connection conn) throws Exception,ITMException
{ {
//Connection conn = null; //Connection conn = null;
PreparedStatement pstmt = null,pstmt1 = null; PreparedStatement pstmt = null,pstmt1 = null;
...@@ -226,24 +233,210 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -226,24 +233,210 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
String locCodeIss1 = ""; String locCodeIss1 = "";
String lotNoIss =""; String lotNoIss ="";
String lotSlIss =""; String lotSlIss ="";
int llCnt=0;
String confirmed="",confPasswd="",lsPwdVerified="",sql1="",lsLedgPostConf="",loginEmpCode="",saleOrder="",lineNoSord="",itemCodeOrd="",expLev="";
double ldQty=0.00,ldBalQty=0.00,qtytoballocated=0.00,qtyAlloc=0.00,lcAllocatedqty=0.00;
boolean lbAllocated=false,isError=false;
try{ try{
System.out.println("in dr confirm::::"); System.out.println("in dr confirm::::");
finCommon = new FinCommon(); finCommon = new FinCommon();
// finCommonInvAcct = new FinCommonInvAcct(); // finCommonInvAcct = new FinCommonInvAcct();
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
//genericUtility = GenericUtility.getInstance(); //genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
System.out.println("@V@ xtraParams :- ["+xtraParams+"]");
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"); termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
System.out.println("@V@ loginEmpCode :- ["+loginEmpCode+"]");
stkUpdMap = new HashMap(); stkUpdMap = new HashMap();
System.out.println("Getting Connection["+conn+"]");
if (conn == null) if (conn == null)
{ {
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); //conn = getConnection();
conn.setAutoCommit(false); conn.setAutoCommit(false);
connDriver = null; connDriver = null;
} }
// VALLABH KADAM gbf_post_logic validations [09/NOV/2017] START
System.out.println("@V@ First half");
sql="select count(*) as llCnt from distord_rcpdet where tran_id = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranID);
rs=pstmt.executeQuery();
if(rs.next())
{
llCnt=rs.getInt("llCnt");
}
rs.close();rs=null;
pstmt.close();pstmt=null;
System.out.println("@V@ llCnt 270:- ["+llCnt+"]");
if(llCnt==0)
{
errString = itmDBAccessEJB.getErrorString("","VTNODET1","BASE","",conn);
return errString;
}
if("mssql".equalsIgnoreCase(commonConstants.DB_NAME))
{
sql="select confirmed, conf_passwd, site_code, qc_reqd from distord_rcp (updlock) where tran_id = ?";
}
else if("db2".equalsIgnoreCase(commonConstants.DB_NAME) || "mysql".equalsIgnoreCase(commonConstants.DB_NAME))
{
sql="select confirmed, conf_passwd, site_code, qc_reqd from distord_rcp where tran_id = ? for update";
}
else
{
sql="select confirmed, conf_passwd, site_code, (case when qc_reqd is null then 'N' else qc_reqd end) as qc_reqd"
+ " from distord_rcp where tran_id = ? for update nowait";
// sql="select confirmed, conf_passwd, site_code, (case when qc_reqd is null then 'N' else qc_reqd end) as qc_reqd"
// + " from distord_rcp where tran_id = ?";
}
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranID);
rs=pstmt.executeQuery();
if(rs.next())
{
confirmed=checkNullAndTrim(rs.getString("confirmed"));
confPasswd=checkNullAndTrim(rs.getString("conf_passwd"));
siteCode=checkNullAndTrim(rs.getString("site_code"));
qcReqd=checkNullAndTrim(rs.getString("qc_reqd"));
}
rs.close();rs=null;
pstmt.close();pstmt=null;
System.out.println("@V@ confirmed 300:- ["+confirmed+"]");
System.out.println("@V@ confPasswd 301:- ["+confPasswd+"]");
System.out.println("@V@ siteCode 302:- ["+siteCode+"]");
System.out.println("@V@ qcReqd 303:- ["+qcReqd+"]");
qcReqd=qcReqd==null || qcReqd.trim().length()==0?"N":qcReqd.trim();
if("Y".equalsIgnoreCase(confirmed))
{
errString = itmDBAccessEJB.getErrorString("","VTDIST15","BASE","",conn);
return errString;
}
if(confPasswd!=null && confPasswd.trim().length()>0 && "N".equalsIgnoreCase(verifyPassword))
{
/**UnComment By Onkar Rane On 20/03/2018 for Password Validation**/
errString = itmDBAccessEJB.getErrorString("","VTPASS1","BASE","",conn);
return errString;
/**Closed...**/
// lsPwdVerified = distCommon.getDisparams("999999","passwordVerified",conn);
//lsPwdVerified = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "passwordVerified");
//System.out.println("@V@ lsPwdVerified 316:- ["+lsPwdVerified+"]");
// VALLABH KADAM [20/NOV/2017] not required after source review START
// if(lsPwdVerified==null || lsPwdVerified.trim().length()==0 || !"Y".equalsIgnoreCase(lsPwdVerified))
// {
// errString = itmDBAccessEJB.getErrorString("","VTPASS1","BASE","",conn);
// return errString;
// }
// VALLABH KADAM [20/NOV/2017] not required after source review END
}
sql="select dist_order,item_code,sum(quantity) as ldQty from distord_rcpdet where tran_id = ? group by dist_order,item_code";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranID);
rs=pstmt.executeQuery();
while(rs.next())
{
distOrder = checkNullAndTrim(rs.getString("dist_order"));
itemCode= checkNullAndTrim(rs.getString("item_code"));
ldQty=rs.getDouble("ldQty");
System.out.println("@V@ distOrder 334:- ["+distOrder+"]");
System.out.println("@V@ itemCode 335:- ["+itemCode+"]");
System.out.println("@V@ ldQty 336:- ["+ldQty+"]");
sql1="select sum( (qty_confirm + (qty_confirm * (case when OVER_SHIP_PERC is null then 1 when OVER_SHIP_PERC = 0 then 1 else OVER_SHIP_PERC end ) / 100 ) ) - qty_received) as ldBalQty"
+ " from distorder,distorder_det"
+ " where distorder.dist_order = distorder_det.dist_order"
+ " and distorder_det.dist_order = ?"
+ " and distorder_det.item_code = ?"
+ " and distorder.confirmed = 'Y'";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1, distOrder);
pstmt1.setString(2, itemCode);
rs1=pstmt1.executeQuery();
if(rs1.next())
{
ldBalQty=rs1.getDouble("ldBalQty");
System.out.println("@V@ ldBalQty 351:- ["+ldBalQty+"]");
if(ldQty > ldBalQty)
{
errString = itmDBAccessEJB.getErrorString("","VTQTYRC","BASE","",conn);
return errString;
}
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
}
rs.close();rs=null;
pstmt.close();pstmt=null;
sql="select count(1) as llQcreqdCtr from distord_rcpdet a, item b where a.item_code = b.item_code and a.tran_id = ? and b.qc_reqd = 'Y'";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranID);
rs=pstmt.executeQuery();
if(rs.next())
{
llCnt=rs.getInt("llQcreqdCtr");
}
rs.close();rs=null;
pstmt.close();pstmt=null;
System.out.println("@V@ llCnt 374:- ["+llCnt+"]");
if(!"Y".equalsIgnoreCase(qcReqd) && llCnt>0)
{
errString = itmDBAccessEJB.getErrorString("","VTQCREQD","BASE","",conn);
return errString;
}
sql="select (case when ledg_post_conf is null then 'N' else ledg_post_conf end) as lsLedgPostConf from transetup where tran_window = 'w_dist_receipt'";
pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery();
if(rs.next())
{
lsLedgPostConf=checkNullAndTrim(rs.getString("lsLedgPostConf"));
}
rs.close();rs=null;
pstmt.close();pstmt=null;
System.out.println("@V@ lsLedgPostConf 390:- ["+lsLedgPostConf+"]");
if("Y".equalsIgnoreCase(lsLedgPostConf))
{
sql="update distord_rcp set tran_date = SYSDATE where tran_id =?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranID);
llCnt=pstmt.executeUpdate();
pstmt.close();pstmt=null;
System.out.println("@V@ Update cnt :- ["+llCnt+"]");
}
if(loginEmpCode==null || loginEmpCode.trim().length()==0)
{
errString = itmDBAccessEJB.getErrorString("","EMPAPRV","BASE","",conn);
return errString;
}
else
{
sql="update distord_rcp set emp_code__aprv = ? where tran_id =?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, loginEmpCode);
pstmt.setString(2, tranID);
llCnt=pstmt.executeUpdate();
pstmt.close();pstmt=null;
System.out.println("@V@ Update cnt :- ["+llCnt+"]");
}
// VALLABH KADAM gbf_post_logic validations [09/NOV/2017] END
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
sql = " select tran_id__iss, site_code, loc_code__git, tran_date, " sql = " select tran_id__iss, site_code, loc_code__git, tran_date, "
+" site_code__ship, ( case when qc_reqd is null then 'N' else qc_reqd end ) qc_reqd, " +" site_code__ship, ( case when qc_reqd is null then 'N' else qc_reqd end ) qc_reqd, "
...@@ -556,7 +749,8 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -556,7 +749,8 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
//System.out.println("sql-------------"+sql); //System.out.println("sql-------------"+sql);
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,tranID); //pstmt1.setString(1,tranID);// commented by azhar as tran id of issue should be used
pstmt1.setString(1,tranIdIss);
pstmt1.setString(2,itemCode); pstmt1.setString(2,itemCode);
pstmt1.setString(3,lotNo); pstmt1.setString(3,lotNo);
pstmt1.setString(4, lotSl); pstmt1.setString(4, lotSl);
...@@ -684,8 +878,6 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -684,8 +878,6 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
acctCodeInv =" "; acctCodeInv =" ";
cctrCodeInv = " "; cctrCodeInv = " ";
} }
//added by azhar [31/JAN/2017][START] //added by azhar [31/JAN/2017][START]
quarLock = distCommon.getDisparams("999999", "QUARNTINE_LOCKCODE", conn);//TODO migrate from pb quarLock = distCommon.getDisparams("999999", "QUARNTINE_LOCKCODE", conn);//TODO migrate from pb
System.out.println("quarantine lock code befor trantype I::" + quarLock); System.out.println("quarantine lock code befor trantype I::" + quarLock);
...@@ -977,21 +1169,25 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -977,21 +1169,25 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
pstmt1 = null; pstmt1 = null;
if(tranIdIss != null && tranIdIss.trim().length() > 0) if(tranIdIss != null && tranIdIss.trim().length() > 0)
{ {
sql ="select loc_code from distord_issdet where tran_id = ? " sql ="select loc_code,lot_no from distord_issdet where tran_id = ? "
+" and item_code = ? " +" and item_code = ? "
+" and lot_no = ? " //+" and lot_no = ? " // commented by azhar[19-May-2017] as lot no changes in rcp_det if gen_lot_no is Y
+" and line_no = ? " // changed by azhar[19-May-2017] lot no of issue to be taken line wise
+" and lot_sl = ? " ; +" and lot_sl = ? " ;
//System.out.println("sql-------------"+sql); //System.out.println("sql-------------"+sql);
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,tranID); //pstmt1.setString(1,tranID); //commented by azhar[19-May-2017][Tran id of distribution issue should be used]
pstmt1.setString(1,tranIdIss);
pstmt1.setString(2,itemCode); pstmt1.setString(2,itemCode);
pstmt1.setString(3,lotNo); //pstmt1.setString(3,lotNo);
pstmt1.setString(3,lineNo); // changed by azhar[19-May-2017] lot no of issue to be taken line wise
pstmt1.setString(4,lotSl); pstmt1.setString(4,lotSl);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()) if(rs1.next())
{ {
locCodeIss=rs1.getString("loc_code"); locCodeIss=rs1.getString("loc_code");
lotNoIss = rs1.getString("lot_no");
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
...@@ -1012,8 +1208,10 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1012,8 +1208,10 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
//System.out.println("sql-------------"+sql); //System.out.println("sql-------------"+sql);
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,itemCode); pstmt1.setString(1,itemCode);
pstmt1.setString(2,locCodeIss); //pstmt1.setString(2,locCodeIss);//commented by azhar[19-May-2017] as location should be of receipt as per pb component
pstmt1.setString(3,lotNo); pstmt1.setString(2,locCode);
//pstmt1.setString(3,lotNo); // commented by azhar[19-May-2017] as lot no changes in rcp_det if gen_lot_no is Y
pstmt1.setString(3,lotNoIss);
pstmt1.setString(4,lotSl); pstmt1.setString(4,lotSl);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
...@@ -1508,17 +1706,6 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1508,17 +1706,6 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
} }
//Modified By Umakanta on 17-OCT-2016[]End //Modified By Umakanta on 17-OCT-2016[]End
} }
//Modified by mayur on 03-JAN-2018[START]
if(errString ==null || errString.indexOf("Error") == -1)
{
InvAcct invacct = new InvAcct();
errString = invacct.acctDisRcptPost(tranID,conn);
System.out.println("Returning Result "+errString);
}
//Modified by mayur on 03-JAN-2018[END]
if(errString !=null && errString.indexOf("Error") != -1) if(errString !=null && errString.indexOf("Error") != -1)
{ {
System.out.println("Returning Result "+errString); System.out.println("Returning Result "+errString);
...@@ -1622,6 +1809,107 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1622,6 +1809,107 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
errString = itmDBAccessEJB.getErrorString("","VTCONF","","",conn); errString = itmDBAccessEJB.getErrorString("","VTCONF","","",conn);
}*/ }*/
//Changed by wasim on 20-11-2015 for work order allocation for AWMS [START] //Changed by wasim on 20-11-2015 for work order allocation for AWMS [START]
// VALLABH KADAM [20/NOV/2017] not required after source review START
//
// System.out.println("@V@ In second half");
// sql="select sale_order from distorder a, distord_rcp b where a.dist_order = b.dist_order and b.tran_id = ?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, tranID);
// rs=pstmt.executeQuery();
// if(rs.next())
// {
// saleOrder=rs.getString("sale_order");
// }
// rs.close();rs=null;
// pstmt.close();pstmt=null;
// System.out.println("@V@ saleOrder 1804:- ["+saleOrder+"]");
// if(saleOrder!=null && saleOrder.trim().length()>0)
// {
// /**
// * Commented as per suggested [17/NOV/2017] START
// * */
//// errString = gbfStockAllocate(tranID,conn,userId,termId);
//// if(errString!=null && errString.trim().length()>0)
//// {
//// return errString;
//// }
// /**
// * Commented as per suggested [17/NOV/2017] END
// * */
//
// sql="select o.LINE_NO__SORD, r.quantity, r.item_code from distord_rcpdet r, distorder_det o"
// + " where o.dist_order = r.dist_order and o.line_no = r.LINE_NO_DIST_ORDER"
// + " and o.SALE_ORDER = ? and o.LINE_NO__SORD is not null and r.tran_id = ?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, saleOrder);
// pstmt.setString(2, tranID);
// rs=pstmt.executeQuery();
// while(rs.next())
// {
// lineNoSord=rs.getString("LINE_NO__SORD");
// qtytoballocated=rs.getDouble("quantity");
// itemCode=rs.getString("item_code");
//
// System.out.println("@V@ lineNoSord 1826:- ["+lineNoSord+"]");
// System.out.println("@V@ saleOrder 1827:- ["+1804+"]");
// System.out.println("@V@ saleOrder 1828:- ["+1804+"]");
//
// sql1="select item_code__ord,exp_lev,QTY_ALLOC from sorditem where sale_order = ? and line_no = ? and line_type = 'I'";
// pstmt1=conn.prepareStatement(sql1);
// pstmt1.setString(1, saleOrder);
// pstmt1.setString(2, lineNoSord);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// itemCodeOrd=rs1.getString("item_code__ord");
// expLev=rs1.getString("exp_lev");
// qtyAlloc=rs1.getDouble("QTY_ALLOC");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
//
// if(qtyAlloc < qtytoballocated)
// {
// lbAllocated = false;
// break;
// }
//
// sql1="select sum( QTY_ALLOC) lc_allocatedqty from sordalloc"
// + " where sale_order = ? and line_no = ? and exp_lev = ? and item_code__ord = ? and item_code = ?";
// pstmt1=conn.prepareStatement(sql1);
// pstmt1.setString(1, saleOrder);
// pstmt1.setString(2, lineNoSord);
// pstmt1.setString(3, expLev);
// pstmt1.setString(4, itemCodeOrd);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// lcAllocatedqty=rs1.getDouble("lc_allocatedqty");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
//
// if(lcAllocatedqty < qtytoballocated)
// {
// lbAllocated = false;
// break;
// }
// } // END WHILE LOOP
// rs.close();rs=null;
// pstmt.close();pstmt=null;
//
// if(!lbAllocated)
// {
// errString = itmDBAccessEJB.getErrorString("","VTNOTALLOC","BASE","",conn);
// return errString;
// }
// }// SORDER IF END
//
//
//
// VALLABH KADAM [20/NOV/2017] not required after source review END
if((errString !=null && errString.indexOf("Error") != -1) || (errString != null && errString.trim().length() > 0)) if((errString !=null && errString.indexOf("Error") != -1) || (errString != null && errString.trim().length() > 0))
{ {
conn.rollback(); conn.rollback();
...@@ -1641,6 +1929,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1641,6 +1929,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
ie.printStackTrace(); ie.printStackTrace();
errString = itmDBAccessEJB.getErrorString("","VTDESNCONF","","",conn); errString = itmDBAccessEJB.getErrorString("","VTDESNCONF","","",conn);
System.out.println("Returnng String From DistOrderRcpConfEJB :"+errString); System.out.println("Returnng String From DistOrderRcpConfEJB :"+errString);
isError=true;
return errString; return errString;
}catch(Exception e){ }catch(Exception e){
System.out.println("Exception in Confirm [DistOrderRcpConfEJB]"+e); System.out.println("Exception in Confirm [DistOrderRcpConfEJB]"+e);
...@@ -1648,6 +1937,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1648,6 +1937,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
e.printStackTrace(); e.printStackTrace();
errString = itmDBAccessEJB.getErrorString("","VTDESNCONF","","",conn); errString = itmDBAccessEJB.getErrorString("","VTDESNCONF","","",conn);
System.out.println("Returnng String From DistOrderRcpConfEJB :"+errString); System.out.println("Returnng String From DistOrderRcpConfEJB :"+errString);
isError=true;
return errString; return errString;
} }
finally finally
...@@ -1660,12 +1950,598 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1660,12 +1950,598 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
{ {
conn = null; conn = null;
}*/ }*/
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1=null;
}
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd=null;
}
if(conn!=null)
{
if(isError)
{
conn.rollback();
// conn.close();
// conn=null;
}
else
{
conn.commit();
// conn.close();
// conn=null;
}
}
}catch(Exception e){System.out.println("Exception : "+e);e.printStackTrace();} }catch(Exception e){System.out.println("Exception : "+e);e.printStackTrace();}
} }
System.out.println("Returnng String From DistOrderRcpConfEJB :"+errString); System.out.println("Returnng String From DistOrderRcpConfEJB :"+errString);
return errString; return errString;
} }
//Changes done by mayur on 3-1-18 [END] /**
* Commented as per suggested [17/NOV/2017] START
* */
// private String gbfStockAllocate(String tranID, Connection conn,String userId,String termId) throws ITMException
// {
// // TODO Auto-generated method stub
// String errStr="",sql="",sql1="";
// PreparedStatement pstmt=null,pstmt1=null;
// ResultSet rs=null,rs1=null;
// int liLineNo=0,lcLineDorder=0,lsLineSord=0,llSoCnt=0,insrtCnt=0;
// String lsDistOrd="",lsItemcode="",lsLotno="",lsLotsl="",lsLocCode="",lsPackInstr="",lsDimension="",lsSaleorder="";
// String lsItemOrd="",lsExpLev="",lsItemref="",lsSitecode="",munit="",mstatus="",lsGrade="",lsSitecodeMfg="",munitStd="";
// double lcQuantityAlloc=0.00,ldGrosswt=0.00,ldTarewt=0.00,ldNetwt=0.00,mquantity=0.00,mconvQty=0.00;
// Timestamp mexpDate=null,mmfgDate=null;
//
// HashMap lstrAllocateHashMap=new HashMap();
//
// try {
// sql="select line_no,dist_order,item_code,lot_no,lot_sl,loc_code,quantity,line_no_dist_order,pack_instr,gross_weight,tare_weight,"
// + "net_weight,dimension from distord_rcpdet where tran_id=?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, tranID);
// rs=pstmt.executeQuery();
// while(rs.next())
// {
// liLineNo=rs.getInt("line_no");
// lsDistOrd=rs.getString("dist_order");
// lsItemcode=rs.getString("item_code");
// lsLotno=rs.getString("lot_no");
// lsLotsl=rs.getString("lot_sl");
// lsLocCode=rs.getString("loc_code");
// lcQuantityAlloc=rs.getDouble("quantity");
// lcLineDorder=rs.getInt("line_no_dist_order");
// lsPackInstr=rs.getString("pack_instr");
// ldGrosswt=rs.getDouble("gross_weight");
// ldTarewt=rs.getDouble("tare_weight");
// ldNetwt=rs.getDouble("net_weight");
// lsDimension=rs.getString("dimension");
//
// sql1="select sale_order from distorder where dist_order =?";
// pstmt1=conn.prepareStatement(sql1);
// pstmt1.setString(1, lsDistOrd);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// lsSaleorder=rs1.getString("sale_order");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
//
// sql1="select line_no__sord from distorder_det where dist_order = ? and line_no = ?";
// pstmt1=conn.prepareStatement(sql1);
// pstmt1.setString(1, lsDistOrd);
// pstmt1.setInt(2, lcLineDorder);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// lsLineSord=rs1.getInt("line_no__sord");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
//
// sql1="select item_code__ord,exp_lev,item_ref,site_code,quantity - qty_desp as mquantity, unit,status"
// + " from sorditem where sale_order = ? and line_no = ? and line_type = 'I'";
// pstmt1=conn.prepareStatement(sql1);
// pstmt1.setString(1, lsSaleorder);
// pstmt1.setInt(2, lsLineSord);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// lsItemOrd=rs1.getString("item_code__ord");
// lsExpLev=rs1.getString("exp_lev");
// lsItemref=rs1.getString("item_ref");
// lsSitecode=rs1.getString("site_code");
// mquantity=rs1.getDouble("mquantity");
// munit=rs1.getString("unit");
// mstatus=rs1.getString("status");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
//
// sql1="select grade,exp_date,mfg_date,site_code__mfg from stock"
// + " where item_code = ? and site_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
// pstmt1=conn.prepareStatement(sql1);
// pstmt1.setString(1, lsSaleorder);
// pstmt1.setInt(2, lsLineSord);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// lsGrade=rs1.getString("grade");
// mexpDate=rs1.getTimestamp("exp_date");
// mmfgDate=rs1.getTimestamp("mfg_date");
// lsSitecodeMfg=rs1.getString("site_code__mfg");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
//
// sql1="select conv__qty_stduom,unit__std from sorddet where sale_order = ? and line_no = ?";
// pstmt1=conn.prepareStatement(sql1);
// pstmt1.setString(1, lsSaleorder);
// pstmt1.setInt(2, lsLineSord);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// mconvQty=rs1.getDouble("conv__qty_stduom");
// munitStd=rs1.getString("unit__std");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
//
// sql1="select count(*) as ll_so_cnt from sordalloc"
// + " where sale_order = ? and line_no = "
// + " and exp_lev = ? and item_code__ord = ?"
// + " and item_code = ? and lot_no = ?"
// + " and lot_sl = ? and loc_code = ?";
// pstmt1=conn.prepareStatement(sql1);
// pstmt1.setString(1, lsSaleorder);
// pstmt1.setInt(2, lsLineSord);
// pstmt1.setString(3, lsExpLev);
// pstmt1.setString(4, lsItemOrd);
// pstmt1.setString(5, lsItemcode);
// pstmt1.setString(6, lsLotno);
// pstmt1.setString(7, lsLotsl);
// pstmt1.setString(8, lsLocCode);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// llSoCnt=rs1.getInt("ll_so_cnt");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
//
// if(llSoCnt>0)
// {
// sql="insert into sordalloc (sale_order,line_no,exp_lev,item_code__ord,item_code,lot_no,"
// + " lot_sl,loc_code,item_ref,quantity,unit,qty_alloc,date_alloc,"
// + " status,item_grade,exp_date,alloc_mode,site_code,conv__qty_stduom,"
// + " unit__std,quantity__stduom,mfg_date,site_code__mfg,ref_id__alloc,ref_line__no)"
// + " values(?,?,?,?,?,?,?,?,?,?,?,'SYSDATE',?,?,?,?,'A',?,?,?,? * ? ,?,?,?,?)";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, lsSaleorder);
// pstmt.setInt(2, lsLineSord);
// pstmt.setString(3, lsExpLev);
// pstmt.setString(4, lsItemOrd);
// pstmt.setString(5, lsItemcode);
// pstmt.setString(6, lsLotno);
// pstmt.setString(7, lsLotsl);
// pstmt.setString(8, lsLocCode);
// pstmt.setString(9, lsItemref);
// pstmt.setDouble(10, mquantity);
// pstmt.setString(11, munit);
// pstmt.setDouble(12, lcQuantityAlloc);
// pstmt.setString(13, mstatus);
// pstmt.setString(14, lsGrade);
// pstmt.setTimestamp(15, mexpDate);
// pstmt.setString(16, lsSitecode);
// pstmt.setDouble(17, mconvQty);
// pstmt.setString(18, munitStd);
// pstmt.setDouble(19, lcQuantityAlloc);
// pstmt.setDouble(20, mconvQty);
// pstmt.setTimestamp(21, mmfgDate);
// pstmt.setString(22, lsSitecodeMfg);
// pstmt.setString(23, tranID);
// pstmt.setInt(24, liLineNo);
// insrtCnt=pstmt.executeUpdate();
// pstmt.close();pstmt=null;
//
// System.out.println("@V@ insrtCnt 2076:- ["+insrtCnt+"]");
// }
// else
// {
// sql="update sordalloc set qty_alloc = qty_alloc + ?, quantity__stduom = (qty_alloc + ?) * ?, status = 'D',"
// + " ref_id__alloc = ?,ref_line__no = ? where sale_order = ? and line_no = ?"
// + " and exp_lev = ? and item_code__ord = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setDouble(1, lcQuantityAlloc);
// pstmt.setDouble(2, lcQuantityAlloc);
// pstmt.setDouble(3, mconvQty);
// pstmt.setString(4, tranID);
// pstmt.setInt(5, liLineNo);
// pstmt.setString(6, lsSaleorder);
// pstmt.setInt(7, lsLineSord);
// pstmt.setString(8, lsExpLev);
// pstmt.setString(9, lsItemOrd);
// pstmt.setString(10, lsItemcode);
// pstmt.setString(11, lsLotno);
// pstmt.setString(12, lsLotsl);
// pstmt.setString(13, lsLocCode);
// insrtCnt=pstmt.executeUpdate();
// pstmt.close();pstmt=null;
//
// System.out.println("@V@ update count 2100 :- ["+insrtCnt+"]");
// }
//
// sql="update sorder set alloc_flag = 'Y' where sale_order =?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, lsSaleorder);
// insrtCnt=pstmt.executeUpdate();
// pstmt.close();pstmt=null;
//
// System.out.println("@V@ update count 2104 :- ["+insrtCnt+"]");
//
// sql="update sorditem set qty_alloc = qty_alloc + ? where sale_order = ? and line_no = ? and exp_lev =?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setDouble(1, lcQuantityAlloc);
// pstmt.setString(2, lsSaleorder);
// pstmt.setInt(3, lsLineSord);
// pstmt.setString(4, lsExpLev);
// insrtCnt=pstmt.executeUpdate();
// pstmt.close();pstmt=null;
//
// System.out.println("@V@ update count 2120 :- ["+insrtCnt+"]");
//
// sql="update stock set gross_weight = ?, tare_weight = ?, net_weight = ?, pack_instr = ?,"
// + " dimension = ? where item_code = ? and site_code = ?"
// + " and loc_code = ? and lot_no = ? and lot_sl =?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setDouble(1, ldGrosswt);
// pstmt.setDouble(2, ldTarewt);
// pstmt.setDouble(3, ldNetwt);
// pstmt.setString(4, lsPackInstr);
// pstmt.setString(5, lsDimension);
// pstmt.setString(6, lsItemcode);
// pstmt.setString(7, lsSitecode);
// pstmt.setString(8, lsLocCode);
// pstmt.setString(9, lsLotno);
// pstmt.setString(10, lsLotsl);
// insrtCnt=pstmt.executeUpdate();
// pstmt.close();pstmt=null;
//
// System.out.println("@V@ update count 2139 :- ["+insrtCnt+"]");
//
// lstrAllocateHashMap.put("ref_ser", "D-RCP");
// lstrAllocateHashMap.put("ref_id", tranID);
// lstrAllocateHashMap.put("ref_line", liLineNo);
// lstrAllocateHashMap.put("site_code", lsSitecode);
// lstrAllocateHashMap.put("item_code", lsItemcode);
// lstrAllocateHashMap.put("loc_code", lsLocCode);
// lstrAllocateHashMap.put("lot_no", lsLotno);
// lstrAllocateHashMap.put("lot_sl", lsLotsl);
// lstrAllocateHashMap.put("alloc_qty", lcQuantityAlloc);
// lstrAllocateHashMap.put("lot_sl", lsLotsl);
// lstrAllocateHashMap.put("chg_user", userId);
// lstrAllocateHashMap.put("chg_term", termId);
// lstrAllocateHashMap.put("chg_win", "W_DIST_RECEIPT");
//
//
// InvAllocTraceBean invBean = new InvAllocTraceBean();
// errStr = invBean.updateInvallocTrace(lstrAllocateHashMap,conn);
//// errStr = gbfUpdAllocTrace(lstrAllocateHashMap,conn,userId);
//
// }
// rs.close();rs=null;
// pstmt.close();pstmt=null;
// }
// catch (SQLException e)
// {
// // TODO Auto-generated catch block
// e.printStackTrace();
// throw new ITMException(e);
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// throw new ITMException(e);
// }
// finally
// {
// try {
// if(pstmt!=null)
// {
// pstmt.close();
// pstmt=null;
// }
// if(pstmt1!=null)
// {
// pstmt1.close();
// pstmt1=null;
// }
// if(rs!=null)
// {
// rs.close();
// rs=null;
// }
// if(rs1!=null)
// {
// rs1.close();
// rs1=null;
// }
// } catch (SQLException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
// return errStr;
// }
/**
* Commented as per suggested [17/NOV/2017] START
* */
// private String gbfUpdAllocTrace(HashMap<String, String> lstrAllocateHashMap, Connection conn,String userId) throws ITMException
// {
// // TODO Auto-generated method stub
// String errStr="",sql="",lsStkOpt="",lsKeystr="",sql1="",lsTRanId="",holdLock="N";
// PreparedStatement pstmt=null,pstmt1=null;
// ResultSet rs=null,rs1=null;
// int llCnt=0,insrtCnt=0;
// ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
// double lcTempallocqty=0.00;
//
// try {
// sql="select stk_opt from item where item_code =?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, lstrAllocateHashMap.get("item_code"));
// rs=pstmt.executeQuery();
// if(rs.next())
// {
// lsStkOpt=rs.getString("stk_opt");
// }
// rs.close();rs=null;
// pstmt.close();pstmt=null;
//
// sql="select key_string from transetup where upper(tran_window) = 'T_ALLOCTRACE'";
// pstmt=conn.prepareStatement(sql);
// rs=pstmt.executeQuery();
// if(rs.next())
// {
// lsKeystr=rs.getString("key_string");
//
// if(lsKeystr==null || lsKeystr.trim().length()==0)
// {
// sql1="select key_string from transetup where upper(tran_window) = 'GENERAL'";
// pstmt1=conn.prepareStatement(sql1);
// rs1=pstmt1.executeQuery();
// if(rs1.next())
// {
// lsKeystr=rs.getString("key_string");
// }
// rs1.close();rs1=null;
// pstmt1.close();pstmt1=null;
// }
// }
// rs.close();rs=null;
// pstmt.close();pstmt=null;
//
//
// String xmlValues = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
// xmlValues = xmlValues + "<Header></Header>";
// xmlValues = xmlValues + "<Detail1>";
// xmlValues = xmlValues + "<tran_id></tran_id>";
// xmlValues = xmlValues + "<site_code>"+lstrAllocateHashMap.get("site_code")+"</site_code>";
// xmlValues = xmlValues + "<tran_date>"+getCurrdateAppFormat()+"</tran_date>";
// xmlValues = xmlValues + "</Detail1></Root>";
//
// lsTRanId=generateTranIdForAllocTrace("T_ALLOCTRACE",xmlValues,userId,conn);
//
// if("N".equalsIgnoreCase(holdLock) && !"QC-ORD".equalsIgnoreCase(lstrAllocateHashMap.get("ref_ser").toString()))
// {
// sql="Select count(1) as ll_count From inv_hold a, inv_hold_det b"
// + " Where a.tran_id = b.tran_id And b.item_code = ?"
// + " And (b.site_code = ? or b.site_code is null )"
// + " And (b.loc_code = ? or b.loc_code is null )"
// + " And (b.lot_no = ? or b.lot_no is null )"
// + " And (b.lot_sl = ? or b.lot_sl is null )"
// + " And a.confirmed='Y' And b.hold_status ='H'";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, lstrAllocateHashMap.get("item_code"));
// pstmt.setString(2, lstrAllocateHashMap.get("site_code"));
// pstmt.setString(3, lstrAllocateHashMap.get("loc_code"));
// pstmt.setString(4, lstrAllocateHashMap.get("lot_no"));
// pstmt.setString(5, lstrAllocateHashMap.get("lot_sl"));
// rs=pstmt.executeQuery();
// if(rs.next())
// {
// llCnt=rs.getInt("ll_count");
// }
// rs.close();rs=null;
// pstmt.close();pstmt=null;
//
// if(llCnt>0)
// {
// errStr=itmDBAccessEJB.getErrorString("","VTSTKHOLD","","",conn);
// }
// }
// if("db2".equalsIgnoreCase(commonConstants.DB_NAME) || "mysql".equalsIgnoreCase(commonConstants.DB_NAME))
// {
// sql="select alloc_qty from stock where item_code = ?"
// + " and site_code = ? and loc_code = ?"
// + " and lot_no = ? and lot_sl = ? for update";
// }
// else if("mssql".equalsIgnoreCase(commonConstants.DB_NAME))
// {
// sql="select alloc_qty from stock (updlock)"
// + " where item_code = ? and site_code = ?"
// + " and loc_code = ? and lot_no = ? and lot_sl = ?";
// }
// else
// {
// sql="select alloc_qty from stock where item_code = ?"
// + " and site_code = ? and loc_code = ?"
// + " and lot_no = ? and lot_sl = ? for update nowait";
// }
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, lstrAllocateHashMap.get("item_code"));
// pstmt.setString(2, lstrAllocateHashMap.get("site_code"));
// pstmt.setString(3, lstrAllocateHashMap.get("loc_code"));
// pstmt.setString(4, lstrAllocateHashMap.get("lot_no"));
// pstmt.setString(5, lstrAllocateHashMap.get("lot_sl"));
// rs=pstmt.executeQuery();
// if(rs.next())
// {
// lcTempallocqty=rs.getDouble("alloc_qty");
// }
// rs.close();rs=null;
// pstmt.close();pstmt=null;
//
// sql="Insert into invalloc_trace (tran_id, tran_date, ref_ser, ref_id, ref_line, item_code, site_code, loc_code, lot_no, lot_sl,"
// + " alloc_qty, chg_win, chg_user, chg_term, chg_date )"
// + " values (?,SYSDATE,?,?,?,?,?,?,?,?,?,?,?,?,SYSDATE)";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, lsTRanId);
// pstmt.setString(2, lstrAllocateHashMap.get("ref_ser"));
// pstmt.setString(3, lstrAllocateHashMap.get("ref_id"));
// pstmt.setString(4, lstrAllocateHashMap.get("ref_line"));
// pstmt.setString(5, lstrAllocateHashMap.get("item_code"));
// pstmt.setString(6, lstrAllocateHashMap.get("site_code"));
// pstmt.setString(7, lstrAllocateHashMap.get("loc_code"));
// pstmt.setString(8, lstrAllocateHashMap.get("lot_no"));
// pstmt.setString(9, lstrAllocateHashMap.get("lot_sl"));
// pstmt.setString(10, lstrAllocateHashMap.get("alloc_qty"));
// pstmt.setString(11, lstrAllocateHashMap.get("chg_win"));
// pstmt.setString(12, lstrAllocateHashMap.get("chg_user"));
// pstmt.setString(13, lstrAllocateHashMap.get("chg_term"));
// insrtCnt=pstmt.executeUpdate();
// pstmt.close();pstmt=null;
//
// System.out.println("@V@ Insert count 2306 :- ["+insrtCnt+"]");
//
// sql="update stock set alloc_qty = (case when alloc_qty is null then 0 else alloc_qty end) + ?"
// + " where item_code = ? and site_code = ? and loc_code = ? and lot_no = ? and lot_sl = ?";
// pstmt=conn.prepareStatement(sql);
// pstmt.setString(1, lstrAllocateHashMap.get("alloc_qty"));
// pstmt.setString(2, lstrAllocateHashMap.get("item_code"));
// pstmt.setString(3, lstrAllocateHashMap.get("site_code"));
// pstmt.setString(4, lstrAllocateHashMap.get("loc_code"));
// pstmt.setString(5, lstrAllocateHashMap.get("lot_no"));
// pstmt.setString(6, lstrAllocateHashMap.get("lot_sl"));
// insrtCnt=pstmt.executeUpdate();
// pstmt.close();pstmt=null;
//
// System.out.println("@V@ update count 2324:- ["+insrtCnt+"]");
//
// }
// catch (SQLException e)
// {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (ITMException e)
// {
// // TODO Auto-generated catch block
// e.printStackTrace();
// } catch (RemoteException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// finally
// {
// try {
// if(pstmt!=null)
// {
// pstmt.close();
// pstmt=null;
// }
// if(pstmt1!=null)
// {
// pstmt1.close();
// pstmt1=null;
// }
// if(rs!=null)
// {
// rs.close();
// rs=null;
// }
// if(rs1!=null)
// {
// rs1.close();
// rs1=null;
// }
// } catch (SQLException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// throw new ITMException(e);
// }
// }
//
// return errStr;
// }
/**
* VALLABH KADAM [13/NOV/2017]
* To generate new tran id for Alloc trace
* */
private static String generateTranIdForAllocTrace(String tranWindow, String xmlValues,String loginCode, Connection conn) throws ITMException {
Statement stmt = null;
ResultSet rs = null;
String sql = "", batchId = "", str3 = "";
try {
sql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = '"+ tranWindow +"'";
System.out.println("sql for generatTranId [" + sql + "]");
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
System.out.println("keyString :" + rs.toString());
String refSer = "", keyString = "", tranIdCol = "";
if (rs.next()) {
keyString = rs.getString(1);
tranIdCol = rs.getString(2);
refSer = rs.getString(3);
}
if (rs != null) {
rs.close();
rs = null;
}
if (stmt != null) {
stmt.close();
stmt = null;
}
// String strXml = "";
// strXml = "<?xml version=\"1.0\" encoding='" + CommonConstants.ENCODING + "'?>\r\n<Root>";
// strXml = strXml + "<Header></Header>";
// strXml = strXml + "<Detail1>";
// strXml = strXml + "<tran_id/>";
// strXml = strXml + "<tran_date>" + tranDate + "</tran_date>";
// strXml = strXml + "<site_code>" + siteCode + "</site_code>";
// strXml = strXml + "</Detail1></Root>";
TransIDGenerator localTransIDGenerator = new TransIDGenerator(xmlValues, loginCode, CommonConstants.DB_NAME);
batchId = localTransIDGenerator.generateTranSeqID(refSer, tranIdCol, keyString, conn);
} catch (Exception e) {
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
} finally {
try {
if (rs != null) {
rs.close();
rs = null;
}
if (stmt != null) {
stmt.close();
stmt = null;
}
} catch (SQLException localSQLException3) {
System.out.println("Connection not Closed....");
}
}
System.out.println("@V@ New Generated batchId...." + batchId);
return batchId;
}
private String getItemSer(String itemCode,String siteCode,Timestamp tranDate,Connection conn) private String getItemSer(String itemCode,String siteCode,Timestamp tranDate,Connection conn)
{ {
String itemSer ="",sql =""; String itemSer ="",sql ="";
...@@ -1854,9 +2730,12 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1854,9 +2730,12 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
String lineNo = ""; String lineNo = "";
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
String tranSer = "D-RCP"; String tranSer = "D-RCP";
String termId="";
//GenericUtility genericUtility = null; //GenericUtility genericUtility = null;
try try
{ {
System.out.println("@V@ xtraParams 1850:- ["+xtraParams+"]");
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
//genericUtility = GenericUtility.getInstance(); //genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
...@@ -1900,7 +2779,8 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1900,7 +2779,8 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
"(CASE WHEN lot_no IS NULL THEN ' ' ELSE lot_no END ) as lot_no," + "(CASE WHEN lot_no IS NULL THEN ' ' ELSE lot_no END ) as lot_no," +
" min(exp_date)," + " min(exp_date)," +
"(CASE WHEN batch_no IS NULL THEN ' ' ELSE batch_no End) as batch_no," + "(CASE WHEN batch_no IS NULL THEN ' ' ELSE batch_no End) as batch_no," +
" Min(line_no), min(mfg_date) , min(retest_date), supp_code__mfg from distord_rcpdet where tran_id = ?" + " Min(line_no), min(mfg_date) , min(retest_date), supp_code__mfg"
+ " from distord_rcpdet where tran_id = ?" +
" Group by loc_code, item_code, lot_no, batch_no , supp_code__mfg" + " Group by loc_code, item_code, lot_no, batch_no , supp_code__mfg" +
" Order by loc_code, item_code, lot_no, batch_no , supp_code__mfg"; " Order by loc_code, item_code, lot_no, batch_no , supp_code__mfg";
...@@ -1964,7 +2844,8 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1964,7 +2844,8 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
if(suppCodeMfg.length() == 0){ if(suppCodeMfg.length() == 0)
{
sql = "select count(*) as count from item_lot_info where item_code = ? and lot_no = ?"; sql = "select count(*) as count from item_lot_info where item_code = ? and lot_no = ?";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode); pstmt1.setString(1, itemCode);
...@@ -1983,8 +2864,11 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1983,8 +2864,11 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
pstmt1.setString(2, lotNo); pstmt1.setString(2, lotNo);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()){ if(rs1.next()){
suppCodeMfg = checkNullAndTrim(rs.getString("supp_code__mfg")); suppCodeMfg = checkNullAndTrim(rs1.getString("supp_code__mfg"));
System.out.println("supp code mfg:::" + suppCodeMfg); System.out.println("supp code mfg:::" + suppCodeMfg);
//Modified By Umakanta Das on 09-OCT-2017[To get Suppcode]Start
suppCode = checkNullAndTrim(rs1.getString("supp_code"));
//Modified By Umakanta Das on 09-OCT-2017[To get Suppcode]Start
} }
closeResources(pstmt1, rs1); closeResources(pstmt1, rs1);
...@@ -1999,7 +2883,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -1999,7 +2883,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
pstmt1.setString(5, lotSl); pstmt1.setString(5, lotSl);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()){ if(rs1.next()){
suppCodeMfg = checkNullAndTrim(rs.getString("supp_code__mfg")); suppCodeMfg = checkNullAndTrim(rs1.getString("supp_code__mfg"));
System.out.println("supp code mfg from stock in if condition:::" + suppCodeMfg); System.out.println("supp code mfg from stock in if condition:::" + suppCodeMfg);
} }
} }
...@@ -2015,12 +2899,15 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -2015,12 +2899,15 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
pstmt1.setString(5, lotSl); pstmt1.setString(5, lotSl);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()){ if(rs1.next()){
suppCodeMfg = checkNullAndTrim(rs.getString("supp_code__mfg")); suppCodeMfg = checkNullAndTrim(rs1.getString("supp_code__mfg"));
System.out.println("supp code mfg from stock in if condition:::" + suppCodeMfg); System.out.println("supp code mfg from stock in if condition:::" + suppCodeMfg);
} }
} }
closeResources(pstmt1, rs1); closeResources(pstmt1, rs1);
} }
System.out.println("@V@ suppCodeMfg :- 2017 ["+suppCodeMfg+"]");
System.out.println("@V@ mfgDate :- 2019 ["+mfgDate+"]");
//added by azhar[31/JAN/2017][END] //added by azhar[31/JAN/2017][END]
...@@ -2191,8 +3078,14 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -2191,8 +3078,14 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
} }
// VALLABH KADAM [06/OCT/2017] START
// userId = genericUtility.getValueFromXTRA_PARAMS("loginCode",xtraParams);
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
// VALLABH KADAM [06/OCT/2017] END
System.out.println("@V@ User id :- ["+userId+"]");
userId = genericUtility.getValueFromXTRA_PARAMS("loginCode",xtraParams);
String xmlValues = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>"; String xmlValues = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
xmlValues = xmlValues + "<Header></Header>"; xmlValues = xmlValues + "<Header></Header>";
xmlValues = xmlValues + "<Detail1>"; xmlValues = xmlValues + "<Detail1>";
...@@ -2271,9 +3164,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -2271,9 +3164,7 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
} }
//added by azhar[14/FEB/2017][END] //added by azhar[14/FEB/2017][END]
sql = "select emp_code " sql = "select emp_code from users where code = '"+userId+"' " ;
+" from users "
+" where code = '"+userId+"' " ;
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) if (rs1.next())
...@@ -2284,13 +3175,16 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -2284,13 +3175,16 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
System.out.println("@V@ empCode :- ["+empCode+"]");
sqlInsert ="insert into qc_order (qorder_no,qorder_type,qorder_date,site_code,item_code, " + sqlInsert ="insert into qc_order (qorder_no,qorder_type,qorder_date,site_code,item_code, " +
"route_code,quantity,qty_passed,qty_rejected," + "route_code,quantity,qty_passed,qty_rejected," +
"start_date,due_date,rel_date,porcp_no,porcp_line_no, " + "start_date,due_date,rel_date,porcp_no,porcp_line_no, " +
"lot_no,lot_sl,chg_date,chg_user,chg_term,loc_code," + "lot_no,lot_sl,chg_date,chg_user,chg_term,loc_code," +
"qty_sample,status, unit,qc_create_type, batch_no,expiry_date," + "qty_sample,status, unit,qc_create_type, batch_no,expiry_date," +
"loc_code__aprv,loc_code__rej,unit__sample,lot_no__new,retest_date,emp_code,item_code__new ) " + "loc_code__aprv,loc_code__rej,unit__sample,lot_no__new,retest_date,emp_code,item_code__new,mfg_date,supp_code__mfg, supp_code ) " +
"values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?)";
pstmt1 = conn.prepareStatement(sqlInsert); pstmt1 = conn.prepareStatement(sqlInsert);
pstmt1.setString(1,qcNo); pstmt1.setString(1,qcNo);
pstmt1.setString(2,"I"); pstmt1.setString(2,"I");
...@@ -2310,7 +3204,12 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -2310,7 +3204,12 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
pstmt1.setString(16,lotSl); pstmt1.setString(16,lotSl);
pstmt1.setTimestamp(17,new Timestamp(System.currentTimeMillis())); pstmt1.setTimestamp(17,new Timestamp(System.currentTimeMillis()));
pstmt1.setString(18,userId); pstmt1.setString(18,userId);
pstmt1.setString(19,userId);
// VALLABH KADAM [06/OCT/2017] START
// pstmt1.setString(19,userId);
pstmt1.setString(19,termId);
// VALLABH KADAM [06/OCT/2017] END
pstmt1.setString(20,locCode); pstmt1.setString(20,locCode);
pstmt1.setDouble(21,qtySample); pstmt1.setDouble(21,qtySample);
pstmt1.setString(22,"U"); pstmt1.setString(22,"U");
...@@ -2329,7 +3228,14 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo ...@@ -2329,7 +3228,14 @@ public class DistOrderRcpConf extends ActionHandlerEJB implements DistOrderRcpCo
pstmt1.setNull(31,Types.TIMESTAMP); pstmt1.setNull(31,Types.TIMESTAMP);
pstmt1.setString(32,empCode); pstmt1.setString(32,empCode);
pstmt1.setString(33,itemCode); pstmt1.setString(33,itemCode);
// VALLABH KADAM [06/OCT/2017] START
pstmt1.setTimestamp(34, mfgDate);
pstmt1.setString(35, suppCodeMfg);
// VALLABH KADAM [06/OCT/2017] END
//Modified By Umakanta Das on 09-OCT-2017[ To set suppiler code in insert statemrnt]
pstmt1.setString( 36, suppCode );
int intCount = pstmt1.executeUpdate(); int intCount = pstmt1.executeUpdate();
System.out.println("Inserting Qc_order :"+intCount); System.out.println("Inserting Qc_order :"+intCount);
pstmt1.clearParameters(); pstmt1.clearParameters();
...@@ -2807,8 +3713,6 @@ private String getCurrdateAppFormat() ...@@ -2807,8 +3713,6 @@ private String getCurrdateAppFormat()
} catch (Exception e) { } catch (Exception e) {
System.out.println("Exception::" + e.getMessage()); System.out.println("Exception::" + e.getMessage());
} }
} }
} }
......
...@@ -7,11 +7,13 @@ import java.util.*; ...@@ -7,11 +7,13 @@ import java.util.*;
import java.io.File; import java.io.File;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.ejb.dis.DistCommon; import ibase.webitm.ejb.dis.DistCommon;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.fin.FinCommon; import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.sys.UtilMethods;
//import ibase.webitm.reports.sun.PackingSlipSOrderFormulation;
import ibase.webitm.utility.TransIDGenerator; import ibase.webitm.utility.TransIDGenerator;
//import ibase.webitm.utility.GenericUtility; //import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
...@@ -49,9 +51,7 @@ public class StockUpdate ...@@ -49,9 +51,7 @@ public class StockUpdate
double holdQty=0; double holdQty=0;
String quarLockCode="",genratedTranId=""; String quarLockCode="",genratedTranId="";
String holdLock="";//addad by priyanka String holdLock="";//addad by priyanka
String noArtStr = ""; DistCommon distCommon = new DistCommon();// added by priyanka
DistCommon distCommon = new DistCommon();// added by priyanka
/** /**
* Updates stock return error if fails * Updates stock return error if fails
...@@ -84,9 +84,8 @@ public class StockUpdate ...@@ -84,9 +84,8 @@ public class StockUpdate
double qtyPerArtStk = 0d,qtyStk=0d; double qtyPerArtStk = 0d,qtyStk=0d;
String quarantineLock="",lockCode=""; String quarantineLock="",lockCode="";
ArrayList< String> lockCodeList= new ArrayList<String>(); ArrayList< String> lockCodeList= new ArrayList<String>();
//Added By Nasruddin Start 21/11/6 bug fix UtilMethods utilMethods = UtilMethods.getInstance();
UtilMethods utilMethods = UtilMethods.getInstance(); String mamountStr="", qtyPerArtStr ="", grosswtPerArtStr ="",tarewtPerArtStr ="";
String mamountStr="", qtyPerArtStr ="", grosswtPerArtStr ="",tarewtPerArtStr ="";
try try
{ {
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
...@@ -120,7 +119,6 @@ public class StockUpdate ...@@ -120,7 +119,6 @@ public class StockUpdate
this.noArt = 1; this.noArt = 1;
} }
} }
//Changed by wasim on 16-03-2015 to close Prepared Statement/Result Set [START] //Changed by wasim on 16-03-2015 to close Prepared Statement/Result Set [START]
if(rs!=null) if(rs!=null)
{ {
...@@ -168,9 +166,10 @@ public class StockUpdate ...@@ -168,9 +166,10 @@ public class StockUpdate
creaDt = new Timestamp(System.currentTimeMillis()) ; creaDt = new Timestamp(System.currentTimeMillis()) ;
System.out.println("creaDt Initialized Current date:::- ["+creaDt+"]"); System.out.println("creaDt Initialized Current date:::- ["+creaDt+"]");
} }
// commented by Kunal 12/04/17 stock Validation not Required
// 05/02/13 manoharan check for stock if issue // 05/02/13 manoharan check for stock if issue
if (this.tranType.equalsIgnoreCase("I") || this.tranType.equalsIgnoreCase("ID") ) /*if (this.tranType.equalsIgnoreCase("I") || this.tranType.equalsIgnoreCase("ID") )
{ {
sql =" select count(1) from stock where item_code = ? " sql =" select count(1) from stock where item_code = ? "
+" and site_code = ? " +" and site_code = ? "
...@@ -200,8 +199,9 @@ public class StockUpdate ...@@ -200,8 +199,9 @@ public class StockUpdate
return errString; return errString;
} }
} }*/
// end 05/02/13 manoharan // end 05/02/13 manoharan
//end by Kunal 12/04/17
/*if gs_run_mode <> 'B' then//Batch load to be checked, currently the current Date /*if gs_run_mode <> 'B' then//Batch load to be checked, currently the current Date
s_updatestock.currdate = ldt_today // and create date is taken as current timestamp s_updatestock.currdate = ldt_today // and create date is taken as current timestamp
...@@ -348,7 +348,6 @@ public class StockUpdate ...@@ -348,7 +348,6 @@ public class StockUpdate
} }
this.qtyStduom = meffQty; this.qtyStduom = meffQty;
} }
if(this.lotNo == null || this.lotNo.trim().length() == 0) if(this.lotNo == null || this.lotNo.trim().length() == 0)
{ {
...@@ -433,7 +432,6 @@ public class StockUpdate ...@@ -433,7 +432,6 @@ public class StockUpdate
} }
pstmt.close(); pstmt.close();
rs.close(); rs.close();
/////////////////// ///////////////////
errString = calcWeights(conn); errString = calcWeights(conn);
if(errString != null && errString.trim().length() >0){ if(errString != null && errString.trim().length() >0){
...@@ -473,7 +471,6 @@ public class StockUpdate ...@@ -473,7 +471,6 @@ public class StockUpdate
} }
pstmt.close(); pstmt.close();
rs.close(); rs.close();
if (this.tranType.equalsIgnoreCase("R")) if (this.tranType.equalsIgnoreCase("R"))
{ {
mafterQty = mbefQty + this.qtyStduom; mafterQty = mbefQty + this.qtyStduom;
...@@ -484,7 +481,6 @@ public class StockUpdate ...@@ -484,7 +481,6 @@ public class StockUpdate
mafterQty = mbefQty - this.qtyStduom; mafterQty = mbefQty - this.qtyStduom;
effQty = this.qtyStduom * -1; effQty = this.qtyStduom * -1;
} }
//****************added by priyanka //****************added by priyanka
if((this.tranType.equalsIgnoreCase("R"))) if((this.tranType.equalsIgnoreCase("R")))
{ {
...@@ -726,7 +722,6 @@ public class StockUpdate ...@@ -726,7 +722,6 @@ public class StockUpdate
xmlValues = xmlValues + "</Detail1></Root>"; xmlValues = xmlValues + "</Detail1></Root>";
minvtraceNo= generateTranId("T_INVTRACE",xmlValues,conn); minvtraceNo= generateTranId("T_INVTRACE",xmlValues,conn);
System.out.println("Generated Tran id ::- ["+minvtraceNo+"]"); System.out.println("Generated Tran id ::- ["+minvtraceNo+"]");
mamount = effQty * this.rate;
// Changed By Nasruddin 21-11-16 Start bug Fix // Changed By Nasruddin 21-11-16 Start bug Fix
mamountStr = utilMethods.getReqDecString(mamount,3); mamountStr = utilMethods.getReqDecString(mamount,3);
mamount = Double.parseDouble(mamountStr); mamount = Double.parseDouble(mamountStr);
...@@ -772,7 +767,8 @@ public class StockUpdate ...@@ -772,7 +767,8 @@ public class StockUpdate
pstmt.setString(30,this.acctCodeCr); pstmt.setString(30,this.acctCodeCr);
pstmt.setString(31,this.cctrCodeCr); pstmt.setString(31,this.cctrCodeCr);
pstmt.setDouble(32,this.noArt); pstmt.setDouble(32,this.noArt);
pstmt.setDouble(33,mamount); //pstmt.setDouble(33,mamount);
pstmt.setString(33,mamountStr);
pstmt.setString(34,this.remarks); pstmt.setString(34,this.remarks);
pstmt.setDouble(35,this.grossWeight); pstmt.setDouble(35,this.grossWeight);
pstmt.setDouble(36,this.tareWeight); pstmt.setDouble(36,this.tareWeight);
...@@ -906,18 +902,20 @@ public class StockUpdate ...@@ -906,18 +902,20 @@ public class StockUpdate
oldvalue = rs.getDouble(2); oldvalue = rs.getDouble(2);
oldGrossValue =rs.getDouble(3); oldGrossValue =rs.getDouble(3);
} }
System.out.println("oldQty::["+oldQty+"]::oldvalue::["+oldvalue+"]::oldGrossValue::["+oldGrossValue+"]");
pstmt.close(); pstmt.close();
rs.close(); rs.close();
newValue = Math.abs(this.qtyStduom) * this.rate; newValue = Math.abs(this.qtyStduom) * this.rate;//13*11=143
newGrossValue = Math.abs(this.qtyStduom) * this.grossRate; newGrossValue = Math.abs(this.qtyStduom) * this.grossRate;
totalValue = oldValue + newValue; //totalValue = oldValue + newValue;//0+143 = 143 // commented by azhar as variable oldValue was incorrect
totalValue = oldvalue + newValue;//0+143 = 143
totalGrossValue = oldGrossValue + newGrossValue ; totalGrossValue = oldGrossValue + newGrossValue ;
if((oldQty + Math.abs(this.qtyStduom)) != 0) if((oldQty + Math.abs(this.qtyStduom)) != 0)
{ {
this.rate = (totalValue)/(oldQty+Math.abs(this.qtyStduom)); this.rate = (totalValue)/(oldQty+Math.abs(this.qtyStduom));
this.grossRate = totalGrossValue / (oldQty + Math.abs(qtyStduom)); this.grossRate = totalGrossValue / (oldQty + Math.abs(qtyStduom));
} }
System.out.println("rate::["+this.rate+"]:::gross rate::["+this.grossRate+"]");
} }
else if(stockValuation.equalsIgnoreCase("C")){ else if(stockValuation.equalsIgnoreCase("C")){
sql =" Select (Case when (sum(Case When quantity IS NULL Then 0 Else quantity End)) is null Then 0 else (sum(Case When quantity IS NULL Then 0 Else quantity End)) end)," sql =" Select (Case when (sum(Case When quantity IS NULL Then 0 Else quantity End)) is null Then 0 else (sum(Case When quantity IS NULL Then 0 Else quantity End)) end),"
...@@ -927,8 +925,7 @@ public class StockUpdate ...@@ -927,8 +925,7 @@ public class StockUpdate
+" where item_code = '"+this.itemCode+"'" +" where item_code = '"+this.itemCode+"'"
+" and site_code = '"+this.siteCode+"'" +" and site_code = '"+this.siteCode+"'"
+" and grade = '"+this.grade+"'" +" and grade = '"+this.grade+"'"
// +" And cctr_code__inv = :'"+this.cctrCodeInv+"'"; +" And cctr_code__inv = :'"+this.cctrCodeInv+"'";
+" And cctr_code__inv = '"+this.cctrCodeInv+"'"; // Changed by Manish on 05/10/16
System.out.println("Query :::- ["+sql+"]"); System.out.println("Query :::- ["+sql+"]");
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -942,7 +939,8 @@ public class StockUpdate ...@@ -942,7 +939,8 @@ public class StockUpdate
rs.close(); rs.close();
newValue = Math.abs(this.qtyStduom) * this.rate; newValue = Math.abs(this.qtyStduom) * this.rate;
newGrossValue = Math.abs(this.qtyStduom) * this.grossRate; newGrossValue = Math.abs(this.qtyStduom) * this.grossRate;
totalValue = oldValue + newValue; //totalValue = oldValue + newValue;//commented by azhar as variable oldValue was incorrect
totalValue = oldvalue + newValue;
totalGrossValue = oldGrossValue + newGrossValue ; totalGrossValue = oldGrossValue + newGrossValue ;
if((oldQty + Math.abs(this.qtyStduom))!= 0) if((oldQty + Math.abs(this.qtyStduom))!= 0)
{ {
...@@ -1123,7 +1121,6 @@ public class StockUpdate ...@@ -1123,7 +1121,6 @@ public class StockUpdate
tarewtPerArt = this.tareWeight/this.noArt; tarewtPerArt = this.tareWeight/this.noArt;
grosswtPerArt = this.grossWeight/this.noArt; grosswtPerArt = this.grossWeight/this.noArt;
} }
// Changed By Nasruddin 21-11-16 Start bug Fix // Changed By Nasruddin 21-11-16 Start bug Fix
qtyPerArtStr = utilMethods.getReqDecString(qtyPerArt,3); qtyPerArtStr = utilMethods.getReqDecString(qtyPerArt,3);
qtyPerArt = Double.parseDouble(qtyPerArtStr); qtyPerArt = Double.parseDouble(qtyPerArtStr);
...@@ -1134,9 +1131,6 @@ public class StockUpdate ...@@ -1134,9 +1131,6 @@ public class StockUpdate
grosswtPerArtStr = utilMethods.getReqDecString(qtyPerArt,3); grosswtPerArtStr = utilMethods.getReqDecString(qtyPerArt,3);
grosswtPerArt = Double.parseDouble(grosswtPerArtStr); grosswtPerArt = Double.parseDouble(grosswtPerArtStr);
// Changed By Nasruddin 21-11-16 END // Changed By Nasruddin 21-11-16 END
sql = "insert into stock (item_code,site_code,loc_code, lot_no,lot_sl,unit, quantity,crea_date,chg_user," sql = "insert into stock (item_code,site_code,loc_code, lot_no,lot_sl,unit, quantity,crea_date,chg_user,"
+" chg_date,chg_term,exp_date, alloc_qty,item_ser,mfg_date, site_code__mfg,potency_perc,pack_code," +" chg_date,chg_term,exp_date, alloc_qty,item_ser,mfg_date, site_code__mfg,potency_perc,pack_code,"
+" inv_stat,ltran_date,last_iss_date,gross_weight,tare_weight,net_weight,pack_instr,dimension,retest_date," +" inv_stat,ltran_date,last_iss_date,gross_weight,tare_weight,net_weight,pack_instr,dimension,retest_date,"
...@@ -1192,9 +1186,12 @@ public class StockUpdate ...@@ -1192,9 +1186,12 @@ public class StockUpdate
pstmt.setString(39,this.batchNo); pstmt.setString(39,this.batchNo);
pstmt.setTimestamp(40,this.lastPhycDate); pstmt.setTimestamp(40,this.lastPhycDate);
pstmt.setDouble(41,qtyPerArt); //pstmt.setDouble(41,qtyPerArt);//qtyPerArtStr
pstmt.setString(41,qtyPerArtStr);
pstmt.setDouble(42,grosswtPerArt); pstmt.setDouble(42,grosswtPerArt);
pstmt.setDouble(43,tarewtPerArt); pstmt.setString(42,grosswtPerArtStr);//grosswtPerArtStr
//pstmt.setDouble(43,tarewtPerArt);//tarewtPerArtStr
pstmt.setString(43,tarewtPerArtStr);
pstmt.setDouble(44,this.actualRate); pstmt.setDouble(44,this.actualRate);
pstmt.setString(45,this.remarks); pstmt.setString(45,this.remarks);
pstmt.setString(46,"0"); pstmt.setString(46,"0");
...@@ -1229,7 +1226,6 @@ public class StockUpdate ...@@ -1229,7 +1226,6 @@ public class StockUpdate
}//end of tranType (L) }//end of tranType (L)
else if(this.tranType.equalsIgnoreCase("A")){ else if(this.tranType.equalsIgnoreCase("A")){
mallocQty = mallocQty + meffQty; mallocQty = mallocQty + meffQty;
if (count != 0){ if (count != 0){
sql =" update stock set alloc_qty = ? ," sql =" update stock set alloc_qty = ? ,"
+" ltran_date = ? " +" ltran_date = ? "
...@@ -1249,7 +1245,6 @@ public class StockUpdate ...@@ -1249,7 +1245,6 @@ public class StockUpdate
}//end of tranType (A) }//end of tranType (A)
else if(this.tranType.equalsIgnoreCase("D")){ else if(this.tranType.equalsIgnoreCase("D")){
mallocQty = mallocQty - meffQty; mallocQty = mallocQty - meffQty;
if (count != 0){ if (count != 0){
sql =" update stock set alloc_qty = ? ," sql =" update stock set alloc_qty = ? ,"
+" ltran_date = ? " +" ltran_date = ? "
...@@ -1377,7 +1372,31 @@ public class StockUpdate ...@@ -1377,7 +1372,31 @@ public class StockUpdate
} }
else if(this.tranType.equalsIgnoreCase("R")) else if(this.tranType.equalsIgnoreCase("R"))
{ {
System.out.println("before update lot info::");
System.out.println("rate::["+this.rate+"]:::gross rate::["+this.grossRate+"]");
//added by azhar[Start][04-May-2017]
updateStockMap.put("no_art",this.noArt);
updateStockMap.put("curr_date",this.currDate);
updateStockMap.put("inv_stat",this.invStat);
updateStockMap.put("item_ser",this.itemSer);
updateStockMap.put("grade",this.grade);
updateStockMap.put("lot_no",this.lotNo);
updateStockMap.put("lot_sl",this.lotSl);
updateStockMap.put("conv__qty_stduom",this.convQtyStduom);
updateStockMap.put("qty_stduom",this.qtyStduom);
updateStockMap.put("rate",this.rate);
updateStockMap.put("acct_code__cr",this.acctCodeCr);
updateStockMap.put("cctr_code__cr",this.cctrCodeCr);
updateStockMap.put("gross_rate",this.grossRate);
//added by azhar[End][04-May-2017]
System.out.println("map before update lot info:: " + updateStockMap);
//Add by manoj sir
if(stkOpt.equalsIgnoreCase("2"))
{
updateStockMap = updateLotInfo( updateStockMap , conn); // added by cpatil calling function updateStockMap = updateLotInfo( updateStockMap , conn); // added by cpatil calling function
}
//End
//if( errString != null && errString.trim().length() > 0) //if( errString != null && errString.trim().length() > 0)
//{ //{
...@@ -1524,8 +1543,10 @@ public class StockUpdate ...@@ -1524,8 +1543,10 @@ public class StockUpdate
+"last_phyc_date = ?," +"last_phyc_date = ?,"
+"supp_code__mfg = ?," +"supp_code__mfg = ?,"
+"batch_no = ? ," +"batch_no = ? ,"
+"hold_qty=hold_qty + ? " //Added by saurabh as hold_qty is not get updated if the value is null[25/10/16|Start]
+"where item_code = '"+this.itemCode+"'" +"hold_qty=(case when hold_qty is null then 0 else hold_qty end) + ? "
//Added by saurabh as hold_qty is not get updated if the value is null[25/10/16|End]
+"where item_code = '"+this.itemCode+"'"
+"and site_code = '"+this.siteCode+"'" +"and site_code = '"+this.siteCode+"'"
+"and loc_code = '"+this.locationCode+"'" +"and loc_code = '"+this.locationCode+"'"
+"and lot_no = '"+this.lotNo+"'" +"and lot_no = '"+this.lotNo+"'"
...@@ -1616,7 +1637,7 @@ public class StockUpdate ...@@ -1616,7 +1637,7 @@ public class StockUpdate
grosswtPerArt = this.grossWeight / this.noArt; grosswtPerArt = this.grossWeight / this.noArt;
} }
} }
// Changed By Nasruddin 21-11-16 Start bug Fix // Changed By Nasruddin 21-11-16 Start bug Fix
qtyPerArtStr = utilMethods.getReqDecString(qtyPerArt,3); qtyPerArtStr = utilMethods.getReqDecString(qtyPerArt,3);
qtyPerArt = Double.parseDouble(qtyPerArtStr); qtyPerArt = Double.parseDouble(qtyPerArtStr);
...@@ -1626,8 +1647,6 @@ public class StockUpdate ...@@ -1626,8 +1647,6 @@ public class StockUpdate
grosswtPerArtStr = utilMethods.getReqDecString(qtyPerArt,3); grosswtPerArtStr = utilMethods.getReqDecString(qtyPerArt,3);
grosswtPerArt = Double.parseDouble(grosswtPerArtStr); grosswtPerArt = Double.parseDouble(grosswtPerArtStr);
// Changed By Nasruddin 21-11-16 END // Changed By Nasruddin 21-11-16 END
sql="insert into stock " sql="insert into stock "
+" (item_code , site_code, loc_code," +" (item_code , site_code, loc_code,"
...@@ -1646,10 +1665,11 @@ public class StockUpdate ...@@ -1646,10 +1665,11 @@ public class StockUpdate
+" no_art,last_phyc_date,qty_per_art," +" no_art,last_phyc_date,qty_per_art,"
+" gross_wt_per_art,tare_wt_per_art,actual_rate," +" gross_wt_per_art,tare_wt_per_art,actual_rate,"
+" remarks,pack_ref,consider_allocate, partial_used, batch_size" +" remarks,pack_ref,consider_allocate, partial_used, batch_size"
+" ,lot_sl__org ) values " +" ,lot_sl__org "
+" ,hold_qty ) values " ////added by saurabh to set hold qty same as quantity[25/10/16]
+" (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?," +" (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+" ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?," +" ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+" ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; +" ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
//System.out.println("SQL :"+sql); //System.out.println("SQL :"+sql);
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,this.itemCode); pstmt.setString(1,this.itemCode);
...@@ -1706,10 +1726,15 @@ public class StockUpdate ...@@ -1706,10 +1726,15 @@ public class StockUpdate
pstmt.setDouble(40,this.noArt); pstmt.setDouble(40,this.noArt);
pstmt.setTimestamp(41,this.lastPhycDate); pstmt.setTimestamp(41,this.lastPhycDate);
pstmt.setDouble(42,qtyPerArt);
//pstmt.setDouble(42,qtyPerArt);
pstmt.setString(42,qtyPerArtStr);
pstmt.setDouble(43,grosswtPerArt); //pstmt.setDouble(43,grosswtPerArt);
pstmt.setDouble(44,tarewtPerArt); pstmt.setString(43,grosswtPerArtStr);
//pstmt.setDouble(44,tarewtPerArt);
pstmt.setString(44,tarewtPerArtStr);
pstmt.setDouble(45,this.actualRate); pstmt.setDouble(45,this.actualRate);
pstmt.setString(46,this.remarks); pstmt.setString(46,this.remarks);
...@@ -1719,6 +1744,8 @@ public class StockUpdate ...@@ -1719,6 +1744,8 @@ public class StockUpdate
pstmt.setDouble(50,this.batchSize); pstmt.setDouble(50,this.batchSize);
pstmt.setString(51,this.lotSlOrg); // cpatil pstmt.setString(51,this.lotSlOrg); // cpatil
pstmt.setDouble(52,this.holdQty); //added by saurabh to set hold qty same as quantity[25/10/16]
System.out.println("ITEM_CODE :"+this.itemCode); System.out.println("ITEM_CODE :"+this.itemCode);
System.out.println("SITE_CODE :"+this.siteCode); System.out.println("SITE_CODE :"+this.siteCode);
System.out.println("LOC_CODE :"+this.locationCode); System.out.println("LOC_CODE :"+this.locationCode);
...@@ -1727,7 +1754,7 @@ public class StockUpdate ...@@ -1727,7 +1754,7 @@ public class StockUpdate
System.out.println("QUANTITY :"+this.qtyStduom); System.out.println("QUANTITY :"+this.qtyStduom);
System.out.println("UNIT :"+mbaseUnit); System.out.println("UNIT :"+mbaseUnit);
System.out.println("CREA_DATE :"+creaDt); System.out.println("CREA_DATE :"+creaDt);
System.out.println("HOLD_QTY :"+this.holdQty);
pstmt.executeUpdate(); pstmt.executeUpdate();
System.out.println("@@@@@@@ executed sucessfully............"); System.out.println("@@@@@@@ executed sucessfully............");
//Changed by wasim on 16-03-2015 to close Prepared Statement/Result Set [START] //Changed by wasim on 16-03-2015 to close Prepared Statement/Result Set [START]
...@@ -2269,7 +2296,12 @@ public class StockUpdate ...@@ -2269,7 +2296,12 @@ public class StockUpdate
{ {
this.shelfLifeType = "E"; this.shelfLifeType = "E";
} }
//added by saurabh to set hold qty[25/10/16|Start]
if(updateStockMap.get("hold_qty")!=null)
{
this.holdQty = Double.parseDouble(updateStockMap.get("hold_qty").toString());
}
//added by saurabh to set hold qty[25/10/16|End]
}catch(Exception e){ }catch(Exception e){
System.out.println("Exception "+e); System.out.println("Exception "+e);
...@@ -2304,18 +2336,6 @@ public class StockUpdate ...@@ -2304,18 +2336,6 @@ public class StockUpdate
keyCol = rs.getString(2); keyCol = rs.getString(2);
tranSer1 = rs.getString(3); tranSer1 = rs.getString(3);
} }
// Changed by Sneha on 21-07-2016, for Closing the Open Cursor [Start]
if ( stmt != null )
{
stmt.close();
stmt = null;
}
if ( rs != null )
{
rs.close();
rs = null;
}
// Changed by Sneha on 21-07-2016, for Closing the Open Cursor [End]
System.out.println("keyString :"+keyString); System.out.println("keyString :"+keyString);
System.out.println("keyCol :"+keyCol); System.out.println("keyCol :"+keyCol);
System.out.println("tranSer1 :"+tranSer1); System.out.println("tranSer1 :"+tranSer1);
...@@ -2601,7 +2621,7 @@ public class StockUpdate ...@@ -2601,7 +2621,7 @@ public class StockUpdate
int count = 0; int count = 0;
String prdCode = "",errCode = "", sql = ""; String prdCode = "",errCode = "", sql = "";
String tranDateStr=""; String tranDateStr="";
Timestamp tranDateTm=null; Timestamp tranDateTm=null;
double qty = 0,amount = 0; double qty = 0,amount = 0;
double poRcpQty = 0,disRcpQty = 0,woIssQty = 0,disIssQty = 0,salIssQty = 0; double poRcpQty = 0,disRcpQty = 0,woIssQty = 0,disIssQty = 0,salIssQty = 0;
double poRcpValue = 0,disRcpValue = 0,woIssValue = 0,disIssValue = 0,salIssValue = 0; double poRcpValue = 0,disRcpValue = 0,woIssValue = 0,disIssValue = 0,salIssValue = 0;
...@@ -2694,10 +2714,11 @@ public class StockUpdate ...@@ -2694,10 +2714,11 @@ public class StockUpdate
} }
System.out.println("TranDate After>>"+tranDateTm); System.out.println("TranDate After>>"+tranDateTm);
} }
sql = "SELECT CODE FROM PERIOD WHERE ? BETWEEN FR_DATE AND TO_DATE"; sql = "SELECT CODE FROM PERIOD WHERE ? BETWEEN FR_DATE AND TO_DATE";
System.out.println("SQL :"+sql); System.out.println("SQL :"+sql);
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setTimestamp(1,this.tranDate);//change by chandrashekar on 31-aug-2016 //pstmt.setTimestamp(1,this.tranDate);//change by chandrashekar on 31-aug-2016
pstmt.setTimestamp(1,tranDateTm); pstmt.setTimestamp(1,tranDateTm);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next()){
...@@ -3421,21 +3442,25 @@ public class StockUpdate ...@@ -3421,21 +3442,25 @@ public class StockUpdate
if(updateStockMap.get("item_code")== null) if(updateStockMap.get("item_code")== null)
{ {
updateStockMap.put("item_code", itemCode); updateStockMap.put("item_code", itemCode);
this.itemCode = itemCode;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.mfg_date) then s_updatestock.mfg_date = ldt_mfgdt //if isnull(s_updatestock.mfg_date) then s_updatestock.mfg_date = ldt_mfgdt
if(updateStockMap.get("mfg_date")== null) if(updateStockMap.get("mfg_date")== null)
{ {
updateStockMap.put("mfg_date", mfgDate); updateStockMap.put("mfg_date", mfgDate);
this.mfgDate = mfgDate;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.potency_perc) then s_updatestock.potency_perc = lc_potency_perc //if isnull(s_updatestock.potency_perc) then s_updatestock.potency_perc = lc_potency_perc
if(updateStockMap.get("potency_perc")== null) if(updateStockMap.get("potency_perc")== null)
{ {
updateStockMap.put("potency_perc", potencyPerc); updateStockMap.put("potency_perc", potencyPerc);
this.potencyPerc = potencyPerc;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.exp_date) then s_updatestock.exp_date = mexpdate //if isnull(s_updatestock.exp_date) then s_updatestock.exp_date = mexpdate
if(updateStockMap.get("exp_date")== null) if(updateStockMap.get("exp_date")== null)
{ {
updateStockMap.put("exp_date", expDate); updateStockMap.put("exp_date", expDate);
this.expDate = expDate;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.retest_date) then s_updatestock.retest_date = mretest_date //if isnull(s_updatestock.retest_date) then s_updatestock.retest_date = mretest_date
// System.out.println("@@@@ updateStockMap.get(retest_date) ["+updateStockMap.get("retest_date").toString()+"]"); // added by cpatil on 05-03-13 // System.out.println("@@@@ updateStockMap.get(retest_date) ["+updateStockMap.get("retest_date").toString()+"]"); // added by cpatil on 05-03-13
...@@ -3483,66 +3508,79 @@ public class StockUpdate ...@@ -3483,66 +3508,79 @@ public class StockUpdate
if(updateStockMap.get("retest_date")== null) if(updateStockMap.get("retest_date")== null)
{ {
updateStockMap.put("retest_date", retestDate); updateStockMap.put("retest_date", retestDate);
this.retestDate = retestDate;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
} }
//if isnull(s_updatestock.lotno) then s_updatestock.lotno = ls_lot_no //if isnull(s_updatestock.lotno) then s_updatestock.lotno = ls_lot_no
if(updateStockMap.get("lotno")== null) if(updateStockMap.get("lotno")== null)
{ {
updateStockMap.put("lotno", lotNo); updateStockMap.put("lotno", lotNo);
this.lotNo = lotNo;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.grade) then s_updatestock.grade = ls_grade //if isnull(s_updatestock.grade) then s_updatestock.grade = ls_grade
if(updateStockMap.get("grade")== null) if(updateStockMap.get("grade")== null)
{ {
updateStockMap.put("grade", grade); updateStockMap.put("grade", grade);
this.grade = grade;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.pack_code) then s_updatestock.pack_code = ls_pack_code //if isnull(s_updatestock.pack_code) then s_updatestock.pack_code = ls_pack_code
if(updateStockMap.get("pack_code")== null) if(updateStockMap.get("pack_code")== null)
{ {
updateStockMap.put("pack_code", packCode); updateStockMap.put("pack_code", packCode);
this.packCode = packCode;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.sitecode_mfg) then s_updatestock.sitecode_mfg = ls_site_code__mfg //if isnull(s_updatestock.sitecode_mfg) then s_updatestock.sitecode_mfg = ls_site_code__mfg
if(updateStockMap.get("site_code__mfg")== null) if(updateStockMap.get("site_code__mfg")== null)
{ {
updateStockMap.put("site_code__mfg", siteCodeMfg); updateStockMap.put("site_code__mfg", siteCodeMfg);
this.siteCodeMfg = siteCodeMfg;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.rate) then s_updatestock.rate = mrate //if isnull(s_updatestock.rate) then s_updatestock.rate = mrate
if(updateStockMap.get("rate")== null) if(updateStockMap.get("rate")== null)
{ {
updateStockMap.put("rate", rate); updateStockMap.put("rate", rate);
this.rate = rate;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.acct_code_inv) then s_updatestock.acct_code_inv = ls_acct_code__inv //if isnull(s_updatestock.acct_code_inv) then s_updatestock.acct_code_inv = ls_acct_code__inv
if(updateStockMap.get("acct_code_inv")== null) if(updateStockMap.get("acct_code_inv")== null)
{ {
updateStockMap.put("acct_code_inv", acctCodeInv); updateStockMap.put("acct_code_inv", acctCodeInv);
this.acctCodeInv = acctCodeInv;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.cctr_code_inv) then s_updatestock.cctr_code_inv = ls_ctr_code__inv //if isnull(s_updatestock.cctr_code_inv) then s_updatestock.cctr_code_inv = ls_ctr_code__inv
if(updateStockMap.get("cctr_code_inv")== null) if(updateStockMap.get("cctr_code_inv")== null)
{ {
updateStockMap.put("cctr_code_inv", cctrCodeInv); updateStockMap.put("cctr_code_inv", cctrCodeInv);
this.cctrCodeInv = cctrCodeInv;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.batch_no) then s_updatestock.batch_no = ls_batch_no //if isnull(s_updatestock.batch_no) then s_updatestock.batch_no = ls_batch_no
if(updateStockMap.get("batch_no")== null) if(updateStockMap.get("batch_no")== null)
{ {
updateStockMap.put("batch_no", batchNo); updateStockMap.put("batch_no", batchNo);
this.batchNo = batchNo;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.gross_rate) then s_updatestock.gross_rate = ld_grossrate //if isnull(s_updatestock.gross_rate) then s_updatestock.gross_rate = ld_grossrate
if(updateStockMap.get("gross_rate")== null) if(updateStockMap.get("gross_rate")== null)
{ {
updateStockMap.put("gross_rate", grossRate); updateStockMap.put("gross_rate", grossRate);
this.grossRate = grossrate;//added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.batch_size) then s_updatestock.batch_size = ld_batch_size //if isnull(s_updatestock.batch_size) then s_updatestock.batch_size = ld_batch_size
if(updateStockMap.get("batch_size")== null) if(updateStockMap.get("batch_size")== null)
{ {
updateStockMap.put("batch_size", batchSize); updateStockMap.put("batch_size", batchSize);
this.batchSize = batchSize; //added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//if isnull(s_updatestock.supp_code__mfg) then s_updatestock.supp_code__mfg = ls_supp_code__mfg //if isnull(s_updatestock.supp_code__mfg) then s_updatestock.supp_code__mfg = ls_supp_code__mfg
if(updateStockMap.get("supp_code__mfg")== null) if(updateStockMap.get("supp_code__mfg")== null)
{ {
updateStockMap.put("supp_code__mfg", suppCodeMfg); updateStockMap.put("supp_code__mfg", suppCodeMfg);
this.suppCodeMfg = suppCodeMfg; //added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
if(updateStockMap.get("supp_code")== null) if(updateStockMap.get("supp_code")== null)
{ {
updateStockMap.put("supp_code", suppCode); updateStockMap.put("supp_code", suppCode);
this.suppCode = suppCode; //added by azhar[17-May-2017] to reinitialize class variables to values from item lot info
} }
//int mapsize = updateStockMap.size(); //int mapsize = updateStockMap.size();
...@@ -3874,4 +3912,4 @@ public class StockUpdate ...@@ -3874,4 +3912,4 @@ public class StockUpdate
// added by cpatil end // added by cpatil end
}//END OF CLASS }//END OF CLASS
\ No newline at end of file
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