Commit ca1478a5 authored by manohar's avatar manohar

Bug fixing in case of more than one line, line_no going 0, also the...

Bug fixing in case of more than one line, line_no going 0, also the potency_adj also considered for transfer


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97209 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c7527585
...@@ -505,7 +505,10 @@ public class WoTrfWizIC extends ValidatorEJB implements WoTrfWizICLocal, WoTrf ...@@ -505,7 +505,10 @@ public class WoTrfWizIC extends ValidatorEJB implements WoTrfWizICLocal, WoTrf
// sql = " select item_code,lot_no,lot_sl,loc_code,sum(quantity) as quantity " // sql = " select item_code,lot_no,lot_sl,loc_code,sum(quantity) as quantity "
// +" from inv_alloc_det where (case when alloc_qty is null then 0 else alloc_qty end - case when dealloc_qty is null then 0 else dealloc_qty end) > 0 and tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) " // +" from inv_alloc_det where (case when alloc_qty is null then 0 else alloc_qty end - case when dealloc_qty is null then 0 else dealloc_qty end) > 0 and tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) "
// +" GROUP BY item_code, lot_no, lot_sl, loc_code "; // +" GROUP BY item_code, lot_no, lot_sl, loc_code ";
sql = " select item_code,lot_no,lot_sl,loc_code,sum(quantity) as quantity "
// 04/02/15 manoharan consider potency_adj also
//sql = " select item_code,lot_no,lot_sl,loc_code,sum(quantity) as quantity "
sql = " select item_code,lot_no,lot_sl,loc_code,sum(quantity + case when potency_adj is null then 0 else potency_adj end) as quantity "
+" from inv_alloc_det where tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) " +" from inv_alloc_det where tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) "
+" GROUP BY item_code, lot_no, lot_sl, loc_code "; +" GROUP BY item_code, lot_no, lot_sl, loc_code ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
......
...@@ -84,6 +84,8 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -84,6 +84,8 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
double holdQty = 0; double holdQty = 0;
double potencyPerc=0,grossWeight=0,tareWeight=0,netWeight=0; double potencyPerc=0,grossWeight=0,tareWeight=0,netWeight=0;
double noArt = 0d; double noArt = 0d;
boolean isError = false;
String retString = "";
try try
{ {
...@@ -181,6 +183,9 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -181,6 +183,9 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
lotSl = genericUtility.getColumnValueFromNode("lot_sl", parentNode); lotSl = genericUtility.getColumnValueFromNode("lot_sl", parentNode);
locCodeTo = genericUtility.getColumnValueFromNode("loc_code__to", parentNode); locCodeTo = genericUtility.getColumnValueFromNode("loc_code__to", parentNode);
siteCode = genericUtility.getColumnValueFromNode("site_code", parentNode); siteCode = genericUtility.getColumnValueFromNode("site_code", parentNode);
// 03/02/15 manoharan
lineNo++; // = Integer.parseInt((genericUtility.getColumnValueFromNode("line_no", parentNode)).trim());
quantityStr = genericUtility.getColumnValueFromNode("quantity", parentNode); quantityStr = genericUtility.getColumnValueFromNode("quantity", parentNode);
list.add(locCodeTo+":"+itemCode+":"+lotNo+":"+lotSl+":"+locCode+":"+siteCode+":"+quantityStr); list.add(locCodeTo+":"+itemCode+":"+lotNo+":"+lotSl+":"+locCode+":"+siteCode+":"+quantityStr);
...@@ -240,10 +245,11 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -240,10 +245,11 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
System.out.println(" detailData final tree ::"+list.size()+"::"+list); System.out.println(" detailData final tree ::"+list.size()+"::"+list);
if(insertFlag) if(insertFlag)
{ {
conn.commit(); //conn.commit(); // 04/02/15 manoharan commented and new method with connection of stock transfer confirm called
System.out.println(" connection committed @@@@@@"); System.out.println(" connection committed @@@@@@");
StockTransferConf stconf = new StockTransferConf(); StockTransferConf stconf = new StockTransferConf();
errString = stconf.confirm(genratedTranId,xtraParams,""); //errString = stconf.confirm(genratedTranId,xtraParams,"");
errString = stconf.confirm( genratedTranId, xtraParams, "N", conn, false );
System.out.println("retString from StockTransferConf :: @:: "+errString);//CONFSUCC System.out.println("retString from StockTransferConf :: @:: "+errString);//CONFSUCC
if(errString.indexOf("CONFSUCC") > -1) if(errString.indexOf("CONFSUCC") > -1)
{ {
...@@ -392,12 +398,8 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -392,12 +398,8 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
boolean isError = false;
String retString = "";
WoTransferPrc mfgStkTrf = new WoTransferPrc(); WoTransferPrc mfgStkTrf = new WoTransferPrc();
errList = mfgStkTrf.allocTransfer(siteCode,itemCode,locCode , errList = mfgStkTrf.allocTransfer(siteCode,itemCode,locCode , lotNo,lotSl,locCodeTo ,lotNo,lotSl, quantity,stockMap, xtraParams , conn );
lotNo,lotSl,locCodeTo ,lotNo,lotSl,
quantity,stockMap, xtraParams , conn );
System.out.println("FROM ALLOC TRANSFER=="+errList.toString()); System.out.println("FROM ALLOC TRANSFER=="+errList.toString());
retString = errList.get(0).toString() ; retString = errList.get(0).toString() ;
System.out.println("FROM ALLOCTRANSFER 0 : "+retString); System.out.println("FROM ALLOCTRANSFER 0 : "+retString);
...@@ -409,7 +411,7 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -409,7 +411,7 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
if(isError == false) if(isError == false)
{ {
conn.commit(); //conn.commit();
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
sql = " UPDATE WORKORDER_ISSDET SET LOC_CODE = ? "+ sql = " UPDATE WORKORDER_ISSDET SET LOC_CODE = ? "+
" WHERE TRAN_ID IN "+ " WHERE TRAN_ID IN "+
...@@ -445,13 +447,14 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -445,13 +447,14 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
updInv = updInv+pstmt.executeUpdate(); updInv = updInv+pstmt.executeUpdate();
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} // if - mfg ctk trf } // if - mfg ctk trf
}// end of for }// end of for
System.out.println( " location updated in workorder iss @ effected lines::"+count); System.out.println( " location updated in workorder iss @ effected lines::"+count);
System.out.println( " location updated in inventory detail @ effected lines::"+count); System.out.println( " location updated in inventory detail @ effected lines::"+count);
} }
else else
{ {
...@@ -463,6 +466,12 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -463,6 +466,12 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
{ {
conn.rollback();System.out.println(" connection rollback @@@@@@"); conn.rollback();System.out.println(" connection rollback @@@@@@");
} }
// 04/02/15 manoharan commit taken from finally
if(!isError)
{
conn.commit();
}
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -475,9 +484,11 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -475,9 +484,11 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
} }
catch (Exception e1) catch (Exception e1)
{ {
errString = e.getMessage(); errString = e1.getMessage(); // 04/02/15 manoharan wrong exception object corrected
e1.printStackTrace(); e1.printStackTrace();
throw new ITMException(e1);
} }
} }
finally finally
{ {
...@@ -493,16 +504,16 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf ...@@ -493,16 +504,16 @@ public class WoTrfWizPos extends ValidatorEJB implements WoTrfWizPosLocal, WoTrf
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(errString.indexOf("CONFSUCC") > -1) /*if(errString.indexOf("CONFSUCC") > -1)
{ {
conn.commit(); conn.commit();
} }*/
} }
catch(Exception e) catch(Exception e)
{ {
e.printStackTrace(); //e.printStackTrace();
throw new ITMException(e); //throw new ITMException(e);
} }
} }
return errString; return errString;
...@@ -599,8 +610,3 @@ private String checkNull(String input) ...@@ -599,8 +610,3 @@ private String checkNull(String input)
} }
class TigerVersion
{
Integer int1 ;
Double double1 ;
}
\ 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