Commit e2fcd26a authored by cpatil's avatar cpatil

added condition as per manoharan sir suggestion : quantity - CASE WHEN...

added condition as per manoharan sir suggestion :   quantity -  CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END as availQty


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94317 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7b16497c
......@@ -923,7 +923,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
// added by cpatil on 31/07/13 for criteria type is F
if(issCriteria != null && issCriteria.equalsIgnoreCase("F"))
{
sql =" select qty_per_art , quantity- alloc_qty as availQty from stock where item_code = ? and site_code = ? " +
sql =" select qty_per_art , quantity - CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END as availQty from stock where item_code = ? and site_code = ? " +
" and loc_code = ? and lot_no = ? and lot_sl = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
......
......@@ -752,7 +752,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
Node currDetail = null, currDetail1 = null;
// added by cpatil 31/07/13
double qtyPerArt=0;
double qtyPerArt=0,availQty=0;
//
ConnDriver connDriver = new ConnDriver();
......@@ -840,7 +840,8 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
// added by cpatil on 31/07/13 for criteria type is F MF1JSUN006
else if( issCriteria != null && ("F").equalsIgnoreCase(issCriteria))
{
sql =" select qty_per_art from stock where item_code = ? and site_code = ? " +
sql =" select qty_per_art, quantity - CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END as availQty " + // modify by cpatil
" from stock where item_code = ? and site_code = ? " +
" and loc_code = ? and lot_no = ? and lot_sl = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
......@@ -852,21 +853,35 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
if(rs.next())
{
qtyPerArt = rs.getDouble(1);
availQty = rs.getDouble(2);
}
rs.close();
pstmt.close();
System.out.println("@@@@@1 stkQty["+stkQty+"]:::remainingQty["+remainingQty+"]:::qtyPerArt["+qtyPerArt+"]");
System.out.println("@@@@@1 stkQty["+stkQty+"]:::remainingQty["+remainingQty+"]:::qtyPerArt["+qtyPerArt+"]availQty["+availQty+"]");
if( qtyPerArt > 0 )
{
if((remainingQty % qtyPerArt) > 0 )
{
inputQty = ( (int)(remainingQty/qtyPerArt) + 1 ) * qtyPerArt;
System.out.println("@@@@@@@inputQty2:["+inputQty+"]");
//System.out.println("@@@@@@@inputQty2:["+inputQty+"]");
System.out.println("@@@@@@@inputQty:["+inputQty+"]::availQty["+availQty+"]");
if( inputQty > availQty) // added by cpatil on 03/03/14 as per manoharan sir suggestion
{
inputQty = availQty ;
}
}
}
else
{
if( remainingQty > availQty) // added by cpatil on 03/03/14
{
inputQty = availQty ;
}
else
{
inputQty = remainingQty;
}
System.out.println("@@@@@@@inputQty2:["+inputQty+"]");
}
}
......
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