Commit e0f42ef4 authored by caluka's avatar caluka

purchase order amendment header and detail order no match condition added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101518 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 758f1073
......@@ -46,12 +46,15 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
{
if (xmlString != null && xmlString.trim().length() > 0) {
dom = parseString(xmlString);
System.out.println("xmlString["+xmlString+"]");
}
if (xmlString1 != null && xmlString1.trim().length() > 0) {
dom1 = parseString(xmlString1);
System.out.println("xmlString1["+xmlString1+"]");
}
if (xmlString2 != null && xmlString2.trim().length() > 0) {
dom2 = parseString(xmlString2);
System.out.println("xmlString2["+xmlString2+"]");
}
errString = wfValData(dom, dom1, dom2, objContext, editFlag,
xtraParams);
......@@ -239,6 +242,14 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
errFields.add(childNodeName.toLowerCase());
}
//Start Added by chandrashekar on 06-may-2016
if (!ispurcOrderDom(dom2,purcOrder))
{
errCode = "VTNOTMATCH";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
//End Added by chandrashekar on 06-may-2016
}
}
......@@ -6487,4 +6498,79 @@ public class POrderAmdIC extends ValidatorEJB implements POrderAmdICLocal,POrder
}
return lastPurPo;
}
private boolean ispurcOrderDom(Document dom,String porderNo) throws ITMException
{
NodeList parentList = null;
NodeList childList = null;
Node parentNode = null;
Node childNode = null;
String porderNoDom = "";
boolean isporderExist = false;
String refNoDom= "",refSerDom="";
System.out.println("---inside ispurcOrderDom--");
try
{
parentList = dom.getElementsByTagName("Detail2");
int parentNodeListLength = parentList.getLength();
System.out.println("parentNodeListLength>>>>"+parentNodeListLength);
if(parentNodeListLength == 0)
{
isporderExist = true;
}
for (int prntCtr = parentNodeListLength; prntCtr > 0; prntCtr-- )
{
parentNode = parentList.item(prntCtr-1);
childList = parentNode.getChildNodes();
for (int ctr = 0; ctr < childList.getLength(); ctr++)
{
childNode = childList.item(ctr);
if(childNode != null && childNode.getNodeName().equalsIgnoreCase("attribute"))
{
String updateFlag = "";
updateFlag = childNode.getAttributes().getNamedItem("updateFlag").getNodeValue();
System.out.println("updateFlag>>>>"+updateFlag);
if (updateFlag.equalsIgnoreCase("D"))
{
System.out.println("Break from here as the record is deleted");
isporderExist = true;
//break;
}
}
if ( childNode != null && childNode.getFirstChild() != null &&
childNode.getNodeName().equalsIgnoreCase("purc_order") )
{
porderNoDom = childNode.getFirstChild().getNodeValue().trim();
}
}
if (porderNo.trim().equalsIgnoreCase(porderNoDom.trim()) )
{
isporderExist = true;
break;
}
}//for loop
}catch(Exception e)
{
e.printStackTrace();
}
finally
{
try
{
}
catch(Exception e)
{
e.printStackTrace();
}
}
System.out.println("isporderExist>>>>>> ["+isporderExist+"]");
return isporderExist;
}
}
\ No newline at end of file
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