Commit 5f77a5bd authored by cpatil's avatar cpatil

inserting detail No Of Art, Acct code, cctr code, stock opt nit set in detail.

If issue creteria is 'W' in item master then Tare Wt set from stock tare_wt_per_art and gross weight set as issue quantity+tare weigh and net weight same as issue quantity


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94369 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 58e98ffc
......@@ -190,9 +190,9 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
HashMap hashMap = new HashMap();
double availQty=0;
double availQty=0,tareWtPerArt=0,tareWeight=0,grossWeight=0,netWeight=0,grossWtPerArt=0;
String lotNoFg = "",lotSlFg="", loginEmpCode=""; //added by cpatil on 11/03/14 as per bharat suggestion
String lotNoFg = "",lotSlFg="", loginEmpCode="",acctCodeInv="",cctrCodeInv=""; //added by cpatil on 11/03/14 as per bharat suggestion
try
{
......@@ -446,8 +446,9 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
// 06/01/14 manoharan
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 ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
" match_potency,min_potency_perc,adj_potency,work_order" +
" ,NO_ART,ACCT_CODE__WP,CCTR_CODE__WP, STK_OPT , TARE_WEIGHT , GROSS_WEIGHT , NET_WEIGHT )" +
" values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ,?,?,?,?,?,?,?)";
pstmtDetail = conn.prepareStatement(sql);
// end 06/01/14 manoharan
......@@ -524,7 +525,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
pstmt.setString(4,workOrder);
pstmt.setInt(5,operation);
pstmt.setString(6,siteCode);
pstmt.setString(7,"for Replacement");
pstmt.setString(7,"For Replacement");
pstmt.setTimestamp(8,currDate1);
pstmt.setString(9,chgUser);
pstmt.setString(10,chgTerm);
......@@ -842,6 +843,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
*/
stockSql ="select a.lot_no, a.loc_code, a.lot_sl, a.rate, a.gross_rate,a.supp_code__mfg, "
+" ( a.quantity-a.alloc_qty ) as stockBalQty "
+" , a.no_art, a.acct_code__inv, a.cctr_code__inv, a.tare_wt_per_art,a.gross_wt_per_art "
+" from stock a, invstat b, item c "
+" Where a.inv_stat = b.inv_stat and a.item_code = c.item_code "
+" and a.item_code = '" + itemCode + "' "
......@@ -943,6 +945,13 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
grossRate = rs.getDouble(5);
suppCodeMfg = rs.getString(6);
stockBalQty = rs.getDouble(7);
noArt = rs.getInt(8);
acctCodeInv = rs.getString(9);
cctrCodeInv = rs.getString(10);
tareWtPerArt = rs.getDouble(11);
grossWtPerArt= rs.getDouble(12);
}
else
{
......@@ -957,6 +966,12 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
System.out.println("stock_lot_no ..."+stock_lot_no);
System.out.println("stockBalQty ..."+stockBalQty);
System.out.println("noArt ..."+noArt);
System.out.println("acctCodeInv ..."+acctCodeInv);
System.out.println("cctrCodeInv ..."+cctrCodeInv);
System.out.println("tareWtPerArt ..."+tareWtPerArt);
System.out.println("grossWtPerArt ..."+grossWtPerArt);
sql ="select item_ser, (case when potency_perc is null then 0 else potency_perc end) "
+" from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -967,7 +982,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
itemSer = rs.getString(1);
itemstdpotency= rs.getDouble(2);
}
if("Y".equalsIgnoreCase(matchPotency))
if("Y".equalsIgnoreCase(matchPotency)) // commented on 13/03/14
{
sql ="select (case when potency_perc is null then 0 else potency_perc end) "
+" from stock where item_code = ? "
......@@ -994,10 +1009,11 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
pstmt = null;
extraQty = (quantity / StockPotencyPerc * itemstdpotency ) - quantity;
issQty = quantity;
}
System.out.println("@@@@@@ test extraQty["+extraQty+"]quantity["+quantity+"]issQty["+issQty+"]");
// added by cpatil on 31/07/13 for criteria type is F
if(issCriteria != null && issCriteria.equalsIgnoreCase("F"))
if( issCriteria != null && issCriteria.equalsIgnoreCase("F"))
{
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 = ? ";
......@@ -1033,7 +1049,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
}
//end
System.out.println("@@@@@@ final reqQty---------:["+reqQty+"]-----------");
}
//}
// test start 06/09/13
String stkOpt="";
sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
......@@ -1083,6 +1099,29 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
pstmtDetail.setDouble(15,minPotencyPerc);
pstmtDetail.setString(16,adjPotency);
pstmtDetail.setString(17,workOrder);
pstmtDetail.setDouble(18,noArt);
pstmtDetail.setString(19,acctCodeInv);
pstmtDetail.setString(20,cctrCodeInv);
pstmtDetail.setString(21,stkOpt);
if( issCriteria != null && issCriteria.equalsIgnoreCase("W") )
{
pstmtDetail.setDouble(22,tareWtPerArt);
pstmtDetail.setDouble(23, ( reqQty+tareWtPerArt ) );
pstmtDetail.setDouble(24,reqQty);
}
else
{
tareWeight = tareWtPerArt * noArt;
netWeight = (grossWtPerArt - tareWtPerArt) * Math.ceil(noArt);
grossWeight = netWeight + tareWeight;
pstmtDetail.setDouble(22,tareWeight);
pstmtDetail.setDouble(23,grossWeight );
pstmtDetail.setDouble(24,netWeight);
}
pstmtDetail.addBatch();
pstmtDetail.clearParameters();
......@@ -1143,6 +1182,29 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
pstmtDetail.setDouble(15,minPotencyPerc);
pstmtDetail.setString(16,adjPotency);
pstmtDetail.setString(17,workOrder);
pstmtDetail.setDouble(18,noArt);
pstmtDetail.setString(19,acctCodeInv);
pstmtDetail.setString(20,cctrCodeInv);
pstmtDetail.setString(21,stkOpt);
if( issCriteria != null && issCriteria.equalsIgnoreCase("W") )
{
pstmtDetail.setDouble(22,tareWtPerArt);
pstmtDetail.setDouble(23,( reqQty+tareWtPerArt ) );
pstmtDetail.setDouble(24,reqQty);
}
else
{
tareWeight = tareWtPerArt*noArt;
netWeight = (grossWtPerArt - tareWtPerArt) * Math.ceil(noArt);
grossWeight = netWeight + tareWeight;
pstmtDetail.setDouble(22,tareWeight);
pstmtDetail.setDouble(23,grossWeight );
pstmtDetail.setDouble(24,netWeight);
}
pstmtDetail.addBatch();
pstmtDetail.clearParameters();
......@@ -1168,7 +1230,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
//Calling DistStkUpdEJB
System.out.println("Calling DistStkUpdEJB.....");
if (updAllocTrace(hashMap, conn) > 0)
if ( updAllocTrace(hashMap, conn) > 0)
{
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
hashMap.clear();
......
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