Commit 660a68b1 authored by manohar's avatar manohar

status included in main query


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91099 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3b3224f6
......@@ -240,7 +240,7 @@ public class AssociateAct extends ActionHandlerEJB implements AssociateActLocal,
// "AND B.NATURE LIKE ? "+
// "AND (CASE WHEN A.ORDER_TYPE IS NULL THEN ' ' ELSE A.ORDER_TYPE END ) LIKE ? ) "+
// "GROUP BY ITEM_CODE, DESCR, UNIT, LOC_TYPE , AC_RATE ORDER BY DESCR";
////******* 15/04/09
// query changed by pankaj 0n 18.01.09
if( orderType == null || orderType.trim().length() == 0 )
{
......@@ -252,40 +252,37 @@ public class AssociateAct extends ActionHandlerEJB implements AssociateActLocal,
sql = sql + " case when c.loc_type__parent is null then c.loc_type else c.loc_type__parent end loc_type, ";
if((replRate != null && replRate.trim().length() > 0) && replRate.equals("1"))
{
sql = sql + "(fn_get_sord_rate (b.sale_order, b.line_no)) ac_rate";
sql = sql + " b.rate ac_rate ";
}
else
{
sql = sql + "(0) ac_rate";
sql = sql + " (0) ac_rate ";
}
//sql = sql + "(case when '" + ls_repl_rate + "' = '1' then d.rate else 0 end) ac_rate ";
// 20/03/09 manoharan seperate connection instead of synonym
//sql = sql + " from sorditem_cp b, item c, sorder_cp a, sorddet_cp d where ";
// 27/03/09 manoharan sorddet removed and function used
//sql = sql + " from sorditem b, item c, sorder a, sorddet d where ";
sql = sql + " from sorditem b, item c, sorder a where ";
sql = sql + " a.sale_order = b.sale_order ";
sql = sql + " and b.item_code = c.item_code ";
//sql = sql + " and b.sale_order = d.sale_order ";
//sql = sql + " and b.line_no = d.line_no ";
sql = sql + " from sorditem b, item c ";
sql = sql + " where b.item_code = c.item_code ";
if((dateFlag != null && dateFlag.trim().length() > 0) && dateFlag.equalsIgnoreCase("O") )
{
sql = sql + " and a.order_date >= ?";
sql = sql + " and a.order_date <= ?";
sql = sql + " and b.order_date >= ?";
sql = sql + " and b.order_date <= ?";
}
else if((dateFlag != null && dateFlag.trim().length() > 0) && dateFlag.equalsIgnoreCase("D") )
{
sql = sql + " and fn_get_dsp_date(b.sale_order, b.line_no) >= ?";
sql = sql + " and fn_get_dsp_date(b.sale_order, b.line_no) <= ?";
sql = sql + " and b.dsp_date >= ?";
sql = sql + " and b.dsp_date <= ?";
}
sql = sql + " and b.site_code = ? ";
sql = sql + " and (case when a.order_type is null then ' ' else a.order_type end ) like '" + orderType + "'";
sql = sql + " and (a.status is null or a.status = 'P') ";
sql = sql + " and (case when b.order_type is null then ' ' else b.order_type end ) like '" + orderType + "'";
sql = sql + " and (b.status is null or b.status in( 'P','D')) ";
sql = sql + " and b.nature like ? ";
sql = sql + " and b.line_type <> 'B' ";
sql = sql + " and (b.quantity - qty_desp) > 0 ";
sql = sql + " ) ";
sql = sql + " group by item_code, descr, unit, loc_type , ac_rate ";
sql = sql + " group by descr, item_code, unit, loc_type , ac_rate ";
sql = sql + " order by descr" ;
}
//End change by pankaj
......@@ -307,8 +304,6 @@ public class AssociateAct extends ActionHandlerEJB implements AssociateActLocal,
//pstmt.setTimestamp(1,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(fromDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
//pstmt.setTimestamp(2,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(toDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmtCP.setString(1,siteCode);
pstmtCP.setString(2,mnature);
if((dateFlag != null && dateFlag.trim().length() > 0) && (dateFlag.equalsIgnoreCase("D") || dateFlag.equalsIgnoreCase("O") ) )
{
pstmtCP.setTimestamp(1,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(fromDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
......@@ -321,6 +316,7 @@ public class AssociateAct extends ActionHandlerEJB implements AssociateActLocal,
pstmtCP.setString(1,siteCode);
pstmtCP.setString(2,mnature);
}
////******* 15/04/09 end
// end 20/03/09 manoharan seperate connection instead of synonym
//pstmt.setString(4,siteCode);//Added by Jiten 09/10/06 as sql changed in PB
//pstmt.setString(5,mnature);//Added by Jiten 09/10/06 as sql changed in PB
......@@ -350,8 +346,8 @@ public class AssociateAct extends ActionHandlerEJB implements AssociateActLocal,
" WHERE A.INV_STAT = B.INV_STAT "+
" AND A.ITEM_CODE = ? " +
" AND A.SITE_CODE = ? " +
" AND A.QUANTITY > 0 "+
" AND B.AVAILABLE = 'Y'"+
" AND A.QUANTITY > 0 " +
" AND B.AVAILABLE = 'Y'" +
" AND B.INV_STAT NOT IN (SELECT DISTINCT INV_STAT FROM INV_RESTR)";
//System.out.println(":sql:"+sql);
//rs = stmt.executeQuery(sql);
......
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