Commit 794cd770 authored by vvengurlekar's avatar vvengurlekar

FinCommon.java- Changes done to fetch account codes from item determination...

FinCommon.java-  Changes done to fetch account codes from item determination account in hierarchy[new method added]


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194635 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3567ed55
...@@ -5981,7 +5981,7 @@ public class FinCommon ...@@ -5981,7 +5981,7 @@ public class FinCommon
*/ */
public String getAcctDetrTtype(String itemCode, String itemSer, String purpose, String tranType, Connection conn) throws ITMException public String getAcctDetrTtype(String itemCode, String itemSer, String purpose, String tranType, Connection conn) throws ITMException
{ {
String acctCode = null, cctrCode = null, stkOpt = null, itemSerN = null, grpCode = null; /*String acctCode = null, cctrCode = null, stkOpt = null, itemSerN = null, grpCode = null;
String sql = null; String sql = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
...@@ -6171,7 +6171,7 @@ public class FinCommon ...@@ -6171,7 +6171,7 @@ public class FinCommon
else else
{ {
//Changed By pragyan on 04/Mar/15 as suggested by Manohran Sir from NVO.start //Changed By pragyan on 04/Mar/15 as suggested by Manohran Sir from NVO.start
/*sql = " SELECT ACCT_CODE__IN,CCTR_CODE__IN FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' " sql = " SELECT ACCT_CODE__IN,CCTR_CODE__IN FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' "
+ " AND ITEM_SER = '" + itemSer + "' AND TRAN_TYPE = ' '"; + " AND ITEM_SER = '" + itemSer + "' AND TRAN_TYPE = ' '";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -6245,7 +6245,7 @@ public class FinCommon ...@@ -6245,7 +6245,7 @@ public class FinCommon
pstmt.close(); pstmt = null; pstmt.close(); pstmt = null;
} }
} }
}*/ }
sql = " SELECT ACCT_CODE__IN,CCTR_CODE__IN FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' " sql = " SELECT ACCT_CODE__IN,CCTR_CODE__IN FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' "
+ " AND ITEM_SER = '"+ itemSer + "' AND TRAN_TYPE = '" + tranType + "' AND FIN_ENTITY = ' ' "; + " AND ITEM_SER = '"+ itemSer + "' AND TRAN_TYPE = '" + tranType + "' AND FIN_ENTITY = ' ' ";
...@@ -9756,8 +9756,8 @@ public class FinCommon ...@@ -9756,8 +9756,8 @@ public class FinCommon
//start Changes By sAkhtar on 28 june 2010 //start Changes By sAkhtar on 28 june 2010
else if(purpose.equalsIgnoreCase("ACCDEPR")) // ACCOUNT CODE ACCUMULATED DEPR FOR FIXED ASSET else if(purpose.equalsIgnoreCase("ACCDEPR")) // ACCOUNT CODE ACCUMULATED DEPR FOR FIXED ASSET
{ {
/*sql = " select acct_code__acc_depr,cctr_code__acc_depr from item_acct_detr where item_code = ?" sql = " select acct_code__acc_depr,cctr_code__acc_depr from item_acct_detr where item_code = ?"
+ " and item_ser = ? and grp_code = ? ";*/ + " and item_ser = ? and grp_code = ? ";
sql = " SELECT ACCT_CODE__ACC_DEPR,CCTR_CODE__ACC_DEPR FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' " sql = " SELECT ACCT_CODE__ACC_DEPR,CCTR_CODE__ACC_DEPR FROM ITEM_ACCT_DETR WHERE ITEM_CODE = '" + itemCode + "' "
+ " AND ITEM_SER = '" + itemSer + "' AND TRAN_TYPE = '" + tranType + "' AND FIN_ENTITY = ' ' "; + " AND ITEM_SER = '" + itemSer + "' AND TRAN_TYPE = '" + tranType + "' AND FIN_ENTITY = ' ' ";
...@@ -9879,8 +9879,8 @@ public class FinCommon ...@@ -9879,8 +9879,8 @@ public class FinCommon
if (acctCode == null || acctCode.trim().length() == 0) if (acctCode == null || acctCode.trim().length() == 0)
{ {
//changes by sarita on 28 JUN 18 to change column name CCTR_CODE__ACC to [CCTR_CODE__ACC_DEPR] == START //changes by sarita on 28 JUN 18 to change column name CCTR_CODE__ACC to [CCTR_CODE__ACC_DEPR] == START
/*sql = " SELECT ACCT_CODE__ACC_DEPR,CCTR_CODE__ACC FROM ITEM_ACCT_DETR WHERE ITEM_SER = '"+ itemSerN +"' AND ITEM_CODE = ' ' " sql = " SELECT ACCT_CODE__ACC_DEPR,CCTR_CODE__ACC FROM ITEM_ACCT_DETR WHERE ITEM_SER = '"+ itemSerN +"' AND ITEM_CODE = ' ' "
+ " AND TRAN_TYPE = ' ' AND FIN_ENTITY = ' '";*/ + " AND TRAN_TYPE = ' ' AND FIN_ENTITY = ' '";
sql = " SELECT ACCT_CODE__ACC_DEPR,CCTR_CODE__ACC_DEPR FROM ITEM_ACCT_DETR WHERE ITEM_SER = '"+ itemSerN +"' AND ITEM_CODE = ' ' " sql = " SELECT ACCT_CODE__ACC_DEPR,CCTR_CODE__ACC_DEPR FROM ITEM_ACCT_DETR WHERE ITEM_SER = '"+ itemSerN +"' AND ITEM_CODE = ' ' "
+ " AND TRAN_TYPE = ' ' AND FIN_ENTITY = ' '"; + " AND TRAN_TYPE = ' ' AND FIN_ENTITY = ' '";
//changes by sarita on 28 JUN 18 to change column name CCTR_CODE__ACC to [CCTR_CODE__ACC_DEPR] == END //changes by sarita on 28 JUN 18 to change column name CCTR_CODE__ACC to [CCTR_CODE__ACC_DEPR] == END
...@@ -11029,7 +11029,8 @@ public class FinCommon ...@@ -11029,7 +11029,8 @@ public class FinCommon
} }
} }
System.out.println("From getFromAcctDetr [" + acctCode + "," + cctrCode + "]"); System.out.println("From getFromAcctDetr [" + acctCode + "," + cctrCode + "]");
return acctCode + "," + cctrCode; return acctCode + "," + cctrCode;*/
return getAcctDetrTtype(itemCode, itemSer, purpose, tranType, "", conn);
} }
///////////// /////////////
/** /**
...@@ -16956,7 +16957,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit ...@@ -16956,7 +16957,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit
+purpose+"]---\n tranType--["+tranType+"]---\n siteCode--["+siteCode+"]"); +purpose+"]---\n tranType--["+tranType+"]---\n siteCode--["+siteCode+"]");
int ctr = 0; int ctr = 0;
String sql = ""; String sql = "";
String groupCode = "", itemSeries = "", finEntity = ""; String groupCode = "", itemSeries = "", finEntity = "", stkOpt = "";
String itemSerVal = "", itemCodeVal = "", tranTypeVal = "", finEntityVal = "", groupCdVal = ""; String itemSerVal = "", itemCodeVal = "", tranTypeVal = "", finEntityVal = "", groupCdVal = "";
String acctCode = "", cctrCode = ""; String acctCode = "", cctrCode = "";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
...@@ -17034,6 +17035,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit ...@@ -17034,6 +17035,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit
itemSeries = " "; itemSeries = " ";
} }
String acctColName = "", cctrColName = ""; String acctColName = "", cctrColName = "";
if("DIS".equalsIgnoreCase(purpose)) if("DIS".equalsIgnoreCase(purpose))
{ {
acctColName = "acct_code__dis"; acctColName = "acct_code__dis";
...@@ -17064,7 +17066,152 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit ...@@ -17064,7 +17066,152 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit
acctColName = "acct_code__sret"; acctColName = "acct_code__sret";
cctrColName = "cctr_code__sret"; cctrColName = "cctr_code__sret";
} }
else if("IN".equalsIgnoreCase(purpose))
{
sql = "select stk_opt from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
stkOpt = checkNull(rs.getString("stk_opt"));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(stkOpt.equalsIgnoreCase("0"))
{
acctColName = "acct_code__ph";
cctrColName = "cctr_code__ph";
}
else
{
acctColName = "acct_code__in";
cctrColName = "cctr_code__in";
}
}
else if("PO".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__ap";
cctrColName = "cctr_code__ap";
}
else if("POVOU".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__ap";
cctrColName = "cctr_code__ap";
}
else if("PORCP".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__pr";
cctrColName = "cctr_code__pr";
}
else if("STKINV".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__in";
cctrColName = "cctr_code__in";
}
else if("ADDCOST".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__adcost";
cctrColName = "cctr_code__adcost";
}
else if("CISS".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__ciss";
cctrColName = "cctr_code__ciss";
}
else if("XFRX".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__trf";
cctrColName = "cctr_code__trf";
}
else if("FA-PL".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__pl";
cctrColName = "cctr_code__pl";
}
else if("FA-LOSS".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__loss";
cctrColName = "cctr_code__loss";
}
else if("FA".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__fa";
cctrColName = "cctr_code__fa";
}
else if("ACCDEPR".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__acc_depr";
cctrColName = "cctr_code__acc_depr";
}
else if("DEPR".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__depr";
cctrColName = "cctr_code__depr";
}
else if("DEPRWB".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__depr_wb";
cctrColName = "cctr_code__depr_wb";
}
else if("PPV".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__ppv";
cctrColName = "cctr_code__ppv";
}
else if("PH".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__ph";
cctrColName = "cctr_code__ph";
}
else if("AREV".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__arev";
cctrColName = "cctr_code__arev";
}
else if("CRREV".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__crrev";
cctrColName = "cctr_code__crrev";
}
else if("DREV".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__drev";
cctrColName = "cctr_code__drev";
}
else if("DRREV".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__drrev";
cctrColName = "cctr_code__drrev";
}
else if("FRECOST".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__fre";
cctrColName = "cctr_code__fre";
}
else if("CLECOST".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__cle";
cctrColName = "cctr_code__cle";
}
else if("INSCOST".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__ins";
cctrColName = "cctr_code__ins";
}
else if("STKINVRCP".equalsIgnoreCase(purpose))
{
acctColName = "acct_code__iss";
cctrColName = "cctr_code__iss";
}
itemSerVal = itemSer; itemSerVal = itemSer;
itemCodeVal = itemCode; itemCodeVal = itemCode;
tranTypeVal = tranType; tranTypeVal = tranType;
...@@ -17249,6 +17396,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit ...@@ -17249,6 +17396,7 @@ public String nfCheckPeriod(String modCode, java.util.Date tranDate , String sit
throw new ITMException(e1); throw new ITMException(e1);
} }
} }
System.out.println("acctCode::::["+acctCode+"] cctrCode::::["+cctrCode+"]");
return acctCode + "," + cctrCode; return acctCode + "," + cctrCode;
} }
//Ended by Varsha V on 06-12-18 getAcctDetrtType with site code //Ended by Varsha V on 06-12-18 getAcctDetrtType with site code
......
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