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