Commit 19ee98dd authored by wansari's avatar wansari

Updated source to correct prepared stamement and sql group by clause.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@43847 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d7fe34f0
......@@ -3469,9 +3469,16 @@ public class PostOrderActivity {
if ("R".equalsIgnoreCase(tranType))
{
sql = "select tran_date, cust_code,cust_code__bill as cust_code__bil from sreturn " + " where tran_id = ?";
sqlDetData = "select tran_id refNo,line_no refLineNo, item_code, sum(net_amt - tax_amt) totamt,sum(quantity__stduom) totqty"
//Changed by wasim on 17-MAY-2017 for correcting SQL for group by clause [START]
/*sqlDetData = "select tran_id refNo,line_no refLineNo, item_code, sum(net_amt - tax_amt) totamt,sum(quantity__stduom) totqty"
+ " from sreturndet where tran_id = ? and ret_rep_flag = 'P' "
+ " group by line_no,item_code order by line_no desc";
+ " group by line_no,item_code order by line_no desc";*/
sqlDetData = "select tran_id as refNo,line_no as refLineNo, item_code, sum(net_amt - tax_amt) as totamt,sum(quantity__stduom) as totqty"
+ " from sreturndet where tran_id = ? and ret_rep_flag = 'P' "
+ " group by tran_id,line_no,item_code order by line_no desc";
//Changed by wasim on 17-MAY-2017 for correcting SQL for group by clause [END]
} else if ("I".equalsIgnoreCase(tranType))
{
......@@ -3817,16 +3824,33 @@ public class PostOrderActivity {
if ("R".equalsIgnoreCase(tranType))
{
sql = "select distinct lot_no from sreturndet where tran_id = ? and line_no = ? and item_code = ? order by lot_no";
} else if ("I".equalsIgnoreCase(tranType))
}
else if ("I".equalsIgnoreCase(tranType))
{
sql = "select distinct lot_no from invoice_trace where invoice_id = ? and sord_no = ?"
+ " and sord_line_no = ? and item_code = ? order by lot_no";
}
pstmtLot = conn.prepareStatement(sql);
pstmtLot.setString(1, invoiceId);
//Changed by wasim on 17-05-2017 for setting correct parameter for prepared statements [START]
/*pstmtLot.setString(1, invoiceId);
pstmtLot.setString(2, refNo);
pstmtLot.setString(3, refLineNo);
pstmtLot.setString(4, itemCode);
pstmtLot.setString(4, itemCode);*/
if ("R".equalsIgnoreCase(tranType))
{
pstmtLot.setString(1, invoiceId);
pstmtLot.setString(2, refLineNo);
pstmtLot.setString(3, itemCode);
}
else if ("I".equalsIgnoreCase(tranType))
{
pstmtLot.setString(1, invoiceId);
pstmtLot.setString(2, refNo);
pstmtLot.setString(3, refLineNo);
pstmtLot.setString(4, itemCode);
}
//Changed by wasim on 17-05-2017 for setting correct parameter for prepared statements [END]
rsLot = pstmtLot.executeQuery();
while (rsLot.next())
{
......
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