Commit 902a26b8 authored by cpatil's avatar cpatil

add while instead of if and break condition


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96747 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 29df9181
......@@ -470,7 +470,9 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
sql = " select operation,exp_lev,item_code,quantity,unit,alloc_qty," +
" site_code,line_type,match_potency,min_potency_perc,adj_potency," +
" potency_adj,iss_qty from workorder_bill " +
" where work_order = ? and operation = ? and alloc_qty >= (case when iss_qty is null then 0 else iss_qty end) and item_code not in (select item_code from workorder where work_order = '"+ worder +"') " ;
" where work_order = ? and operation = ? " +
" and alloc_qty >= (case when iss_qty is null then 0 else iss_qty end) " +
" and item_code not in (select item_code from workorder where work_order = '"+ worder +"') " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,worder);
pstmt.setInt(2,operation);
......@@ -496,20 +498,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
System.out.println("@@@@@@ workorder_bill-qty -- item wise -->["+issueQtyBill+"]");
sql = " SELECT LOC_CODE,LOT_NO,LOT_SL FROM INV_ALLOC_DET WHERE TRAN_ID IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER = ? ) AND ITEM_CODE = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,worder);
pstmt1.setString(2,itemCode);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
locCode =rs1.getString(1);
lotNoInv =rs1.getString(2);
lotSlInv =rs1.getString(3);
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
sql =" select nvl(sum(nvl(quantity,0) + nvl(potency_adj,0)),0) "
+" from workorder_iss a, workorder_issdet b "
......@@ -546,9 +535,23 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
list.add(issuedQty);
list.add(issueQtyBill);
flag = true;
break; // added break condition on 05/11/14 by cpatil
}
if(flag == false)
{
sql = " SELECT LOC_CODE,LOT_NO,LOT_SL FROM INV_ALLOC_DET WHERE TRAN_ID IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER = ? ) AND ITEM_CODE = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,worder);
pstmt1.setString(2,itemCode);
rs1 = pstmt1.executeQuery();
while(rs1.next())
{
locCode =rs1.getString(1);
lotNoInv =rs1.getString(2);
lotSlInv =rs1.getString(3);
String propReqQtyStr = df.format(propReqQty);
propReqQty = Double.parseDouble(propReqQtyStr);
......@@ -620,6 +623,9 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
int cnt=pstmt1.executeUpdate();
System.out.println("Count after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt+"]");
pstmt1.close();pstmt1=null;
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
}
}
System.out.println("detail record :: inserted "+updDet);
......
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