Commit 6709bc11 authored by pdas's avatar pdas

Changes in CommDebitNote and CommCreditNote methods for proper entry in the comm.CreditNote Table


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97418 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 880d9a10
......@@ -481,7 +481,7 @@ public class CalculateCommission
finCommon = new FinCommon();
ITMDBAccessEJB itmDBAccessEJB = null;
itmDBAccessEJB = new ITMDBAccessEJB();
HashMap commMap = new HashMap();
HashMap commMap = null;
ArrayList commtList = new ArrayList();
ArrayList<String> drnList = null;
ArrayList<String> tranIdList = null;
......@@ -575,13 +575,14 @@ public class CalculateCommission
if(("SR".equalsIgnoreCase(calledFrom)) && ("P".equalsIgnoreCase(commCalc)))
{
tranId=tranIdRcp;
sretId = invno;
invno = "";
sql = "select invoice_id, net_amt, curr_code, exch_rate, site_code, tran_id__crn" +
"from sreturn where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sretId);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -687,6 +688,7 @@ public class CalculateCommission
}
if("Y".equalsIgnoreCase(commHdr))
{
sql = "select invoice_id, ref_line_no, inv_amt, frt_amt, item_ser, tran_date, eff_date, curr_code, exch_rate, fin_entity, site_code," +
" sales_pers,comm_perc__on,comm_perc,dlv_term, ord_amt, insu_amt,sorder_no, curr_code_sp, exch_rate_sp,comm_amt from (" +
" select DISTINCT a.invoice_id, 1 as ref_line_no, a.inv_amt inv_amt, a.frt_amt * d.exch_rate__frt / a.exch_rate frt_amt," +
......@@ -727,6 +729,9 @@ public class CalculateCommission
rs = pstmt.executeQuery();
while(rs.next())
{
commMap=null;
commMap = new HashMap();
commMap.put("invoice_id",rs.getString("invoice_id"));
commMap.put("ref_line_no" ,rs.getString("ref_line_no"));
commMap.put("inv_amt" ,rs.getDouble("inv_amt"));
......@@ -749,7 +754,8 @@ public class CalculateCommission
commMap.put("exch_rate_sp" , rs.getDouble("exch_rate_sp"));
commMap.put("comm_amt" , rs.getDouble("comm_amt"));
commtList.add(commMap);
commtList.add(commMap);//added
//commMap.clear(); //added
}
......@@ -795,6 +801,9 @@ public class CalculateCommission
rs = pstmt.executeQuery();
while(rs.next())
{
commMap=null;
commMap = new HashMap();
commMap.put("invoice_id" , rs.getString("invoice_id"));
commMap.put("ref_line_no" , rs.getString("ref_line_no"));
commMap.put("inv_amt" ,rs.getDouble("inv_amt"));
......@@ -827,7 +836,9 @@ public class CalculateCommission
commMap.put("exch_rate_sp" , rs.getDouble("exch_rate_sp"));
commMap.put("comm_amt" , rs.getDouble("comm_amt"));
commtList.add(commMap);
commtList.add(commMap);//added
//commMap. 0();//added
}
......@@ -865,8 +876,10 @@ public class CalculateCommission
for(int cnt = 0 ;commtList.size() > cnt ;cnt++) //change done by kunal on 23/jun/14 loop start with 0
{
commMap = new HashMap();
commMap = (HashMap) commtList.get(cnt);
System.out.println(commMap);
refLineNo = (String) commMap.get("ref_line_no");
invoiceId = (String) commMap.get("invoice_id");
invAmt = (Double) commMap.get("inv_amt");
......@@ -879,6 +892,7 @@ public class CalculateCommission
finent = (String) commMap.get("fin_entity");
siteCode = (String) commMap.get("site_code");
dlvTerm = (String) commMap.get("dlv_term");
if("Y".equalsIgnoreCase(commHdr))
{
......@@ -1341,7 +1355,7 @@ public class CalculateCommission
xmlBuff.append("</Detail2>");
}
oldsp = salesPers;
currcdSpOld = currcodeSp ;
currcdSpOld = currCodeSp ;
sql = "select due_date from invoice where invoice_id = ?";
......@@ -2464,6 +2478,9 @@ public class CalculateCommission
rs = pstmt.executeQuery();
while(rs.next())
{
commMap=null;
commMap = new HashMap();
commMap.put("invoice_id" , rs.getString("invoice_id"));
commMap.put("ref_line_no" , rs.getString("ref_line_no"));
commMap.put("inv_amt" ,rs.getDouble("inv_amt"));
......
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