Commit 5eeb8aa1 authored by cpatil's avatar cpatil

added validation for check issue qty present in quantity and alloc_qty of stock


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101678 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d5d2562a
...@@ -269,6 +269,11 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -269,6 +269,11 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
System.out.println("batch quantity not valid)]]");; System.out.println("batch quantity not valid)]]");;
errString = itmDBAccessEJB.getErrorString("","VTBATQTYNT","","",conn); errString = itmDBAccessEJB.getErrorString("","VTBATQTYNT","","",conn);
} }
else if(errString != null && errString.indexOf("VMQTYNOTAV") > -1)
{
System.out.println("allocation quantity not available in quantity or alloc_qty of stock");;
errString = itmDBAccessEJB.getErrorString("","VMQTYNOTAV","","",conn);
}
else else
{ {
conn.rollback(); conn.rollback();
...@@ -798,6 +803,37 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -798,6 +803,37 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
} }
// added validation for check issue qty present in quantity and alloc_qty of stock
double quantityStock=0.0,allocQtyStock=0.0;
sql = " select quantity, alloc_qty from stock "
+" where item_code = ? and lot_sl= ? "
+ " and lot_no = ? and site_code= ? and loc_code = ? " ;
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,itemCodeInv);
pstmt1.setString(2,lotSlInv);
pstmt1.setString(3,lotNoInv);
pstmt1.setString(4,siteCode);
pstmt1.setString(5,locCode);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
quantityStock = rs1.getDouble("quantity");
allocQtyStock = rs1.getDouble("alloc_qty");
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
System.out.println("@@@@@@@@ quantityStock["+quantityStock+"]allocQtyStock["+allocQtyStock+"]propReqQty["+propReqQty+"]");
if( propReqQty > quantityStock || propReqQty > allocQtyStock )
{
retString = "VMQTYNOTAV";
System.out.println("@@@@@@@@@ allocation quantity not available in quantity or alloc_qty of stock...itemCode["+itemCodeInv+"]");
return retString ;
}
// end
insertDetail ="insert into workorder_issdet (tran_id,line_no,exp_lev,item_code,loc_code,lot_no," + insertDetail ="insert into workorder_issdet (tran_id,line_no,exp_lev,item_code,loc_code,lot_no," +
" lot_sl,quantity,unit,rate,gross_rate,calc_potency, potency_adj," + " lot_sl,quantity,unit,rate,gross_rate,calc_potency, potency_adj," +
...@@ -853,6 +889,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -853,6 +889,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
//added cpatil on 16/05/16 for ... if alloc and dealloc qty is same then update deallocated flag as Y start.......... //added cpatil on 16/05/16 for ... if alloc and dealloc qty is same then update deallocated flag as Y start..........
/* //remove as this validation handle by trigger
double allocQtyDet=0.0,deAllocQtyDet=0.0; double allocQtyDet=0.0,deAllocQtyDet=0.0;
sql = " select alloc_qty,dealloc_qty from inv_alloc_det " sql = " select alloc_qty,dealloc_qty from inv_alloc_det "
+ " where tran_id in (select tran_id from inv_allocate where work_order = ? )" + " where tran_id in (select tran_id from inv_allocate where work_order = ? )"
...@@ -898,6 +935,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -898,6 +935,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
System.out.println("Count2 after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt2+"]"); System.out.println("Count2 after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt2+"]");
pstmt1.close();pstmt1=null; pstmt1.close();pstmt1=null;
} }
*/
//added cpatil on 16/05/16 for ... if alloc and dealloc qty is same then update deallocated flag as Y end.......... //added cpatil on 16/05/16 for ... if alloc and dealloc qty is same then update deallocated flag as Y 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