Commit 6f5a12cb authored by cshah's avatar cshah

SY01SUN033-if backflush type is C then detail mfg_date,exp_date and loc_code...

SY01SUN033-if backflush type is C then detail mfg_date,exp_date and loc_code should be set in header table


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91390 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9e445d00
......@@ -6,7 +6,7 @@ import java.sql.*;
import javax.ejb.*;
import org.w3c.dom.*;
import java.sql.Timestamp;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.*;
import ibase.webitm.utility.ITMException;
......@@ -68,8 +68,13 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
ResultSet rs = null;
String siteCodeReq = "", itemCode = "", lineNo = "",locCode = "", lotNo = "", lotSl = "";
String sql = "", line = "", tranType = "", errString = "";
String sumQtyDet = ""; // 24/01/11 - Chandni Shah
String sumQtyDet = "" ; // 24/01/11 - Chandni Shah
double qtyDoc = 0d; // 24/01/11 - Chandni Shah
// 27/01/11 - Chandni Shah
String backflushType = "" , locCodeDet = "" ;
Timestamp mfgDate = null;
Timestamp expDate = null;
//
HashMap strAllocate = null;
double quantity = 0d;
int updateCnt = 0, retVal = 0;
......@@ -93,7 +98,7 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
System.out.println("\n tranId :"+tranId);
// 24/01/11 - Chandni Shah
sql = "SELECT B.SUM_QTY_DET "
sql = "SELECT B.SUM_QTY_DET,A.BACKFLUSH_TYPE "
+ " FROM RECEIPT_BACKFLUSH A,BACKFLUSH_TYPE B "
+" WHERE A.BACKFLUSH_TYPE = B.BACKFLUSH_TYPE "
+" AND TRAN_ID = ? " ;
......@@ -103,6 +108,7 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
if (rs.next())
{
sumQtyDet = rs.getString("sum_qty_det");
backflushType = rs.getString("backflush_type");
}
rs.close();
rs = null;
......@@ -111,7 +117,7 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
if ("Y".equalsIgnoreCase(sumQtyDet))
{
sql = " select sum ( case when qty_doc is null then 0 else qty_doc end) as qty_doc "
sql = " select sum ( case when qty_doc is null then quantity else qty_doc end) as qty_doc "
+" from receipt_backflush_det "
+" where tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
......@@ -139,7 +145,47 @@ public class RcptBackFlushPos extends ValidatorEJB implements RcptBackFlushPosL
pstmt.close();
pstmt = null;
}
// 27/01/11 - Chandni Shah
if ("C".equalsIgnoreCase(backflushType))
{
sql = " select s.mfg_date,s.exp_date,r.loc_code from "
+" receipt_backflush_det r , stock s "
+" where r.item_code = s.item_code "
+" and r.site_code = s.site_code "
+" and r.loc_code = s.loc_code "
+" and r.lot_no = s.lot_no "
+" and r.lot_sl = s.lot_sl "
+" and r.tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
if (rs.next())
{
mfgDate = rs.getTimestamp ("mfg_date") ;
expDate = rs.getTimestamp ("exp_date");
locCodeDet = rs.getString ("loc_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " update receipt_backflush "
+" set mfg_date = ? , "
+" exp_date = ? , "
+" loc_code = ? "
+" where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,mfgDate);
pstmt.setTimestamp(2,expDate);
pstmt.setString(3,locCodeDet);
pstmt.setString(4,tranId);
int upd = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
currDetail = getCurrentDetailFromDom(dom,domID);
updateStatus = getCurrentUpdateFlag(currDetail);
......
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