Commit 78b4d694 authored by ngadkari's avatar ngadkari

changes for setting sundry code in misc pay

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@210629 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7e31377a
......@@ -17,6 +17,7 @@ import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import javax.ejb.Stateless; // added for ejb3
import javax.naming.InitialContext;
......@@ -758,6 +759,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
double payAmt = 0.0, netPayable = 0.0, totUnconfAmt = 0.0;
//Ended by Varsha V on 06-08-18 for declaring variable outside try
ArrayList<String> alreadyExist = null;
int count=0;//added by nandkumar gadkari on 15/10/19
boolean sundryM=false;//added by nandkumar gadkari on 15/10/19
String sundryCodeM="";
try
{
genericUtility = new E12GenericUtility();
......@@ -1079,6 +1083,44 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
totTax = 0.0;
System.out.println("mSundryCode--["+mSundryType+"]parentNodeList1---["+parentNodeList1.getLength()+"]");
// added by nandkumar gadkari on 15/10/19-------------------start----------------------
count=0;
sundryM=true;
HashMap<Integer, String> sundryCodeMap = new HashMap<>();
for(int j = 0; j < parentNodeList1.getLength(); j++)
{
parentNode1 = parentNodeList1.item(j);
count++;
sundryCodeM = genericUtility.getColumnValueFromNode("sundry_code", parentNode1);
sundryCodeMap.put(count,sundryCodeM);
}
System.out.println("sundryCodeMap:"+sundryCodeMap.size());
for (i=1 ; i<=sundryCodeMap.size();i++)
{
for (int s=1 ; s<=sundryCodeMap.size();s++)
{
if(!sundryCodeMap.get(i).equals(sundryCodeMap.get(s)))
{
sundryM=false;
}
if(!sundryM)
{
break;
}
}
if(!sundryM)
{
break;
}
}
System.out.println("sundryM:"+sundryM);
// added by nandkumar gadkari on 15/10/19-------------------end----------------------
for(int j = 0; j < parentNodeList1.getLength(); j++)
{
parentNode1 = parentNodeList1.item(j);
......@@ -1115,11 +1157,24 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
}
else
{
// added by nandkumar gadkari on 15/10/19-------------------start----------------------
if(sundryM)
{
dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_code", mSundryCode);
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
}
else
{
// added by nandkumar gadkari on 15/10/19-------------------end----------------------
dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_code", " ");
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
}
}
//Modified by Anjali R. on [25/02/2019][End]
oPayMode = mPayMode;
......@@ -1866,6 +1921,12 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, oSundryType);
if("C".equalsIgnoreCase(oPayMode) || "Q".equalsIgnoreCase(oPayMode))// condition added by nandkumar gadkari on 24/07/19
{
pstmt.setString(2, oSundryCode);
}
else
{
if(sundryM)// condition added by nandkumar gadkari on 15/10/19-
{
pstmt.setString(2, oSundryCode);
}
......@@ -1873,6 +1934,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{
pstmt.setString(2, " ");
}
}
pstmt.setString(3, oPayMode);
//pstmt.setString(4, mRefNo);
pstmt.setInt(4, refNoInt);
......@@ -2112,6 +2174,9 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
double payAmt = 0.0, netPayable = 0.0, totUnconfAmt = 0.0;
//Ended by Varsha V on 06-08-18 for declaring variable outside try
ArrayList<String> alreadyExist = null;
int count=0;//added by nandkumar gadkari on 15/10/19
boolean sundryM=false;//added by nandkumar gadkari on 15/10/19
String sundryCodeM="";
try
{
genericUtility = new E12GenericUtility();
......@@ -2412,6 +2477,44 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
// added by nandkumar gadkari on 15/10/19-------------------start----------------------
count=0;
sundryM=true;
HashMap<Integer, String> sundryCodeMap = new HashMap<>();
for(int j = 0; j < parentNodeList1.getLength(); j++)
{
parentNode1 = parentNodeList1.item(j);
count++;
sundryCodeM = genericUtility.getColumnValueFromNode("sundry_code", parentNode1);
sundryCodeMap.put(count,sundryCodeM);
}
System.out.println("sundryCodeMap:"+sundryCodeMap.size());
for (i=1 ; i<=sundryCodeMap.size();i++)
{
for (int s=1 ; s<=sundryCodeMap.size();s++)
{
if(!sundryCodeMap.get(i).equals(sundryCodeMap.get(s)))
{
sundryM=false;
}
if(!sundryM)
{
break;
}
}
if(!sundryM)
{
break;
}
}
System.out.println("sundryM:"+sundryM);
// added by nandkumar gadkari on 15/10/19-------------------end----------------------
if("C".equalsIgnoreCase(mPayMode) || "Q".equalsIgnoreCase(mPayMode))// condition added by nandkumar gadkari on 24/07/19
{
dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_code", mSundryCode);
......@@ -2421,11 +2524,26 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
}
else
{
// added by nandkumar gadkari on 15/10/19-------------------start----------------------
if(sundryM)
{
dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_code", sundryCodeM);
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
}
else
{
// added by nandkumar gadkari on 15/10/19-------------------end----------------------
dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_code", " ");
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
}
}
//Modified by Anjali R. on [25/02/2019][End]
mRemarks = "Automatic Payment ";
......@@ -3197,6 +3315,12 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
pstmt.setString(1, oSundryType);
pstmt.setString(2, oSundryCode);
if("C".equalsIgnoreCase(oPayMode) || "Q".equalsIgnoreCase(oPayMode))// condition added by nandkumar gadkari on 24/07/19
{
pstmt.setString(2, oSundryCode);
}
else
{
if(sundryM)// condition added by nandkumar gadkari on 15/10/19-
{
pstmt.setString(2, oSundryCode);
}
......@@ -3204,6 +3328,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{
pstmt.setString(2, " ");
}
}
pstmt.setString(3, oPayMode);
//pstmt.setString(4, mRefNo);
pstmt.setInt(4, refNoInt);
......
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