Commit 46e48f1c authored by dsawant's avatar dsawant

UPDATED FOR RATE OR OLDRATE SAME AND AMT DIFF ZERO


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94991 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d7cd0c29
...@@ -2097,12 +2097,15 @@ public class InvAcct ...@@ -2097,12 +2097,15 @@ public class InvAcct
updateAcctMap.put("dr_amt", diffAmt); updateAcctMap.put("dr_amt", diffAmt);
updateAcctMap.put("cr_amt", 0); updateAcctMap.put("cr_amt", 0);
System.out.println("CREDIT MA"+updateAcctMap); System.out.println("CREDIT MA"+updateAcctMap);
if(diffAmt != 0)
{
errString = finCommon.glTraceUpdate(updateAcctMap,conn); errString = finCommon.glTraceUpdate(updateAcctMap,conn);
if(errString != null && errString.trim().length() > 0 ) if(errString != null && errString.trim().length() > 0 )
{ {
break; break;
} }
}
// stk acct debit // stk acct debit
} }
else else
...@@ -2128,12 +2131,16 @@ public class InvAcct ...@@ -2128,12 +2131,16 @@ public class InvAcct
updateAcctMap.put("analysis3",analysis3__cr); updateAcctMap.put("analysis3",analysis3__cr);
System.out.println("DEBIT MA"+updateAcctMap); System.out.println("DEBIT MA"+updateAcctMap);
if(diffAmt != 0)
{
errString = finCommon.glTraceUpdate(updateAcctMap,conn); errString = finCommon.glTraceUpdate(updateAcctMap,conn);
if(errString != null && errString.trim().length() > 0 ) if(errString != null && errString.trim().length() > 0 )
{ {
break; break;
} }
}
//inrev cred //inrev cred
} }
...@@ -2157,6 +2164,8 @@ public class InvAcct ...@@ -2157,6 +2164,8 @@ public class InvAcct
updateAcctMap.put("analysis2",analysis2__dr); updateAcctMap.put("analysis2",analysis2__dr);
updateAcctMap.put("analysis3",analysis3__dr); updateAcctMap.put("analysis3",analysis3__dr);
System.out.println("DEBIT MA1"+updateAcctMap); System.out.println("DEBIT MA1"+updateAcctMap);
if(diffAmt != 0)
{
errString = finCommon.glTraceUpdate(updateAcctMap,conn); errString = finCommon.glTraceUpdate(updateAcctMap,conn);
if(errString != null && errString.trim().length() > 0 ) if(errString != null && errString.trim().length() > 0 )
...@@ -2164,6 +2173,7 @@ public class InvAcct ...@@ -2164,6 +2173,7 @@ public class InvAcct
break; break;
} }
// stk acct debit // stk acct debit
}
} }
...@@ -2179,6 +2189,8 @@ public class InvAcct ...@@ -2179,6 +2189,8 @@ public class InvAcct
updateAcctMap.put("dr_amt", 0); updateAcctMap.put("dr_amt", 0);
updateAcctMap.put("cr_amt", diffAmt); updateAcctMap.put("cr_amt", diffAmt);
System.out.println("CREDIT MA1"+updateAcctMap); System.out.println("CREDIT MA1"+updateAcctMap);
if(diffAmt != 0)
{
errString = finCommon.glTraceUpdate(updateAcctMap,conn); errString = finCommon.glTraceUpdate(updateAcctMap,conn);
if(errString != null && errString.trim().length() > 0 ) if(errString != null && errString.trim().length() > 0 )
...@@ -2186,6 +2198,7 @@ public class InvAcct ...@@ -2186,6 +2198,7 @@ public class InvAcct
break; break;
} }
//inrev cred //inrev cred
}
} }
......
...@@ -52,7 +52,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -52,7 +52,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
String errCall=""; String errCall="";
PreparedStatement pstmt=null; PreparedStatement pstmt=null;
String errString="",sql="",loginEmpCode="",siteCode="",itemCode="",locCode="",lotNo="",lotSl="",lineNo=""; String errString="",sql="",loginEmpCode="",siteCode="",itemCode="",locCode="",lotNo="",lotSl="",lineNo="";
double PriceListRate=0,amount=0; double PriceListRate=0,amount=0,rateOld=0;
ConnDriver ConnDriver = new ConnDriver(); ConnDriver ConnDriver = new ConnDriver();
Map <String,String>updateStockMap =new HashMap<String,String>(); Map <String,String>updateStockMap =new HashMap<String,String>();
...@@ -99,7 +99,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -99,7 +99,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
//VTCONSUCC //VTCONSUCC
tranId=tranId==null ? "" :tranId.trim(); tranId=tranId==null ? "" :tranId.trim();
sql="select h.site_code,d.rate,d.item_code,d.loc_code,d.lot_no,d.lot_sl,d.line_no " sql="select h.site_code,d.rate,d.item_code,d.loc_code,d.lot_no,d.lot_sl,d.line_no,d.rate__old "
+ "from stock_val_adj h,stock_val_adj_det d where h.tran_id=d.tran_id and d.tran_id = ?"; + "from stock_val_adj h,stock_val_adj_det d where h.tran_id=d.tran_id and d.tran_id = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
...@@ -110,9 +110,10 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -110,9 +110,10 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
PriceListRate=rs.getDouble(2); PriceListRate=rs.getDouble(2);
itemCode=checkNull(rs.getString(3)); itemCode=checkNull(rs.getString(3));
locCode=checkNull(rs.getString(4)); locCode=checkNull(rs.getString(4));
lotNo=checkNull(rs.getString(5)); lotNo=rs.getString(5);
lotSl=checkNull(rs.getString(6)); lotSl=rs.getString(6);
lineNo=checkNull(rs.getString(7)); lineNo=checkNull(rs.getString(7));
rateOld=rs.getDouble(8);
updateStockMap.put("price_list_rate",Double.toString(PriceListRate)); updateStockMap.put("price_list_rate",Double.toString(PriceListRate));
updateStockMap.put("item_code",itemCode); updateStockMap.put("item_code",itemCode);
...@@ -120,6 +121,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -120,6 +121,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
updateStockMap.put("loc_code",locCode); updateStockMap.put("loc_code",locCode);
updateStockMap.put("lot_no",lotNo); updateStockMap.put("lot_no",lotNo);
updateStockMap.put("lot_sl",lotSl); updateStockMap.put("lot_sl",lotSl);
updateStockMap.put("rate__old",Double.toString(rateOld));
errCall = inv.stkAdjust(tranId,lineNo,conn); errCall = inv.stkAdjust(tranId,lineNo,conn);
...@@ -136,22 +138,18 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -136,22 +138,18 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
count=updateStockValAdj(conn, loginEmpCode, tranId); count=updateStockValAdj(conn, loginEmpCode, tranId);
System.out.println("updateStockRateAsPerPriceListRate count-->["+count+"]"); System.out.println("updateStockRateAsPerPriceListRate count-->["+count+"]");
if(count > 0){ if(count > 0){
System.out.println("654321");
System.out.println("123456");
count=updateStockRateAsPerPriceListRate(conn, updateStockMap); count=updateStockRateAsPerPriceListRate(conn, updateStockMap);
System.out.println("updateStockValAdj-->>["+count+"]"); System.out.println("updateStockValAdj-->>["+count+"]");
if(count > 0){
//confirmed messages show............. //confirmed messages show.............
System.out.println("COMMITING RECORD"); System.out.println("COMMITING RECORD");
errString = itmdbAccess.getErrorString("", "STKVACONF", "", "", conn); errString = itmdbAccess.getErrorString("", "STKVACONF", "", "", conn);
//return errString; //return errString;
}
}else{ }else{
//disply error message. //disply error message.
conn.rollback(); conn.rollback();
...@@ -246,7 +244,13 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -246,7 +244,13 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
public int updateStockRateAsPerPriceListRate(Connection conn,Map<String,String> updateStockMap){ public int updateStockRateAsPerPriceListRate(Connection conn,Map<String,String> updateStockMap){
PreparedStatement pstmt=null; PreparedStatement pstmt=null;
String sql=""; String sql="";
double rate = 0,oldRate=0;
rate = Double.parseDouble(updateStockMap.get("price_list_rate"));
oldRate = Double.parseDouble(updateStockMap.get("rate__old"));
System.out.println("rate++oldRate>>>"+rate+">>>"+oldRate);
int count=0; int count=0;
if(rate != oldRate){
try{ try{
sql="update stock set rate = ? where item_code= ? and site_code = ? and loc_code = ? " sql="update stock set rate = ? where item_code= ? and site_code = ? and loc_code = ? "
+ "and lot_no = ? and lot_sl = ?"; + "and lot_no = ? and lot_sl = ?";
...@@ -266,8 +270,9 @@ public int updateStockRateAsPerPriceListRate(Connection conn,Map<String,String> ...@@ -266,8 +270,9 @@ public int updateStockRateAsPerPriceListRate(Connection conn,Map<String,String>
System.out.println("Exception in updateStockRateAsPerPriceListRate----------"); System.out.println("Exception in updateStockRateAsPerPriceListRate----------");
e.printStackTrace(); e.printStackTrace();
} }
}
return count; return count;
} }
private int updateStockValAdj(Connection conn,String loginEmpCodeL,String tranId){ private int updateStockValAdj(Connection conn,String loginEmpCodeL,String tranId){
......
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