Commit f3bc0cba authored by kdabholkar's avatar kdabholkar

commit changes regarding Nill rated transaction , B2B transaction.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@184232 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 85965079
...@@ -561,7 +561,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -561,7 +561,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.inv_type <> 'EC' " +" and i.inv_type <> 'EC' "
//+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; //+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id ";
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV'" +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV'"
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
//hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") "; //hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
...@@ -1053,7 +1054,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1053,7 +1054,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
//+" and (select count(1) from taxtran ti where ti.tran_code = 'P-RET' and ti.tran_id = i.tran_id "; //+" and (select count(1) from taxtran ti where ti.tran_code = 'P-RET' and ti.tran_id = i.tran_id ";
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'VOUCH' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'VOUCH' "
+" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
//hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") "; //hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
...@@ -1264,7 +1266,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1264,7 +1266,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_ser = 'P-RET' " +" and i.tran_ser = 'P-RET' "
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'P-RET' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'P-RET' "
+" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
//hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") "; //hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
...@@ -1539,9 +1542,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1539,9 +1542,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+ " i.tran_date as PRD_CODE," + " i.tran_date as PRD_CODE,"
// +" '1' as REC_TYPE,"// -- GSTR1,GSTR2,etc. Changed on 25 April 2018 as per discuss with devendra sir for client pitambari // +" '1' as REC_TYPE,"// -- GSTR1,GSTR2,etc. Changed on 25 April 2018 as per discuss with devendra sir for client pitambari
+" '2' as REC_TYPE," +" '2' as REC_TYPE,"
+" 'R' as GST_TYPE," +" 'U' as GST_TYPE,"
// +" '02' as TRAN_TYPE,"// -- b2b,b2c Changed on 25 April 2018 as per discuss with devendra sir for client pitambari // +" '02' as TRAN_TYPE,"// -- b2b,b2c Changed on 25 April 2018 as per discuss with devendra sir for client pitambari
+" '05' as TRAN_TYPE," +" '06' as TRAN_TYPE,"
//+" i.sundry_code as CUST_CODE," //+" i.sundry_code as CUST_CODE,"
+"C.SUPP_CODE as CUST_CODE," +"C.SUPP_CODE as CUST_CODE,"
+" Case When c.tax_reg_2='UNREGISTER' then i.remarks ELSE c.supp_name END AS CUST_NAME, " +" Case When c.tax_reg_2='UNREGISTER' then i.remarks ELSE c.supp_name END AS CUST_NAME, "
...@@ -1579,7 +1582,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1579,7 +1582,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" AND state.state_code = c.STATE_CODE " +" AND state.state_code = c.STATE_CODE "
+" AND c.tax_reg_2 = 'UNREGISTER' " +" AND c.tax_reg_2 = 'UNREGISTER' "
+" 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 = 'M-VOUC' and ti.tran_id = i.tran_id "; +" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
// hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") "; // hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
...@@ -1737,7 +1740,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1737,7 +1740,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and i.inv_type='EC' " +" and i.inv_type='EC' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV'" +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV'"
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class not in ("+taxClassAllStr+") or ti.tax_chap not in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class not in ("+taxClassAllStr+") or ti.tax_chap not in ("+TAX_CHAP_STR+") ) ";
...@@ -1921,7 +1925,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1921,7 +1925,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; //+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id ";
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
//+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; inter state changed on 22 aug //+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; inter state changed on 22 aug
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('I','J') "; +" and ti.tran_id = i.invoice_id and tm.tax_type in ('I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
// hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") "; // hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
...@@ -2358,7 +2363,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2358,7 +2363,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.net_amt >= "+GST_B2CL_INV_VAL+" " //-- amount is more than 2.5 lakh " +" and i.net_amt >= "+GST_B2CL_INV_VAL+" " //-- amount is more than 2.5 lakh "
+ "AND s.state_code = d.STATE_CODE__DLV " + "AND s.state_code = d.STATE_CODE__DLV "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class not in ("+taxClassAllStr+") OR ti.tax_chap not in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class not in ("+taxClassAllStr+") OR ti.tax_chap not in ("+TAX_CHAP_STR+") ) ";
...@@ -3008,7 +3014,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3008,7 +3014,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc <> 0 ";
if(GST_SEZWP_TAXCLASS.length() > 0) if(GST_SEZWP_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_SEZWP_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_SEZWP_TAXCLASS+") ";
...@@ -3236,7 +3243,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3236,7 +3243,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc <> 0 ";
if(GST_SEZWOP_TAXCLASS.length() > 0) if(GST_SEZWOP_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_SEZWOP_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_SEZWOP_TAXCLASS+") ";
...@@ -3460,7 +3468,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3460,7 +3468,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc <> 0 ";
if(GST_DE_TAXCLASS.length() > 0) if(GST_DE_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_DE_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_DE_TAXCLASS+") ";
...@@ -3684,7 +3693,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3684,7 +3693,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" and i.conf_date between ? and ? " commented by kaustubh on 27 july // +" and i.conf_date between ? and ? " commented by kaustubh on 27 july
/* below added on 22 aug */ /* below added on 22 aug */
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
// hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") "; // hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
...@@ -3883,7 +3893,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3883,7 +3893,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class not in ("+taxClassAllStr+") or ti.tax_chap not in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class not in ("+taxClassAllStr+") or ti.tax_chap not in ("+TAX_CHAP_STR+") )";
...@@ -4064,7 +4075,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4064,7 +4075,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and i.conf_date between ? and ? " commented by kaustubh 27 july 2017 //+" and i.conf_date between ? and ? " commented by kaustubh 27 july 2017
/*below added on 22 aug */ /*below added on 22 aug */
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
// hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") "; // hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
...@@ -4261,7 +4273,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4261,7 +4273,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" AND S.state_code <> d.STATE_CODE__DLV " +" AND S.state_code <> d.STATE_CODE__DLV "
+" 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' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class not in ("+taxClassAllStr+") or ti.tax_chap not in ("+TAX_CHAP_STR+")) "; hdrSql = hdrSql +" and (ti.tax_class not in ("+taxClassAllStr+") or ti.tax_chap not in ("+TAX_CHAP_STR+")) ";
...@@ -4438,16 +4451,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4438,16 +4451,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " // site.state_CODE<>customer' state.state_code +" and s.state_code <> c.state_code " // site.state_CODE<>customer' state.state_code
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_NIL_TAXENV.length() > 0) /*if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " commented by kaustubh 27 july 2017 // +" and i.conf_date between ? and ? " commented by kaustubh 27 july 2017
...@@ -4654,16 +4668,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4654,16 +4668,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_EXE_TAXCLASS.length() > 0) if(GST_EXE_TAXCLASS.length() > 0)
{ {
// hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") "; // hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_EXE_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_EXE_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_EXE_TAXENV.length() > 0) /* if(GST_EXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " commented by kaustubh 27 july 2017 // +" and i.conf_date between ? and ? " commented by kaustubh 27 july 2017
...@@ -4876,15 +4891,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4876,15 +4891,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+")) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+")) ";
} }
if(GST_NIL_TAXENV.length() > 0) /* if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and (select count(1) from taxtran ti, tax t where t.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax t where t.tax_code = ti.tax_code "
+" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id and t.tax_type not in ('G','H','I','J')) > 0 " +" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id and t.tax_type not in ('G','H','I','J')) > 0 "
...@@ -5095,7 +5111,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5095,7 +5111,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and ((st.state_code = state.state_code) AND (s.fin_entity = d.fin_entity)) " +" and ((st.state_code = state.state_code) AND (s.fin_entity = d.fin_entity)) "
//+" and (select count(1) from taxtran ti where ti.tran_code = 'D-ISS' and ti.tran_id = i.tran_id "; //+" and (select count(1) from taxtran ti where ti.tran_code = 'D-ISS' and ti.tran_id = i.tran_id ";
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'D-ISS' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'D-ISS' "
+" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "; +" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc = 0 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
...@@ -5301,15 +5318,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5301,15 +5318,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_NIL_TAXENV.length() > 0) /* if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " commented by kaustubh on 27 july // +" and i.conf_date between ? and ? " commented by kaustubh on 27 july
...@@ -5517,16 +5535,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5517,16 +5535,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_EXE_TAXCLASS.length() > 0) if(GST_EXE_TAXCLASS.length() > 0)
{ {
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_EXE_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_EXE_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_EXE_TAXENV.length() > 0) /*if(GST_EXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " commetned by kaustubh on 27 july // +" and i.conf_date between ? and ? " commetned by kaustubh on 27 july
...@@ -5733,17 +5752,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5733,17 +5752,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
{ {
// hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ('GST-NIL')) "; // hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ('GST-NIL')) ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_NIL_TAXENV.length() > 0) /*if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and (select count(1) from taxtran ti, tax t where t.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax t where t.tax_code = ti.tax_code "
+" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id and t.tax_type not in ('G','H','I','J')) > 0 " +" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id and t.tax_type not in ('G','H','I','J')) > 0 "
...@@ -5953,15 +5973,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5953,15 +5973,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and c.tax_reg_2 = 'UNREGISTER' " +" and c.tax_reg_2 = 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_NIL_TAXENV.length() > 0) /* if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
//+" and i.conf_date between ? and ? " commented by kaustubh on 27 july //+" and i.conf_date between ? and ? " commented by kaustubh on 27 july
...@@ -6168,16 +6189,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6168,16 +6189,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and c.tax_reg_2 = 'UNREGISTER' " +" and c.tax_reg_2 = 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_EXE_TAXCLASS.length() > 0) if(GST_EXE_TAXCLASS.length() > 0)
{ {
// hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") "; // hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_EXE_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_EXE_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_EXE_TAXENV.length() > 0) /* if(GST_EXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " commented by kaustubh on 27 july // +" and i.conf_date between ? and ? " commented by kaustubh on 27 july
...@@ -6392,15 +6414,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6392,15 +6414,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and c.tax_reg_2 = 'UNREGISTER' " +" and c.tax_reg_2 = 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_NIL_TAXENV.length() > 0) /*if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and (select count(1) from taxtran ti, tax t where t.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax t where t.tax_code = ti.tax_code "
+" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id and t.tax_type not in ('G','H','I','J') ) > 0 " +" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id and t.tax_type not in ('G','H','I','J') ) > 0 "
...@@ -6612,15 +6635,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6612,15 +6635,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and c.tax_reg_2 = 'UNREGISTER' " +" and c.tax_reg_2 = 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_NIL_TAXENV.length() > 0) /* if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " copmmented by kaustubh on 27 july // +" and i.conf_date between ? and ? " copmmented by kaustubh on 27 july
...@@ -6827,16 +6851,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6827,16 +6851,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and c.tax_reg_2 = 'UNREGISTER' " +" and c.tax_reg_2 = 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_EXE_TAXCLASS.length() > 0) if(GST_EXE_TAXCLASS.length() > 0)
{ {
// hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") "; // hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_EXE_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_EXE_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_EXE_TAXENV.length() > 0) /* if(GST_EXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " commented by kaustubh on 27 july // +" and i.conf_date between ? and ? " commented by kaustubh on 27 july
...@@ -7050,16 +7075,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7050,16 +7075,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and c.tax_reg_2 = 'UNREGISTER' " +" and c.tax_reg_2 = 'UNREGISTER' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
{ {
//hdrSql = hdrSql +" and ( ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ('GST-NIL') )"; //hdrSql = hdrSql +" and ( ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ('GST-NIL') )";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )"; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_NIL_TAXCLASS+") OR ti.tax_chap in ("+TAX_CHAP_STR+") )";
} }
if(GST_NIL_TAXENV.length() > 0) /* if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and (select count(1) from taxtran ti, tax t where t.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax t where t.tax_code = ti.tax_code "
+" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id and t.tax_type not in ('G','H','I','J') ) > 0 " +" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id and t.tax_type not in ('G','H','I','J') ) > 0 "
...@@ -13553,10 +13579,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -13553,10 +13579,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_NIL_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_NIL_TAXCLASS+") ";
} }
if(GST_NIL_TAXENV.length() > 0) /* if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and i.tran_type = 'INV' " +" and i.tran_type = 'INV' "
+" and i.drcr_flag ='D' " +" and i.drcr_flag ='D' "
...@@ -13712,10 +13738,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -13712,10 +13738,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_NIL_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_NIL_TAXCLASS+") ";
} }
if(GST_NIL_TAXENV.length() > 0) /* if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " copmmented by kaustubh on 27 july // +" and i.conf_date between ? and ? " copmmented by kaustubh on 27 july
...@@ -13865,10 +13891,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -13865,10 +13891,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_EXE_TAXCLASS+") ";
} }
if(GST_EXE_TAXENV.length() > 0) /* if(GST_EXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_EXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
// +" and i.conf_date between ? and ? " commented by kaustubh on 27 july // +" and i.conf_date between ? and ? " commented by kaustubh on 27 july
...@@ -14017,10 +14043,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -14017,10 +14043,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_NIL_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_NIL_TAXCLASS+") ";
} }
if(GST_NIL_TAXENV.length() > 0) /* if(GST_NIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_NIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and i.tran_type = 'INV' " +" and i.tran_type = 'INV' "
+" and i.drcr_flag ='D' " +" and i.drcr_flag ='D' "
...@@ -17848,7 +17874,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17848,7 +17874,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" i.bill_date as DOC_DATE," +" i.bill_date as DOC_DATE,"
//+"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE," //+"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE,"
+" i.net_amt as AMOUNT, " +" i.net_amt as AMOUNT, "
+" 'N' as REVERSE_CHRG, " +" 'Y' as REVERSE_CHRG, "
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" i.lr_date as LR_DATE," // +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
...@@ -26501,7 +26527,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -26501,7 +26527,7 @@ dtlSql = " select '' as TRAN_ID, "
+" i.INVOICE_NO as DOC_NO," +" i.INVOICE_NO as DOC_NO,"
+" i.invoice_date as DOC_DATE," +" i.invoice_date as DOC_DATE,"
+" i.amount as AMOUNT, " +" i.amount as AMOUNT, "
+" 'N' as REVERSE_CHRG, " +" 'Y' as REVERSE_CHRG, "
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" i.lr_date as LR_DATE," // +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
...@@ -26679,8 +26705,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -26679,8 +26705,8 @@ dtlSql = " select '' as TRAN_ID, "
+" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE , " +" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE , "
+ "i.tran_date as PRD_CODE," + "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE, " +" '2' as REC_TYPE, "
+" 'I' as GST_TYPE," +" 'U' as GST_TYPE,"
+" '05' as TRAN_TYPE," +" '06' as TRAN_TYPE,"
+" i.supp_code as CUST_CODE, " +" i.supp_code as CUST_CODE, "
+" c.supp_name as CUST_NAME, " +" c.supp_name as CUST_NAME, "
+" state.GST_CODE, " +" state.GST_CODE, "
...@@ -26691,7 +26717,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -26691,7 +26717,7 @@ dtlSql = " select '' as TRAN_ID, "
+" i.INVOICE_NO as DOC_NO," +" i.INVOICE_NO as DOC_NO,"
+" i.invoice_date as DOC_DATE," +" i.invoice_date as DOC_DATE,"
+" i.amount as AMOUNT, " +" i.amount as AMOUNT, "
+" 'N' as REVERSE_CHRG, " +" 'Y' as REVERSE_CHRG, "
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" i.lr_date as LR_DATE," // +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
...@@ -26883,7 +26909,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -26883,7 +26909,7 @@ dtlSql = " select '' as TRAN_ID, "
+" i.bill_date as DOC_DATE," +" i.bill_date as DOC_DATE,"
//+"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE," //+"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE,"
+" i.net_amt as AMOUNT, " +" i.net_amt as AMOUNT, "
+" 'N' as REVERSE_CHRG, " +" 'Y' as REVERSE_CHRG, "
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" i.lr_date as LR_DATE," // +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
...@@ -27095,8 +27121,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -27095,8 +27121,8 @@ dtlSql = " select '' as TRAN_ID, "
+" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE ," +" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE ,"
+ " i.tran_date as PRD_CODE," + " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE, " +" '2' as REC_TYPE, "
+" 'I' as GST_TYPE," +" 'U' as GST_TYPE,"
+" '05' as TRAN_TYPE," +" '06' as TRAN_TYPE,"
+" i.sundry_code as CUST_CODE, " +" i.sundry_code as CUST_CODE, "
+" c.supp_name as CUST_NAME, " +" c.supp_name as CUST_NAME, "
+" state.GST_CODE, " +" state.GST_CODE, "
...@@ -27110,7 +27136,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -27110,7 +27136,7 @@ dtlSql = " select '' as TRAN_ID, "
+" i.bill_date as DOC_DATE," +" i.bill_date as DOC_DATE,"
//+"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE," //+"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE,"
+" i.net_amt as AMOUNT, " +" i.net_amt as AMOUNT, "
+" 'N' as REVERSE_CHRG, " +" 'Y' as REVERSE_CHRG, "
+" ' ' as LR_NO, " +" ' ' as LR_NO, "
// +" i.lr_date as LR_DATE," // +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, " +" ' ' as REAS_CODE, "
...@@ -27524,8 +27550,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -27524,8 +27550,8 @@ dtlSql = " select '' as TRAN_ID, "
} }
hdrSql=hdrSql*/ hdrSql=hdrSql*/
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'U' as GST_TYPE," +" 'R' as GST_TYPE,"
+" '06' as TRAN_TYPE,"// -- b2b,b2c +" '05' as TRAN_TYPE,"// -- b2b,b2c
+" i.supp_code as CUST_CODE," +" i.supp_code as CUST_CODE,"
+" c.supp_name as CUST_NAME," +" c.supp_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -27915,8 +27941,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -27915,8 +27941,8 @@ dtlSql = " select '' as TRAN_ID, "
+" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE ," +" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE ,"
+ " i.tran_date as PRD_CODE," + " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'U' as GST_TYPE," +" 'I' as GST_TYPE,"
+" '06' as TRAN_TYPE,"// -- b2b,b2c +" '05' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.supp_name as CUST_NAME," +" c.supp_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -29418,7 +29444,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29418,7 +29444,7 @@ dtlSql = " select '' as TRAN_ID, "
+ "i.tran_date as PRD_CODE," + "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'C' as GST_TYPE," +" 'C' as GST_TYPE,"
+" '10' as TRAN_TYPE,"// -- b2b,b2c +" '12' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.supp_name as CUST_NAME," +" c.supp_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -29573,7 +29599,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29573,7 +29599,7 @@ dtlSql = " select '' as TRAN_ID, "
+ "i.tran_date as PRD_CODE," + "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'C' as GST_TYPE," +" 'C' as GST_TYPE,"
+" '10' as TRAN_TYPE,"// -- b2b,b2c +" '13' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.supp_name as CUST_NAME," +" c.supp_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -29728,7 +29754,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29728,7 +29754,7 @@ dtlSql = " select '' as TRAN_ID, "
+ "i.tran_date as PRD_CODE," + "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'C' as GST_TYPE," +" 'C' as GST_TYPE,"
+" '01' as TRAN_TYPE,"// -- b2b,b2c +" '12' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.tran_name as CUST_NAME," +" c.tran_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -29755,7 +29781,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29755,7 +29781,7 @@ dtlSql = " select '' as TRAN_ID, "
+" c.tax_reg_2 as TAX_REG_NO," +" c.tax_reg_2 as TAX_REG_NO,"
+" ' ' as RECO_STATUS," +" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO," +" ' ' as ECOM_REG_NO,"
+" 'CRNPAY' as ref_ser" +" 'M-VOUC' as ref_ser"
+" from misc_voucher i,TRANSPORTER c, site s, state state " +" from misc_voucher i,TRANSPORTER c, site s, state state "
+" where c.tran_code = i.sundry_code " +" where c.tran_code = i.sundry_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
...@@ -29884,7 +29910,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29884,7 +29910,7 @@ dtlSql = " select '' as TRAN_ID, "
+ "i.tran_date as PRD_CODE," + "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'C' as GST_TYPE," +" 'C' as GST_TYPE,"
+" '01' as TRAN_TYPE,"// -- b2b,b2c +" '13' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.tran_name as CUST_NAME," +" c.tran_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -29911,7 +29937,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29911,7 +29937,7 @@ dtlSql = " select '' as TRAN_ID, "
+" c.tax_reg_2 as TAX_REG_NO," +" c.tax_reg_2 as TAX_REG_NO,"
+" ' ' as RECO_STATUS," +" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO," +" ' ' as ECOM_REG_NO,"
+" 'CRNPAY' as ref_ser" +" 'M-VOUC' as ref_ser"
+" from misc_voucher i,TRANSPORTER c, site s, state state " +" from misc_voucher i,TRANSPORTER c, site s, state state "
+" where c.tran_code = i.sundry_code " +" where c.tran_code = i.sundry_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
...@@ -30199,7 +30225,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -30199,7 +30225,7 @@ dtlSql = " select '' as TRAN_ID, "
+ "i.tran_date as PRD_CODE," + "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'D' as GST_TYPE," +" 'D' as GST_TYPE,"
+" '10' as TRAN_TYPE,"// -- b2b,b2c +" '11' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.supp_name as CUST_NAME," +" c.supp_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -30355,7 +30381,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -30355,7 +30381,7 @@ dtlSql = " select '' as TRAN_ID, "
+ "i.tran_date as PRD_CODE," + "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'D' as GST_TYPE," +" 'D' as GST_TYPE,"
+" '01' as TRAN_TYPE,"// -- b2b,b2c +" '10' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.tran_name as CUST_NAME," +" c.tran_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -30382,7 +30408,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -30382,7 +30408,7 @@ dtlSql = " select '' as TRAN_ID, "
+" c.tax_reg_2 as TAX_REG_NO," +" c.tax_reg_2 as TAX_REG_NO,"
+" ' ' as RECO_STATUS," +" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO," +" ' ' as ECOM_REG_NO,"
+" 'CRNPAY' as ref_ser" +" 'M-VOUC' as ref_ser"
+" from misc_voucher i,TRANSPORTER c, site s, state state " +" from misc_voucher i,TRANSPORTER c, site s, state state "
+" where c.tran_code = i.sundry_code " +" where c.tran_code = i.sundry_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
...@@ -30512,7 +30538,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -30512,7 +30538,7 @@ dtlSql = " select '' as TRAN_ID, "
+ "i.tran_date as PRD_CODE," + "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'D' as GST_TYPE," +" 'D' as GST_TYPE,"
+" '01' as TRAN_TYPE,"// -- b2b,b2c +" '11' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.tran_name as CUST_NAME," +" c.tran_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -30539,7 +30565,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -30539,7 +30565,7 @@ dtlSql = " select '' as TRAN_ID, "
+" c.tax_reg_2 as TAX_REG_NO," +" c.tax_reg_2 as TAX_REG_NO,"
+" ' ' as RECO_STATUS," +" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO," +" ' ' as ECOM_REG_NO,"
+" 'CRNPAY' as ref_ser" +" 'M-VOUC' as ref_ser"
+" from misc_voucher i,TRANSPORTER c, site s, state state " +" from misc_voucher i,TRANSPORTER c, site s, state state "
+" where c.tran_code = i.sundry_code " +" where c.tran_code = i.sundry_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
...@@ -32249,10 +32275,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32249,10 +32275,10 @@ dtlSql = " select '' as TRAN_ID, "
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_COMP_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_COMP_TAXCLASS+") ";
} }
if(GST_COMP_TAXCLASS.length() > 0) /*if(GST_COMP_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_COMP_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_COMP_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" 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' "
...@@ -32440,10 +32466,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32440,10 +32466,10 @@ dtlSql = " select '' as TRAN_ID, "
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_COMP_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_COMP_TAXCLASS+") ";
} }
if(GST_COMP_TAXCLASS.length() > 0) /*if(GST_COMP_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_COMP_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_COMP_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" 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' "
...@@ -32633,11 +32659,12 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32633,11 +32659,12 @@ dtlSql = " select '' as TRAN_ID, "
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_PUREXE_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_PUREXE_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PUREXE_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PUREXE_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_PUREXE_TAXENV.length() > 0) /*if(GST_PUREXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PUREXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PUREXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql
+" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -32825,10 +32852,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32825,10 +32852,10 @@ dtlSql = " select '' as TRAN_ID, "
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_PUREXE_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_PUREXE_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PUREXE_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PUREXE_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_PUREXE_TAXENV.length() > 0) /*if(GST_PUREXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PUREXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PUREXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -33006,10 +33033,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33006,10 +33033,10 @@ dtlSql = " select '' as TRAN_ID, "
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNIL_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNIL_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PURNIL_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PURNIL_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_PURNIL_TAXENV.length() > 0) /*if(GST_PURNIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -33187,10 +33214,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33187,10 +33214,10 @@ dtlSql = " select '' as TRAN_ID, "
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNIL_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNIL_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PURNIL_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PURNIL_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_PURNIL_TAXENV.length() > 0) /* if(GST_PURNIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -33370,10 +33397,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33370,10 +33397,10 @@ dtlSql = " select '' as TRAN_ID, "
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNON_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNON_TAXCLASS+") ";
} }
if(GST_PURNON_TAXENV.length() > 0) /*if(GST_PURNON_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNON_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNON_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -33550,10 +33577,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33550,10 +33577,10 @@ dtlSql = " select '' as TRAN_ID, "
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNON_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNON_TAXCLASS+") ";
} }
if(GST_PURNON_TAXENV.length() > 0) /*if(GST_PURNON_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNON_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNON_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -33729,10 +33756,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33729,10 +33756,10 @@ dtlSql = " select '' as TRAN_ID, "
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_COMP_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_COMP_TAXCLASS+") ";
} }
if(GST_COMP_TAXCLASS.length() > 0) /* if(GST_COMP_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_COMP_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_COMP_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -33912,10 +33939,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33912,10 +33939,10 @@ dtlSql = " select '' as TRAN_ID, "
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_COMP_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_COMP_TAXCLASS+") ";
} }
if(GST_COMP_TAXCLASS.length() > 0) /*if(GST_COMP_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_COMP_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_COMP_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -34094,10 +34121,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -34094,10 +34121,10 @@ dtlSql = " select '' as TRAN_ID, "
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_PUREXE_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_PUREXE_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PUREXE_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PUREXE_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_PUREXE_TAXENV.length() > 0) /*if(GST_PUREXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PUREXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PUREXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -34269,10 +34296,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -34269,10 +34296,10 @@ dtlSql = " select '' as TRAN_ID, "
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_PUREXE_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_PUREXE_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PUREXE_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PUREXE_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_PUREXE_TAXENV.length() > 0) /*if(GST_PUREXE_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PUREXE_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PUREXE_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -34445,10 +34472,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -34445,10 +34472,10 @@ dtlSql = " select '' as TRAN_ID, "
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNIL_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNIL_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PURNIL_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PURNIL_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_PURNIL_TAXENV.length() > 0) /*if(GST_PURNIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -34620,10 +34647,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -34620,10 +34647,10 @@ dtlSql = " select '' as TRAN_ID, "
//hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNIL_TAXCLASS+") "; //hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNIL_TAXCLASS+") ";
hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PURNIL_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) "; hdrSql = hdrSql +" and (ti.tax_class in ("+GST_PURNIL_TAXCLASS+") or ti.tax_chap in ("+TAX_CHAP_STR+") ) ";
} }
if(GST_PURNIL_TAXENV.length() > 0) /*if(GST_PURNIL_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNIL_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNIL_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -34797,10 +34824,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -34797,10 +34824,10 @@ dtlSql = " select '' as TRAN_ID, "
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNON_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNON_TAXCLASS+") ";
} }
if(GST_PURNON_TAXENV.length() > 0) /*if(GST_PURNON_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNON_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNON_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
...@@ -34974,10 +35001,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -34974,10 +35001,10 @@ dtlSql = " select '' as TRAN_ID, "
{ {
hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNON_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_class in ("+GST_PURNON_TAXCLASS+") ";
} }
if(GST_PURNON_TAXENV.length() > 0) /*if(GST_PURNON_TAXENV.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNON_TAXENV+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURNON_TAXENV+") ";
} }*/
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" 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' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
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