Commit 6b7de975 authored by manohar's avatar manohar

credit note rounding done and unnecessary validation for rate__contr commented


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91351 ce508802-f39f-4f6c-b175-0d175dae99d5
parent df00226d
...@@ -529,10 +529,15 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C ...@@ -529,10 +529,15 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
rateSell = "0"; rateSell = "0";
if( rateContr == null ) if( rateContr == null )
rateContr = "0"; rateContr = "0";
if( Double.parseDouble(rateContr) > Double.parseDouble(rateSell) ) /*if( Double.parseDouble(rateContr) > Double.parseDouble(rateSell) )
{ {
errString =itmDBAccessEJB.getErrorString("rate__contr","EDCSTRTINV",userId); errString =itmDBAccessEJB.getErrorString("rate__contr","EDCSTRTINV",userId);
break ; break ;
}*/
if( Double.parseDouble(rateContr) < 0 )
{
errString =itmDBAccessEJB.getErrorString("rate__contr","VTSTKBILRT",userId);
break ;
} }
} }
} }
...@@ -743,11 +748,11 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C ...@@ -743,11 +748,11 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
valueXmlString.append("<tran_date>").append("<![CDATA[" + getCurrdateAppFormat() + "]]>").append("</tran_date>"); valueXmlString.append("<tran_date>").append("<![CDATA[" + getCurrdateAppFormat() + "]]>").append("</tran_date>");
valueXmlString.append("<eff_date>").append("<![CDATA[" + getCurrdateAppFormat() + "]]>").append("</eff_date>"); valueXmlString.append("<eff_date>").append("<![CDATA[" + getCurrdateAppFormat() + "]]>").append("</eff_date>");
valueXmlString.append("<site_code__log>").append("<![CDATA[" + ( loginSite )+ "]]>").append("</site_code__log>"); valueXmlString.append("<site_code__log>").append("<![CDATA[" + ( loginSite )+ "]]>").append("</site_code__log>");
valueXmlString.append("<site_log_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_log_descr>"); valueXmlString.append("<site_descr1>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr1>");
valueXmlString.append("<site_code>").append("<![CDATA[" + ( loginSite )+ "]]>").append("</site_code>"); valueXmlString.append("<site_code>").append("<![CDATA[" + ( loginSite )+ "]]>").append("</site_code>");
valueXmlString.append("<site_bill_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_bill_descr>"); valueXmlString.append("<site_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr>");
valueXmlString.append("<site_code__cr>").append("<![CDATA[" + ( loginSite )+ "]]>").append("</site_code__cr>"); valueXmlString.append("<site_code__cr>").append("<![CDATA[" + ( loginSite )+ "]]>").append("</site_code__cr>");
valueXmlString.append("<site_cr_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_cr_descr>"); valueXmlString.append("<site_descr2>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr2>");
valueXmlString.append("<type>").append("R").append("</type>"); valueXmlString.append("<type>").append("R").append("</type>");
valueXmlString.append("<curr_code>").append("<![CDATA[" + ( currCode )+ "]]>").append("</curr_code>"); valueXmlString.append("<curr_code>").append("<![CDATA[" + ( currCode )+ "]]>").append("</curr_code>");
valueXmlString.append("<exch_rate>").append("<![CDATA[" + ( exchRate )+ "]]>").append("</exch_rate>"); valueXmlString.append("<exch_rate>").append("<![CDATA[" + ( exchRate )+ "]]>").append("</exch_rate>");
...@@ -970,10 +975,35 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C ...@@ -970,10 +975,35 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
pStmt = null; pStmt = null;
} }
valueXmlString.append("<site_bill_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_bill_descr>"); valueXmlString.append("<site_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr>");
valueXmlString.append("<site_code__cr>").append("<![CDATA[" + ( siteCode )+ "]]>").append("</site_code__cr>");
valueXmlString.append("<site_cr_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_cr_descr>");
} }
if (currentColumn.trim().equals( "site_code__log" ))
{
siteCode = genericUtility.getColumnValue( "site_code__log", dom );
System.out.println("site_code is==>"+siteCode);
/* siteCode = genericUtility.getColumnValue( "site_code", dom, "1" );
System.out.println("site_code is==>"+siteCode);
siteCode = childNode.getFirstChild().getNodeValue().trim();
System.out.println("site_code is==>"+siteCode); */
if( siteCode != null && siteCode.trim().length() > 0 )
{
sql = "select descr from site where site_code = ? ";
pStmt = conn.prepareStatement( sql );
pStmt.setString(1,siteCode.trim());
rs = pStmt.executeQuery();
if( rs.next() )
{
siteDescr = rs.getString( "descr" );
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
}
valueXmlString.append("<site_descr1>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr1>");
}
if (currentColumn.trim().equals( "site_code__cr" ))
if (currentColumn.trim().equals( "site_code__cr" )) if (currentColumn.trim().equals( "site_code__cr" ))
{ {
siteCode = genericUtility.getColumnValue( "site_code__cr", dom ); siteCode = genericUtility.getColumnValue( "site_code__cr", dom );
...@@ -998,7 +1028,7 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C ...@@ -998,7 +1028,7 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
pStmt = null; pStmt = null;
} }
valueXmlString.append("<site_cr_descr>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_cr_descr>"); valueXmlString.append("<site_descr2>").append("<![CDATA[" + ( siteDescr )+ "]]>").append("</site_descr2>");
// 15/05/10 manoharan site code should be credit site code // 15/05/10 manoharan site code should be credit site code
custCode = genericUtility.getColumnValue( "cust_code", dom ); custCode = genericUtility.getColumnValue( "cust_code", dom );
// end 15/05/10 manoharan site code should be credit site code // end 15/05/10 manoharan site code should be credit site code
......
...@@ -415,7 +415,25 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -415,7 +415,25 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pstmtHdr.setString( 8, custCodeCr ); pstmtHdr.setString( 8, custCodeCr );
pstmtHdr.setString( 9, acctCode == null ? "" : acctCode ); pstmtHdr.setString( 9, acctCode == null ? "" : acctCode );
pstmtHdr.setString( 10, cctrCode == null ? " " : cctrCode ); pstmtHdr.setString( 10, cctrCode == null ? " " : cctrCode );
pstmtHdr.setDouble( 11, drcrAmt ); sql = "select nvl(round,'N') ls_round, nvl(round_to,0.001) lc_round_to from customer where cust_code = ? ";
pstmt1 = conn.prepareStatement( sql );
pstmt1.setString(1, custCodeCr );
rSet = pstmt1.executeQuery();
if( rSet.next() )
{
round = rSet.getString( "ls_round" );
roundTo = rSet.getDouble( "lc_round_to" );
}
rSet.close();
rSet = null;
pstmt1.close();
pstmt1 = null;
roundAmt = disComm.getRndamt( drcrAmt, round, roundTo );
diffAmt = roundAmt - drcrAmt;
//pstmtHdr.setDouble( 11, drcrAmt );
pstmtHdr.setDouble( 11, roundAmt );
pstmtHdr.setString( 12, currCode == null || currCode.trim().length() == 0 ? "" : currCode); pstmtHdr.setString( 12, currCode == null || currCode.trim().length() == 0 ? "" : currCode);
pstmtHdr.setDouble( 13, exchgRate ); pstmtHdr.setDouble( 13, exchgRate );
...@@ -441,7 +459,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -441,7 +459,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pstmtHdr.setTimestamp( 23, currDate ); pstmtHdr.setTimestamp( 23, currDate );
pstmtHdr.setString( 24, ( tranType == null || tranType.trim().length() == 0 ? "" :tranType.trim() ) ); pstmtHdr.setString( 24, ( tranType == null || tranType.trim().length() == 0 ? "" :tranType.trim() ) );
pstmtHdr.setString( 25, ( itemSer == null || itemSer.trim().length() == 0 ? "" : itemSer.trim() ) ); pstmtHdr.setString( 25, ( itemSer == null || itemSer.trim().length() == 0 ? "" : itemSer.trim() ) );
pstmtHdr.setDouble( 26, drcrAmt ); //pstmtHdr.setDouble( 26, drcrAmt );
pstmtHdr.setDouble( 26, roundAmt * exchgRate);
pstmtHdr.setString( 27, ( tranIdSel == null || tranIdSel.trim().length() == 0 ? "" : tranIdSel.trim() ) ); pstmtHdr.setString( 27, ( tranIdSel == null || tranIdSel.trim().length() == 0 ? "" : tranIdSel.trim() ) );
pstmtHdr.setString( 28, "" ); //ADJ_MISC_CRN pstmtHdr.setString( 28, "" ); //ADJ_MISC_CRN
pstmtHdr.setDouble( 29, 0.0 ); //ADJ_AMOUNT pstmtHdr.setDouble( 29, 0.0 ); //ADJ_AMOUNT
...@@ -553,7 +572,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -553,7 +572,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
sql = "select nvl(round,'N') ls_round, nvl(round_to,0.001) lc_round_to from customer where cust_code = ? "; /*sql = "select nvl(round,'N') ls_round, nvl(round_to,0.001) lc_round_to from customer where cust_code = ? ";
pstmt1 = conn.prepareStatement( sql ); pstmt1 = conn.prepareStatement( sql );
pstmt1.setString(1, custCodeCr ); pstmt1.setString(1, custCodeCr );
rSet = pstmt1.executeQuery(); rSet = pstmt1.executeQuery();
...@@ -568,7 +587,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -568,7 +587,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pstmt1 = null; pstmt1 = null;
roundAmt = disComm.getRndamt( drcrAmt, round, roundTo ); roundAmt = disComm.getRndamt( drcrAmt, round, roundTo );
diffAmt = roundAmt - drcrAmt; diffAmt = roundAmt - drcrAmt;*/
if( diffAmt != 0 ) if( diffAmt != 0 )
{ {
//1. update header //1. update header
......
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