Commit c957ba51 authored by manohar's avatar manohar

DI89SUN238 in add mode also if allocation found in sordalloc deallocation done


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91223 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2ac66ae2
......@@ -74,7 +74,7 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
HashMap strAllocate = new HashMap();
String sqlSordAlloc = "", sqlSord = "", sqlSordItem = "", line = "";
double qtyAlloc = 0d, qtyStduom = 0d;
int updateCnt = 0, retVal = 0;
int updateCnt = 0, retVal = 0, count =0;
java.sql.Date tranDate = null;
GenericUtility genericUtility = GenericUtility.getInstance();
DistStkUpdLocal distStkUpd = null;
......@@ -121,7 +121,7 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
System.out.println("*************** Update Status *************** ");
if (currDetail != null && !updateStatus.equalsIgnoreCase("A"))
if (currDetail != null ) //&& !updateStatus.equalsIgnoreCase("A")) 22/02/10 manoharan if allocation found then deallocate
{
itemCode = GenericUtility.getInstance().getColumnValueFromNode("item_code",currDetail);
lineNo = GenericUtility.getInstance().getColumnValueFromNode("line_no",currDetail);
......@@ -133,6 +133,36 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
itemCodeOrd = GenericUtility.getInstance().getColumnValueFromNode("item_code__ord",currDetail);
sordNo = GenericUtility.getInstance().getColumnValueFromNode("sord_no",currDetail);
lineNoSord = GenericUtility.getInstance().getColumnValueFromNode("line_no__sord",currDetail);
// 22/02/10 manoharan if allocation found in sordalloc the deallocate
sqlSord = "SELECT COUNT(1) AS COUNT FROM SORDALLOC "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? "
+"AND ITEM_CODE__ORD = ? "
+"AND ITEM_CODE = ? "
+"AND LOT_NO = ? "
+"AND LOT_SL = ? "
+"AND LOC_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,sordNo);
pstmt.setString(2,lineNoSord);
pstmt.setString(3,expLev);
pstmt.setString(4,itemCodeOrd);
pstmt.setString(5,itemCode);
pstmt.setString(6,lotNo);
pstmt.setString(7,lotSl);
pstmt.setString(8,locCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// end 22/02/10 manoharan
if (updateStatus.equalsIgnoreCase("E") || updateStatus.equalsIgnoreCase("D")) //if codn added by jiten 19/05/06
{
//Commented And Changes Below - Gulzar 10/05/07
......@@ -152,6 +182,8 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
lotSl = rs.getString("LOT_SL"); //Gulzar 10/05/07
qtyStduomStr = rs.getString("QUANTITY__STDUOM");
}
rs.close();
rs = null;
//End Changes - Gulzar 10/05/07
}
......@@ -176,6 +208,9 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
{
qtyAlloc = 0;
}
// 22/02/10 manoharan if allocation found in sordalloc then deallocate
if (count > 0 )
{
if (qtyAlloc - qtyStduom <= 0)
{
sqlSord = "DELETE FROM SORDALLOC WHERE SALE_ORDER = ? "
......@@ -197,6 +232,8 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
pstmt.setString(7,lotSl);
pstmt.setString(8,locCode);
updateCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Deleted the no of records are : updateCnt :"+updateCnt);
}
else
......@@ -222,6 +259,8 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
pstmt.setString(8,lotSl);
pstmt.setString(9,locCode);
updateCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated the no of records are : updateCnt :"+updateCnt);
}
sqlSordItem = "UPDATE SORDITEM SET QTY_ALLOC = QTY_ALLOC - ? "
......@@ -235,6 +274,8 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
pstmt.setString(3,lineNoSord);
pstmt.setString(4,expLev);
updateCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated the no of records : updateCnt :"+updateCnt);
line = " " + lineNo;
......@@ -259,7 +300,10 @@ public class DespatchPrs extends ValidatorEJB implements DespatchPrsLocal, Despa
{
System.out.println("distStkUpd.UpdAllocTrace(hashMap) : Sucessuful!");
}
} // end 22/02/10 manoharan
}
rs1.close();
rs1 = null;
}
}//try end
catch (SQLException sqx)
......
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