Commit 5cd1e91a authored by cpatil's avatar cpatil

for stock option 0


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93581 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1899d658
...@@ -183,7 +183,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt ...@@ -183,7 +183,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
{ {
if (!Character.isDigit(c)) if (!Character.isDigit(c))
{ {
retStr =itmDBAccessEJB.getErrorString("","VMOPERINV","","",conn); retStr =itmDBAccessEJB.getErrorString("","VM OPERINV","","",conn);
return retStr; return retStr;
} }
} }
...@@ -910,7 +910,76 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt ...@@ -910,7 +910,76 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
} }
if ( stockBalQty > 0 ) // test start 06/09/13
String stkOpt="";
sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
System.out.println("sql :"+sql);
pstmt.setString(1,itemCode);
rs = pstmt.executeQuery(sql);
if (rs.next())
{
stkOpt = rs.getString(1);
}
System.out.println("@@@@@@@@stkOpt["+stkOpt+"]");
if( "0".equalsIgnoreCase(stkOpt))
{
System.out.println("@@@@@@@@ inside stkOpt["+stkOpt+"]");
// insert into workorder_issdet
lnNo++;
batchLoadCnt++;
sql ="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," +
" match_potency,min_potency_perc,adj_potency,work_order)" +
" values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
pstmt.setInt(2,lnNo);
pstmt.setString(3,expLev);
pstmt.setString(4,itemCode);
pstmt.setString(5,locCode);
pstmt.setString(6," ");
pstmt.setString(7," ");
pstmt.setDouble(8,reqQty);
pstmt.setString(9,unit);
pstmt.setDouble(10,rate);
pstmt.setDouble(11,grossRate);
pstmt.setString(12,calcPotency);
pstmt.setDouble(13,extraQty);
pstmt.setString(14,matchPotency);
pstmt.setDouble(15,minPotencyPerc);
pstmt.setString(16,adjPotency);
pstmt.setString(17,workOrder);
pstmt.addBatch();
pstmt.clearParameters();
// for stock allocation
System.out.println("@@@@@ inside stkopt lineNo :["+lineNo+"] itemCode :["+itemCode+"] loc_code :["+locCode+"]:: reqQty :["+reqQty+"]");
//allocQty = -1 * reqQty;
//line = " " + lineNo;
hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis()));
hashMap.put("ref_ser",tranSer1);
hashMap.put("ref_id", tranId);
hashMap.put("ref_line", lnNo);
hashMap.put("item_code", itemCode);
hashMap.put("site_code", siteCode);
hashMap.put("loc_code",locCode);
hashMap.put("lot_no"," ");
hashMap.put("lot_sl"," ");
hashMap.put("alloc_qty", new Double(reqQty));
hashMap.put("chg_win","W_WO_ISS_REPLACEMENT");
hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));
if (updAllocTrace(hashMap, conn) > 0)
{
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
hashMap.clear();
}
}
// end on 06/09/13
else if ( stockBalQty > 0 )
{ {
// insert into workorder_issdet // insert into workorder_issdet
lnNo++; lnNo++;
...@@ -942,7 +1011,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt ...@@ -942,7 +1011,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
// for stock allocation // for stock allocation
System.out.println("lineNo :"+lineNo+" itemCode :"+itemCode+" stock_loc_code :"+stock_loc_code+" stock_lot_no :"+stock_lot_no+" stock_lot_sl :"+stock_lot_sl+" reqQty :"+reqQty); System.out.println("@@@@@ normal lineNo :"+lineNo+" itemCode :"+itemCode+" stock_loc_code :"+stock_loc_code+" stock_lot_no :"+stock_lot_no+" stock_lot_sl :"+stock_lot_sl+" reqQty :"+reqQty);
//allocQty = -1 * reqQty; //allocQty = -1 * reqQty;
//line = " " + lineNo; //line = " " + lineNo;
...@@ -965,6 +1034,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt ...@@ -965,6 +1034,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
if (updAllocTrace(hashMap, conn) > 0) if (updAllocTrace(hashMap, conn) > 0)
{ {
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!"); System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
hashMap.clear();
} }
...@@ -986,9 +1056,6 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt ...@@ -986,9 +1056,6 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
pstmt = null; pstmt = null;
} }
} }
} }
else else
......
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