Commit 754b841a authored by manohar's avatar manohar

in actionallocate order by changed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92407 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 54cfab1f
...@@ -1764,9 +1764,28 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -1764,9 +1764,28 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
{ {
sql = sql + " AND c.loc_group = '" + locGroup + "' "; sql = sql + " AND c.loc_group = '" + locGroup + "' ";
} }
// 22/12/12 manoharan
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME))
{
sql = sql + " nvl(a.exp_date,a.crea_date),a.crea_date,a.lot_no ";
//System.out.println("after sql db converted --["+sql+"]->.");
}
else
{
sql = sql + " nvl(a.exp_date,a.crea_date),a.crea_date,a.lot_no, "
+ " decode(length(decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) ," +
" 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) ), "
+ " 1, '00' || decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , " +
"'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) )) ,rtrim(a.lot_sl)), "
+" decode(length(decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) ), "
+ " 2, '0' || decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) )) ,rtrim(a.lot_sl)), "
+" decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) ," +
" 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) )) ";
}
// added by cpatil start on 9/11/12 // added by cpatil start on 9/11/12
sql = sql + " order by (A.QUANTITY - A.ALLOC_QTY) "; //sql = sql + " order by (A.QUANTITY - A.ALLOC_QTY) ";
//" order by sum( (case when quantity is null then 0 else quantity end) " + //" order by sum( (case when quantity is null then 0 else quantity end) " +
//" - (case when alloc_qty is null then 0 else alloc_qty end) " + //" - (case when alloc_qty is null then 0 else alloc_qty end) " +
// " - (case when hold_qty is null then 0 else hold_qty end) )"; // " - (case when hold_qty is null then 0 else hold_qty end) )";
...@@ -1976,8 +1995,26 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -1976,8 +1995,26 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
{ {
sql = sql + " AND c.loc_group = '" + locGroup + "' "; sql = sql + " AND c.loc_group = '" + locGroup + "' ";
} }
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME))
{
sql = sql + " nvl(a.exp_date,a.crea_date),a.crea_date,a.lot_no ";
//System.out.println("after sql db converted --["+sql+"]->.");
}
else
{
sql = sql + " nvl(a.exp_date,a.crea_date),a.crea_date,a.lot_no, "
+ " decode(length(decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) ," +
" 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) ), "
+ " 1, '00' || decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , " +
"'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) )) ,rtrim(a.lot_sl)), "
+" decode(length(decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) ), "
+ " 2, '0' || decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) , 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) )) ,rtrim(a.lot_sl)), "
+" decode( substr(rtrim(a.lot_sl), length(rtrim(a.lot_sl))) ," +
" 'S',(substr(rtrim(a.lot_sl),1,length(rtrim(a.lot_sl)) - 1)) ,rtrim(a.lot_sl)) )) ";
}
// added by cpatil start on 9/11/12 // added by cpatil start on 9/11/12
sql = sql + " order by (CASE WHEN SUM(A.QUANTITY-A.ALLOC_QTY) IS NULL THEN 0 ELSE SUM(A.QUANTITY-A.ALLOC_QTY) END) "; //sql = sql + " order by (CASE WHEN SUM(A.QUANTITY-A.ALLOC_QTY) IS NULL THEN 0 ELSE SUM(A.QUANTITY-A.ALLOC_QTY) END) ";
//" order by sum( (case when quantity is null then 0 else quantity end) " + //" order by sum( (case when quantity is null then 0 else quantity end) " +
//" - (case when alloc_qty is null then 0 else alloc_qty end) " + //" - (case when alloc_qty is null then 0 else alloc_qty end) " +
//" - (case when hold_qty is null then 0 else hold_qty end) )"; //" - (case when hold_qty is null then 0 else hold_qty end) )";
......
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