Commit 915e7877 authored by dpawar's avatar dpawar

detail receipt flush done


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94018 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 300b0109
...@@ -102,9 +102,15 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -102,9 +102,15 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
{ {
errString = retrieveBackflush(tranID,"R-BFS",1,xtraParams,conn); errString = retrieveBackflush(tranID,"R-BFS",1,xtraParams,conn);
System.out.println("After returning string from retrieveReceipt method-->>["+errString+"]"); System.out.println("After returning string from retrieveReceipt method-->>["+errString+"]");
/* if (errString.indexOf("Error") > 0) { if (errString.indexOf("Error") > -1) {
conn.rollback();
return errString; return errString;
}*/
}
else if(errString.equalsIgnoreCase("Error")){
errString = itmDBAccessEJB.getErrorString("","VTDESNCONF","","",conn);
conn.rollback();
}
} }
...@@ -757,7 +763,13 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -757,7 +763,13 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
} }
//Confirmation for BackFlush //Confirmation for BackFlush
retString=confirmBackflush(tranID,tranSer,xtraParams,conn); retString=confirmBackflush(tranID,tranSer,xtraParams,conn);
// System.out.println("after confirmation retString ---->["+retString+"]"); System.out.println("after confirmBackflush retString ---->["+retString+"]");
if(retString.equalsIgnoreCase("Error"))
{
retString = itmDBAccessLocal.getErrorString("","VTDESNCONF","","",conn);
conn.rollback();
return retString;
}
System.out.println("after confirmation lsProjCode ---->["+lsProjCode+"]"); System.out.println("after confirmation lsProjCode ---->["+lsProjCode+"]");
if (retString.trim().length()==0 && lsProjCode.trim().length() > 0) if (retString.trim().length()==0 && lsProjCode.trim().length() > 0)
...@@ -878,15 +890,9 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -878,15 +890,9 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception in retrieveReceipt method-------------["+e.getMessage()+"]"); System.out.println("Exception in retrieveReceipt method-------------["+e.getMessage()+"]");
retString=e.getMessage();
e.printStackTrace(); e.printStackTrace();
try { return "Error";
conn.rollback();
} catch (SQLException e1) {
// TODO Auto-generated catch block
System.out.println("Exception while rollback transaction..........");
e1.printStackTrace();
}
} }
return retString; return retString;
...@@ -1246,7 +1252,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1246,7 +1252,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
lsSuppCodeMfg=rs.getString(1) == null ? "" : rs.getString(1).trim();; lsSuppCodeMfg=rs.getString(1) == null ? "" : rs.getString(1).trim();
} }
System.out.println("ldtMfgdt-------->>["+ldtMfgdt.toString()+"]"); System.out.println("ldtMfgdt-------->>["+ldtMfgdt.toString()+"]");
if(rs != null) if(rs != null)
...@@ -1531,8 +1537,11 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1531,8 +1537,11 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranID); pstmt.setString(1, tranID);
rs=pstmt.executeQuery(); rs=pstmt.executeQuery();
int count=0;
while(rs.next()) while(rs.next())
{ {
count++;
System.out.println("in while of condition-------------count-->>["+count+"]");
lsLineno=rs.getString(1) == null ? "" : rs.getString(1) ; lsLineno=rs.getString(1) == null ? "" : rs.getString(1) ;
lsItemcode=rs.getString(2) == null ? "" : rs.getString(2) ; lsItemcode=rs.getString(2) == null ? "" : rs.getString(2) ;
lsSitecode=rs.getString(3) == null ? "" : rs.getString(3) ; lsSitecode=rs.getString(3) == null ? "" : rs.getString(3) ;
...@@ -1580,7 +1589,8 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1580,7 +1589,8 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
{ {
pstmt1.close(); pstmt1.close();
pstmt1=null; pstmt1=null;
} }
System.out.println("lcQuantityDet---------->>["+lcQuantityDet+"]"); System.out.println("lcQuantityDet---------->>["+lcQuantityDet+"]");
if(lcQuantityDet > 0 && !(isRecordFound)) if(lcQuantityDet > 0 && !(isRecordFound))
{ {
...@@ -1588,11 +1598,11 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1588,11 +1598,11 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
errorCode = itmDBAccessLocal1.getErrorString("","VXSTK2","","",conn); errorCode = itmDBAccessLocal1.getErrorString("","VXSTK2","","",conn);
return errorCode; return errorCode;
} }
sql=" select item_ser,item_stru from item where item_code= ?"; sql="select item_ser,item_stru from item where item_code= ?";
pstmt1=conn.prepareStatement(sql); pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1, lsItemcode); pstmt1.setString(1, lsItemcode);
rs1=pstmt.executeQuery(); rs1=pstmt1.executeQuery();
if(rs.next()) if(rs1.next()) //i got it
{ {
lsItemser=rs1.getString(1) ==null ? "" : rs1.getString(1); lsItemser=rs1.getString(1) ==null ? "" : rs1.getString(1);
lsItemStru=rs1.getString(2) ==null ? "" : rs1.getString(2); lsItemStru=rs1.getString(2) ==null ? "" : rs1.getString(2);
...@@ -1611,7 +1621,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1611,7 +1621,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
} }
if(lcQuantityDet < 0) if(lcQuantityDet < 0)
{ {
lcRate = lcDetrate; lcRate = lcDetrate;
lcGrossrate = lcDetrate; lcGrossrate = lcDetrate;
...@@ -1634,7 +1644,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1634,7 +1644,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
} }
} }
else else
{ {
lsAcctcodecr = lsAcctcodedet; lsAcctcodecr = lsAcctcodedet;
lsCctrcodecr = lsCctrcodedet; lsCctrcodecr = lsCctrcodedet;
} }
...@@ -1651,7 +1661,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1651,7 +1661,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
lsGrade=lsGrade ==null ? "" : lsGrade; lsGrade=lsGrade ==null ? "" : lsGrade;
if (lcQuantityDet > 0) if (lcQuantityDet > 0)
{ {
lcAmount += (lcRate * lcQuantityDet); lcAmount += (lcRate * lcQuantityDet);
lcGrossamount += (lcGrossrate * lcQuantityDet); lcGrossamount += (lcGrossrate * lcQuantityDet);
} }
...@@ -1714,7 +1724,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1714,7 +1724,7 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
pstmt1=null; pstmt1=null;
} }
} }
} }
System.out.println("lsCctrcodecr---->>["+lsCctrcodecr+"] lsCctrcodedr---->>"+lsCctrcodedr+"]"); System.out.println("lsCctrcodecr---->>["+lsCctrcodecr+"] lsCctrcodedr---->>"+lsCctrcodedr+"]");
if(lsCctrcodecr == null || lsCctrcodecr.trim().length() == 0) if(lsCctrcodecr == null || lsCctrcodecr.trim().length() == 0)
{ {
...@@ -1759,19 +1769,20 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1759,19 +1769,20 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
stkUpdstk.put("rate",Double.toString(lcRate)); stkUpdstk.put("rate",Double.toString(lcRate));
stkUpdstk.put("gross_rate",Double.toString(lcGrossrate)); stkUpdstk.put("gross_rate",Double.toString(lcGrossrate));
} }
stkUpdstk.put("item_ser",""); stkUpdstk.put("item_ser","");
if(lsItemStru == null || !lsItemStru.equalsIgnoreCase("R")) if(lsItemStru == null || !lsItemStru.equalsIgnoreCase("R"))
{ {
StockUpdate stkUpd = new StockUpdate(); StockUpdate stkUpd = new StockUpdate();
errorCode = stkUpd.updateStock(stkUpdstk,xtraParams,conn); errorCode = stkUpd.updateStock(stkUpdstk,xtraParams,conn);
System.out.println("After calling updateStock error string--->>["+errorCode+"]");
stkUpd = null; stkUpd = null;
if(errorCode.indexOf("Error") != -1) if(errorCode.indexOf("Error") != -1)
break; break;
} }
stkUpdstk.clear(); stkUpdstk.clear();
}//end while lsAcctcodedr }//end while lsAcctcodedr
if(rs != null) if(rs != null)
{ {
...@@ -1956,18 +1967,10 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus ...@@ -1956,18 +1967,10 @@ public class RcpBackflushConfirm extends ActionHandlerEJB implements RcpBackflus
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception : confirmBackflush() method------------"); System.out.println("Exception : confirmBackflush() method------------");
errorCode=e.getMessage(); e.printStackTrace();
try { return "Error";
conn.rollback(); }
} catch (SQLException e1) {
// TODO Auto-generated catch block
System.out.println("Exception while rollback transaction..........");
e1.printStackTrace();
}
}
return errorCode; return errorCode;
......
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