Commit 211738fc authored by pgole's avatar pgole

Updated ejb component for debit note generation if net_amt< 0


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104346 ce508802-f39f-4f6c-b175-0d175dae99d5
parent dbcfa9ff
...@@ -1066,7 +1066,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1066,7 +1066,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
double total = 0.0; double total = 0.0;
double roundAmt = 0.0; double roundAmt = 0.0;
double diffAmt = 0.0; double diffAmt = 0.0;
double discountAmt = 0.0; double discountAmt = 0.0 ,taxAmt = 0.0;
int llLineNo = 0; int llLineNo = 0;
java.sql.Timestamp tranDate = null; java.sql.Timestamp tranDate = null;
java.sql.Timestamp pOrderDate = null; java.sql.Timestamp pOrderDate = null;
...@@ -1143,7 +1143,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1143,7 +1143,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
sql = "select a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, " sql = "select a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, "
+" a.net_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, " +" a.net_amt,a.tax_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, "
+" a.amount, a.remarks, sum(b.discount_amt) as discAmt ,b.tax_class as tax_class,b.tax_chap as tax_chap,b.tax_env as tax_env " +" a.amount, a.remarks, sum(b.discount_amt) as discAmt ,b.tax_class as tax_class,b.tax_chap as tax_chap,b.tax_env as tax_env "
+" from charge_back a, charge_back_det b " +" from charge_back a, charge_back_det b "
+" where a.tran_id = b.tran_id " +" where a.tran_id = b.tran_id "
...@@ -1156,7 +1156,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1156,7 +1156,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
+" and a.site_code = ? " +" and a.site_code = ? "
// +" and a.confirmed = 'Y' " // +" and a.confirmed = 'Y' "
+" group by a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, " +" group by a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, "
+" a.net_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, " +" a.net_amt,a.tax_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, "
+" a.amount, a.remarks ,b.tax_class ,b.tax_chap ,b.tax_env"; +" a.amount, a.remarks ,b.tax_class ,b.tax_chap ,b.tax_env";
pstmt = conn.prepareStatement( sql ); pstmt = conn.prepareStatement( sql );
...@@ -1178,6 +1178,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1178,6 +1178,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
empCodeAprv = rs.getString("emp_code__aprv"); empCodeAprv = rs.getString("emp_code__aprv");
tranIdSel = rs.getString("tran_id"); tranIdSel = rs.getString("tran_id");
netAmt = rs.getDouble("net_amt"); netAmt = rs.getDouble("net_amt");
taxAmt = rs.getDouble("tax_amt");
pOrderNo = rs.getString("porder_no"); pOrderNo = rs.getString("porder_no");
pOrderDate = rs.getTimestamp("porder_date"); pOrderDate = rs.getTimestamp("porder_date");
claimAmt = rs.getDouble("claum_amt"); claimAmt = rs.getDouble("claum_amt");
...@@ -1193,6 +1194,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1193,6 +1194,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
System.out.println("taxClass==>["+taxClass+"]"); System.out.println("taxClass==>["+taxClass+"]");
System.out.println("taxChap==>["+taxChap+"]"); System.out.println("taxChap==>["+taxChap+"]");
System.out.println("taxEnv==>["+taxEnv+"]"); System.out.println("taxEnv==>["+taxEnv+"]");
System.out.println("netAmt==>["+netAmt+"]grossAmount["+grossAmount+"]taxAmt["+taxAmt+"]");
if( siteCodeCr == null || siteCodeCr.trim().length() == 0 ) if( siteCodeCr == null || siteCodeCr.trim().length() == 0 )
{ {
siteCodeCr = siteCode; siteCodeCr = siteCode;
...@@ -1456,17 +1459,32 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1456,17 +1459,32 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
{ {
grossAmount = grossAmount * (-1); grossAmount = grossAmount * (-1);
} }
if(taxAmt < 0)
{
taxAmt = taxAmt * (-1);
}
System.out.println("drcrAmt in debit detail"+drcrAmt); System.out.println("drcrAmt in debit detail"+drcrAmt);
System.out.println("grossAmount in debit detail"+grossAmount); System.out.println("grossAmount in debit detail"+grossAmount);
System.out.println("taxAmt in debit detail"+taxAmt);
//if( claimAmt > 0 && claimAmt < netAmt ) //if( claimAmt > 0 && claimAmt < netAmt )
//{ //{
//pstmtDtl.setDouble( 5, drcrAmt ); //pstmtDtl.setDouble( 5, drcrAmt );
//pstmtDtl.setDouble( 6, drcrAmt ); //pstmtDtl.setDouble( 6, drcrAmt );
//CHANGED BY POONAM //CHANGED BY POONAM
if(claimAmt < netAmt)
{
xmlBuffDet.append("<amount><![CDATA["+ drcrAmt +"]]></amount>"); xmlBuffDet.append("<amount><![CDATA["+ drcrAmt +"]]></amount>");
xmlBuffDet.append("<net_amt><![CDATA["+ drcrAmt +"]]></net_amt>"); xmlBuffDet.append("<net_amt><![CDATA["+ drcrAmt +"]]></net_amt>");
//xmlBuffDet.append("<tax_amt><![CDATA["+ taxAmt +"]]></tax_amt>");
}
else
{
xmlBuffDet.append("<amount><![CDATA["+ grossAmount +"]]></amount>");
xmlBuffDet.append("<net_amt><![CDATA["+ drcrAmt +"]]></net_amt>");
xmlBuffDet.append("<tax_amt><![CDATA["+ taxAmt +"]]></tax_amt>");
}
//} //}
/*else /*else
{ {
...@@ -1485,6 +1503,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1485,6 +1503,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
xmlBuffDet.append("<ref_no><![CDATA["+ tranIdSel +"]]></ref_no>"); xmlBuffDet.append("<ref_no><![CDATA["+ tranIdSel +"]]></ref_no>");
xmlBuffDet.append("<reas_code><![CDATA["+ checkNull(reasonCd) +"]]></reas_code>"); xmlBuffDet.append("<reas_code><![CDATA["+ checkNull(reasonCd) +"]]></reas_code>");
xmlBuffDet.append("<anal_code><![CDATA["+ analCode +"]]></anal_code>"); xmlBuffDet.append("<anal_code><![CDATA["+ analCode +"]]></anal_code>");
xmlBuffDet.append("<tax_class><![CDATA["+ checkNull(taxClass) +"]]></tax_class>"); xmlBuffDet.append("<tax_class><![CDATA["+ checkNull(taxClass) +"]]></tax_class>");
xmlBuffDet.append("<tax_chap><![CDATA["+ checkNull(taxChap) +"]]></tax_chap>"); xmlBuffDet.append("<tax_chap><![CDATA["+ checkNull(taxChap) +"]]></tax_chap>");
xmlBuffDet.append("<tax_env><![CDATA["+ checkNull(taxEnv) +"]]></tax_env>"); xmlBuffDet.append("<tax_env><![CDATA["+ checkNull(taxEnv) +"]]></tax_env>");
...@@ -1741,7 +1761,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1741,7 +1761,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
double total = 0.0; double total = 0.0;
double roundAmt = 0.0; double roundAmt = 0.0;
double diffAmt = 0.0; double diffAmt = 0.0;
double discountAmt = 0.0; double discountAmt = 0.0 ,taxAmt = 0.0;
int llLineNo = 0; int llLineNo = 0;
java.sql.Timestamp tranDate = null; java.sql.Timestamp tranDate = null;
java.sql.Timestamp pOrderDate = null; java.sql.Timestamp pOrderDate = null;
...@@ -1818,7 +1838,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1818,7 +1838,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
sql = "select a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, " sql = "select a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, "
+" a.net_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, " +" a.net_amt, a.tax_amt,a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, "
+" a.amount, a.remarks, sum(b.discount_amt) as discAmt ,b.tax_class as tax_class,b.tax_chap as tax_chap,b.tax_env as tax_env " +" a.amount, a.remarks, sum(b.discount_amt) as discAmt ,b.tax_class as tax_class,b.tax_chap as tax_chap,b.tax_env as tax_env "
+" from charge_back a, charge_back_det b " +" from charge_back a, charge_back_det b "
+" where a.tran_id = b.tran_id " +" where a.tran_id = b.tran_id "
...@@ -1831,7 +1851,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1831,7 +1851,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
+" and a.site_code = ? " +" and a.site_code = ? "
// +" and a.confirmed = 'Y' " // +" and a.confirmed = 'Y' "
+" group by a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, " +" group by a.cust_code__credit, a.curr_code, a.exch_rate, a.emp_code__aprv, a.tran_id, "
+" a.net_amt, a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, " +" a.net_amt, a.tax_amt,a.porder_no, a.porder_date, a.claum_amt, a.site_code__cr, a.item_ser, "
+" a.amount, a.remarks ,b.tax_class ,b.tax_chap ,b.tax_env"; +" a.amount, a.remarks ,b.tax_class ,b.tax_chap ,b.tax_env";
pstmt = conn.prepareStatement( sql ); pstmt = conn.prepareStatement( sql );
...@@ -1853,6 +1873,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -1853,6 +1873,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
empCodeAprv = rs.getString("emp_code__aprv"); empCodeAprv = rs.getString("emp_code__aprv");
tranIdSel = rs.getString("tran_id"); tranIdSel = rs.getString("tran_id");
netAmt = rs.getDouble("net_amt"); netAmt = rs.getDouble("net_amt");
taxAmt = rs.getDouble("tax_amt");
pOrderNo = rs.getString("porder_no"); pOrderNo = rs.getString("porder_no");
pOrderDate = rs.getTimestamp("porder_date"); pOrderDate = rs.getTimestamp("porder_date");
claimAmt = rs.getDouble("claum_amt"); claimAmt = rs.getDouble("claum_amt");
...@@ -2008,6 +2029,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -2008,6 +2029,8 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
drcrAmt = drcrAmt * (-1); drcrAmt = drcrAmt * (-1);
} }
System.out.println("drcrAmt IN debit note"+drcrAmt); System.out.println("drcrAmt IN debit note"+drcrAmt);
diffAmt = roundAmt - drcrAmt; diffAmt = roundAmt - drcrAmt;
...@@ -2131,17 +2154,22 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo ...@@ -2131,17 +2154,22 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
{ {
grossAmount = grossAmount * (-1); grossAmount = grossAmount * (-1);
} }
if(taxAmt < 0)
{
taxAmt = taxAmt * (-1);
}
System.out.println("drcrAmt in debit detail"+drcrAmt); System.out.println("drcrAmt in debit detail"+drcrAmt);
System.out.println("grossAmount in debit detail"+grossAmount); System.out.println("grossAmount in debit detail"+grossAmount);
System.out.println("taxAmt in debit detail"+taxAmt);
//if( claimAmt > 0 && claimAmt < netAmt ) //if( claimAmt > 0 && claimAmt < netAmt )
//{ //{
//pstmtDtl.setDouble( 5, drcrAmt ); //pstmtDtl.setDouble( 5, drcrAmt );
//pstmtDtl.setDouble( 6, drcrAmt ); //pstmtDtl.setDouble( 6, drcrAmt );
//CHANGED BY POONAM //CHANGED BY POONAM
xmlBuffDet.append("<amount><![CDATA["+ drcrAmt +"]]></amount>"); xmlBuffDet.append("<amount><![CDATA["+ grossAmount +"]]></amount>");
xmlBuffDet.append("<net_amt><![CDATA["+ drcrAmt +"]]></net_amt>"); xmlBuffDet.append("<net_amt><![CDATA["+ drcrAmt +"]]></net_amt>");
xmlBuffDet.append("<net_amt><![CDATA["+ taxAmt +"]]></net_amt>");
//} //}
/*else /*else
{ {
......
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