Commit 8aeb6eb7 authored by kshinde's avatar kshinde

In Stock Revaluation process Inventory accounting only if disparm variable is Y[D18ASHL001]

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183196 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7fec9b87
...@@ -96,6 +96,7 @@ public String process(Document dom, Document dom2, String windowName, String xtr ...@@ -96,6 +96,7 @@ public String process(Document dom, Document dom2, String windowName, String xtr
String headerXml="",detail2Xml="",locCode="",accCodeInvOld="",cctrCodeInvOld=""; String headerXml="",detail2Xml="",locCode="",accCodeInvOld="",cctrCodeInvOld="";
try{ try{
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
// genericUtility = GenericUtility.getInstance(); // genericUtility = GenericUtility.getInstance();
itmdbAccess=new ITMDBAccessEJB(); itmdbAccess=new ITMDBAccessEJB();
vdt=new ValidatorEJB(); vdt=new ValidatorEJB();
...@@ -120,7 +121,8 @@ conn = getConnection(); ...@@ -120,7 +121,8 @@ conn = getConnection();
//Validation for Site code //Validation for Site code
if (siteCode.length() == 0 ){ if (siteCode.length() == 0 ){
errCode = "VTSITECNE"; errCode = "VTSITECNE";
errorString = vdt.getErrorString("site_code",errCode,userId); //errorString = vdt.getErrorString("site_code",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("site_code",errCode,"","",conn);
return errorString; return errorString;
}else{ }else{
...@@ -128,14 +130,16 @@ conn = getConnection(); ...@@ -128,14 +130,16 @@ conn = getConnection();
if(cnt == 0){ if(cnt == 0){
System.out.println("site_code not exist validation fire"); System.out.println("site_code not exist validation fire");
errCode = "VTSITENEX"; errCode = "VTSITENEX";
errorString = vdt.getErrorString("site_code",errCode,userId); //errorString = vdt.getErrorString("site_code",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("site_code",errCode,"","",conn);
return errorString; return errorString;
} }
} }
//Validation for item series From //Validation for item series From
if (itemSerFrm.length() == 0 ){ if (itemSerFrm.length() == 0 ){
errCode = "VTISERFNN"; errCode = "VTISERFNN";
errorString = vdt.getErrorString("item_ser__from",errCode,userId); //errorString = vdt.getErrorString("item_ser__from",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("item_ser__from",errCode,"","",conn);
return errorString; return errorString;
}else{ }else{
...@@ -145,7 +149,8 @@ conn = getConnection(); ...@@ -145,7 +149,8 @@ conn = getConnection();
if(cnt == 0){ if(cnt == 0){
System.out.println("itemSerFrm not exist validation fire"); System.out.println("itemSerFrm not exist validation fire");
errCode = "VTISERFNE"; errCode = "VTISERFNE";
errorString = vdt.getErrorString("item_ser__from",errCode,userId); //errorString = vdt.getErrorString("item_ser__from",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("item_ser__from",errCode,"","",conn);
return errorString; return errorString;
} }
} }
...@@ -154,7 +159,8 @@ conn = getConnection(); ...@@ -154,7 +159,8 @@ conn = getConnection();
//Validation for item series To //Validation for item series To
if (itemSerTo.length() == 0 ){ if (itemSerTo.length() == 0 ){
errCode = "VTISERTNN"; errCode = "VTISERTNN";
errorString = vdt.getErrorString("item_ser__to",errCode,userId); //errorString = vdt.getErrorString("item_ser__to",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("item_ser__to",errCode,"","",conn);
return errorString; return errorString;
}else{ }else{
...@@ -164,7 +170,8 @@ conn = getConnection(); ...@@ -164,7 +170,8 @@ conn = getConnection();
if(cnt == 0){ if(cnt == 0){
System.out.println("itemSerTo not exist validation fire"); System.out.println("itemSerTo not exist validation fire");
errCode = "VTISERTNE"; errCode = "VTISERTNE";
errorString = vdt.getErrorString("item_ser__to",errCode,userId); //errorString = vdt.getErrorString("item_ser__to",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("item_ser__to",errCode,"","",conn);
return errorString; return errorString;
} }
} }
...@@ -173,7 +180,8 @@ conn = getConnection(); ...@@ -173,7 +180,8 @@ conn = getConnection();
//Validation for item code from //Validation for item code from
if (itemCodeFrm.length() == 0 ){ if (itemCodeFrm.length() == 0 ){
errCode = "VTITMCFNN"; errCode = "VTITMCFNN";
errorString = vdt.getErrorString("item_code__from",errCode,userId); //errorString = vdt.getErrorString("item_code__from",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("item_code__from",errCode,"","",conn);
return errorString; return errorString;
}else{ }else{
...@@ -183,7 +191,8 @@ conn = getConnection(); ...@@ -183,7 +191,8 @@ conn = getConnection();
if(cnt == 0){ if(cnt == 0){
System.out.println("itemCodeFrm not exist validation fire"); System.out.println("itemCodeFrm not exist validation fire");
errCode = "VTITMCFNE"; errCode = "VTITMCFNE";
errorString = vdt.getErrorString("item_code__from",errCode,userId); //errorString = vdt.getErrorString("item_code__from",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("item_code__from",errCode,"","",conn);
return errorString; return errorString;
} }
} }
...@@ -192,7 +201,8 @@ conn = getConnection(); ...@@ -192,7 +201,8 @@ conn = getConnection();
//Validation for item code To //Validation for item code To
if (itemCodeTo.length() == 0 ){ if (itemCodeTo.length() == 0 ){
errCode = "VTITMCTNN"; errCode = "VTITMCTNN";
errorString = vdt.getErrorString("item_code_to",errCode,userId); //errorString = vdt.getErrorString("item_code_to",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("item_code_to",errCode,"","",conn);
return errorString; return errorString;
}else{ }else{
...@@ -202,7 +212,8 @@ conn = getConnection(); ...@@ -202,7 +212,8 @@ conn = getConnection();
if(cnt == 0){ if(cnt == 0){
System.out.println("itemCodeTo not exist validation fire"); System.out.println("itemCodeTo not exist validation fire");
errCode = "VTITMCTNE"; errCode = "VTITMCTNE";
errorString = vdt.getErrorString("item_code_to",errCode,userId); //errorString = vdt.getErrorString("item_code_to",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("item_code_to",errCode,"","",conn);
return errorString; return errorString;
} }
} }
...@@ -211,13 +222,15 @@ conn = getConnection(); ...@@ -211,13 +222,15 @@ conn = getConnection();
//Validation for Reason code //Validation for Reason code
if (reasonCode.length() == 0 ){ if (reasonCode.length() == 0 ){
errCode = "VTRESNCNN"; errCode = "VTRESNCNN";
errorString = vdt.getErrorString("reason_code",errCode,userId); //errorString = vdt.getErrorString("reason_code",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("reason_code",errCode,"","",conn);
return errorString; return errorString;
}else{ }else{
cnt=getDBRowCount(conn,"finparm","var_value",reasonCode); cnt=getDBRowCount(conn,"finparm","var_value",reasonCode);
if(cnt == 0){ if(cnt == 0){
errCode = "VTRESNCNE"; errCode = "VTRESNCNE";
errorString = vdt.getErrorString("reason_code",errCode,userId); //errorString = vdt.getErrorString("reason_code",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("reason_code",errCode,"","",conn);
return errorString; return errorString;
} }
...@@ -226,7 +239,8 @@ conn = getConnection(); ...@@ -226,7 +239,8 @@ conn = getConnection();
if(priceList.length() == 0){ if(priceList.length() == 0){
priceList = genericUtility.getColumnValue("price_list",dom); priceList = genericUtility.getColumnValue("price_list",dom);
errCode = "VTPRCLNN"; errCode = "VTPRCLNN";
errorString = vdt.getErrorString("price_list",errCode,userId); //errorString = vdt.getErrorString("price_list",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("price_list",errCode,"","",conn);
return errorString; return errorString;
}else{ }else{
...@@ -242,7 +256,8 @@ conn = getConnection(); ...@@ -242,7 +256,8 @@ conn = getConnection();
if(cnt == 0) if(cnt == 0)
{ {
errCode = "STKVALPRAE"; errCode = "STKVALPRAE";
errorString = vdt.getErrorString("price_list",errCode,userId); //errorString = vdt.getErrorString("price_list",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("price_list",errCode,"","",conn);
return errorString; return errorString;
} }
...@@ -303,7 +318,8 @@ conn = getConnection(); ...@@ -303,7 +318,8 @@ conn = getConnection();
if(! isRecordFound){ if(! isRecordFound){
conn.rollback(); conn.rollback();
errCode = "VTDNFEV";// data not found errCode = "VTDNFEV";// data not found
errorString = vdt.getErrorString("",errCode,userId); //errorString = vdt.getErrorString("",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("",errCode,"","",conn);
return errorString; return errorString;
} }
//recordProcess //recordProcess
...@@ -403,17 +419,21 @@ conn = getConnection(); ...@@ -403,17 +419,21 @@ conn = getConnection();
isRecordPrc=true; isRecordPrc=true;
if (errorString.indexOf("Success") > -1) if (errorString.indexOf("Success") > -1)
{ {
conn.commit(); //conn.commit();
System.out.println("Record saved Successfully12......"); System.out.println("Record saved Successfully12......");
System.out.println("autoConfirm----->>["+autoConfirm+"]"); System.out.println("autoConfirm----->>["+autoConfirm+"]");
if("Y".equalsIgnoreCase(autoConfirm)){ if("Y".equalsIgnoreCase(autoConfirm)){
StockValAdjTranConf objStockAdj=new StockValAdjTranConf(); StockValAdjTranConf objStockAdj=new StockValAdjTranConf();
errorString=objStockAdj.confirm(stockRevalAdjTranID,xtraParams,""); errorString=objStockAdj.confirmTran(stockRevalAdjTranID,xtraParams,"",conn);
System.out.println("After Confirming record errorString--->>["+errorString+"]"); System.out.println("After Confirming record errorString--->>["+errorString+"]");
System.out.println("Index=="+errorString.indexOf("STKVACONF"));
if(errorString!=null && errorString.indexOf("STKVACONF") > -1){ if(errorString!=null && errorString.indexOf("STKVACONF") > -1){
}else{ }
conn.commit(); else
{
System.out.println("returning errorString");
//conn.commit();
return errorString; return errorString;
} }
}else{ }else{
...@@ -430,7 +450,8 @@ conn = getConnection(); ...@@ -430,7 +450,8 @@ conn = getConnection();
}else if (detail2Xml.length() <= 0 && ! isRecordPrc && recordProcess == itemSerSet.size()){ }else if (detail2Xml.length() <= 0 && ! isRecordPrc && recordProcess == itemSerSet.size()){
conn.rollback(); conn.rollback();
errCode = "VTNRORS";// data not found errCode = "VTNRORS";// data not found
errorString = vdt.getErrorString("",errCode,userId); //errorString = vdt.getErrorString("",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("",errCode,"","",conn);
return errorString; return errorString;
} }
...@@ -442,7 +463,8 @@ conn = getConnection(); ...@@ -442,7 +463,8 @@ conn = getConnection();
if(errorString!=null && errorString.indexOf("STKVACONF") > -1 || saveRecord){ if(errorString!=null && errorString.indexOf("STKVACONF") > -1 || saveRecord){
conn.commit(); conn.commit();
errCode = "VTPRCCSF"; errCode = "VTPRCCSF";
errorString = vdt.getErrorString("",errCode,userId); //errorString = vdt.getErrorString("",errCode,userId);
errorString=itmDBAccessEJB.getErrorString("",errCode,"","",conn);
return errorString; return errorString;
}else{ }else{
conn.rollback(); conn.rollback();
......
...@@ -29,7 +29,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -29,7 +29,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
try try
{ {
retString = confirmTran(tranId,xtraParams,forcedFlag); retString = confirmTran(tranId,xtraParams,forcedFlag,null);
System.out.println("retString >>>>"+retString); System.out.println("retString >>>>"+retString);
} }
...@@ -42,7 +42,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -42,7 +42,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
return retString; return retString;
} }
private String confirmTran(String tranId,String xtraParams,String forcedFlag) throws ITMException String confirmTran(String tranId,String xtraParams,String forcedFlag,Connection connPrc) throws ITMException
{ {
System.out.println("---------Class : StockValAdjTranConf-->> confirm method called-----------"); System.out.println("---------Class : StockValAdjTranConf-->> confirm method called-----------");
InvAcct inv = new InvAcct(); InvAcct inv = new InvAcct();
...@@ -59,6 +59,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -59,6 +59,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
int updCnt=0,count=0; int updCnt=0,count=0;
ITMDBAccessLocal itmdbAccess=new ITMDBAccessEJB(); ITMDBAccessLocal itmdbAccess=new ITMDBAccessEJB();
FinCommon finCommon = new FinCommon();
try try
{ {
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
...@@ -66,7 +67,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj ...@@ -66,7 +67,7 @@ public class StockValAdjTranConf extends ActionHandlerEJB implements StockValAdj
connDriver = new ConnDriver(); connDriver = new ConnDriver();
//Changes and Commented By Bhushan on 06-06-2016 :START //Changes and Commented By Bhushan on 06-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn=connPrc==null?getConnection():connPrc;
//Changes and Commented By Bhushan on 06-06-2016 :END //Changes and Commented By Bhushan on 06-06-2016 :END
loginEmpCode= genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode"); loginEmpCode= genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode");
loginEmpCode=loginEmpCode==null ? "" :loginEmpCode.trim(); loginEmpCode=loginEmpCode==null ? "" :loginEmpCode.trim();
...@@ -128,17 +129,27 @@ conn = getConnection(); ...@@ -128,17 +129,27 @@ conn = getConnection();
updateStockMap.put("lot_sl",lotSl); updateStockMap.put("lot_sl",lotSl);
updateStockMap.put("rate__old",Double.toString(rateOld)); updateStockMap.put("rate__old",Double.toString(rateOld));
//Changed on 3/04/2018 by Kunal to adjust stock if INVENTORY_ACCT finparm value is Y start
errCall = inv.stkAdjust(tranId,lineNo,conn); String inventoryAcct = finCommon.getFinparams("999999", "INVENTORY_ACCT",conn);
System.out.println(">>>>>>> errCall"+errCall);
if("NULLFOUND".equalsIgnoreCase(inventoryAcct) && inventoryAcct != null && inventoryAcct.trim().length()>0)
if(errCall.trim().length() > 0) {
inventoryAcct="N";
}
if("Y".equalsIgnoreCase(inventoryAcct))
{ {
System.out.println(">>>>>> isErrorcall"); errCall = inv.stkAdjust(tranId,lineNo,conn);
errString = errCall; System.out.println(">>>>>>> errCall"+errCall);
return errString;
if(errCall.trim().length() > 0)
{
System.out.println(">>>>>> isErrorcall");
errString = errCall;
return errString;
}
} }
//Changed on 3/04/2018 by Kunal end
count=updateStockValAdj(conn, loginEmpCode, tranId); count=updateStockValAdj(conn, loginEmpCode, tranId);
System.out.println("updateStockRateAsPerPriceListRate count-->["+count+"]"); System.out.println("updateStockRateAsPerPriceListRate count-->["+count+"]");
...@@ -228,7 +239,7 @@ conn = getConnection(); ...@@ -228,7 +239,7 @@ conn = getConnection();
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if (conn!=null) if (conn!=null && connPrc==null)
{ {
conn.close(); conn.close();
conn=null; conn=null;
......
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