Commit 44652b12 authored by kdabholkar's avatar kdabholkar

Added trim while checking following condition for 'PR' type transaction.

-  i.tran_type NOT IN ('PR','EPC')    and
-  i.tran_type  IN ('PR')


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@195893 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b8c986ac
...@@ -5005,7 +5005,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5005,7 +5005,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and trim(i.tran_type) != 'PR' " //+" and trim(i.tran_type) != 'PR' "
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+"AND (SELECT COUNT(1) FROM taxtran ti,tax tm WHERE tm.tax_code = ti.tax_code " +"AND (SELECT COUNT(1) FROM taxtran ti,tax tm WHERE tm.tax_code = ti.tax_code "
...@@ -5374,7 +5374,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5374,7 +5374,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" and trim(i.tran_type) != 'PR' " // +" and trim(i.tran_type) != 'PR' "
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+"AND (SELECT COUNT(1) FROM taxtran ti,tax tm WHERE tm.tax_code = ti.tax_code " +"AND (SELECT COUNT(1) FROM taxtran ti,tax tm WHERE tm.tax_code = ti.tax_code "
...@@ -5571,7 +5571,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5571,7 +5571,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and st_c.GST_CODE <> '00' "; +" and st_c.GST_CODE <> '00' ";
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
//+ " and trim(i.tran_type) != 'PR'" //+ " and trim(i.tran_type) != 'PR'"
...@@ -7952,7 +7952,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7952,7 +7952,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.GST_CODE <> '00'"; +" and state.GST_CODE <> '00'";
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' and ti.tran_id = i.tran_id "
...@@ -8115,7 +8115,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8115,7 +8115,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.GST_CODE <> '00' "; +" and state.GST_CODE <> '00' ";
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' and ti.tran_id = i.tran_id "
...@@ -8277,7 +8277,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8277,7 +8277,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.GST_CODE <> '00' "; +" and state.GST_CODE <> '00' ";
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' and ti.tran_id = i.tran_id "
...@@ -8440,7 +8440,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8440,7 +8440,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.GST_CODE <> '00' "; +" and state.GST_CODE <> '00' ";
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' and ti.tran_id = i.tran_id "
...@@ -10183,7 +10183,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10183,7 +10183,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and trim(i.tran_type) != 'PR' " //+" and trim(i.tran_type) != 'PR' "
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
...@@ -10551,7 +10551,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10551,7 +10551,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and trim(i.tran_type) != 'PR' " //+" and trim(i.tran_type) != 'PR' "
if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 ) if(GST_CUST_PAY_CDN.length() > 0 && GST_EXP_PAY_BYCUST.length() > 0 )
{ {
hdrSql = hdrSql +" and i.tran_type NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") "; hdrSql = hdrSql +" and trim(i.tran_type) NOT IN ("+GST_CUST_PAY_CDN+","+GST_EXP_PAY_BYCUST+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -25030,7 +25030,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -25030,7 +25030,7 @@ dtlSql = " select '' as TRAN_ID, "
+" AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "; +" AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' ";
if(GST_CUST_PAY_CDN.length() > 0) if(GST_CUST_PAY_CDN.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type in ("+GST_CUST_PAY_CDN+") "; hdrSql = hdrSql +" and trim(i.tran_type) in ("+GST_CUST_PAY_CDN+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
...@@ -25195,7 +25195,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -25195,7 +25195,7 @@ dtlSql = " select '' as TRAN_ID, "
+" AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "; +" AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' ";
if(GST_CUST_PAY_CDN.length() > 0) if(GST_CUST_PAY_CDN.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type in ("+GST_CUST_PAY_CDN+") "; hdrSql = hdrSql +" and trim(i.tran_type) in ("+GST_CUST_PAY_CDN+") ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 "
...@@ -25463,8 +25463,13 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -25463,8 +25463,13 @@ dtlSql = " select '' as TRAN_ID, "
+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.STATE_CODE " +" and state.state_code = c.STATE_CODE "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
+" and trim(i.tran_type) = 'PR' " if(GST_CUST_PAY_CDN.length() > 0)
{
hdrSql = hdrSql +" and trim(i.tran_type) in ("+GST_CUST_PAY_CDN+") ";
}
hdrSql = hdrSql
//+" and trim(i.tran_type) = 'PR' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'S-RET' and ti.tran_id = i.tran_id " +" and ti.tran_code = 'S-RET' and ti.tran_id = i.tran_id "
//+" and tm.TAX_GROUP IN ('ITC','NITC') " //+" and tm.TAX_GROUP IN ('ITC','NITC') "
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