Commit 8d81c9d6 authored by cpatil's avatar cpatil

added condition quantity - CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty...

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


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94319 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 310d4aec
...@@ -1027,7 +1027,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -1027,7 +1027,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n"); StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
String sql2=""; String sql2="";
// added by cpatil 31/07/13 // added by cpatil 31/07/13
double qtyPerArt=0; double qtyPerArt=0,availQty=0;
// //
if (dom == null) if (dom == null)
{ {
...@@ -1501,8 +1501,9 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -1501,8 +1501,9 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
// added by cpatil on 31/07/13 for criteria type is F MF1JSUN006 // added by cpatil on 31/07/13 for criteria type is F MF1JSUN006
else if(criteria != null && ("F").equalsIgnoreCase(criteria)) else if(criteria != null && ("F").equalsIgnoreCase(criteria))
{ {
sql2 =" select qty_per_art from stock where item_code = ? and site_code = ? " + sql2 =" select qty_per_art, quantity - CASE WHEN alloc_qty IS NULL THEN 0 ELSE alloc_qty END as availQty " +
" and loc_code = ? and lot_no = ? and lot_sl = ? "; " from stock where item_code = ? and site_code = ? " +
" and loc_code = ? and lot_no = ? and lot_sl = ? ";
pstmt2 = conn.prepareStatement(sql2); pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,itemCode); pstmt2.setString(1,itemCode);
pstmt2.setString(2,siteCode); pstmt2.setString(2,siteCode);
...@@ -1513,6 +1514,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -1513,6 +1514,7 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
if(rs2.next()) if(rs2.next())
{ {
qtyPerArt = rs2.getDouble(1); qtyPerArt = rs2.getDouble(1);
availQty = rs.getDouble(2);
} }
rs2.close(); rs2.close();
pstmt2.close(); pstmt2.close();
...@@ -1523,11 +1525,24 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL ...@@ -1523,11 +1525,24 @@ public class WOrderIssueAct extends ActionHandlerEJB implements WOrderIssueActL
{ {
inputQty = ( (int)(remainingQty/qtyPerArt) + 1 ) * qtyPerArt; inputQty = ( (int)(remainingQty/qtyPerArt) + 1 ) * qtyPerArt;
System.out.println("@@@@@@@inputQty:["+inputQty+"]"); System.out.println("@@@@@@@inputQty:["+inputQty+"]");
if( inputQty > availQty) // added by cpatil on 03/03/14 as per manoharan sir suggestion
{
inputQty = availQty ;
}
} }
} }
else else
{ {
inputQty = remainingQty; if( remainingQty > availQty) // added by cpatil on 03/03/14
{
inputQty = availQty ;
}
else
{
inputQty = remainingQty;
}
System.out.println("@@@@@@@inputQty:["+inputQty+"]"); System.out.println("@@@@@@@inputQty:["+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