Commit 2a48703f authored by mnair's avatar mnair

Added new methods

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@177577 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2ba25964
......@@ -4990,4 +4990,1358 @@ public class InvAcct
return findIndex;
}
//Changed by wasim on 05-JUN-2017 for migration NVO to Java #W16IBAS005 [END]
//Changes by mayur on 3-JUNE-2018 [START]
private String getMsg(String trace,String Code,Connection conn) throws ITMException, Exception
{
String mainStr ="";
try
{
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String errString = "";
errString = itmDBAccessEJB.getErrorString("",Code,"","",conn);
String begPart = errString.substring(0,errString.indexOf("<message>")+9);
String begDesc = errString.substring(0,errString.indexOf("<description>")+13);
String endDesc = errString.substring(errString.indexOf("</description>"));
mainStr= begPart + trace + " </message><description>";
mainStr= mainStr+endDesc;
begPart = null;
itmDBAccessEJB = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return mainStr;
}
public String acctDisRcptPost(String tranId, Connection conn) throws ITMException, Exception
{
//////////// start gbf_dist_rcp_post
PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null;
ResultSet rs = null, rs1 = null;
String errCode = "", sql = "", errString = "", currCodeBase = "", distOrder = "", tranType = "";
String itemCode = "", acctCodeCR = "", acctCodeDR = "", cctrCodeCR = "", cctrCodeDR = "", remarks = "";
String siteCode = "", finEntity = "", currCode = "", acctCodeNP = "", cctrCodeNP = "";
String acctCodeReco = "", cctrCodeReco = "", acctCodeAddcost = "", cctrCodeAddcost = "";
String itemSer = "", invOnline = "", vouchOnline = "", cctrCodeAP, acctCodeAP = "";
String suppCode = "", projCode = "";
String siteCodeShip = "", locCode = "", lotNo = "";
String lotSl = "", grpCode = "", costPriceList = "", distRcpPost = "", postTax = "", CostPlSer = "",postDiff = "";
double netAmount = 0, recoAmount = 0, grandAmount = 0;
double addAmount = 0, amountNP = 0, addAmtHdr = 0, amountCR = 0, costRate = 0, quantity =0, amountTP = 0;
Timestamp tranDate = null, effDate = null;
int lineNo = 0, totalElements = 0, foundIndex = -1, taxRow = 0,doExit = 1, len = -1, updcount = 0;
String tranSer = "",analysis = "",strTemp = "",analysis1Cr = "",analysis2Cr = "",analysis3Cr = "",analysis1Dr = "",analysis2Dr = "",analysis3Dr = "",itemCode1 = "";
String acctCodeRcp = "",cctrCodeRcp = "",cctrCodeBrTr = "",acctCodeBrTr = "",itemSer1 = "" ,transferAcctReq = "";
double amount = 0,totRecoAmt= 0, exchRate= 0;
FinCommon finCommon = null;
DistCommon distCommon = null;
ITMDBAccessEJB itmDBAccessEJB = null;
HashMap glTraceMap = null, tempMap = null,dRcpMap = null;
String[] acctCctr = null;
String[] analysisStr =null;
String tranDateStr = "",lineNoStr = "0",acctCodeTP = "", cctrCodeTP = "";
try
{
tranSer = "D-RCP";
finCommon = new FinCommon();
distCommon = new DistCommon();
itmDBAccessEJB = new ITMDBAccessEJB();
invOnline = finCommon.getFinparams("999999", "INV_ACCT_DRCP", conn);
invOnline = invOnline.trim();
if ("NULLFOUND".equals(invOnline))
{
errCode = "VTFINPARM";
errString = getMsg("FINPARM INV_ACCT_DRCP not defined",errCode, conn);
return errString;
}
if (!"Y".equals(invOnline) && !"N".equals(invOnline) && !"S".equals(invOnline))
{
errCode = "VTFINPARM";
errString = getMsg("FINPARM INV_ACCT_DRCP can have value N,Y or S",errCode, conn);
return errString;
}
// Below line commented by pravin 25/09/2013 var Value 'S' also consider' same as dist Issue
// if invOnline <> 'Y' then exit
if (invOnline == null || invOnline.trim().length() == 0 )
{
invOnline = "N";
}
if ("N".equals(invOnline))
{
return "";
}
// added by pravin 16/12/2013 for branch diff posting
// check the environment variable for branch transfer accounting.
postDiff = finCommon.getFinparams("999999", "BR_XFR_DIFF_POST", conn);
if ("NULLFOUND".equals(postDiff))
{
errCode = "VTFINPARM";
errString = getMsg("FINPARM BR_XFR_DIFF_POST not defined",errCode, conn);
return errString;
}
postDiff = postDiff.trim();
if (!"Y".equals(postDiff) && !"N".equals(postDiff) )
{
postDiff = "N";
}
// amish 17-08-04 ///cost price list from finparm
costPriceList = finCommon.getFinparams("999999", "STD_COST_PRICE", conn);
distRcpPost = finCommon.getFinparams("999999", "DIST_ISS_RCP_POST", conn);
if ("NULLFOUND".equals(distRcpPost))
{
errCode = "VTFINPARM";
errString = getMsg("FINPARM DIST_ISS_RCP_POST not defined",errCode, conn);
return errString;
}
if ("S".equals(distRcpPost) && "NULLFOUND".equals(costPriceList))
{
// if posting is standard then cost price list should be defined.
errCode = "VTFINPARM";
errString = getMsg("Standard costing configured as per FINPARM variable DIST_ISS_RCP_POST, variable for cost price list DIST_STD_COST_PL not defined",errCode, conn);
return errString;
}
// end by amish 17-08-04 ///cost price list from disparm
//begin jyoti 11/6/04
// If variable value is NULL/SPACE Then variable value is "N"
// Below line added by pravin 25/09/2013 var Value 'S' also consider' same as dist Issue FI2LSUN009
doExit = 0;
if("S".equals(invOnline))
{
sql = "select (case when s.inv_acct is null then 'N' else s.inv_acct end) as inv_acct "
+ " from distord_rcpdet r, item i, itemser s "
+ " where i.item_code = r.item_code "
+ " and s.item_ser = i.item_ser and r.tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
while(rs.next())
{
itemSer1 = rs.getString("inv_acct");
if (!"Y".equals(itemSer1))
{
doExit = 1;
break;
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
//added by Rutuja on 22-Mar-16 for req. Id. FI2LSUN009 -for branch accounting posting
sql = "select r.tran_type as tran_type, t.transfer_acct_req as transfer_acct_req from distord_rcp r,distorder_type t where t.tran_type = r.tran_type and r.tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if (rs.next())
{
tranType = rs.getString("tran_type");
transferAcctReq = rs.getString("transfer_acct_req");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if ("N".equals(transferAcctReq))
{
return "";
}
// below if condition added by pravin on 02/09/2013 FI2LSUN009
// if invOnline = 'Y' or (invOnline = 'S' and doExit <> 1)
if ("Y".equals(invOnline) || ("S".equals(invOnline) && doExit != 1) || ("Y".equals(transferAcctReq) ) )
{
// ended by Rutuja on 22-Mar-16 for req. Id. FI2LSUN009 -for branch accounting posting
// Information from the Header table
// amish 16-02-05 curr_code and exch rate added.
// amish 08-04-05 projCode
sql = "select tran_date, eff_date, site_code, site_code__ship, curr_code, exch_rate, proj_code from distord_rcp where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if (rs.next())
{
tranDate = rs.getTimestamp("tran_date");
effDate = rs.getTimestamp("eff_date");
siteCode = rs.getString("site_code");
siteCodeShip = rs.getString("site_code__ship");
currCode = rs.getString("curr_code");
exchRate = rs.getDouble("exch_rate");
projCode = rs.getString("proj_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
tranDateStr = sdf.format(tranDate);
/// amish 11-04-05 exchange rate will always be 1 in
/// dist issue receipt instrected by kandarp sir
exchRate = 1;
//end by amish 11-04-05
// Checking for the Financial Entity
sql = "select fin_entity from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
finEntity = rs.getString("fin_entity");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// Checking for the Currency Code
sql = "select curr_code from finent where fin_entity = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
rs = pstmt.executeQuery();
if (rs.next())
{
currCode = rs.getString("curr_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
/// amish 16-02-05 currency code and exchange rate validation.
if (currCode == null || currCode.trim().length() == 0)
{
errCode = "VTCURFIN";
errString = getMsg("Not able to get currency code from financial entity",errCode, conn);
return errString;
}
if (exchRate <= 0 )
{
errCode = "VTEXCHRATE";
errString = getMsg("Exchange rate cannot be negative or zero",errCode, conn);
return errString;
}
dRcpMap = new HashMap();
// Cursor to get PO Detail Data
sql = "select item_code, line_no, (case when net_amt is null then 0 else net_amt end) as net_amt, "
+ " loc_code, lot_no, lot_sl, (case when cost_rate is null then 0 else cost_rate end) as cost_rate, quantity, "
+ " (case when amount is null then 0 else amount end) as amount "// amish 17-08-04 cost rate added &
+" from distord_rcpdet where tran_id = ?" ;
// Loop to process the Accounting Effect
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, tranId);
rs1 = pstmt1.executeQuery();
while (rs.next())
{
// 19/01/09 manoharan while sqlca.sqlcode = 0 creating problem as there
// are many other select statement within the loop
//fetch cur_dist_rcp_det into :itemCode, :lineNo, :netAmount,
// :locCode, :lotNo, :lotSl, :costRate, :quantity ; // amish 17-08-04 cost rate
///********************* manohar 30-0604 commented and moved below inside loop
/// as the item_code, item_ser may be different for each item
// select item_ser, grp_code into :itemSer, :grpCode
// from item
// where item_code = :itemCode ;
//
// if get_sqlcode() < 0 then
// populateerror(9999,'populateerror')
// errString = 'DS000' + trim(String(sqlca.sqldbcode)) + "~t" + sqlca.sqlerrtext
// errString = gf_error_location(errString)+'(sql statement for picking item series and grp code from item master)' //changed by Kalpesh 21/03/02
// exit
// end if
//
// // Crediting Account Code for Issue-Site
// cctrCodeCR = gbf_acct_detr_dist(siteCodeShip, siteCode, itemSer, grpCode, itemCode, 'D-ISS')
// acctCodeCR = f_get_token(cctrCodeCR,'~t')
//
// // If ACCT Code is NULL/SPACE Then Exit
// if isnull(acctCodeCR) or len(trim(acctCodeCR)) = 0 then
// populateerror(9999,'populateerror')
// errString = 'VTACCTISS'
// errString = gf_error_location(errString)
// exit
// end if
// //the inventory account is got from item account determination distribution
//// cctrCodeDR = gbf_acct_detr_ttype(itemCode,itemSer,'STKINV',tranType)
// cctrCodeDR = gbf_acct_detr_dist(siteCodeShip, siteCode, itemSer, grpCode, itemCode, 'D-INV')
// acctCodeDR = f_get_token(cctrCodeDR,'~t')
//
// // If ACCT Code is NULL/SPACE Then Exit
// if isnull(acctCodeDR) or len(trim(acctCodeDR)) = 0 then
// populateerror(9999,'populateerror')
// errString = 'VTACCTINV'
// errString = gf_error_location(errString)
// exit
// end if
// if isnull(cctrCodeDR) or len(trim(cctrCodeDR)) = 0 then
// if (not isnull(cctrCodeCR)) and (len(trim(cctrCodeCR)) > 0) then
// cctrCodeDR = cctrCodeCR
// else
// cctrCodeDR = ' '
// end if
// end if
//
// if isnull(cctrCodeCR) or len(trim(cctrCodeCR)) = 0 then
// if (not isnull(cctrCodeDR)) and (len(trim(cctrCodeDR)) > 0) then
// cctrCodeCR = cctrCodeDR
// else
// cctrCodeCR = ' '
// end if
// end if
// *** end manoharan 30-06-04
///////////////////////////////////////////////////////////////
// ********************** IMPORTANT *************************//
///////////////////////////////////////////////////////////////
// 23/03/02 manoharan new column 'type' added in d_porcp
// for additional cost it will be 'A' and all other amount
// it will be 'X'
// in all the dw find function it should be considered
// because the acct/cctr will be same
// Purpose :- additional cost will be in base currency
// posting should be done separately
// Loop to process the Accounting Effect
itemCode = rs1.getString("item_code");
lineNo = rs1.getInt("line_no");
netAmount = rs1.getDouble("net_amt");
locCode = rs1.getString("loc_code");
lotNo = rs1.getString("lot_no");
lotSl = rs1.getString("lot_sl");
costRate = rs1.getDouble("cost_rate");
quantity = rs1.getDouble("quantity");
amount = rs1.getDouble("amount"); // amish 17-08-04 cost rate
// end 19/01/09 manoharan
// **** manoharan 30-06-04 moved from above
sql = "select item_ser, grp_code from item where item_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
itemSer = rs.getString("item_ser");
grpCode = rs.getString("grp_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// Crediting Account Code for Issue-Site
//commented by Jasmina 26/11/09-DI89UNI113, as addtional parameter tran type passed
//cctrCodeCR = gbf_acct_detr_dist(siteCodeShip, siteCode, itemSer, grpCode, itemCode, 'D-ISS')
// start Added by pravin 16/12/2013
//if environment variable 'BR_XFR_DIFF_POST' = 'Y' then cost of goods trander account is debitted
//else receiving site - branch account is debitted
if( "Y".equals(postDiff)) //jyoti 07/12/03
{
// Debit Account Code for Receiving Site
//commented by Jasmina 26/11/09-DI89UNI113, as addtional parameter tran type passed
//cctrCodeRcp = gbf_acct_detr_dist(siteCode, siteCode__dlv, itemSer, grpCode, itemCode, 'D-COGT')
cctrCodeCR = finCommon.getAcctDetrDistTtype(siteCodeShip,siteCode, itemSer,grpCode,itemCode, "D-COGT'", tranType, conn);
acctCctr = cctrCodeCR.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
if( len > -1 )
{
acctCodeCR = acctCctr[0];
}
else
{
acctCodeCR = "";
}
if( len > 0 )
{
cctrCodeCR = acctCctr[1];
}
else
{
cctrCodeCR = "";
}
}
else
{
// Debit Account Code for Receiving Site
cctrCodeCR = finCommon.getAcctDetrDistTtype(siteCodeShip, siteCode, itemSer, grpCode, itemCode, "D-ISS",tranType, conn);
acctCctr = cctrCodeCR.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
if( len > -1 )
{
acctCodeCR = acctCctr[0];
}
else
{
acctCodeCR = "";
}
if( len > 0 )
{
cctrCodeCR = acctCctr[1];
}
else
{
cctrCodeCR = "";
}
}
// If ACCT Code is NULL/SPACE Then Exit
if (cctrCodeCR == null || cctrCodeCR.trim().length() == 0 )
{
cctrCodeCR = " ";
}
// end added by pravin 16/12/2013
if (acctCodeCR == null || acctCodeCR.trim().length() == 0 )
{
// If ACCT Code is NULL/SPACE Then Exit
errCode = "VTACCTISS";
errString = getMsg("Credit account is not defined for inventory posting",errCode, conn);
break;
}
//Commented & added by jasmina 07/11/09-DI89UNI113
////the inventory account is got from item account determination distribution
////cctrCodeDR = gbf_acct_detr_ttype(itemCode,itemSer,'STKINV',tranType)
//// first get the account/cctr from stock it should be there
//// in case not there pick from item_acct_detr_dist
//select acct_code__inv,cctr_code__inv into :acctCodeDR, :cctrCodeDR
//from stock
//where item_code = :itemCode
//and site_code = :siteCode
//and loc_code = :locCode
//and lot_no = :lotNo
//and lot_sl = :lotSl ;
//if get_sqlcode() < 0 then
// populateerror(9999,'populateerror')
// errString = 'DS000' + String(sqlca.sqldbcode) + "~t" + sqlca.sqlerrtext
// errString = gf_error_location(errString)
// exit
//elseif get_sqlcode() = 100 then
// cctrCodeDR = gbf_acct_detr_dist(siteCodeShip, siteCode, itemSer, grpCode, itemCode, 'D-INV')
// acctCodeDR = f_get_token(cctrCodeDR,'~t')
//end if
//first get the account/cctr from item account dete. dist. if not found than pick up from stock
cctrCodeDR = finCommon.getAcctDetrDistTtype(siteCodeShip, siteCode, itemSer, grpCode, itemCode, "D-INV",tranType, conn);
acctCctr = cctrCodeDR.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
if( len > -1 )
{
acctCodeDR = acctCctr[0];
}
else
{
acctCodeDR = "";
}
if( len > 0 )
{
cctrCodeDR = acctCctr[1];
}
else
{
cctrCodeDR = "";
}
if (acctCodeDR == null || cctrCodeDR.trim().length() == 0)
{
sql = "select acct_code__inv,cctr_code__inv from stock where item_code = ? and site_code = ? and loc_code = ? and lot_no = ? and lot_sl = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
pstmt.setString(3, locCode);
pstmt.setString(4, lotNo);
pstmt.setString(5, lotSl);
rs = pstmt.executeQuery();
if (rs.next())
{
acctCodeDR = rs.getString("acct_code__inv");
cctrCodeDR = rs.getString("cctr_code__inv");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
//Commented & added end by jasmina 07/11/09-DI89UNI113
if (acctCodeDR == null || acctCodeDR.trim().length() == 0 )
{
// If ACCT Code is NULL/SPACE Then Exit
errCode = "VTACCTINV";
errString = getMsg("Debit account is not defined for inventory posting",errCode, conn);
break;
}
if (cctrCodeDR == null || cctrCodeDR.trim().length() == 0 )
{
if (cctrCodeCR != null && cctrCodeCR.trim().length() > 0)
{
cctrCodeDR = cctrCodeCR;
}
else
{
cctrCodeDR = " ";
}
}
if (cctrCodeCR == null || cctrCodeCR.trim().length() == 0 )
{
if (cctrCodeDR != null && cctrCodeDR.trim().length() > 0)
{
cctrCodeCR = cctrCodeDR;
}
else
{
cctrCodeCR = " ";
}
}
// *** end manoharan 30-06-04
// amish 17-08-04
// if cost rate is null or zero then pickup the rate from the price list
if ( costRate == 0 && "S".equals(distRcpPost))
{
/// amish 26-10-04 pickup the price list from the item series.
/// if not found then consider the pl from variable
CostPlSer = "";
sql = "select b.price_list__cost from item a, itemser b where a.item_ser = b.item_ser and a.item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
CostPlSer = rs.getString("price_list__cost");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (CostPlSer != null && CostPlSer.trim().length() > 0)
{
costPriceList = CostPlSer;
}
costRate = distCommon.pickRate(costPriceList,tranDateStr,itemCode,"L",conn);
if (costRate == 0 )
{
errCode = "VTITCOST";
errString = getMsg("Cost price not deined for inventory posting",errCode, conn);
break;
}
/// amish 26-10-04 update cost rate in dist issue.
sql = "update distord_rcpdet set cost_rate = ? "
+ " where tran_id = ? "
+ " and line_no = ? " ;
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1,costRate);
pstmtUpd.setString(2,tranId);
pstmtUpd.setInt(3,lineNo);
updcount = pstmtUpd.executeUpdate();
pstmtUpd = null;
}
if ("S".equals(distRcpPost)) // amish 26-10-04
{
// amish 17-08-04 // set net amount = cost rate * quantity
// bcs posting on the basis of cost rate
netAmount = costRate * quantity ;
}
if ("Y".equals(transferAcctReq))
{
amount = amount;
}
else
{
amount = netAmount;
}
//*******************************************************
// 28/03/02 mamoharan based on old object
amountCR = amountCR + netAmount;
//*******************************************************
// // sum for credit amount
// // shiri 23/04/02 redone, if no tax then credit is not posted
// amountCR = amountCR + netAmount
// added by pravin 08/03/2013 DI2KSUN011 gbf_acct_analysis_ttype call for analysis initialisetion
analysis = AcctAnalysisType( itemCode, tranSer, tranType, "CR", conn);
analysisStr = analysis.split("@");
len = analysisStr.length-1;
//System.out.println("@@@cr len["+len+"]");
if( len > -1 )
{
analysis1Cr = analysisStr[0];
}
else
{
analysis1Cr = "";
}
if( len > 0 )
{
analysis2Cr = analysisStr[1];
}
else
{
analysis2Cr = "";
}
if( len > 1)
{
analysis3Cr = analysisStr[2];
}
else
{
analysis3Cr ="";
}
analysis = AcctAnalysisType( itemCode,tranSer,tranType,"DR", conn);
analysisStr = analysis.split("@");
len = analysisStr.length-1;
//System.out.println("@@@cr len["+len+"]");
if( len > -1 )
{
analysis1Dr = analysisStr[0];
}
else
{
analysis1Dr = "";
}
if( len > 0 )
{
analysis2Dr = analysisStr[1];
}
else
{
analysis2Dr = "";
}
if( len > 1)
{
analysis3Dr = analysisStr[2];
}
else
{
analysis3Dr ="";
}
// end added by pravin 28/02/2013
if("Y".equals( invOnline) || "S".equals(invOnline))
{
if (amount != 0 ) // if ( netAmount != 0 ) changed by manoharan 31-dec-17 while migrating
{
if (dRcpMap.containsKey("X" + acctCodeDR + cctrCodeDR + analysis1Dr + analysis2Dr + analysis3Dr ))
{
tempMap = (HashMap) dRcpMap.get("X" + acctCodeDR + cctrCodeDR + analysis1Dr + analysis2Dr + analysis3Dr );
grandAmount = Double.parseDouble(tempMap.get("amount").toString());
System.out.println("tempMap[old] ==================== ["+tempMap+"]");
//System.out.println("grandAmount[old] ==================== ["+grandAmount+"]");
//System.out.println("netAmount[new] ==================== ["+netAmount+"]");
tempMap.put("amount", "" + (grandAmount + amount));
System.out.println("tempMap[new] ==================== ["+tempMap+"]");
}
else
{
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeDR);
tempMap.put("cctr_code", cctrCodeDR);
tempMap.put("amount", "" + amount);
// added by cpatil on 09-03-13 start
tempMap.put("analysis1",analysis1Dr);
tempMap.put("analysis2",analysis2Dr);
tempMap.put("analysis3",analysis3Dr);
// added by cpatil on 09-03-13 end
}
//dRcpMap.put("A" + acctCodeDR + cctrCodeDR, tempMap); // 07/11/13 manoharan commented and added following line
dRcpMap.put("X" + acctCodeDR + cctrCodeDR + analysis1Dr + analysis2Dr + analysis3Dr, tempMap);
}
}
// start added by pravin 16/12/2013 po
//if environment variable 'BR_XFR_DIFF_POST' = 'Y'
//then branch account is debitted and branch tranfer account is creditted.
if("Y".equals(postDiff) && amount != 0) //jyoti 07/12/03
{
//commented by Jasmina 26/11/09-DI89UNI113, as addtional parameter tran type passed
// Credit Account Code for Issuing Site-branch
//cctrCodeRcp = gbf_acct_detr_dist(siteCode, siteCode__dlv, itemSer, grpCode, itemCode, 'D-RCP')
cctrCodeRcp = finCommon.getAcctDetrDistTtype(siteCodeShip, siteCode, itemSer, grpCode, itemCode, "D-ISS",tranType, conn);
acctCctr = cctrCodeRcp.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
if( len > -1 )
{
acctCodeRcp = acctCctr[0];
}
else
{
acctCodeRcp = "";
}
if( len > 0 )
{
cctrCodeRcp = acctCctr[1];
}
else
{
cctrCodeRcp = "";
}
//cctrCodeRcp = gbf_acct_detr_dist_ttype(siteCode, siteCode__dlv, itemSer, grpCode, itemCode, 'D-RCP',distOrdertype)
//acctCodeRcp = f_get_token(cctrCodeRcp,'~t')
// If ACCT Code is NULL/SPACE Then Exit
if (acctCodeRcp == null || acctCodeRcp.trim().length() == 0 )
{
// If ACCT Code is NULL/SPACE Then Exit
errCode = "VTACCTRCP";
errString = getMsg("Receipt account is not defined for branch transfer posting",errCode, conn);
break;
}
if (cctrCodeRcp == null || cctrCodeRcp.trim().length() == 0 )
{
cctrCodeRcp = " ";
}
// Debiting the Site with amount + taxes
// gf_nulltostr() called to convert null to blank String by Amit on 19/09/03 for DB2.
if (dRcpMap.containsKey("C" + acctCodeRcp + cctrCodeRcp + analysis1Cr + analysis2Cr + analysis3Cr ))
{
tempMap = (HashMap) dRcpMap.get("C" + acctCodeRcp + cctrCodeRcp + analysis1Cr + analysis2Cr + analysis3Cr);
grandAmount = Double.parseDouble(tempMap.get("amount").toString());
System.out.println("tempMap[old] ==================== ["+tempMap+"]");
//System.out.println("grandAmount[old] ==================== ["+grandAmount+"]");
//System.out.println("netAmount[new] ==================== ["+netAmount+"]");
tempMap.put("amount", "" + (grandAmount + (amount * -1)));
System.out.println("tempMap[new] ==================== ["+tempMap+"]");
// 07/11/13 manoharan added as this has to be updated in the dRcpMap
}
else
{
tempMap = new HashMap();
tempMap.put("type", "C");
tempMap.put("acct_code", acctCodeRcp);
tempMap.put("cctr_code", cctrCodeRcp);
tempMap.put("amount", "" + (amount * -1));
// added by cpatil on 09-03-13 start
tempMap.put("analysis1",analysis1Cr);
tempMap.put("analysis2",analysis2Cr);
tempMap.put("analysis3",analysis3Cr);
// added by cpatil on 09-03-13 end
}
//dRcpMap.put("A" + acctCodeDR + cctrCodeDR, tempMap); // 07/11/13 manoharan commented and added following line
dRcpMap.put("C" + acctCodeRcp + cctrCodeRcp + analysis1Cr + analysis2Cr + analysis3Cr, tempMap);
// credit Account Code for branch transfer
//cctrCodeBrTr = gbf_acct_detr_dist(siteCode, siteCode__dlv, itemSer, grpCode, itemCode, 'D-BRTR')//commented by Jasmina 26/11/09-DI89UNI113, as addtional parameter tran type passed
//cctrCodeRcp = gbf_acct_detr_dist_ttype(siteCodeShip, siteCode, itemSer, grpCode, itemCode, 'D-ISS',tranType)
//acctCodeRcp = f_get_token(cctrCodeRcp,'~t')
cctrCodeBrTr = finCommon.getAcctDetrDistTtype(siteCodeShip, siteCode, itemSer, grpCode, itemCode, "D-ISS",tranType, conn);
acctCctr = cctrCodeBrTr.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
if( len > -1 )
{
acctCodeBrTr = acctCctr[0];
}
else
{
acctCodeBrTr = "";
}
if( len > 0 )
{
cctrCodeBrTr = acctCctr[1];
}
else
{
cctrCodeBrTr = "";
}
if (acctCodeBrTr == null || acctCodeBrTr.trim().length() == 0 )
{
// If ACCT Code is NULL/SPACE Then Exit
errCode = "VTACCTRCP";
errString = getMsg("Receipt account is not defined for branch transfer posting",errCode, conn);
break;
}
if (cctrCodeBrTr == null || cctrCodeBrTr.trim().length() == 0 )
{
cctrCodeBrTr = " ";
}
// Crediting the Site with amount - taxes
// gf_nulltostr() called to convert null to blank String by Amit on 19/09/03 for DB2.
if (dRcpMap.containsKey("D" + acctCodeBrTr + cctrCodeBrTr + analysis1Dr + analysis2Dr + analysis3Dr ))
{
tempMap = (HashMap) dRcpMap.get("D" + acctCodeDR + cctrCodeDR + analysis1Dr + analysis2Dr + analysis3Dr );
grandAmount = Double.parseDouble(tempMap.get("amount").toString());
System.out.println("tempMap[old] ==================== ["+tempMap+"]");
//System.out.println("grandAmount[old] ==================== ["+grandAmount+"]");
//System.out.println("netAmount[new] ==================== ["+netAmount+"]");
tempMap.put("amount", "" + (grandAmount + amount));
System.out.println("tempMap[new] ==================== ["+tempMap+"]");
}
else
{
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeBrTr);
tempMap.put("cctr_code", cctrCodeBrTr);
tempMap.put("amount", "" + amount);
// added by cpatil on 09-03-13 start
tempMap.put("analysis1",analysis1Dr);
tempMap.put("analysis2",analysis2Dr);
tempMap.put("analysis3",analysis3Dr);
// added by cpatil on 09-03-13 end
}
//dRcpMap.put("A" + acctCodeDR + cctrCodeDR, tempMap); // 07/11/13 manoharan commented and added following line
dRcpMap.put("D" + acctCodeBrTr + cctrCodeBrTr + analysis1Dr + analysis2Dr + analysis3Dr, tempMap);
}
// end added by pravin
if (errString != null || errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
}
lineNoStr = " " + lineNo;
lineNoStr = lineNoStr.substring(lineNoStr.length() - 3,lineNoStr.length());
// amish 17-08-04 do not post recovery tax on the basis of the parameter add the condition
postTax = finCommon.getFinparams("999999", "INV_ACCT_DISS_TAX", conn);
if ("NULLFOUND".equals(postTax))
{
errCode = "VTFINPARM";
errString = getMsg("FINPARM INV_ACCT_DISS_TAX not defined",errCode, conn);
break;
}
if ("Y".equals(postTax))
{
// Cursor for Tax recovery for the item, if any
sql = "select acct_code__reco, cctr_code__reco, sum(reco_amount) as reco_amount "
+ " from taxtran "
+ " where tran_code = ? "
+ " and tran_id = ? "
+ " and line_no = ? "
+ " and reco_amount <> 0 "
+ " group by acct_code__reco, cctr_code__reco ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranSer);
pstmt.setString(2, tranId);
pstmt.setString(3, lineNoStr);
rs = pstmt.executeQuery();
while (rs.next())
{
acctCodeReco = rs.getString("acct_code__reco");
cctrCodeReco = rs.getString("cctr_code__reco");
recoAmount = rs.getDouble("reco_amount");
if (acctCodeReco == null || acctCodeReco.trim().length() == 0)
{
// Selecting ACCT/CCTR Code from ITEM_ACCT_DETR Table
// shiri 22/04/02 changed func call from gbf_acct_detr to gbf_acct_detr_type for a/cing on tran type
cctrCodeReco = finCommon.getAcctDetrTtype(itemCode, itemSer, "TAXRECO", tranType, conn);
acctCctr = cctrCodeReco.split(",");
len = acctCctr.length-1;
//System.out.println("@@@cr len["+len+"]");
if( len > -1 )
{
acctCodeReco = acctCctr[0];
}
else
{
acctCodeReco = "";
}
if( len > 0 )
{
cctrCodeReco = acctCctr[1];
}
else
{
cctrCodeReco = "";
}
}
// If ACCT Code is NULL/SPACE Then Exit
if (acctCodeReco == null || acctCodeReco.trim().length() == 0 )
{
// If ACCT Code is NULL/SPACE Then Exit
errCode = "VTACCTRECO";
errString = getMsg("Recoverable tax account is not defined for branch transfer posting",errCode, conn);
break;
}
// If CCTR Code is NULL/SPACE Then set to inventory cost centre
// 28/10/02 manoharan
//if isnull(cctrCodeReco) then
if (cctrCodeReco == null || cctrCodeReco.trim().length() == 0 )
{
cctrCodeReco = cctrCodeDR;
}
// the tax recovery amount is subtracted from the effect going to the inventory
// 26/12/2017 below is commnted by pravin same is credited in credit side
//grandAmount = rcpList.getitemnumber(foundIndex,"amount")
//rcpList.setitem(foundIndex,"amount",grandAmount - recoAmount)
// gf_nulltostr() called to convert null to blank String by Amit on 19/09/03 for DB2.
if (dRcpMap.containsKey("X" + acctCodeReco + cctrCodeReco + analysis1Cr + analysis2Cr + analysis3Cr ))
{
tempMap = (HashMap) dRcpMap.get("X" + acctCodeReco + cctrCodeReco + analysis1Cr + analysis2Cr + analysis3Cr );
grandAmount = Double.parseDouble(tempMap.get("amount").toString());
System.out.println("tempMap[old] ==================== ["+tempMap+"]");
//System.out.println("grandAmount[old] ==================== ["+grandAmount+"]");
//System.out.println("netAmount[new] ==================== ["+netAmount+"]");
tempMap.put("amount", "" + (grandAmount + recoAmount));
System.out.println("tempMap[new] ==================== ["+tempMap+"]");
// 07/11/13 manoharan added as this has to be updated in the dRcpMap
}
else
{
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeReco);
tempMap.put("cctr_code", cctrCodeReco);
tempMap.put("amount", "" + recoAmount);
// added by cpatil on 09-03-13 recoAmount
tempMap.put("analysis1",analysis1Cr);
tempMap.put("analysis2",analysis2Cr);
tempMap.put("analysis3",analysis3Cr);
// added by cpatil on 09-03-13 end
}
//dRcpMap.put("A" + acctCodeDR + cctrCodeDR, tempMap); // 07/11/13 manoharan commented and added following line
dRcpMap.put("X" + acctCodeReco + cctrCodeReco + analysis1Cr + analysis2Cr + analysis3Cr, tempMap); // there was abug in this line, instead of analysis3Cr wronly analysis3Dr used
totRecoAmt = totRecoAmt + recoAmount;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (errString != null || errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
}
// Cursor for non payable taxes to be removed from the effect to unbooked purchases
sql = "select a.acct_code as acct_code, a.cctr_code as cctr_code , sum(a.tax_amt) as tax_amt "
+ " from taxtran a, tax b "
+ " where a.tax_code = b.tax_code "
+ " a.tran_code = ? "
+ " and a.tran_id = ? "
+ " and a.line_no = ? "
+ " and a.tax_amt <> 0 "
+ " and b.non_payable = 'Y' "
+ " group by a.acct_code, a.cctr_code ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranSer);
pstmt.setString(2, tranId);
pstmt.setString(3, lineNoStr);
rs = pstmt.executeQuery();
while (rs.next())
{
acctCodeNP = rs.getString("acct_code");
cctrCodeNP = rs.getString("cctr_code");
amountNP = rs.getDouble("tax_amt");
// If ACCT Code is NULL/SPACE Then Exit
if (acctCodeNP == null || acctCodeNP.trim().length() == 0 )
{
// If ACCT Code is NULL/SPACE Then Exit
errCode = "VMACCT1";
errString = getMsg("Tax account is not defined for branch transfer posting",errCode, conn);
break;
}
// If CCTR Code is NULL/SPACE Then set to inventory cost centre
if (cctrCodeNP == null || cctrCodeNP.trim().length() == 0 )
{
cctrCodeNP = cctrCodeDR;
}
// If CCTR Code is still NULL/SPACE Then set to blank
if (cctrCodeNP == null || cctrCodeNP.trim().length() == 0 )
{
cctrCodeNP = " ";
}
// before changing sign subtract from credit amount to go to unbooked purchases
amountCR = amountCR - amountNP;
// chnage sign so that it goes as credit
amountNP = -1 * amountNP;
if (dRcpMap.containsKey("X" + acctCodeNP + cctrCodeNP + analysis1Cr + analysis2Cr + analysis3Cr ))
{
tempMap = (HashMap) dRcpMap.get("X" + acctCodeNP + cctrCodeNP + analysis1Cr + analysis2Cr + analysis3Cr );
grandAmount = Double.parseDouble(tempMap.get("amount").toString());
System.out.println("tempMap[old] ==================== ["+tempMap+"]");
//System.out.println("grandAmount[old] ==================== ["+grandAmount+"]");
//System.out.println("netAmount[new] ==================== ["+netAmount+"]");
tempMap.put("amount", "" + (grandAmount + amountNP));
System.out.println("tempMap[new] ==================== ["+tempMap+"]");
// 07/11/13 manoharan added as this has to be updated in the dRcpMap
}
else
{
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeReco);
tempMap.put("cctr_code", cctrCodeReco);
tempMap.put("amount", "" + amountNP);
// added by cpatil on 09-03-13 recoAmount
tempMap.put("analysis1",analysis1Cr);
tempMap.put("analysis2",analysis2Cr);
tempMap.put("analysis3",analysis3Cr);
// added by cpatil on 09-03-13 end
}
//dRcpMap.put("A" + acctCodeDR + cctrCodeDR, tempMap); // 07/11/13 manoharan commented and added following line
dRcpMap.put("X" + acctCodeNP + cctrCodeNP + analysis1Cr + analysis2Cr + analysis3Cr, tempMap); // there was abug in this line, instead of analysis3Cr wronly analysis3Dr used
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} // amish 17-08-04 postTax = 'Y'
// 19/01/09 manoharan as was creating problem while sqlca.sqlcode = 0
// fetch cur_dist_rcp_det into :itemCode, :lineNo, :netAmount,
// :locCode, :lotNo, :lotSl, :costRate, :quantity ; // amish 17-08-04 cost rate
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
if (errString != null || errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
}
///////////////////////////////////////////////////////////////////////////
// this is added as per new requirement of Pitambari
// Cursor for payable taxes to be removed from the effect to unbooked purchases
sql = "select a.acct_code as acct_code, a.cctr_code as cctr_code , sum(a.tax_amt) as tax_amt "
+ " from taxtran a, tax b "
+ " where a.tax_code = b.tax_code "
+ " a.tran_code = ? "
+ " and a.tran_id = ? "
+ " and a.line_no = ? "
+ " and a.tax_amt <> 0 "
+ " and b.non_payable = 'N' "
+ " group by a.acct_code, a.cctr_code ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranSer);
pstmt.setString(2, tranId);
pstmt.setString(3, lineNoStr);
rs = pstmt.executeQuery();
while (rs.next())
{
acctCodeTP = rs.getString("acct_code");
cctrCodeTP = rs.getString("cctr_code");
amountTP = rs.getDouble("tax_amt");
// If ACCT Code is NULL/SPACE Then Exit
if (acctCodeTP == null || acctCodeTP.trim().length() == 0 )
{
// If ACCT Code is NULL/SPACE Then Exit
errCode = "VMACCT1";
errString = getMsg("Tax account is not defined for branch transfer posting",errCode, conn);
break;
}
// If CCTR Code is NULL/SPACE Then set to inventory cost centre
if (cctrCodeTP == null || cctrCodeTP.trim().length() == 0 )
{
cctrCodeTP = cctrCodeDR;
}
// If CCTR Code is still NULL/SPACE Then set to blank
if (cctrCodeTP == null || cctrCodeTP.trim().length() == 0 )
{
cctrCodeTP = " ";
}
// before changing sign subtract from credit amount to go to unbooked purchases
amountCR = amountCR + amountTP;
// chnage sign so that it goes as credit
amountTP = amountTP;
if (dRcpMap.containsKey("X" + acctCodeTP + cctrCodeTP + analysis1Cr + analysis2Cr + analysis3Cr ))
{
tempMap = (HashMap) dRcpMap.get("X" + acctCodeTP + cctrCodeTP + analysis1Cr + analysis2Cr + analysis3Cr );
grandAmount = Double.parseDouble(tempMap.get("amount").toString());
System.out.println("tempMap[old] ==================== ["+tempMap+"]");
//System.out.println("grandAmount[old] ==================== ["+grandAmount+"]");
//System.out.println("netAmount[new] ==================== ["+netAmount+"]");
tempMap.put("amount", "" + (grandAmount + amountTP));
System.out.println("tempMap[new] ==================== ["+tempMap+"]");
// 07/11/13 manoharan added as this has to be updated in the dRcpMap
}
else
{
tempMap = new HashMap();
tempMap.put("type", "X");
tempMap.put("acct_code", acctCodeReco);
tempMap.put("cctr_code", cctrCodeReco);
tempMap.put("amount", "" + amountTP);
// added by cpatil on 09-03-13 recoAmount
tempMap.put("analysis1",analysis1Cr);
tempMap.put("analysis2",analysis2Cr);
tempMap.put("analysis3",analysis3Cr);
// added by cpatil on 09-03-13 end
}
dRcpMap.put("X" + acctCodeTP + cctrCodeTP + analysis1Cr + analysis2Cr + analysis3Cr, tempMap); // there was abug in this line, instead of analysis3Cr wronly analysis3Dr used
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// end added as per new requirement of Pitambari
///////////////////////////////////////////////////////////////////////////
// Initialising the variable to ZERO
netAmount = 0;
grandAmount = 0;
Map.Entry dRcpMapEntry = null;
Set dRcpSet = dRcpMap.entrySet();
Iterator itrDRcp = dRcpSet.iterator();
int glTraceCtr = 0;
System.out.println("07/11/13 dRcpMap final ==================== ["+dRcpMap+"]");
// Counting rows from Datastore
String mapKey = null;
while(itrDRcp.hasNext())
{
dRcpMapEntry = (Map.Entry)itrDRcp.next();
mapKey = (String)dRcpMapEntry.getKey();
tempMap = (HashMap)dRcpMap.get(mapKey);
glTraceCtr++;
System.out.println("manohar 07/11/13 glTraceCtr 1 [" + glTraceCtr + "] mapKey [" + mapKey + "] dRcpMapEntry [" + dRcpMapEntry + "] tempMap [" + tempMap + "]");
// Debit Entry for Inventory / credit entry for non payable taxes
acctCodeDR = (String) tempMap.get("acct_code");
cctrCodeDR = (String) tempMap.get("cctr_code");
grandAmount = Double.parseDouble(tempMap.get("amount").toString());
System.out.println("tempMap.get(analysis1):::"+tempMap.get("analysis1").toString());
System.out.println("tempMap.get(analysis2):::"+tempMap.get("analysis2").toString());
System.out.println("tempMap.get(analysis3):::"+tempMap.get("analysis3").toString());
glTraceMap = new HashMap();
// Debit Entry for Inventory / credit entry for non payable taxes
glTraceMap.put("analysis1", (String) tempMap.get("analysis1"));
glTraceMap.put("analysis2", (String) tempMap.get("analysis2"));
glTraceMap.put("analysis3", (String) tempMap.get("analysis3"));
// shiri 22/12/01
//if as_transer = 'P-RET' then
// grandAmount = 0 - grandAmount
//end if
glTraceMap.put("tran_date",tranDate);
glTraceMap.put("eff_date",effDate);
glTraceMap.put("fin_entity",finEntity);
glTraceMap.put("site_code",siteCode);
glTraceMap.put("sundry_type","O");
glTraceMap.put("sundry_code","");
glTraceMap.put("acct_code",acctCodeDR);
glTraceMap.put("cctr_code",cctrCodeDR);
glTraceMap.put("emp_code","");
glTraceMap.put("anal_code","");
glTraceMap.put("curr_code",currCode);
glTraceMap.put("exch_rate",exchRate);
if (grandAmount > 0 )
{
glTraceMap.put("dr_amt","" + grandAmount);
glTraceMap.put("cr_amt","0");
}
else
{
glTraceMap.put("dr_amt","0");
glTraceMap.put("cr_amt", "" + (-1 * grandAmount));
}
glTraceMap.put("ref_type","D");
glTraceMap.put("ref_ser",tranSer);
glTraceMap.put("ref_id",tranId);
glTraceMap.put("remarks",remarks);
glTraceMap.put("proj_code",projCode);
System.out.println("manohar 07/11/13 glTraceCtr before gltrace update 2 [" + glTraceCtr + "]");
errString = finCommon.glTraceUpdate(glTraceMap,conn);
System.out.println("manohar 07/11/13 glTraceCtr after gltrace update 2 [" + glTraceCtr + "] errString [" + errString + "]");
glTraceMap = null;
if(errString != null && errString.trim().length() > 0 )
{
break;
}
netAmount = netAmount + grandAmount;
}
if (errString != null || errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
}
// Assigning the PO Receipt A/c & CC Code to the variable
//acctCodeCR = acctCodeAP
//cctrCodeCR = cctrCodeAP
//shiri modified this posting instead of using netAmount, amount_hdr is used so that the credit for
//the additional cost can be taken separately in the posting - 29/11/01
//on 20/12/01 used separate credit amount as it is net off non payable taxes
// Crediting Entry for PO Receipt
if (netAmount != 0 )
{
glTraceMap = null;
glTraceMap = new HashMap();
glTraceMap.put("analysis1", analysis1Cr);
glTraceMap.put("analysis2", analysis2Cr);
glTraceMap.put("analysis3", analysis3Cr);
// shiri 22/12/01
//if as_transer = 'P-RET' then
// grandAmount = 0 - grandAmount
//end if
glTraceMap.put("tran_date",tranDate);
glTraceMap.put("eff_date",effDate);
glTraceMap.put("fin_entity",finEntity);
glTraceMap.put("site_code",siteCode);
glTraceMap.put("sundry_type","O");
glTraceMap.put("sundry_code","");
glTraceMap.put("acct_code",acctCodeCR);
glTraceMap.put("cctr_code",cctrCodeCR);
glTraceMap.put("emp_code","");
glTraceMap.put("anal_code","");
glTraceMap.put("curr_code",currCode);
glTraceMap.put("exch_rate",exchRate);
if (netAmount > 0 )
{
glTraceMap.put("dr_amt","" + (netAmount));
glTraceMap.put("cr_amt","0");
}
else
{
glTraceMap.put("dr_amt","0");
glTraceMap.put("cr_amt", "" + (-1 * (netAmount)));
}
glTraceMap.put("ref_type","D");
glTraceMap.put("ref_ser",tranSer);
glTraceMap.put("ref_id",tranId);
glTraceMap.put("remarks",remarks);
glTraceMap.put("proj_code",projCode);
System.out.println("manohar 07/11/13 glTraceCtr before gltrace update 2 [" + glTraceCtr + "]");
errString = finCommon.glTraceUpdate(glTraceMap,conn);
System.out.println("manohar 07/11/13 glTraceCtr after gltrace update 2 [" + glTraceCtr + "] errString [" + errString + "]");
glTraceMap = null;
if (errString != null || errString.trim().length() > 0 )
{
// handle error here not to proceed
return errString ;
}
}
//check coin diff.
errString = finCommon.checkGlTranDrCr(tranSer,tranId,conn);
} // if ("Y".equals(invOnline) || ("S".equals(invOnline) && doExit != 1) || ("Y".equals(transferAcctReq) ) )
}//try
catch(Exception exception)
{
exception.printStackTrace();
throw new ITMException(exception);
}
finally
{
try
{
if (distCommon != null)
{
distCommon = null;
}
if (finCommon != null)
{
finCommon = null;
}
if (rs != null)
{
rs.close(); rs = null;
}
if (pstmt != null)
{
pstmt.close(); pstmt = null;
}
if (rs1 != null)
{
rs1.close(); rs1 = null;
}
if (pstmt1 != null)
{
pstmt1.close(); pstmt1 = null;
}
if (pstmtUpd != null)
{
pstmtUpd.close(); pstmtUpd = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
return (errString);
}
//Changes by mayur on 3-JUNE-2018 [END]
}
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