Commit 04d14d8d authored by msaggam's avatar msaggam

Sales return - line_no__invtrace should not be allowed in more then one line

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@202166 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f772cc2a
......@@ -7713,11 +7713,14 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
String itemValue = "",lineNo = "",lineValue= "",updateFlag = "";
String itemValue = "",lineNo = "",lineValue= "",updateFlag = "", invTrace = " ";
int lineNoInt = 0,lineValueInt = 0;
//NodeList itemNodeList = null,lineNoList = null,detail2List = null,childDetilList = null;
//Node itemNode = null,lineNoNode = null,detailNode = null,chidDetailNode = null;
NodeList itemNodeList = null,lineNoList = null,detail2List = null,childDetilList = null; //Variables added by Mahesh Saggam on 17-June-2019
Node itemNode = null,lineNoNode = null,detailNode = null,chidDetailNode = null; //Variables added by Mahesh Saggam on 17-June-2019
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
......@@ -7799,6 +7802,64 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
}
}
}
// Added by Mahesh Saggam on 17-June-2019 [Start]
detail2List = dom2.getElementsByTagName("Detail2");
invTrace = genericUtility.getColumnValue("line_no__invtrace",dom);
lineNo = genericUtility.getColumnValue("line_no",dom);
//System.out.println("Detail 2 List "+detail2List);
if(lineNo != null && lineNo.trim().length() > 0)
{
lineNoInt = Integer.parseInt(lineNo.trim());
}
for(int t =0; t < detail2List.getLength(); t++ )
{
detailNode = detail2List.item(t);
childDetilList = detailNode.getChildNodes();
for(int p =0; p < childDetilList.getLength(); p++ )
{
chidDetailNode = childDetilList.item(p);
//System.out.println("current child node>>>>>>>>>> " + chidDetailNode.getNodeName() );
if(chidDetailNode.getNodeName().equalsIgnoreCase("line_no") )
{
//System.out.println("line node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
lineValue = chidDetailNode.getFirstChild().getNodeValue();
if(lineValue != null && lineValue.trim().length() > 0)
{
lineValueInt = Integer.parseInt(lineValue.trim());
}
}
}
if(chidDetailNode.getNodeName().equalsIgnoreCase("attribute") )
{
//System.out.println("operation node found >>>>>" + chidDetailNode.getNodeName());
updateFlag = chidDetailNode.getAttributes().getNamedItem("updateFlag").getNodeValue();
//System.out.println("Update flag is......."+updateFlag);
}
if(chidDetailNode.getNodeName().equalsIgnoreCase("line_no__invtrace") )
{
//System.out.println("invoiceTrace node found >>>>>" + chidDetailNode.getNodeName());
if(chidDetailNode.getFirstChild() != null )
{
lineValue = chidDetailNode.getFirstChild().getNodeValue();
if(mlineNoStr !=null && !updateFlag.equalsIgnoreCase("D") && lineNoInt != lineValueInt && lineValue.trim().equalsIgnoreCase(invTrace.trim()))
{
//System.out.println("Duplicate item");
errCode = "VTLININVTR";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
}
}
// Added by Mahesh Saggam on 17-June-2019 [End]
}
if( childNodeName.equalsIgnoreCase( "item_code" ) )
{
......
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