Commit 228361d5 authored by cpatil's avatar cpatil

added date validation in conf and remove from IC


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94002 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0067907b
......@@ -160,6 +160,11 @@ QCTransferConfLocal, QCTransferConfRemote
String status="",ediOption="",dataStr = "";
double qty=0,qcQty=0,stkGrossWt=0,stkTareWt=0,stkNetWt=0,qtyPerArt=0,grossWtPerArt=0,tareWtPerArt=0,stockQty=0;
HashMap stockUpd = new HashMap();
String available="";
double aprvLeadTime = 0;
Timestamp qcOrderDate = null,newQCOrderDate=null; // added by cpatil on 02/11/13
try
{
StockUpdate stockUpdate = new StockUpdate();
......@@ -224,6 +229,76 @@ QCTransferConfLocal, QCTransferConfRemote
return errCode;
}
///added by cpatil on 12/12/13 for date validation with approval lead time start
System.out.println("@@@@ tranDate new validation start--------- ");
if (toLoc != null)
{
sql = " Select Available from location a, invstat b "
+ " Where a.loc_code = ? and a.inv_stat = b.inv_stat ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, toLoc);
rs = pstmt.executeQuery();
if (rs.next())
{
available = rs.getString("available");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if("Y".equalsIgnoreCase(available))
{
sql = " Select aprv_lead_time from siteitem where site_code = ? and item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setString(2, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
aprvLeadTime = rs.getDouble("aprv_lead_time");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " select qorder_date from qc_order where qorder_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, qorderNo);
rs = pstmt.executeQuery();
if (rs.next())
{
qcOrderDate = rs.getTimestamp("qorder_date");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@ site code[" + siteCode+ "]::item code[" + itemCode+ "]::aprvLeadTime[" + aprvLeadTime
+ "]::qcOrderDate[" + qcOrderDate + "]:::tranDate["+tranDate+"]");
Calendar cal = Calendar.getInstance();
cal.setTime(qcOrderDate);
cal.add(Calendar.DAY_OF_WEEK,(int) Math.round(aprvLeadTime));
newQCOrderDate = new Timestamp(cal.getTime().getTime());
System.out.println("@@@@ tranDate ["+ tranDate + "]:::: newQCOrderDate ["+ newQCOrderDate + "]:::::");
if( tranDate.before(newQCOrderDate))
{
errCode = "VTAPPRLEAD";
return errCode;
}
}
}
System.out.println("@@@@ tranDate new validation end---------errCode["+ errCode + "]");
///added by cpatil on 12/12/13 for date validation with approval lead time end
if( errCode == null || errCode.trim().length() == 0 )
{
sql = " Select quantity from qc_order where qorder_no = ? ";
......
......@@ -156,13 +156,15 @@ QCTransferICRemote {
System.out.println("@@@@ tranDate [" + tranDateStr
+ "]:::qorderNo[" + qorderNo + "]");
if (qorderNo != null && qorderNo.length() > 0) {
if (qorderNo != null && qorderNo.length() > 0)
{
sql = " Select qorder_date from qc_order"
+ " where qorder_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, qorderNo);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
date2 = rs.getTimestamp("qorder_date");
}
rs.close();
......@@ -170,7 +172,8 @@ QCTransferICRemote {
pstmt.close();
pstmt = null;
if (tranDateStr != null && tranDateStr.length() > 0) {
if (tranDateStr != null && tranDateStr.length() > 0)
{
tranDate = Timestamp.valueOf(genericUtility
.getValidDateString(tranDateStr,
genericUtility
......@@ -183,7 +186,8 @@ QCTransferICRemote {
System.out.println("@@@@ tranDate [" + tranDate
+ "]:::qorder_date[" + date2 + "]");
if (tranDate.before(date2)) {
if (tranDate.before(date2))
{
errCode = "QCTRFDATE";
// ls_errcode = 'QCTRFDATE~t' + 'QC Transfer
// Date cannot be less then QC Order Date'
......@@ -192,7 +196,7 @@ QCTransferICRemote {
}
// / added by cpatil on 01/11/13 start
/*
System.out
.println("@@@@ tranDate new validation start--------- ");
......@@ -246,6 +250,7 @@ QCTransferICRemote {
}
System.out.println("@@@@ tranDate new validation end---------errCode["+ errCode + "]");
}
*/
// / added by cpatil on 01/11/13 end
}
}
......
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