Commit 952cbc08 authored by manohar's avatar manohar

If pending QC found update the loc_code,lor_sl to null as per PB code DI89SUN004


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93821 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4e3fd3e3
......@@ -112,10 +112,10 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
double stkQuantity = 0,holdQuantity = 0;
//Changed by Rohan on 06-08-13 for define variable
double holdQty = 0;
PreparedStatement pstmtUpd = null, pstmtHold = null, pstmtRel = null;
ResultSet rsHold = null, rsRel = null;
String tranIdHold = "", sqlRel = "", sqlHold = "",nearExpLoc = "";
int lineNoHold = 0;
PreparedStatement pstmtUpd = null, pstmtHold = null, pstmtRel = null,pstmtQC = null;
ResultSet rsHold = null, rsRel = null, rsQC = null;
String tranIdHold = "", sqlRel = "", sqlHold = "",nearExpLoc = "", sqlQC = "";
int lineNoHold = 0, qcCount = 0;
// end 16/10/11 manoharan
String partialGrlLoc = ""; //added by Ashish Sonawane on 05/SEP/12 for partial GRL location Inventory Status.
String invStatLocCodeTo =""; //added by Ashish Sonawane on 05/SEP/12 for partial GRL location Inventory Status.
......@@ -238,6 +238,105 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
holdQuantity = 0;
// end 16/10/11 manoharan hold_qty added
/*Added by Ashish Sonawane on 05-Sep-12 [START]*/
///Added by jasmina DI89SUN004-08/07/08- Shifted from gbf_update_stock
//for updating loc_code & lot_sl as null if qc order is found during stock transfer
// 24/10/13 manoharan merged from PB, eas missing in java code
if (quantity > 0)
{
qcCount = 0;
sqlQC = "select count(1) from qc_order "
+ " where site_code = ? "
+ " and loc_code = ? "
+ " and item_code = ? "
+ " and lot_no = ? "
+ " and lot_sl = ? "
+ " and status <> 'C' ";
pstmtQC = conn.prepareStatement( sqlQC );
pstmtQC.setString( 1, siteCode );
pstmtQC.setString( 2, locCodeFr );
pstmtQC.setString( 3, itemCode );
pstmtQC.setString( 4, lotNo );
pstmtQC.setString( 5, lotSl );
rsQC = pstmtQC.executeQuery();
if( rsQC.next() )
{
qcCount = rsQC.getInt(1);
}
rsQC.close();
rsQC = null;
pstmtQC.close();
pstmtQC = null;
if (qcCount > 0 )
{
//below sql tran_id__xfrx added by jasmina 29/07/08-MF89SUN046
sqlQC = "update qc_order set loc_code = NULL, lot_sl = NULL, tran_id__xfrx = ? " // :as_tran_id
+ " where site_code = ? "
+ " and loc_code = ? "
+ " and item_code = ? "
+ " and lot_no = ? "
+ " and lot_sl = ? "
+ " and status <> 'C' ";
pstmtQC = conn.prepareStatement( sqlQC );
pstmtQC.setString( 1, tranId );
pstmtQC.setString( 2, siteCode );
pstmtQC.setString( 3, locCodeFr );
pstmtQC.setString( 4, itemCode );
pstmtQC.setString( 5, lotNo );
pstmtQC.setString( 6, lotSl );
pstmtQC.executeUpdate();
}
else
{
//If the above count has returned 0 then check for the lot where lot_sl is null
sqlQC = "select count(1) from qc_order "
+ " where site_code = ? "
+ " and loc_code = ? "
+ " and item_code = ? "
+ " and lot_no = ? "
+ " and lot_sl is null "
+ " and status <> 'C' ";
pstmtQC = conn.prepareStatement( sqlQC );
pstmtQC.setString( 1, siteCode );
pstmtQC.setString( 2, locCodeFr );
pstmtQC.setString( 3, itemCode );
pstmtQC.setString( 4, lotNo );
rsQC = pstmtQC.executeQuery();
if( rsQC.next() )
{
qcCount = rsQC.getInt(1);
}
rsQC.close();
rsQC = null;
pstmtQC.close();
pstmtQC = null;
if (qcCount > 0 )
{
//below sql tran_id__xfrx added by jasmina 29/07/08-MF89SUN046
sqlQC = "update qc_order set loc_code = NULL, lot_sl = NULL, tran_id__xfrx = ? " // :as_tran_id
+ " where site_code = ? "
+ " and loc_code = ? "
+ " and item_code = ? "
+ " and lot_no = ? "
+ " and lot_sl is null "
+ " and status <> 'C' ";
pstmtQC = conn.prepareStatement( sqlQC );
pstmtQC.setString( 1, tranId );
pstmtQC.setString( 2, siteCode );
pstmtQC.setString( 3, locCodeFr );
pstmtQC.setString( 4, itemCode );
pstmtQC.setString( 5, lotNo );
pstmtQC.executeUpdate();
}
}
}
///Added end by jasmina DI89SUN004-08/07/08- Shifted from gbf_update_stock
String sqlInvStat = "SELECT INV_STAT FROM LOCATION WHERE LOC_CODE = ?";
pstmtInvStat = conn.prepareStatement( sqlInvStat );
......
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