Commit 2f232019 authored by mmhatre's avatar mmhatre

called iscctrCode method for cctr code validation

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@214506 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 249233a2
...@@ -682,7 +682,13 @@ public class AdjIssueIC extends ValidatorEJB implements AdjIssueICLocal, AdjIssu ...@@ -682,7 +682,13 @@ public class AdjIssueIC extends ValidatorEJB implements AdjIssueICLocal, AdjIssu
cctrCodeDr = this.genericUtility.getColumnValue("cctr_code__dr", dom); cctrCodeDr = this.genericUtility.getColumnValue("cctr_code__dr", dom);
if("Y".equalsIgnoreCase(inventoryAcct)) if("Y".equalsIgnoreCase(inventoryAcct))
{ {
cnt=0; //added by manish mhatre on 3-jan-2020
errCode = finCommon.isCctrCode(acctCodeDr, cctrCodeDr, " ", conn);
if (errCode != null && errCode.trim().length() > 0) {
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}//end manish
/* cnt=0;
sql = "select count(*) from costctr where cctr_code = ? "; sql = "select count(*) from costctr where cctr_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeDr); pstmt.setString(1, cctrCodeDr);
...@@ -701,14 +707,21 @@ public class AdjIssueIC extends ValidatorEJB implements AdjIssueICLocal, AdjIssu ...@@ -701,14 +707,21 @@ public class AdjIssueIC extends ValidatorEJB implements AdjIssueICLocal, AdjIssu
errCode = "VMCCTR"; errCode = "VMCCTR";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
} }
}else if(childNodeName.equalsIgnoreCase("cctr_code__cr")) }else if(childNodeName.equalsIgnoreCase("cctr_code__cr"))
{ {
cctrCodeCr = this.genericUtility.getColumnValue("cctr_code__cr", dom); cctrCodeCr = this.genericUtility.getColumnValue("cctr_code__cr", dom);
if("Y".equalsIgnoreCase(inventoryAcct)) if("Y".equalsIgnoreCase(inventoryAcct))
{ {
cnt=0;
//added by manish mhatre on 3-jan-2020
errCode = finCommon.isCctrCode(acctCodeCr, cctrCodeCr, " ", conn);
if (errCode != null && errCode.trim().length() > 0) {
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}//end manish
/*cnt=0;
sql = "select count(*) from costctr where cctr_code = ? "; sql = "select count(*) from costctr where cctr_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeCr); pstmt.setString(1, cctrCodeCr);
...@@ -727,7 +740,7 @@ public class AdjIssueIC extends ValidatorEJB implements AdjIssueICLocal, AdjIssu ...@@ -727,7 +740,7 @@ public class AdjIssueIC extends ValidatorEJB implements AdjIssueICLocal, AdjIssu
errCode = "VMCCTR"; errCode = "VMCCTR";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
} }
}else if(childNodeName.equalsIgnoreCase("rate")) }else if(childNodeName.equalsIgnoreCase("rate"))
{ {
......
...@@ -130,6 +130,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -130,6 +130,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
int cntItmSer = 0,noArt=0; int cntItmSer = 0,noArt=0;
double detQty= 0.0,detRate=0.0; double detQty= 0.0,detRate=0.0;
Date tranDate=null; Date tranDate=null;
String acctCodeCr="",acctCodeDr="",errcode=""; //added by manish mhatre
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try try
...@@ -769,7 +770,8 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -769,7 +770,8 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
else if (childNodeName.equalsIgnoreCase("cctr_code__dr")) else if (childNodeName.equalsIgnoreCase("cctr_code__dr"))
{ {
cctrCode=checkNull(genericUtility.getColumnValue("cctr_code__dr",dom)); cctrCode=checkNull(genericUtility.getColumnValue("cctr_code__dr",dom));
if(cctrCode ==null && "Y".equalsIgnoreCase(finParam) ) acctCodeDr=checkNull(genericUtility.getColumnValue("acct_code__dr",dom));
if(cctrCode == null && "Y".equalsIgnoreCase(finParam) )
{ {
System.out.println("Account validatioon fire"); System.out.println("Account validatioon fire");
errCode = "VMCCTR"; errCode = "VMCCTR";
...@@ -777,9 +779,15 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -777,9 +779,15 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else else
if(cctrCode.trim().length() > 0) if(cctrCode!=null && cctrCode.trim().length() > 0)
{ {
sql = "SELECT COUNT(*) FROM COSTCTR WHERE CCTR_CODE = ? "; //added by manish mhatre on 3-jan-2020
errcode = finCommon.isCctrCode(acctCodeDr, cctrCode, " ", conn);
if (errcode != null && errcode.trim().length() > 0) {
errList.add(errcode);
errFields.add(childNodeName.toLowerCase());
} //end manish
/*sql = "SELECT COUNT(*) FROM COSTCTR WHERE CCTR_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCode); pstmt.setString(1, cctrCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -799,13 +807,14 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -799,13 +807,14 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
errCode = "VMCCTR"; errCode = "VMCCTR";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
} }
} }
else if (childNodeName.equalsIgnoreCase("cctr_code__cr")) else if (childNodeName.equalsIgnoreCase("cctr_code__cr"))
{ {
cctrCode=checkNull(genericUtility.getColumnValue("cctr_code__cr",dom)); cctrCode=checkNull(genericUtility.getColumnValue("cctr_code__cr",dom));
if(cctrCode ==null && "Y".equalsIgnoreCase(finParam) ) acctCodeCr=checkNull(genericUtility.getColumnValue("acct_code__cr",dom));
if(cctrCode ==null && "Y".equalsIgnoreCase(finParam) )
{ {
System.out.println("Account validatioon fire"); System.out.println("Account validatioon fire");
errCode = "VMCCTR"; errCode = "VMCCTR";
...@@ -813,9 +822,15 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -813,9 +822,15 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else else
if(cctrCode.trim().length() > 0) if(cctrCode!=null && cctrCode.trim().length() > 0)
{ {
sql = "SELECT COUNT(*) FROM COSTCTR WHERE CCTR_CODE = ? "; //added by manish mhatre on 3-jan-2020
errcode = finCommon.isCctrCode(acctCodeCr, cctrCode, " ", conn);
if (errcode != null && errcode.trim().length() > 0) {
errList.add(errcode);
errFields.add(childNodeName.toLowerCase());
}//end manish
/*sql = "SELECT COUNT(*) FROM COSTCTR WHERE CCTR_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCode); pstmt.setString(1, cctrCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -835,7 +850,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -835,7 +850,7 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
errCode = "VMCCTR"; errCode = "VMCCTR";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
} }
} }
else if (childNodeName.equalsIgnoreCase("site_code__mfg")) else if (childNodeName.equalsIgnoreCase("site_code__mfg"))
......
...@@ -11,6 +11,7 @@ package ibase.webitm.ejb.dis; ...@@ -11,6 +11,7 @@ package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
//import ibase.webitm.utility.GenericUtility; //import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.util.*; import java.util.*;
...@@ -29,6 +30,7 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -29,6 +30,7 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
//Comment By Nasruddin 07-10-16 GenericUtility //Comment By Nasruddin 07-10-16 GenericUtility
//GenericUtility genericUtility = GenericUtility.getInstance(); //GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
FinCommon finCommon=new FinCommon();
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
String errString = ""; String errString = "";
...@@ -422,7 +424,7 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -422,7 +424,7 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
cctrCode = checkNull(genericUtility.getColumnValue("cctr_code", dom)); cctrCode = checkNull(genericUtility.getColumnValue("cctr_code", dom));
if(cctrCode != null && cctrCode.trim().length() > 0) if(cctrCode != null && cctrCode.trim().length() > 0)
{ {
sql = "select count(*) from costctr where cctr_code = ?"; /*sql = "select count(*) from costctr where cctr_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,cctrCode); pstmt.setString(1,cctrCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -439,7 +441,13 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre ...@@ -439,7 +441,13 @@ public class CreditTermIC extends ValidatorEJB implements CreditTermICLocal, Cre
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;*/
//added by manish mhatre on 3-jan-2020
errCode = finCommon.isCctrCode(acctCode, cctrCode, " ", conn);
if (errCode != null && errCode.trim().length() > 0) {
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}//end manish
} }
} }
} }
......
...@@ -406,8 +406,7 @@ implements CustomerLocal, CustomerRemote ...@@ -406,8 +406,7 @@ implements CustomerLocal, CustomerRemote
cnt = 0; cnt = 0;
if (cctrCodeAdv != null && cctrCodeAdv.trim().length() > 0) if (cctrCodeAdv != null && cctrCodeAdv.trim().length() > 0)
{ {
/* sql = "select count(*) as cnt from costctr where cctr_code =?";
sql = "select count(*) as cnt from costctr where cctr_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeAdv); pstmt.setString(1, cctrCodeAdv);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -425,7 +424,13 @@ implements CustomerLocal, CustomerRemote ...@@ -425,7 +424,13 @@ implements CustomerLocal, CustomerRemote
errCode = "VTCCTRCD1"; errCode = "VTCCTRCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
//added by manish mhatre on 3-jan-2020
errCode = finCommon.isCctrCode(acctCodeAdv, cctrCodeAdv, " ", conn);
if (errCode != null && errCode.trim().length() > 0) {
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}//end manish
} }
} }
else if (childNodeName.equalsIgnoreCase("group_code")) else if (childNodeName.equalsIgnoreCase("group_code"))
...@@ -844,7 +849,7 @@ implements CustomerLocal, CustomerRemote ...@@ -844,7 +849,7 @@ implements CustomerLocal, CustomerRemote
if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0) if (cctrCodeAr != null && cctrCodeAr.trim().length() > 0)
{ {
cnt = 0; /*cnt = 0;
sql = "select count(*) as cnt from costctr where cctr_code =?"; sql = "select count(*) as cnt from costctr where cctr_code =?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cctrCodeAr); pstmt.setString(1, cctrCodeAr);
...@@ -863,7 +868,13 @@ implements CustomerLocal, CustomerRemote ...@@ -863,7 +868,13 @@ implements CustomerLocal, CustomerRemote
errCode = "VTCCTRCD1"; errCode = "VTCCTRCD1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }*/
//added by manish mhatre on 3-jan-2020
errCode = finCommon.isCctrCode(acctCodeAr, cctrCodeAr, " ", conn);
if (errCode != null && errCode.trim().length() > 0) {
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}//end manish
} }
// //Changed By PriyankaC on 09/01/2018..[START] // //Changed By PriyankaC on 09/01/2018..[START]
/*else /*else
......
...@@ -154,7 +154,7 @@ PoReturnICRemote { ...@@ -154,7 +154,7 @@ PoReturnICRemote {
String poGno="",supp_code=""; String poGno="",supp_code="";
Timestamp tran_date=null; Timestamp tran_date=null;
long cnt = 0, cntc = 0,ll_sr,ll_cnt=0, ll_sel_row=0 , li_return=0 ,ll_ret=0; long cnt = 0, cntc = 0,ll_sr,ll_cnt=0, ll_sel_row=0 , li_return=0 ,ll_ret=0;
String cctrCodeDr="",cctrCodeCr=""; //added by manish mhatre
/* decimal{3} mqty,mqty1,mqty2,mperc,ld_qtytol,lc_rcp_qty,lc_old_qty,lc_qty,& /* decimal{3} mqty,mqty1,mqty2,mperc,ld_qtytol,lc_rcp_qty,lc_old_qty,lc_qty,&
lc_stk_qty,lc_qty_std, lc_order_qty , lc_porcpqty, lc_ct3_qty, lc_qty_used lc_stk_qty,lc_qty_std, lc_order_qty , lc_porcpqty, lc_ct3_qty, lc_qty_used
*/ */
...@@ -2133,7 +2133,9 @@ PoReturnICRemote { ...@@ -2133,7 +2133,9 @@ PoReturnICRemote {
mfgDate = genericUtility.getColumnValue("mfg_date", dom); mfgDate = genericUtility.getColumnValue("mfg_date", dom);
System.out.println("mfgDate@@"+mfgDate); System.out.println("mfgDate@@"+mfgDate);
ls_sitecode = checkNull(genericUtility.getColumnValue("site_code", dom1)); ls_sitecode = checkNull(genericUtility.getColumnValue("site_code", dom1));
ls_suppcode = checkNull(genericUtility.getColumnValue("supp_code", dom1)); ls_suppcode = checkNull(genericUtility.getColumnValue("supp_code", dom1));
cctrCodeDr=checkNull(genericUtility.getColumnValue("cctr_code__dr",dom));
acctCodeDr=checkNull(genericUtility.getColumnValue("acct_code__dr",dom));
if(mfgDate!=null) if(mfgDate!=null)
{ {
ldt_date = Timestamp.valueOf(genericUtility.getValidDateString(mfgDate.toString(), genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+" 00:00:00.0"); ldt_date = Timestamp.valueOf(genericUtility.getValidDateString(mfgDate.toString(), genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+" 00:00:00.0");
...@@ -2184,6 +2186,30 @@ PoReturnICRemote { ...@@ -2184,6 +2186,30 @@ PoReturnICRemote {
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
//added by manish mhatre on 3-jan-2020
if(cctrCodeDr!=null && cctrCodeDr.trim().length() > 0)
{
errCode = finCommon.isCctrCode(acctCodeDr, cctrCodeDr, " ", conn);
if (errCode != null && errCode.trim().length() > 0) {
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}//end manish
}
//added by manish mhatre on 3-jan-2020
else if (childNodeName.equalsIgnoreCase("cctr_code__cr"))
{
cctrCodeCr=checkNull(genericUtility.getColumnValue("cctr_code__cr",dom));
acctCodeCr=checkNull(genericUtility.getColumnValue("acct_code__cr",dom));
if(cctrCodeCr!=null && cctrCodeCr.trim().length() > 0)
{
errCode = finCommon.isCctrCode(acctCodeCr, cctrCodeCr, " ", conn);
if (errCode != null && errCode.trim().length() > 0) {
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}//end manish
} }
else if (childNodeName.equalsIgnoreCase("lot_no")) else if (childNodeName.equalsIgnoreCase("lot_no"))
{ {
......
...@@ -152,6 +152,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -152,6 +152,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
System.out.println("Priyanka testing : editFlag=====>> :" + editFlag); System.out.println("Priyanka testing : editFlag=====>> :" + editFlag);
String schemeStkChk=""; //added by nandkumar gadkari on 21/09/19 String schemeStkChk=""; //added by nandkumar gadkari on 21/09/19
double availQty=0.0;//added by nandkumar gadkari on 21/09/19 double availQty=0.0;//added by nandkumar gadkari on 21/09/19
String cctrCodeSal="";
try { try {
System.out.println("In empty try block"); System.out.println("In empty try block");
...@@ -1636,6 +1637,21 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal ...@@ -1636,6 +1637,21 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
} }
//end manish //end manish
if (childNodeName.equalsIgnoreCase("cctr_code__sal"))
{
cctrCodeSal = checkNull(genericUtility.getColumnValue("cctr_code__sal", dom));
acctCodeSal = checkNull(genericUtility.getColumnValue("acct_code__sal", dom));
if(cctrCodeSal != null && cctrCodeSal.trim().length() > 0)
{
errCode = finCommon.isCctrCode(acctCodeSal, cctrCodeSal," " , conn);
if( errCode != null && errCode.trim().length() > 0)
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
} // end of else if loop } // end of else if loop
// end of for // end of for
break;// end of switch break;// end of switch
......
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