Commit a173e31f authored by ngadkari's avatar ngadkari

added filter of ref_type in sql

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@199391 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c8ad7876
......@@ -63,6 +63,7 @@ public class InvoiceDrcrAdj
String xmlValues = null;
String mTranId="", mTranSer="", mRefNo="";
String sqlStr1 = "";
String invAutoAdjCrtp=""; //variable declared by nandkumar gadkari on 08/04/19
try
{
......@@ -851,13 +852,40 @@ public class InvoiceDrcrAdj
}
//Amit 21/01/05 'CUST_ADV'
asjCustAdv = distCommon.getDisparams("999999","CUST_ADVADJ_TYPE",conn);
//added by nandkumar gadkari on 08/04/19-----------start----for ref_type filter--------
invAutoAdjCrtp = distCommon.getDisparams("999999","INV_AUTO_ADJ_CRTYPE",conn);
if ("NULLFOUND".equals(invAutoAdjCrtp) || invAutoAdjCrtp == null )
{
invAutoAdjCrtp = " ";
}
arrStr = invAutoAdjCrtp.split(",");
invAutoAdjCrtp="";
for(int i = 0; i<arrStr.length; i++)
{
if( arrStr[i] != null && arrStr[i].trim().length() > 0)
{
invAutoAdjCrtp =invAutoAdjCrtp+"'"+arrStr[i]+"',";
}
}
if( invAutoAdjCrtp != null && invAutoAdjCrtp.trim().length() > 0)
{
invAutoAdjCrtp =invAutoAdjCrtp.substring(0,invAutoAdjCrtp.length()-1);
}
System.out.println("invAutoAdjCrtp="+invAutoAdjCrtp);
//added by nandkumar gadkari on 08/04/19-----------end-----for ref_type filter-------
if ("C".equals(advAdj)) //prince 11/11/05
{
if ("I".equals(asjCustAdv))
{
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables "
+ " where ((tran_ser in (" + tranSeries + ")) and (tot_amt - adj_amt) < 0 and (fin_scheme is null or fin_scheme = ' ')) "
+ " and (site_code = ? and item_ser = ? and cust_code = ?) order by tran_id ";
+ " and (site_code = ? and item_ser = ? and cust_code = ?) ";
// if condition added by nandkumar gadkari on 08/04/19 for ref_type filter-------
if(invAutoAdjCrtp.trim().length()> 0)
{
sqlStr =sqlStr + " and ref_type in ("+invAutoAdjCrtp+")";
}
sqlStr= sqlStr + " order by tran_id ";
pstmt = conn.prepareStatement(sqlStr);
pstmt.setString(1,siteCode);
pstmt.setString(2,itemSer);
......@@ -904,7 +932,13 @@ public class InvoiceDrcrAdj
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables "
+ " where ((tran_ser in (" +tranSeries + ")) and (tot_amt - adj_amt) < 0 and (fin_scheme is null or fin_scheme = ' ')) "
+ " and (site_code = ? and ref_no = ? and cust_code = ?) order by tran_id ";
+ " and (site_code = ? and ref_no = ? and cust_code = ?) " ;
// if condition added by nandkumar gadkari on 08/04/19 for ref_type filter-------
if(invAutoAdjCrtp.trim().length()> 0)
{
sqlStr =sqlStr + " and ref_type in ("+invAutoAdjCrtp+")";
}
sqlStr= sqlStr + " order by tran_id ";
pstmt = conn.prepareStatement(sqlStr);
pstmt.setString(1,siteCode);
pstmt.setString(2,rcpNo);
......@@ -916,7 +950,13 @@ public class InvoiceDrcrAdj
sqlStr = "select tran_id, tran_ser, ref_no, tot_amt, adj_amt from receivables "
+ " where ((tran_ser in (" +tranSeries + ")) and (tot_amt - adj_amt) < 0 and (fin_scheme is null or fin_scheme = ' ')) "
+ " and ((site_code = ? and item_ser = ? and cust_code = ?) "
+ " OR ( site_code = ? and cust_code = ?)) order by tran_id ";
+ " OR ( site_code = ? and cust_code = ?)) ";
// if condition added by nandkumar gadkari on 08/04/19 for ref_type filter-------
if(invAutoAdjCrtp.trim().length()> 0)
{
sqlStr =sqlStr + " and ref_type in ("+invAutoAdjCrtp+")";
}
sqlStr= sqlStr + " order by tran_id ";
pstmt = conn.prepareStatement(sqlStr);
pstmt.setString(1,siteCode);
pstmt.setString(2,itemSer);
......@@ -932,7 +972,13 @@ public class InvoiceDrcrAdj
+ " where ((tran_ser in (" +tranSeries + ")) and (tot_amt - adj_amt) < 0 ) "
+ " and ((site_code = ? and item_ser = ? and cust_code = ?) "
+ " OR ( site_code = ? and cust_code = ?)) "
+ " and ( sale_order = ?) order by tran_id ";
+ " and ( sale_order = ?) ";
// if condition added by nandkumar gadkari on 08/04/19 for ref_type filter-------
if(invAutoAdjCrtp.trim().length()> 0)
{
sqlStr =sqlStr + " and ref_type in ("+invAutoAdjCrtp+")";
}
sqlStr= sqlStr + " order by tran_id ";
pstmt = conn.prepareStatement(sqlStr);
pstmt.setString(1,siteCode);
pstmt.setString(2,itemSer);
......
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