Commit da5d17e5 authored by arawankar's avatar arawankar

MiscVoucherIC.java

-Changes made validate bill_no duplicate for case 3
-On edit of detail 3,sundry code for and sundry type for showing blank.(Wrong condition added to check null)

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@196902 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9fe4078a
......@@ -2101,15 +2101,37 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
{
//Added by sarita on 28FEB2018
cnt = 0;
billNo = checkNull(genericUtility.getColumnValue("bill_no", dom2));
//Modified by Anjali R. on [08/02/2019][Checking for same bill number in multiple lines][Start]
//billNo = checkNull(genericUtility.getColumnValue("bill_no", dom2));
billNo = checkNull(genericUtility.getColumnValue("bill_no", dom));
//Modified by Anjali R. on [08/02/2019][Checking for same bill number in multiple lines][End]
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom2));
if(billNo!= null && (billNo.trim().length() > 0 ))
{
billDate = checkNull(genericUtility.getColumnValue("bill_date", dom2));
//Modified by Anjali R. on [08/02/2019][Checking for same bill number in multiple lines][Start]
/*billDate = checkNull(genericUtility.getColumnValue("bill_date", dom2));
sundryTypeFor = checkNull(genericUtility.getColumnValue("sundry_type__for", dom2));
sundryCodeFor = checkNull(genericUtility.getColumnValue("sundry_code__for", dom2));
tranId = checkNull(genericUtility.getColumnValue("tran_id", dom2));
lineNo = checkNull(genericUtility.getColumnValue("line_no", dom2));
lineNo = checkNull(genericUtility.getColumnValue("line_no", dom2));*/
billDate = checkNull(genericUtility.getColumnValue("bill_date", dom));
sundryTypeFor = checkNull(genericUtility.getColumnValue("sundry_type__for", dom));
sundryCodeFor = checkNull(genericUtility.getColumnValue("sundry_code__for", dom));
tranId = checkNull(genericUtility.getColumnValue("tran_id", dom2));
lineNo = checkNull(genericUtility.getColumnValue("line_no", dom));
boolean isDuplicateBillNoDetailExist = false;
//isDuplicateBillNoDetailExist = getDuplicateBillNo(dom, dom2);//Modified by Anjali R. on [08/02/2019][This part was not migrated as per pb code,For checking bill no combination in multiple details.]
if(isDuplicateBillNoDetailExist)
{
errCode = "VTBILL1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
//Modified by Anjali R. on [08/02/2019][Checking for same bill number in multiple lines][End]
if(tranId == null)
{
//Modified by Anjali R. on [08/02/2019][Record not found if tran_id set as empty][Start]
......@@ -4678,11 +4700,17 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
{
sundryTypeFor = genericUtility.getColumnValue("sundry_type__for", dom);
sundryCodeFor = genericUtility.getColumnValue("sundry_code__for", dom);
if(sundryTypeFor == null || sundryTypeFor.trim().length() > 0)
//Modified by Anjali R. on [08/02/2019][Start]
//if(sundryTypeFor == null || sundryTypeFor.trim().length() > 0)
if(sundryTypeFor == null || sundryTypeFor.trim().length() == 0)
//Modified by Anjali R. on [08/02/2019][End]
{
sundryTypeFor = "";
}
if(sundryCodeFor == null || sundryCodeFor.trim().length() > 0)
//Modified by Anjali R. on [08/02/2019][Start]
//if(sundryCodeFor == null || sundryCodeFor.trim().length() > 0)
if(sundryCodeFor == null || sundryCodeFor.trim().length() == 0)
//Modified by Anjali R. on [08/02/2019][End]
{
sundryCodeFor = "";
}
......@@ -5937,5 +5965,71 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
setNodeValue(dom, nodeName, Double.toString(nodeVal));
}
//Modified by Anjali R. on [08/02/2019][Added method to Check for same bill number in multiple lines][Start]
private boolean getDuplicateBillNo(Document currentDom , Document allDom) throws ITMException
{
NodeList parentNodeList = null;
Node parentNode = null;
boolean isDuplicateBillNo = false;
int ctr = 0;
String billNo = "";
String billDate = "";
String sundryTypeFor = "";
String sundryCodeFor = "";
String lineNo = "";
String billNoOthr = "";
String billDateOthr = "";
String sundryTypeForOthr = "";
String sundryCodeForOthr = "";
String lineNoOthr = "";
try
{
billNo = checkNull(genericUtility.getColumnValue("bill_no", currentDom));
billDate = checkNull(genericUtility.getColumnValue("bill_date", currentDom));
sundryTypeFor = checkNull(genericUtility.getColumnValue("sundry_type__for", currentDom));
sundryCodeFor = checkNull(genericUtility.getColumnValue("sundry_code__for", currentDom));
lineNo = checkNull(genericUtility.getColumnValue("line_no", currentDom));
parentNodeList = allDom.getElementsByTagName("Detail3");
System.out.println("parentNodeList---["+parentNodeList+"]");
for(ctr = 0; ctr < parentNodeList.getLength(); ctr ++)
{
parentNode = parentNodeList.item(ctr);
billNoOthr = checkNull(genericUtility.getColumnValueFromNode("bill_no", parentNode));
billDateOthr = checkNull(genericUtility.getColumnValueFromNode("bill_date", parentNode));
sundryTypeForOthr = checkNull(genericUtility.getColumnValueFromNode("sundry_type__for", parentNode));
sundryCodeForOthr = checkNull(genericUtility.getColumnValueFromNode("sundry_code__for", parentNode));
lineNoOthr = checkNull(genericUtility.getColumnValueFromNode("line_no", parentNode));
System.out.println("billNoOthr--["+billNoOthr+"]\n billDateOthr--["+billDateOthr+"]\n sundryTypeForOthr--["+sundryTypeForOthr+"]\n sundryCodeForOthr--["+sundryCodeForOthr+"] \n"
+ "lineNoOthr--["+lineNoOthr+"]");
if(billNo.equalsIgnoreCase(billNoOthr) && sundryTypeFor.equalsIgnoreCase(sundryTypeForOthr) && sundryCodeFor.equalsIgnoreCase(sundryCodeForOthr)
&& billDate.equalsIgnoreCase(billDateOthr) && !lineNo.equalsIgnoreCase(lineNoOthr))
{
isDuplicateBillNo = true;
}
System.out.println("isDuplicateBillNo--["+isDuplicateBillNo+"]");
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
return isDuplicateBillNo;
}
//Modified by Anjali R. on [08/02/2019][Added method to Check for same bill number in multiple lines][End]
}
\ 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