Commit c2c88ed3 authored by pdas's avatar pdas

net amt is assigned to comission amt


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97796 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 269b1584
......@@ -2868,7 +2868,54 @@ public class CalculateCommission
{
invLineNo = lineNoInv;
}
if("SR".equalsIgnoreCase(calledFrom) && "P".equalsIgnoreCase(commCalc))
{
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 = ? " +
"and drcr_inv.curr_code = ? and drcr_flag = 'C' " +
"and (case when line_no__inv is null then 0 else line_no__inv end) = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,invoiceId );
pstmt.setString(2, salesPer);
pstmt.setString(3, currCodeSp);
pstmt.setInt(4, lineNoInv);
rs = pstmt.executeQuery();
if(rs.next())
{
netAmt = rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else
{
sql = "select sum(case when drcr_flag = 'C' then net_amt else -net_amt end) from drcr_inv, drcr_invdet " +
"where drcr_inv.tran_id = drcr_invdet.tran_id and drcr_inv.invoice_id = ? and drcr_inv.sundry_code = ? " +
" and drcr_inv.curr_code = ? and (case when line_no__inv is null then 0 else line_no__inv end) = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,invoiceId );
pstmt.setString(2, salesPer);
pstmt.setString(3, currCodeSp);
pstmt.setInt(4, lineNoInv);
rs = pstmt.executeQuery();
if(rs.next())
{
netAmt = rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
System.out.println("08/01/15 manoharan netAmt before ["+netAmt + "]");
commAmt=netAmt;
if(commAmt !=0)
{
//if(errString == null || errString.trim().length() ==0)
//{
lineNo++;
......@@ -2893,7 +2940,7 @@ public class CalculateCommission
xmlBuff.append("<net_amt><![CDATA["+ commAmt +"]]></net_amt>");
xmlBuff.append("</Detail2>");
//}
}
if(!("R".equalsIgnoreCase(calledFrom) && "P".equalsIgnoreCase(commCalc)))
{
......
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