Commit a7162408 authored by manohar's avatar manohar

if dr/cr note against receipt there receipt tran_is is stored in tran_id__rcv...

if dr/cr note against receipt there receipt tran_is is stored in tran_id__rcv so that can be used during receipt dishonour


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95836 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 278fffc8
...@@ -122,7 +122,7 @@ public class CalculateCommission ...@@ -122,7 +122,7 @@ public class CalculateCommission
refSer = rs.getString(1); refSer = rs.getString(1);
invno = rs.getString(2); invno = rs.getString(2);
facter = rs.getInt(3); facter = rs.getInt(3);
// Added by fatema - 30/04/2007 - DI7CHT0010
invFound = "N"; invFound = "N";
for(int cnt = 0 ; cnt < invList.size();cnt++) for(int cnt = 0 ; cnt < invList.size();cnt++)
{ {
...@@ -136,6 +136,7 @@ public class CalculateCommission ...@@ -136,6 +136,7 @@ public class CalculateCommission
{ {
continue; continue;
} }
// Ended by fatema - 30/04/2007 - DI7CHT0010
// create debit note for invoice = ls_invno and factor = lc_factor // create debit note for invoice = ls_invno and factor = lc_factor
sql1 = "select case when rcp_amt is null then 0 else rcp_amt end from rcpdet" + sql1 = "select case when rcp_amt is null then 0 else rcp_amt end from rcpdet" +
...@@ -172,12 +173,12 @@ public class CalculateCommission ...@@ -172,12 +173,12 @@ public class CalculateCommission
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
if(Math.round(checkAdjAmt) == 0) if(Math.round(checkAdjAmt) == 0) // Added by fatema-30/04/2007-DI7CHT0010-Coz this func is called after the receipt posting & so the invoce is already adjusted
{ {
errString = commDebitNote(invno, facter, tranId, postCrn, callModule,xtraParams, conn); errString = commDebitNote(invno, facter, tranId, postCrn, callModule,xtraParams, conn);
if (errString == null || errString.trim().length() == 0) if (errString == null || errString.trim().length() == 0)
{ {
invList.add(invno); invList.add(invno); // Added by fatema-30/04/2007-DI7CHT0010
} }
else else
{ {
...@@ -199,7 +200,7 @@ public class CalculateCommission ...@@ -199,7 +200,7 @@ public class CalculateCommission
{ {
invList = null; invList = null;
invList = new ArrayList<String>(); invList = new ArrayList<String>();// Added by fatema - 30/04/2007 - DI7CHT0010
sql = "select rcpdet.ref_ser, rcpdet.ref_no, ( rcpdet.rcp_amt - ( rcpdet.tax_amt * rcpdet.rcp_amt / rcpdet.net_amt ) ) / (inv_amt - invoice.disc_amt)" + sql = "select rcpdet.ref_ser, rcpdet.ref_no, ( rcpdet.rcp_amt - ( rcpdet.tax_amt * rcpdet.rcp_amt / rcpdet.net_amt ) ) / (inv_amt - invoice.disc_amt)" +
"from rcpdet, invoice where rcpdet.ref_no = invoice.invoice_id and tran_id = ?" + "from rcpdet, invoice where rcpdet.ref_no = invoice.invoice_id and tran_id = ?" +
" and ( ref_ser = 'S-INV' OR ref_ser like 'R-IBC%' )"; " and ( ref_ser = 'S-INV' OR ref_ser like 'R-IBC%' )";
...@@ -211,7 +212,7 @@ public class CalculateCommission ...@@ -211,7 +212,7 @@ public class CalculateCommission
refSer = rs.getString(1); refSer = rs.getString(1);
invno = rs.getString(2); invno = rs.getString(2);
facter = rs.getInt(3); facter = rs.getInt(3);
// Added by fatema - 30/04/2007 - DI7CHT0010
invFound = "N"; invFound = "N";
for(int cnt = 0 ; cnt < invList.size();cnt++) for(int cnt = 0 ; cnt < invList.size();cnt++)
{ {
...@@ -225,7 +226,7 @@ public class CalculateCommission ...@@ -225,7 +226,7 @@ public class CalculateCommission
{ {
continue; continue;
} }
// Ended by fatema - 30/04/2007 - DI7CHT0010
sql1 = "Select case when rcp_amt is null then 0 else rcp_amt end from rcpdet where tran_id = ?" + sql1 = "Select case when rcp_amt is null then 0 else rcp_amt end from rcpdet where tran_id = ?" +
" and ref_ser = ? and ref_no = ?"; " and ref_ser = ? and ref_no = ?";
pstmt1 = conn.prepareStatement(sql1); pstmt1 = conn.prepareStatement(sql1);
...@@ -256,7 +257,7 @@ public class CalculateCommission ...@@ -256,7 +257,7 @@ public class CalculateCommission
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
// Added by fatema-30/04/2007-DI7CHT0010-Coz this func is called after the receipt posting & so the invoce is already adjusted
if(Math.round(checkAdjAmt) == 0) if(Math.round(checkAdjAmt) == 0)
{ {
errString = commCrditNote(invno, facter, tranId, postCrn, callModule,xtraParams, conn); errString = commCrditNote(invno, facter, tranId, postCrn, callModule,xtraParams, conn);
...@@ -284,6 +285,9 @@ public class CalculateCommission ...@@ -284,6 +285,9 @@ public class CalculateCommission
} }
else if("SR".equalsIgnoreCase(callModule) && "P".equalsIgnoreCase(commCalc)) else if("SR".equalsIgnoreCase(callModule) && "P".equalsIgnoreCase(commCalc))
{ {
// To create DB-note for reversal of prov. CR-Note
// Added by fatema-11/06/2007-DI7CHT0010 - To continue process only if invoice is not completely adjusted
sql = " Select sum((case when tot_amt is null then 0 else tot_amt end) - (case when adj_amt is null then 0 else adj_amt end)) from receivables " + sql = " Select sum((case when tot_amt is null then 0 else tot_amt end) - (case when adj_amt is null then 0 else adj_amt end)) from receivables " +
"where (tran_ser = 'S-INV' or tran_ser like 'R-IBC%') and ref_no = ?"; "where (tran_ser = 'S-INV' or tran_ser like 'R-IBC%') and ref_no = ?";
...@@ -299,13 +303,14 @@ public class CalculateCommission ...@@ -299,13 +303,14 @@ public class CalculateCommission
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(Math.round(checkAdjAmt)> 0) if(Math.round(checkAdjAmt)> 0) // Ended by fatema-11/06/2007-DI7CHT0010
{ {
errString = commDebitNote(tranId, facter, tranId, postCrn, callModule ,xtraParams, conn); errString = commDebitNote(tranId, facter, tranId, postCrn, callModule ,xtraParams, conn);
return errString; return errString;
} }
// Added by fatema-11/06/2007-DI7CHT0010
} }
...@@ -480,7 +485,7 @@ public class CalculateCommission ...@@ -480,7 +485,7 @@ public class CalculateCommission
{ {
if ((!"null".equals(tranIdRcp)) && tranIdRcp != null && tranIdRcp.trim().length() > 0 ) if ((!"null".equals(tranIdRcp)) && tranIdRcp != null && tranIdRcp.trim().length() > 0 )
{ {
remarks = "Agst Receipt # [" + tranIdRcp + "] of Invoice # [" + invno + "]"; remarks = "Agst Receipt # [" + tranIdRcp + "] of Invoice # [" + invno + "]"; //tran_id__rcv
} }
else else
{ {
...@@ -1206,6 +1211,12 @@ public class CalculateCommission ...@@ -1206,6 +1211,12 @@ public class CalculateCommission
xmlBuff.append("<acct_code__cf><![CDATA["+ acctCodeCf +"]]></acct_code__cf>"); xmlBuff.append("<acct_code__cf><![CDATA["+ acctCodeCf +"]]></acct_code__cf>");
xmlBuff.append("<cctr_code__cf><![CDATA["+ cctrCodeCf +"]]></cctr_code__cf>"); xmlBuff.append("<cctr_code__cf><![CDATA["+ cctrCodeCf +"]]></cctr_code__cf>");
// 08/08/14 manoharan to use during receipt dishonour
if ((!"null".equals(tranIdRcp)) && tranIdRcp != null && tranIdRcp.trim().length() > 0 )
{
xmlBuff.append("<tran_id__rcv><![CDATA["+ tranIdRcp +"]]></tran_id__rcv>");
}
xmlBuff.append("</Detail1>"); xmlBuff.append("</Detail1>");
} }
if(errString == null || errString.trim().length() ==0) if(errString == null || errString.trim().length() ==0)
...@@ -2551,7 +2562,7 @@ public class CalculateCommission ...@@ -2551,7 +2562,7 @@ public class CalculateCommission
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
jvExchrate = 0.0; jvExchrate = 0.0;// Added by fatema-20/04/2007-DI7CHT0010
sql = "select exch_rate from journal where ref_ser = 'S-INV' and ref_no = ? and ref_line_no = ?"; sql = "select exch_rate from journal where ref_ser = 'S-INV' and ref_no = ? and ref_line_no = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -2579,7 +2590,7 @@ public class CalculateCommission ...@@ -2579,7 +2590,7 @@ public class CalculateCommission
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
// Added by fatema - 25/04/2007 - DI7CHT0010
if(siteCodeRcp == null || siteCodeRcp.trim().length() == 0 || siteCodeRcp.equalsIgnoreCase(siteCode)) if(siteCodeRcp == null || siteCodeRcp.trim().length() == 0 || siteCodeRcp.equalsIgnoreCase(siteCode))
{ {
rcpRefser = "S-INV"; rcpRefser = "S-INV";
...@@ -2589,7 +2600,7 @@ public class CalculateCommission ...@@ -2589,7 +2600,7 @@ public class CalculateCommission
{ {
rcpRefser = "R-IBCA"; rcpRefser = "R-IBCA";
} }
// Ended by fatema - 25/04/2007 - DI7CHT0010
sql = "Select distinct h.site_code from receipt h, rcpdet d where h.tran_id = d.tran_id " + sql = "Select distinct h.site_code from receipt h, rcpdet d where h.tran_id = d.tran_id " +
" and d.ref_ser = ? and d.ref_no = ? and " + " and d.ref_ser = ? and d.ref_no = ? and " +
...@@ -2754,6 +2765,11 @@ public class CalculateCommission ...@@ -2754,6 +2765,11 @@ public class CalculateCommission
xmlBuff.append("<due_date><![CDATA["+ sdf.format(utilMethods.RelativeDate((new java.util.Date()), crdays)).toString() +"]]></due_date>"); xmlBuff.append("<due_date><![CDATA["+ sdf.format(utilMethods.RelativeDate((new java.util.Date()), crdays)).toString() +"]]></due_date>");
xmlBuff.append("<acct_code__cf><![CDATA["+ acctCodecf +"]]></acct_code__cf>"); xmlBuff.append("<acct_code__cf><![CDATA["+ acctCodecf +"]]></acct_code__cf>");
xmlBuff.append("<cctr_code__cf><![CDATA["+ cctrCodecf +"]]></cctr_code__cf>"); xmlBuff.append("<cctr_code__cf><![CDATA["+ cctrCodecf +"]]></cctr_code__cf>");
// 08/08/14 manoharan in order user during receipt dishonour
if ((!"null".equals(tranIdRcp)) && tranIdRcp != null && tranIdRcp.trim().length() > 0 )
{
xmlBuff.append("<tran_id__rcv><![CDATA["+ tranIdRcp +"]]></tran_id__rcv>");
}
xmlBuff.append("</Detail1>"); xmlBuff.append("</Detail1>");
...@@ -2786,12 +2802,13 @@ public class CalculateCommission ...@@ -2786,12 +2802,13 @@ public class CalculateCommission
//} //}
if("R".equalsIgnoreCase(calledFrom) && "P".equalsIgnoreCase(commCalc)) if(!("R".equalsIgnoreCase(calledFrom) && "P".equalsIgnoreCase(commCalc)))
{ {
/// ///
} }
else else
{ {
// Added by fatema-11/07/2007-FI78CHT006
sql = "select net_amt from drcr_inv, drcr_invdet where drcr_inv.tran_id = drcr_invdet.tran_id and " + sql = "select net_amt from drcr_inv, drcr_invdet where drcr_inv.tran_id = drcr_invdet.tran_id and " +
"drcr_inv.invoice_id = ? and drcr_inv.sundry_code = ? " + "drcr_inv.invoice_id = ? and drcr_inv.sundry_code = ? " +
"and drcr_inv.curr_code = ? and drcr_flag = 'D' " + "and drcr_inv.curr_code = ? and drcr_flag = 'D' " +
......
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