Commit 5de5b6d7 authored by msalla's avatar msalla

On confirmation of bank receipt coin difference error is coming.

This receipt is created for invoice for which bill discounting is done.(pont no:661)

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@211565 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6fdf1ab1
......@@ -7,12 +7,13 @@ package ibase.webitm.ejb.fin.adv;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.utility.GenericUtility;
//import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
......@@ -41,7 +42,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
boolean isConn= false;
Connection conn = null;
boolean isPreview = false;
try
{
......@@ -103,7 +104,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
else if(retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0)
{
retString = getErrorXmlString(Fcommon, retString, tranID);
// System.out.println("ReturnString : ["+retString+"]");
// System.out.println("ReturnString : ["+retString+"]");
}
//Commented by sarita on 23 NOV 2018 [END]
}
......@@ -457,7 +458,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
//Added by varsha v for truncating time from tran_date on 07-05-18
java.sql.Timestamp today = null;
java.util.Date date = null;
GenericUtility genericUtility = new GenericUtility();
// GenericUtility genericUtility = new GenericUtility();
E12GenericUtility genericUtility = new E12GenericUtility();
//Ended by varsha v for truncating time from tran_date on 07-05-18
try
{
......@@ -586,6 +588,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
RcpHdrMap.put("ref_date",rs.getDate("ref_date"));
RcpHdrMap.put("remarks",rs.getString("remarks"));
RcpHdrMap.put("net_amt",rs.getDouble("net_amt"));
System.out.println("net amt in reterive from receipt:["+RcpHdrMap.get("net_amt"));
RcpHdrMap.put("exch_rate",rs.getDouble("exch_rate"));
RcpHdrMap.put("curr_code",rs.getString("curr_code"));
RcpHdrMap.put("net_amt__bc",rs.getDouble("net_amt__bc"));
......@@ -614,7 +617,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
RcpHdrMap.put("cctr_code__adv",rs.getString("cctr_code__adv")==null?" ":rs.getString("cctr_code__adv"));
RcpHdrMap.put("tax_amt",rs.getDouble("tax_amt"));
RcpHdrMap.put("item_ser",rs.getString("item_ser"));
//System.out.println(" Header Map..........");
System.out.println(" Header Map..........");
//System.out.println(RcpHdrMap.toString());
}
pstmt.close();
......@@ -687,8 +690,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
DetMap.put("effect_party", rs.getString("effect_party")); // 29/01/14 manoharan
DetMap.put("eff_bank", rs.getString("eff_bank")); // 03/02/14 Manoj
DetList.add(DetMap);
//System.out.println(" receipt Acct Map..........");
// System.out.println("DetList initial [" + DetList.toString() + "]");
System.out.println(" receipt Acct Map..........");
System.out.println("DetList initial [" + DetList.toString() + "]");
}
rs.close();
rs = null;
......@@ -696,16 +699,16 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = null;
detListSize = DetList.size();
// }
sql = "select ref_ser,ref_no,adj_amt,acct_code,cctr_code,exch_rate__vouch from rcpadv where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
while(rs.next())
{
ADetMap = new HashMap();
ADetMap.put("ref_ser", rs.getString("ref_ser"));
ADetMap.put("ref_no", rs.getString("ref_no"));
ADetMap.put("adj_amt", rs.getDouble("adj_amt"));
......@@ -720,7 +723,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
rs1= pstmt1.executeQuery();
if(rs1.next())
{
ADetMap.put("sundry_code",rs1.getString("cust_code"));
ADetMap.put("sundry_code",rs1.getString("cust_code"));
}
rs1.close();
rs1 = null;
......@@ -731,8 +734,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
ADetMap.put("cctr_code", rs.getString("cctr_code"));
ADetMap.put("exch_rate__vouch", rs.getDouble("exch_rate__vouch"));
ADetList.add(ADetMap);
//System.out.println("receipt Adv Map..........");
//System.out.println(ADetMap.toString());
System.out.println("receipt Adv Map..........");
System.out.println(ADetMap.toString());
}
rs.close();
rs = null;
......@@ -758,8 +761,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
EpcAdjMap.put("sundry_type", rs.getString("sundry_type"));
EpcAdjMap.put("sundry_code", rs.getString("sundry_code"));
EpcAdjList.add(EpcAdjMap);
//System.out.println(" Rcpepc Adj Map..........");
//System.out.println(EpcAdjList.toString());
System.out.println(" Rcpepc Adj Map..........");
System.out.println(EpcAdjList.toString());
}
rs.close();
......@@ -789,8 +792,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
RcpDetMap.put("bill_disc_amt", rs.getDouble("bill_disc_amt")); //ADDED BY RITESH ON 24/05/13
RcpDetList.add(RcpDetMap);
//System.out.println(" DetMap Map..........");
//System.out.println(RcpDetMap.toString());
System.out.println(" DetMap Map..........");
System.out.println(RcpDetMap.toString());
}
......@@ -813,7 +816,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
//finTotal = finTotal + (double) Double.parseDouble( "" + RcpDetMap.get("fin_chg"));
tFin = tFin + (double) Double.parseDouble( "" + RcpDetMap.get("fin_chg"));
//System.out.println("LINE NO 541"+total);
// System.out.println("LINE NO 541"+total);
if(rcpClubPost.equals("Y"))
{
......@@ -926,7 +929,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
}
// populate bill if bill is discounted
// then credit the amount to the BD
//System.out.println("DetList*****************************811******************"+DetList.toString());
// System.out.println("DetList*****************************811******************"+DetList.toString());
total=0;
for(i=0 ; i<RcpDetList.size() ; i++)
{
......@@ -1100,7 +1103,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
}
}
//System.out.println("DetList*****************984******************************"+DetList.toString());
// System.out.println("DetList*****************984******************************"+DetList.toString());
//adjust for advances adjusted
for(i=0 ; i<ADetList.size() ; i++)
......@@ -1115,7 +1118,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
amount = (double) Double.parseDouble( "" + ADetMap.get("adj_amt"));
total = total + amount;
//System.out.println("LINE NO 743"+total);
// System.out.println("LINE NO 743"+total);
if(rcpClubPost.equals("Y"))
{
findIndex = findExistingIndex(DetList, acct, cctr, exch);
......@@ -1348,7 +1351,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
}
// System.out.println("DetList**************************1231*********************"+DetList.toString());
//System.out.println("DetList**************************1231*********************"+DetList.toString());
// insert data for advance
advAmt = (double) Double.parseDouble( "" + RcpHdrMap.get("adv_amt"));
......@@ -1356,8 +1359,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if(advAmt!= 0)
{
total = total + advAmt;
//System.out.println("LINE NO 874"+total);
// System.out.println("total in adv"+total);
//System.out.println("LINE NO 874"+total);
// System.out.println("total in adv"+total);
acct = (String)RcpHdrMap.get("acct_code__adv")==null?"":(String)RcpHdrMap.get("acct_code__adv");
cctr = (String)RcpHdrMap.get("cctr_code__adv")==null?" ":(String)RcpHdrMap.get("cctr_code__adv");
exch = (double) Double.parseDouble( "" + RcpHdrMap.get("exch_rate"));
......@@ -1366,7 +1369,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if(rcpClubPost.equals("Y"))
{
findIndex = findExistingIndex(DetList, acct, cctr, exch);
// System.out.println("FINDINDEX>>>>>>>1243>>>>>"+findIndex);
// System.out.println("FINDINDEX>>>>>>>1243>>>>>"+findIndex);
}
else
{
......@@ -1385,7 +1388,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
rs=null;
pstmt.close();
pstmt=null;
//System.out.println("total in adv"+amtNoBankEffect);
// System.out.println("total in adv"+amtNoBankEffect);
if (findIndex > -1)
{
detMap = (HashMap) DetList.get(findIndex);
......@@ -1425,7 +1428,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
detMap.put("eff_bank", "Y"); // 03/02/14 Manoj
DetList.add(detMap);
}
// System.out.println("1273---DetList.toString()----"+DetList.toString());
//System.out.println("1273---DetList.toString()----"+DetList.toString());
/*sql = "select count(*) from rcpacct where acct_code = ? and cctr_code = ? and exch_rate = ? and tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,acct);
......@@ -1509,9 +1512,9 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
hcurrCode = (String)RcpHdrMap.get("curr_code");
//hexchRate = (Double)RcpHdrMap.get("exch_rate");
totEpc = totEpc + amount;
// if(!currCode.equalsIgnoreCase(hcurrCode)) //commented by monika on 8 august 2019
// if(!currCode.equalsIgnoreCase(hcurrCode)) //commented by monika on 8 august 2019
if(!currCode.trim().equalsIgnoreCase(hcurrCode.trim()))//added by monika to trim 8 august 2019
{
isEpcCurrSame = false;
......@@ -1522,7 +1525,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
isEpcCurrSame = true;//added by monika on 8 august 2019 to set isEpcCurrSame to true
totEpcBc = totEpcBc + (hexchRate * amount);
}
//added to by monika
//added to by monika
// System.out.println("epccurrsame value:::"+isEpcCurrSame);
if(rcpClubPost.equals("Y"))
......@@ -1803,7 +1806,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
amtRev = Math.min(badDebtAmt,amtProv);
totBad = totBad + amtRev;
System.out.println("LINE NO 1164"+total);
//System.out.println("LINE NO 1164"+total);
if(rcpClubPost.equals("Y"))
{
......@@ -2012,10 +2015,10 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = null;
totBad = 0;
}
//System.out.println("aaaaaaaaaaaa"+total);
// System.out.println("aaaaaaaaaaaa"+total);
//System.out.println("BBBBBBBBBBB"+total);
//System.out.println("CCCCCCCCCCCC"+total);
System.out.println("CCCCCCCCCCCC"+total);
}
exchRate = (double) Double.parseDouble( "" + RcpHdrMap.get("exch_rate"));
......@@ -2072,7 +2075,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = null;
*/
//commented-by-Monika-30-may-2019
// chq = ((double) Double.parseDouble( "" + RcpHdrMap.get("chq_amt")) ) - ((double) Double.parseDouble( "" + RcpHdrMap.get("bill_disc_amt")));// + ((double) Double.parseDouble( "" + RcpHdrMap.get("oth_amt")) );
// chq = ((double) Double.parseDouble( "" + RcpHdrMap.get("chq_amt")) ) - ((double) Double.parseDouble( "" + RcpHdrMap.get("bill_disc_amt")));// + ((double) Double.parseDouble( "" + RcpHdrMap.get("oth_amt")) );
//changes made-by-monika-30-may-2019
chq = ((double) Double.parseDouble( "" + RcpHdrMap.get("chq_amt")) );
//end
......@@ -2081,7 +2084,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
//end
// if EPC adjusted in same currency then
//added by monika 8 aug-2019
//System.out.println("before amount added with efund +++"+chq);
if(isEpcCurrSame == true)
{
......@@ -2098,21 +2101,42 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
//added by monika to 15 oct 19 -to check coin difference in billdiscounting
billDiscountAmt=((double) Double.parseDouble( "" + RcpHdrMap.get("bill_disc_amt")));
//System.out.println("bill discount amount and ["+billDiscountAmt+"] total::>>["+total+"]");
total=total-billDiscountAmt;
chq=chq-billDiscountAmt;
//end
// System.out.println("chq and ["+chq+"] total ["+total + "] other_amount ]"+othAmt+" ] diff [" + Math.abs(chq - (total -taxAmt)+othAmt ) +"]");
if(Math.abs(chq - (total - taxAmt)+othAmt) > 1)//end
{
errString = itmDBAccessEJB.getErrorString("","VTRCPT8","","",conn);
conn.rollback();
return errString;
}
//to check validation for chq_amt and net_amt is 0 or not in receivables--8 nov 2019--by monika
if ((double) Double.parseDouble( "" + RcpHdrMap.get("net_amt")) != 0 && (double) Double.parseDouble( "" + RcpHdrMap.get("chq_amt")) != 0)
{//end
if(total>0) //to check billdiscounting accounting effect -07 nov -19
{
total=total-billDiscountAmt;
chq=chq-billDiscountAmt;
//end
// System.out.println("chq and ["+chq+"] total ["+total + "] other_amount ]"+othAmt+" ] diff [" + Math.abs(chq +(total -taxAmt)+othAmt ) +"]");
//if(Math.abs(chq + (total - taxAmt)+othAmt) > 1)//end
if(Math.abs(chq -(total -taxAmt)+othAmt) > 1)
{
errString = itmDBAccessEJB.getErrorString("","VTRCPT8","","",conn);
conn.rollback();
return errString;
}
}
else
{
chq=chq-billDiscountAmt;
//end
//System.out.println("chq and ["+chq+"] total ["+total + "] other_amount ]"+othAmt+" ] diff [" + Math.abs(chq +(total -taxAmt)+othAmt ) +"]");
//if(Math.abs(chq + (total - taxAmt)+othAmt) > 1)//end
if(Math.abs(chq +(total -taxAmt)+othAmt) > 1)
{
errString = itmDBAccessEJB.getErrorString("","VTRCPT8","","",conn);
conn.rollback();
return errString;
}
}//end
}
RcpHdrMap.put("net_amt", total);
RcpHdrMap.put("net_amt__bc", totBc);
//System.out.println("net_amt ["+total+"] net_amt__bc ["+totBc + "]");
// System.out.println("net_amt ["+total+"] net_amt__bc ["+totBc + "]");
// 14/01/14 manoharan details has to be inserted
sql = "select max(line_no) from rcpacct where tran_id = ?";
......@@ -2219,12 +2243,12 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
errString= "ERROR";
//commented by-monika-30-maY-2019
/*retString = "ERROR";
int [] updateCounts = buex.getUpdateCounts();
//changes made by-MONIKA-30-may-2019
for (int j = 0; j < updateCounts.length; j++)
{
System.err.println(" Statement " + j + ":" + updateCounts[j]);
......@@ -2241,35 +2265,35 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
System.err.println(" Error code: " + ex.getErrorCode());
ex = ex.getNextException();
}
*/
*/
//CHANGES --by-monika-30-maY-2019
try
{
conn.rollback();
int [] updateCounts = buex.getUpdateCounts();
for ( i = 0; i < updateCounts.length; i++)
{
System.err.println(" Statement " + i + ":" + updateCounts[i]);
}
System.err.println(" Message: " + buex.getMessage());
System.err.println(" SQLSTATE: " + buex.getSQLState());
System.err.println(" Error code: " + buex.getErrorCode());
SQLException ex = buex.getNextException();
while (ex != null)
{
System.err.println("SQL exception:");
System.err.println(" Message: " + ex.getMessage());
System.err.println(" SQLSTATE: " + ex.getSQLState());
System.err.println(" Error code: " + ex.getErrorCode());
ex = ex.getNextException();
}
}
catch ( Exception e)
{
e.printStackTrace();
}
throw new ITMException(buex);
try
{
conn.rollback();
int [] updateCounts = buex.getUpdateCounts();
for ( i = 0; i < updateCounts.length; i++)
{
System.err.println(" Statement " + i + ":" + updateCounts[i]);
}
System.err.println(" Message: " + buex.getMessage());
System.err.println(" SQLSTATE: " + buex.getSQLState());
System.err.println(" Error code: " + buex.getErrorCode());
SQLException ex = buex.getNextException();
while (ex != null)
{
System.err.println("SQL exception:");
System.err.println(" Message: " + ex.getMessage());
System.err.println(" SQLSTATE: " + ex.getSQLState());
System.err.println(" Error code: " + ex.getErrorCode());
ex = ex.getNextException();
}
}
catch ( Exception e)
{
e.printStackTrace();
}
throw new ITMException(buex);
}
catch(Exception e)
{
......@@ -2278,22 +2302,22 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
finally
{
try
{
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
return errString;
}
// 26/09/13 manoharan to find existing detail
......@@ -2413,7 +2437,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
else
{
errString=gbfPostRcpdet(tranId,xtraParams,RcpHdrMap,DDetList,RcpDetList,ADetList,EpcAdjList,conn,isPreview);//Changed by Manoj dtd 15/01/2014 to return errString from method
// System.out.println("errString while posting rcpdet......................"+errString);
// System.out.println("errString while posting rcpdet......................"+errString);
}
if(errString != null && errString.trim().length() > 0)
{
......@@ -2476,8 +2500,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt1=null;
pstmt.close();
pstmt=null;
// System.out.println("netAmountBc+taxAmt amount --------->"+netAmount);
//System.out.println("netAmountBc+taxAmt amount --------->"+amount);
//System.out.println("netAmountBc+taxAmt amount --------->"+netAmount);
// System.out.println("netAmountBc+taxAmt amount --------->"+amount);
//end
if(! isPreview)//if isPreview is false
......@@ -2499,7 +2523,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if(amount > 0)
{
//System.out.println("advbking amount=["+amount+"]");
// sql = "update advbking set bal_amt=bal_amt - ? where tran_id=?";
// sql = "update advbking set bal_amt=bal_amt - ? where tran_id=?";
sql = "update advbking set bal_amt = (case when bal_amt is null then 0 else bal_amt end -?) where tran_id = ?";
/*pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,amount);
......@@ -2511,15 +2535,15 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
*/ //COMMENTED BY MONIKA-same pstmt statement used
//changes by monika on 07 august 2019
pstmt1 = conn.prepareStatement(sql);
// pstmt1.setDouble(1,amountadvbking);//commented by monika on 4 oct 2019
// pstmt1.setDouble(1,amountadvbking);//commented by monika on 4 oct 2019
pstmt1.setDouble(1,amount);//added by monika 4 oct 2019
pstmt1.setString(2,refNo);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
//System.out.println("balamount in advbking=[");
// System.out.println("balamount in advbking=[");
}
}
rs.close();
......@@ -2558,7 +2582,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt1.close();
pstmt1 = null;
}
}
......@@ -2582,7 +2606,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
{
return errString;
}
commCalcOnOff = finCommon.getFinparams("999999", "COMM_CALC_ON_OFF", conn);
if(commCalcOnOff.equalsIgnoreCase("Y"))
{
......@@ -2808,6 +2832,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
netAmt = (double) Double.parseDouble( "" + RcpHdrMap.get("net_amt"));
currCode = (String)RcpHdrMap.get("curr_code");
exchRate = (double) Double.parseDouble( "" + RcpHdrMap.get("exch_rate"));
//System.out.println("exchange_rate in diff hdr"+exchRate);
projCode = (String)RcpHdrMap.get("proj_code");
projCode = (String)RcpHdrMap.get("proj_code");
refNO = (String)RcpHdrMap.get("ref_no");
......@@ -2871,11 +2897,11 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
if(isInBaseCurr == true)
{
//netAmountBc = netAmountBc+taxAmt;//added by akhilesh on 31/july/13 for tax provision
System.out.println("IN TRUE!!!!!!!!!!!!!!!!!");
// System.out.println("IN TRUE!!!!!!!!!!!!!!!!!");
glTraceMap.put("curr_code", basecurrCode);
glTraceMap.put("exch_rate", 1.0);
System.out.println("NET AMOUNT BC..["+RcpHdrMap.get("net_amt__bc"));
// System.out.println("NET AMOUNT BC..["+RcpHdrMap.get("net_amt__bc"));
if((double) Double.parseDouble( "" + RcpHdrMap.get("net_amt__bc")) < 0 )
{
glTraceMap.put("dr_amt", 0.0);
......@@ -2889,14 +2915,14 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
}
else
{
//netAmt = netAmt+taxAmt;//added by akhilesh on 31/july/13 for tax provision
netAmt = netAmt+taxAmt;//added by akhilesh on 31/july/13 for tax provision
System.out.println("IN FALSE!!!!!!!!!!!!!!!!!");
//System.out.println("IN FALSE!!!!!!!!!!!!!!!!!");
glTraceMap.put("curr_code", currCode);
glTraceMap.put("exch_rate", exchRate);
System.out.println("NET AMOUNT BC..["+RcpHdrMap.get("net_amt"));
// System.out.println("NET AMOUNT BC..["+RcpHdrMap.get("net_amt"));
if((double) Double.parseDouble( "" + RcpHdrMap.get("net_amt")) < 0 )
{
glTraceMap.put("dr_amt", 0.0);
......@@ -2981,7 +3007,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
//Added by Sharon as instructed by Shiri madam on 29-July-2004
if (chqAmt != 0 || advAmt > 0 )
{
//System.out.println("In 1826 SUNDRY-BAL !!!!!!!!!!!!!!!!!!!!!!!!!!");
// System.out.println("In 1826 SUNDRY-BAL !!!!!!!!!!!!!!!!!!!!!!!!!!");
if (! isPreview)//if isPreview is false *****vishakha
{
errString = finCommon.gbf_sundrybal_upd(sundryBalMap,conn);
......@@ -3045,7 +3071,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
//bankTranLogMap.put("exch_rate", exchRate);
bankTranLogMap.put("entry_batch_no",(String)RcpHdrMap.get("entry_batch_no") );
//ls_errcode = gbf_banktranlog_upd(lstr_banktranlog)
//System.out.println("545 bankTranLogUpdateeUpdate Called..............");
// System.out.println("545 bankTranLogUpdateeUpdate Called..............");
errString = finCommon.bankTranLogUpdate(bankTranLogMap, xtraParams, conn);
if(errString != null && errString.trim().length() > 0)
{
......@@ -3083,11 +3109,14 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
glTraceMap.put("exch_rate", 1.0);
if((double) Double.parseDouble( "" + RcpHdrMap.get("diff_amt__exch")) > 0)
{
// System.out.println("inside true-- difference amount in gltrace"+ RcpHdrMap.get("diff_amt__exch"));
glTraceMap.put("dr_amt",(double) Double.parseDouble( "" + RcpHdrMap.get("diff_amt__exch")));
glTraceMap.put("cr_amt", 0);
cnt1=1;
}else
{
// System.out.println("inside false--- difference amount in gltrace"+ RcpHdrMap.get("diff_amt__exch"));
glTraceMap.put("dr_amt", 0.0);
glTraceMap.put("cr_amt", -1 * (double) Double.parseDouble( "" + RcpHdrMap.get("diff_amt__exch")));
cnt1=2;
......@@ -3114,10 +3143,12 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
}
//System.out.println("exchange rate---in difference amount---"+glTraceMap.get("exch_rate"));
debit = debit + ((double) Double.parseDouble( "" + glTraceMap.get("dr_amt")) * (double) Double.parseDouble( "" + glTraceMap.get("exch_rate")));
credit = credit + ((double) Double.parseDouble( "" + glTraceMap.get("cr_amt")) * (double) Double.parseDouble( "" + glTraceMap.get("exch_rate")));
//System.out.println("credit difference>>["+credit+"] debit >>>["+debit+"]");
// insert into receivables for advance amount
......@@ -3172,7 +3203,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
receivablesMap.put("cust_ref_date",null);
receivablesMap.put("cust_ref_amt","");
//System.out.println("In 1997 receivablesMap [" + receivablesMap + "]");
// System.out.println("In 1997 receivablesMap [" + receivablesMap + "]");
errString = finCommon.gbfReceivablesUpd(receivablesMap,conn);
if(errString != null && errString.trim().length() > 0)
{
......@@ -3196,7 +3227,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
sundryBalMap.put("adv_amt", ((double) Double.parseDouble( "" + RcpHdrMap.get("adv_amt"))));
contactCode = finCommon.getContactCode(sundryType, sundryCode, conn);
sundryBalMap.put("contact_code",contactCode );
//System.out.println("In 2021 sundryBalMap [" + sundryBalMap + "]");
// System.out.println("In 2021 sundryBalMap [" + sundryBalMap + "]");
errString = finCommon.gbf_sundrybal_upd(sundryBalMap,conn);
if(errString != null && errString.trim().length() > 0)
......@@ -3433,13 +3464,13 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
hexchRate = (double) Double.parseDouble( "" + RcpHdrMap.get("exch_rate"));
remarks = (String)RcpHdrMap.get("remarks");
// System.out.println("DetList SIZE ["+DetList.size() + "] DetList [" +DetList + "]");
// System.out.println("DetList SIZE ["+DetList.size() + "] DetList [" +DetList + "]");
for (int ctr =0; ctr < DetList.size(); ctr++)
{
//System.out.println("no of times "+ctr);
// System.out.println("no of times "+ctr);
//DetMap = new HashMap();
DetMap = (HashMap) DetList.get(ctr);
......@@ -3470,13 +3501,15 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
glTraceMap.put("sundry_type",(String)DetMap.get("sundry_type")==null?"O":(String)DetMap.get("sundry_type"));
glTraceMap.put("sundry_code",(String)DetMap.get("sundry_code")== null?"":(String)DetMap.get("sundry_code"));
glTraceMap.put("acct_code", (String)DetMap.get("acct_code"));
System.out.println("818 account chek ="+acctCode+" "+sundryType+" "+sundryCode);
// System.out.println("818 account chek ="+acctCode+" "+sundryType+" "+sundryCode);
glTraceMap.put("cctr_code", (String)DetMap.get("cctr_code")==null?" ":(String)DetMap.get("cctr_code"));
glTraceMap.put("emp_code", (String)DetMap.get("emp_code"));
glTraceMap.put("anal_code", (String)DetMap.get("anal_code"));
glTraceMap.put("curr_code", (String)DetMap.get("curr_code")==null?hcurrCode:(String)DetMap.get("curr_code"));
glTraceMap.put("proj_code", projectCode);
glTraceMap.put("exch_rate", (double) Double.parseDouble( "" + DetMap.get("exch_rate")));
// System.out.println("818 exchrate ="+acctCode+" "+sundryType+" "+sundryCode+" exchrate sundry bal"+DetMap.get("exch_rate"));
amount = (double) Double.parseDouble( "" + DetMap.get("amount"));
if(amount > 0)
......@@ -3501,19 +3534,19 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
errString = finCommon.glTraceUpdate(glTraceMap,conn,isPreview);
if(errString != null && errString.trim().length() > 0)
{
// System.out.println("ERROR IN GLTRACE ........... errString [" + errString + "]");
// System.out.println("ERROR IN GLTRACE ........... errString [" + errString + "]");
return errString;
}
debit = debit + ((double) Double.parseDouble( "" + glTraceMap.get("dr_amt")) * (double) Double.parseDouble( "" + glTraceMap.get("exch_rate")));
credit = credit + ((double) Double.parseDouble( "" + glTraceMap.get("cr_amt")) * (double) Double.parseDouble( "" + glTraceMap.get("exch_rate")));
// System.out.println("dr in receivables "+debit+" credit "+credit);
/// update sundrybal for customer code
if((String)glTraceMap.get("sundry_type") != null && !((String)glTraceMap.get("sundry_type")).trim().equalsIgnoreCase("O") && (! isPreview))//if is Preview is false **vishakha
{
// System.out.println("COMES INTO CONDITION ...........");
//System.out.println("COMES INTO CONDITION ...........");
sundryBalMap = new HashMap();
......@@ -3539,6 +3572,9 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
sundryBalMap.put("dr_amt", -1 * amount);
sundryBalMap.put("cr_amt", 0.0);
}
// System.out.println("dr in sundry "+amount);
sundryBalMap.put("adv_amt", 0.0);
contactCode = finCommon.getContactCode(sundryType, sundryCode, conn);
sundryBalMap.put("contact_code",contactCode );
......@@ -3546,7 +3582,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
errString = finCommon.gbf_sundrybal_upd(sundryBalMap, conn);
if(errString != null && errString.trim().length() > 0)
{
// System.out.println("error is sundryBaleUpdate ..........."+errString);
// System.out.println("error is sundryBaleUpdate ..........."+errString);
return errString;
}
......@@ -3603,12 +3639,12 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt = null;
//System.out.println("05/04/14 manoharan totAmt [" + totAmt + "] adjAmt [ " + adjAmt + "] amount [" + amount + "]" +
// " Math.abs(totAmt - adjAmt) [" + Math.abs(totAmt - adjAmt) + "] Math.abs(amount) [" + Math.abs(amount) + "]");
// " Math.abs(totAmt - adjAmt) [" + Math.abs(totAmt - adjAmt) + "] Math.abs(amount) [" + Math.abs(amount) + "]");
double tempAmt=distCommon.getRequiredDecimal(Math.abs(totAmt - adjAmt), 3);
//System.out.println("@V@ TempAmt :- ["+tempAmt+"]");
///System.out.println("@V@ getReqDecimal(tempAmt,2) :- ["+getReqDecimal(tempAmt,2)+"]");
//System.out.println("@V@ getReqDecimal(Math.abs(amount),2) :- ["+getReqDecimal(Math.abs(amount),2)+"]");
// System.out.println("@V@ getReqDecimal(Math.abs(amount),2) :- ["+getReqDecimal(Math.abs(amount),2)+"]");
// if(getReqDecimal(Math.abs(totAmt - adjAmt),2) < getReqDecimal(Math.abs(amount),2))
if(getReqDecimal(tempAmt,2) < getReqDecimal(Math.abs(amount),2))
{
......@@ -3749,6 +3785,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
sundryBalMap.put("acct_code", (String)ADetMap.get("acct_code"));
sundryBalMap.put("cctr_code", (String)ADetMap.get("cctr_code"));
sundryBalMap.put("curr_code", hcurrCode);
//System.out.println("884 sundryBaleUpdate Called.............."+ ADetMap.get("exch_rate__vouch"));
sundryBalMap.put("exch_rate", (double) Double.parseDouble( "" + ADetMap.get("exch_rate__vouch")));
sundryBalMap.put("dr_amt", 0.0);
sundryBalMap.put("cr_amt", 0.0);
......@@ -3781,7 +3818,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
{
//COMMENTED BY MONIKA
//sql = "SELECT tot_amt, adj_amt FROM receivables WHERE tran_ser = ? and ref_no = ? for update ";
//CHANGES DONE BY MONIKA-0N 7 AUGUST 2019
//CHANGES DONE BY MONIKA-0N 7 AUGUST 2019
sql = "SELECT tot_amt, adj_amt FROM misc_payables WHERE tran_ser = ? and ref_no = ? for update ";//end
}
......@@ -3842,7 +3879,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
}
// sql = "update misc_payables set adj_amt = ? where tran_ser = 'E-FUND' and ref_no = ? ";//commeneted by monika 0n 7 august 2019
// sql = "update misc_payables set adj_amt = ? where tran_ser = 'E-FUND' and ref_no = ? ";//commeneted by monika 0n 7 august 2019
sql = "update misc_payables set adj_amt = ? where tran_ser = ? and ref_no = ? ";
pstmt = conn.prepareStatement(sql);
//pstmt.setDouble(1,adjAmt);//commented by monika
......@@ -3853,11 +3890,11 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
//ADDED BY MONIKA FOR EXPORT_FUND
sql = "update export_fund set bal_amt = (case when bal_amt is null then 0 else bal_amt end-?),amount__epcadj=? where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
// pstmt.setDouble(1,adjAmt);
// pstmt.setDouble(1,adjAmt);
pstmt.setDouble(1,(amount * -1));
pstmt.setDouble(2,adjAmt);
pstmt.setString(3,refNo);
......@@ -3865,8 +3902,8 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
pstmt.close();
pstmt = null;
//end
//end
}
//added by akhilesh on 31/july/13 for tax provision
errString = taxPost(tranId,xtraParams,RcpHdrMap, conn);
......@@ -3946,7 +3983,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
acctCode = rs.getString("acct_code");
cctrCode = rs.getString("cctr_code");
// System.out.println("cctrCode:" +cctrCode + ":");
// System.out.println("cctrCode:" +cctrCode + ":");
amount = rs.getDouble("tax_amt");
......@@ -3985,7 +4022,7 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
glTraceMap.put("analysis2",anal2);
glTraceMap.put("analysis3",anal3);
// System.out.println("glTraceUpdate before update "+glTraceMap);
// System.out.println("glTraceUpdate before update "+glTraceMap);
glTraceMap.put("chg_date", new Timestamp(tranDate.getTime()));
glTraceMap.put("chg_user", loginEmpCode);
glTraceMap.put("chg_term", chgTermstr);
......
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