Commit aad79120 authored by mchaudhari's avatar mchaudhari

Facility Code Validation added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95854 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2fb091fd
......@@ -5118,6 +5118,7 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
ITMDBAccessEJB dbEjb = null;
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
String errorType = "";
String locCode = "", faciLocCode = "", faciSiteCode = "";
try
{
......@@ -6991,6 +6992,47 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
// Added by mahesh on 09-07-2014
else{
sql = " Select facility_code from location Where loc_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mVal);
rs = pstmt.executeQuery();
if (rs.next()) {
faciLocCode = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " Select facility_code from site Where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next()) {
faciSiteCode = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
faciLocCode = faciLocCode == null ? "" : faciLocCode.trim();
faciSiteCode = faciSiteCode == null ? "" : faciSiteCode.trim();
if(faciLocCode.length() > 0 && faciSiteCode.length() > 0){
if(!faciLocCode.equalsIgnoreCase(faciSiteCode)){
errCode = "VMFACI2"; // 'Diffrent Loc Code from location and site
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
// End of code added by mahesh
}
else
{
......
......@@ -86,6 +86,7 @@ QCTransferICRemote {
String tranDateStr = "", qorderNo = "", refNo = "", tranId = "", itemCode = "", locCode = "", lotNo = "", lotSl = "", siteCode = "";
String status = "", porcpNo = "", porcpLineNo = "", qcLocCode = "", minQtyStr = "", available = "", keyFlag = "";
Timestamp date2 = null, tranDate = null;
String faciLocCode = "", faciSiteCode = "";
double aprvLeadTime = 0;
Timestamp qcOrderDate = null,WORecTranDate=null; // added by cpatil on 02/11/13
......@@ -730,7 +731,50 @@ QCTransferICRemote {
}
//}
}
// Added by mahesh on 09-07-2014
if (childNodeName.equalsIgnoreCase("loc_code")) {
qcLocCode = genericUtility.getColumnValue("loc_code",dom);
qcLocCode = qcLocCode == null ? "" : qcLocCode.trim();
sql = " Select facility_code from location Where loc_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, qcLocCode);
rs = pstmt.executeQuery();
if (rs.next()) {
faciLocCode = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " Select facility_code from site Where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next()) {
faciSiteCode = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
faciLocCode = faciLocCode == null ? "" : faciLocCode.trim();
faciSiteCode = faciSiteCode == null ? "" : faciSiteCode.trim();
if(faciLocCode.length() > 0 && faciSiteCode.length() > 0){
if(!faciLocCode.equalsIgnoreCase(faciSiteCode)){
errCode = "VMFACI2"; // 'Diffrent Loc Code from location and site
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
// End of code added by mahesh
} // end for
break; // case 1 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