Commit 69d42276 authored by kdabholkar's avatar kdabholkar

commit following changes in GST1 Data population queries

- added new condition  in invoice query for cancelled invoice
- added new condition in credit note queries for cancelled invoices 
- correct the join which is wrong in case CUSTCODE_BILL__TO  

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194548 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 344f08b3
...@@ -591,18 +591,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -591,18 +591,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state, sordertype sot" +" from invoice i,customer c, site s, state state, sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /*+" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 i.inv_type=sot.ORDER_TYPE" +" and i.inv_type=sot.ORDER_TYPE"
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.inv_type <> 'EC' "; +" and i.inv_type <> 'EC' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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'"
...@@ -1568,20 +1571,22 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1568,20 +1571,22 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" (select tax_reg_2 from sales_pers where sales_pers.sales_pers=i.sales_pers) AS ECOM_REG_NO," +" (select tax_reg_2 from sales_pers where sales_pers.sales_pers=i.sales_pers) AS ECOM_REG_NO,"
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, despatch d, site s, state state, sordertype sot" +" from invoice i,customer c, despatch d, site s, state state, sordertype sot"
//+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" AND i.desp_id= d.desp_id " +" AND i.desp_id= d.desp_id "
+" and i.inv_type=sot.ORDER_TYPE" +" and i.inv_type=sot.ORDER_TYPE"
+" and state.state_code = d.STATE_CODE__DLV " +" and state.state_code = d.STATE_CODE__DLV "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.inv_type='EC' "; +" and i.inv_type='EC' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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'"
...@@ -1742,10 +1747,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1742,10 +1747,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO," +" ' ' as ECOM_REG_NO,"
+" 'S-INV' as ref_ser" +" 'S-INV' as ref_ser"
+" from invoice i,customer c, site s, state st_c, state st_own, sordertype sot " +" from invoice i,customer c, site s, state st_c, state st_own, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /*+" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code"
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and i.inv_type=sot.ORDER_TYPE" +" and i.inv_type=sot.ORDER_TYPE"
+" and st_c.state_code = c.STATE_CODE " +" and st_c.state_code = c.STATE_CODE "
...@@ -1753,10 +1759,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1753,10 +1759,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and st_c.gst_code <> st_own.gst_code " //-- inter-state only +" and st_c.gst_code <> st_own.gst_code " //-- inter-state only
+" 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 trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.inv_type <> 'EC' "; +" and i.inv_type <> 'EC' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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' "
...@@ -2062,20 +2070,23 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2062,20 +2070,23 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(select tax_reg_2 from sales_pers where sales_pers.sales_pers=i.sales_pers) AS ECOM_REG_NO," +"(select tax_reg_2 from sales_pers where sales_pers.sales_pers=i.sales_pers) AS ECOM_REG_NO,"
+" 'S-INV' as ref_ser" +" 'S-INV' as ref_ser"
+" from invoice i,customer c, site s,despatch d, state state,sordertype sot " +" from invoice i,customer c, site s,despatch d, state state,sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /*+" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+ "where c.cust_code = i.cust_code"
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" AND i.desp_id= d.desp_id " +" AND i.desp_id= d.desp_id "
//+" AND st_c.state_code = d.STATE_CODE__DLV " //+" AND st_c.state_code = d.STATE_CODE__DLV "
+" AND state.state_code = d.STATE_CODE__DLV " +" AND state.state_code = d.STATE_CODE__DLV "
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.inv_type=sot.ORDER_TYPE" +" and i.inv_type=sot.ORDER_TYPE"
+" AND i.inv_type ='EC' "; +" AND i.inv_type ='EC' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -2238,15 +2249,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2238,15 +2249,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s , sordertype sot" +" from invoice i,customer c, site s , sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code"
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and s.site_code = i.site_code "; +" and s.site_code = i.site_code "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
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 "
...@@ -2403,15 +2417,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2403,15 +2417,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s , sordertype sot" +" from invoice i,customer c, site s , sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code"
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and s.site_code = i.site_code "; +" and s.site_code = i.site_code "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+" and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti, " +" and (select count(1) from taxtran ti, "
...@@ -2564,17 +2581,20 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2564,17 +2581,20 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state , sordertype sot " +" from invoice i,customer c, site s, state state , sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' "; +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -2723,17 +2743,20 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2723,17 +2743,20 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state , sordertype sot " +" from invoice i,customer c, site s, state state , sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' "; +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -2884,17 +2907,20 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2884,17 +2907,20 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state, sordertype sot " +" from invoice i,customer c, site s, state state, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' "; +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -3043,20 +3069,23 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3043,20 +3069,23 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state st_c, state st_own, sordertype sot " +" from invoice i,customer c, site s, state st_c, state st_own, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+ "where c.cust_code = i.cust_code"
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and st_c.state_code = c.state_code " +" and st_c.state_code = c.state_code "
+" and s.state_code = st_own.state_code " +" and s.state_code = st_own.state_code "
+" and st_own.gst_code = st_c.gst_code " //Intra-state supply. Site.GST_CODE = Customer's SITE.GST_CODE +" and st_own.gst_code = st_c.gst_code " //Intra-state supply. Site.GST_CODE = Customer's SITE.GST_CODE
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.inv_type <> 'EC' "; +" and i.inv_type <> 'EC' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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' "
...@@ -3214,19 +3243,22 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3214,19 +3243,22 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" (select tax_reg_2 from sales_pers where sales_pers.sales_pers=i.sales_pers) AS ECOM_REG_NO," +" (select tax_reg_2 from sales_pers where sales_pers.sales_pers=i.sales_pers) AS ECOM_REG_NO,"
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, despatch d, state state,sordertype sot " +" from invoice i,customer c, site s, despatch d, state state,sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end) " +" i.CUST_CODE__BIL else i.cust_code end) "*/
+" where c.cust_code = i.cust_code"
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" AND i.desp_id= d.desp_id " +" AND i.desp_id= d.desp_id "
+" AND state.state_code = d.STATE_CODE__DLV" +" AND state.state_code = d.STATE_CODE__DLV"
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and i.inv_type = 'EC' "; +" and i.inv_type = 'EC' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -3389,10 +3421,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3389,10 +3421,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state st_c, state st_own, sordertype sot " +" from invoice i,customer c, site s, state st_c, state st_own, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end) " +" i.CUST_CODE__BIL else i.cust_code end) "*/
+" where c.cust_code = i.cust_code"
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and st_c.state_code = c.state_code " +" and st_c.state_code = c.state_code "
+" and s.state_code = st_own.state_code " +" and s.state_code = st_own.state_code "
...@@ -3400,10 +3433,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3400,10 +3433,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and i.net_amt <= "+GST_B2CL_INV_VAL+" " +" and i.net_amt <= "+GST_B2CL_INV_VAL+" "
+" and i.inv_type <> 'EC' "; +" and i.inv_type <> 'EC' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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' "
...@@ -3557,10 +3592,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3557,10 +3592,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" (select tax_reg_2 from sales_pers where sales_pers.sales_pers=i.sales_pers) AS ECOM_REG_NO," +" (select tax_reg_2 from sales_pers where sales_pers.sales_pers=i.sales_pers) AS ECOM_REG_NO,"
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s,despatch d, state state, sordertype sot " +" from invoice i,customer c, site s,despatch d, state state, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" AND i.desp_id= d.desp_id " +" AND i.desp_id= d.desp_id "
+" AND state.state_code = d.STATE_CODE__DLV " +" AND state.state_code = d.STATE_CODE__DLV "
...@@ -3569,6 +3605,13 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3569,6 +3605,13 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and i.net_amt < "+GST_B2CL_INV_VAL+" " +" and i.net_amt < "+GST_B2CL_INV_VAL+" "
+" AND S.state_code <> d.STATE_CODE__DLV " +" AND S.state_code <> d.STATE_CODE__DLV "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
}
hdrSql = hdrSql
+" 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') "
...@@ -3728,18 +3771,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3728,18 +3771,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state , sordertype sot" +" from invoice i,customer c, site s, state state , sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" 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 trim(c.tax_reg_2) <> 'UNREGISTER' "; +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -4085,18 +4131,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4085,18 +4131,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state, sordertype sot " +" from invoice i,customer c, site s, state state, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' "; +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -4274,18 +4323,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4274,18 +4323,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state , sordertype sot" +" from invoice i,customer c, site s, state state , sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and trim(c.tax_reg_2) = 'UNREGISTER' "; +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -4476,18 +4528,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4476,18 +4528,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state, sordertype sot " +" from invoice i,customer c, site s, state state, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and trim(c.tax_reg_2) = 'UNREGISTER' "; +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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 "
...@@ -4699,18 +4754,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4699,18 +4754,21 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state, invoice_amendment a , sordertype sot" +" from invoice i,customer c, site s, state, invoice_amendment a , sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" i.CUST_CODE__BIL else i.cust_code end)" +" i.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 i.invoice_id = a.invoice_id " +" and i.invoice_id = a.invoice_id "
+" and i.inv_type=sot.ORDER_TYPE " +" and i.inv_type=sot.ORDER_TYPE "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' "; +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.invoice_id not in (select inv.INVOICE_ID from invoice inv,sreturn srt where inv.INVOICE_ID = srt.INVOICE_ID "
+"and srt.TRAN_DATE between ? and ? ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") "; hdrSql = hdrSql +" and trim(srt.tran_type) = ("+SRET_FULL_TRANTYPE+") )";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' "
...@@ -6059,10 +6117,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6059,10 +6117,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'CRNRCP' as ref_ser " +" 'CRNRCP' as ref_ser "
+" FROM drcr_rcp i, customer c, site s, state st_c, state st_own, invoice inv , sordertype sot" +" FROM drcr_rcp i, customer c, site s, state st_c, state st_own, invoice inv , sordertype sot"
//+" WHERE c.cust_code = i.cust_code " //+" WHERE c.cust_code = i.cust_code "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+"(case when trim(sot.CUST_TAX_OPT) = '1' then " +"(case when trim(sot.CUST_TAX_OPT) = '1' then "
+" inv.CUST_CODE__BIL else i.cust_code end)" +" inv.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code "
+" AND s.site_code = i.site_code " +" AND s.site_code = i.site_code "
+" AND st_c.state_code = c.state_code " +" AND st_c.state_code = c.state_code "
+" AND inv.invoice_id = i.invoice_id " +" AND inv.invoice_id = i.invoice_id "
...@@ -6072,7 +6131,13 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6072,7 +6131,13 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" AND st_own.gst_code = st_c.gst_code "; +" AND st_own.gst_code = st_c.gst_code ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") "; //hdrSql = hdrSql +" and trim(i.tran_type) not in ("+SRET_FULL_TRANTYPE+") ";
hdrSql = hdrSql + " AND i.tran_id not in ("
+ " select d.tran_id from invoice i, drcr_rcp d "
+ " where i.INVOICE_ID =d.INVOICE_ID "
+ " and trim(d.TRAN_TYPE) = "+SRET_FULL_TRANTYPE+""
+ " and i.tran_date between ? and ? "
+ " and d.confirmed = 'Y') ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" 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' "
...@@ -6213,10 +6278,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6213,10 +6278,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'CRNRCP' as ref_ser " +" 'CRNRCP' as ref_ser "
+" FROM drcr_rcp i, customer c, site s, state st_c, state st_own, invoice inv , sordertype sot" +" FROM drcr_rcp i, customer c, site s, state st_c, state st_own, invoice inv , sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+" (case when trim(sot.CUST_TAX_OPT) = '1' then " +" (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" inv.CUST_CODE__BIL else i.cust_code end)" +" inv.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code "
+" AND s.site_code = i.site_code " +" AND s.site_code = i.site_code "
+" AND st_c.state_code = c.state_code " +" AND st_c.state_code = c.state_code "
+" AND inv.invoice_id = i.invoice_id " +" AND inv.invoice_id = i.invoice_id "
...@@ -6225,9 +6291,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6225,9 +6291,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" AND s.state_code = st_own.state_code " +" AND s.state_code = st_own.state_code "
+" AND st_own.gst_code <> st_c.gst_code " +" AND st_own.gst_code <> st_c.gst_code "
+" 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(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") "; //hdrSql = hdrSql +" and trim(i.tran_type) not in ("+SRET_FULL_TRANTYPE+") ";
hdrSql = hdrSql + " AND i.tran_id not in ("
+ " select d.tran_id from invoice i, drcr_rcp d "
+ " where i.INVOICE_ID =d.INVOICE_ID "
+ " and trim(d.TRAN_TYPE) = "+SRET_FULL_TRANTYPE+""
+ " and i.tran_date between ? and ? "
+ " and d.confirmed = 'Y') ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer " +" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer "
...@@ -6367,10 +6440,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6367,10 +6440,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'DRNRCP' as ref_ser " +" 'DRNRCP' as ref_ser "
+" FROM drcr_rcp i, customer c, site s, state st_c, state st_own, invoice inv ,sordertype sot " +" FROM drcr_rcp i, customer c, site s, state st_c, state st_own, invoice inv ,sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+"(case when trim(sot.CUST_TAX_OPT) = '1' then " +"(case when trim(sot.CUST_TAX_OPT) = '1' then "
+" inv.CUST_CODE__BIL else i.cust_code end)" +" inv.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code"
+" AND s.site_code = i.site_code " +" AND s.site_code = i.site_code "
+" and inv.inv_type=sot.ORDER_TYPE " +" and inv.inv_type=sot.ORDER_TYPE "
+" AND st_c.state_code = c.state_code " +" AND st_c.state_code = c.state_code "
...@@ -6516,10 +6590,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6516,10 +6590,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'DRNRCP' as ref_ser " +" 'DRNRCP' as ref_ser "
+" FROM drcr_rcp i, customer c, site s, state st_c, state st_own, invoice inv, sordertype sot " +" FROM drcr_rcp i, customer c, site s, state st_c, state st_own, invoice inv, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+"(case when trim(sot.CUST_TAX_OPT) = '1' then " +"(case when trim(sot.CUST_TAX_OPT) = '1' then "
+" inv.CUST_CODE__BIL else i.cust_code end)" +" inv.CUST_CODE__BIL else i.cust_code end)"*/
+ " where c.cust_code = i.cust_code "
+" AND s.site_code = i.site_code " +" AND s.site_code = i.site_code "
+" AND st_c.state_code = c.state_code " +" AND st_c.state_code = c.state_code "
+" AND inv.invoice_id = i.invoice_id " +" AND inv.invoice_id = i.invoice_id "
...@@ -6673,9 +6748,16 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6673,9 +6748,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 trim(c.tax_reg_2) <> 'UNREGISTER' "; +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") "; //hdrSql = hdrSql +" and trim(i.tran_type) not in ("+SRET_FULL_TRANTYPE+") ";
hdrSql = hdrSql + " AND i.tran_id not in ("
+ " select d.tran_id from invoice i, drcr_rcp d "
+ " where i.INVOICE_ID =d.INVOICE_ID "
+ " and trim(d.TRAN_TYPE) = "+SRET_FULL_TRANTYPE+""
+ " and i.tran_date between ? and ? "
+ " and d.confirmed = 'Y') ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id "
...@@ -6822,11 +6904,19 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6822,11 +6904,19 @@ 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 trim(c.tax_reg_2) = 'UNREGISTER' "; +" and trim(c.tax_reg_2) = 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") "; //hdrSql = hdrSql +" and trim(i.tran_type) not in ("+SRET_FULL_TRANTYPE+") ";
hdrSql = hdrSql + " AND i.tran_id not in ("
+ " select d.tran_id from invoice i, drcr_rcp d "
+ " where i.INVOICE_ID =d.INVOICE_ID "
+ " and trim(d.TRAN_TYPE) = "+SRET_FULL_TRANTYPE+""
+ " and i.tran_date between ? and ? "
+ " and d.confirmed = 'Y') ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -6971,11 +7061,19 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6971,11 +7061,19 @@ 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 trim(c.tax_reg_2) = 'UNREGISTER' "; +" and trim(c.tax_reg_2) = 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") "; //hdrSql = hdrSql +" and trim(i.tran_type) not in ("+SRET_FULL_TRANTYPE+") ";
hdrSql = hdrSql + " AND i.tran_id not in ("
+ " select d.tran_id from invoice i, drcr_rcp d "
+ " where i.INVOICE_ID =d.INVOICE_ID "
+ " and trim(d.TRAN_TYPE) = "+SRET_FULL_TRANTYPE+""
+ " and i.tran_date between ? and ? "
+ " and d.confirmed = 'Y') ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -7118,11 +7216,19 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7118,11 +7216,19 @@ 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 trim(c.tax_reg_2) <> 'UNREGISTER' "; +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") "; //hdrSql = hdrSql +" and trim(i.tran_type) not in ("+SRET_FULL_TRANTYPE+") ";
hdrSql = hdrSql + " AND i.tran_id not in ("
+ " select d.tran_id from invoice i, drcr_rcp d "
+ " where i.INVOICE_ID =d.INVOICE_ID "
+ " and trim(d.TRAN_TYPE) = "+SRET_FULL_TRANTYPE+""
+ " and i.tran_date between ? and ? "
+ " and d.confirmed = 'Y') ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -9153,19 +9259,28 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9153,19 +9259,28 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'CRNRCP' as ref_ser " +" 'CRNRCP' as ref_ser "
// +" case when i.drcr_flag = 'C' then 'CRNRCP' else 'DRNRCP' end as ref_ser " // +" case when i.drcr_flag = 'C' then 'CRNRCP' else 'DRNRCP' end as ref_ser "
+" from drcr_rcp i,customer c, site s, state, invoice inv, sordertype sot " +" from drcr_rcp i,customer c, site s, state, invoice inv, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+"(case when trim(sot.CUST_TAX_OPT) = '1' then " +"(case when trim(sot.CUST_TAX_OPT) = '1' then "
+" inv.CUST_CODE__BIL else i.cust_code end)" +" inv.CUST_CODE__BIL else i.cust_code end)"*/
+ " 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 inv.inv_type=sot.ORDER_TYPE " +" and inv.inv_type=sot.ORDER_TYPE "
+" and inv.invoice_id = i.invoice_id "; +" and inv.invoice_id = i.invoice_id ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") "; //hdrSql = hdrSql +" and trim(i.tran_type) not in ("+SRET_FULL_TRANTYPE+") ";
hdrSql = hdrSql + " AND i.tran_id not in ("
+ " select d.tran_id from invoice i, drcr_rcp d "
+ " where i.INVOICE_ID =d.INVOICE_ID "
+ " and trim(d.TRAN_TYPE) = "+SRET_FULL_TRANTYPE+""
+ " and i.tran_date between ? and ? "
+ " and d.confirmed = 'Y') ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and i.drcr_flag ='C'" //added by kaustubh on 26 july to seperate Debit and credit note data +" and i.drcr_flag ='C'" //added by kaustubh on 26 july to seperate Debit and credit note data
+" and trim(i.tran_type) != 'PR' " +" and trim(i.tran_type) != 'PR' "
+" 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' "
...@@ -9391,10 +9506,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9391,10 +9506,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'DRNRCP' as ref_ser " +" 'DRNRCP' as ref_ser "
// +" case when i.drcr_flag = 'C' then 'CRNRCP' else 'DRNRCP' end as ref_ser " // +" case when i.drcr_flag = 'C' then 'CRNRCP' else 'DRNRCP' end as ref_ser "
+" from drcr_rcp i,customer c, site s, state, invoice inv, sordertype sot " +" from drcr_rcp i,customer c, site s, state, invoice inv, sordertype sot "
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+"(case when trim(sot.CUST_TAX_OPT) = '1' then " +"(case when trim(sot.CUST_TAX_OPT) = '1' then "
+" inv.CUST_CODE__BIL else i.cust_code end)" +" inv.CUST_CODE__BIL else i.cust_code end)"*/
+ " 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 inv.invoice_id = i.invoice_id " +" and inv.invoice_id = i.invoice_id "
...@@ -9607,19 +9723,28 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9607,19 +9723,28 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'CRNRCP' as ref_ser " +" 'CRNRCP' as ref_ser "
// +" case when i.drcr_flag = 'C' then 'CRNRCP' else 'DRNRCP' end as ref_ser " // +" case when i.drcr_flag = 'C' then 'CRNRCP' else 'DRNRCP' end as ref_ser "
+" from drcr_rcp i,customer c, site s, state, invoice inv , sordertype sot" +" from drcr_rcp i,customer c, site s, state, invoice inv , sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+"(case when trim(sot.CUST_TAX_OPT) = '1' then " +"(case when trim(sot.CUST_TAX_OPT) = '1' then "
+" inv.CUST_CODE__BIL else i.cust_code end)" +" inv.CUST_CODE__BIL else i.cust_code end)"*/
+" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and inv.inv_type=sot.ORDER_TYPE " +" and inv.inv_type=sot.ORDER_TYPE "
+" and state.state_code = c.STATE_CODE " +" and state.state_code = c.STATE_CODE "
+" and inv.invoice_id = i.invoice_id "; +" and inv.invoice_id = i.invoice_id ";
if(SRET_FULL_TRANTYPE.length() > 0) if(SRET_FULL_TRANTYPE.length() > 0)
{ {
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") "; //hdrSql = hdrSql +" and trim(i.tran_type) not in ("+SRET_FULL_TRANTYPE+") ";
hdrSql = hdrSql + " AND i.tran_id not in ("
+ " select d.tran_id from invoice i, drcr_rcp d "
+ " where i.INVOICE_ID =d.INVOICE_ID "
+ " and trim(d.TRAN_TYPE) = "+SRET_FULL_TRANTYPE+""
+ " and i.tran_date between ? and ? "
+ " and d.confirmed = 'Y') ";
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and i.drcr_flag ='C'" //added by kaustubh on 26 july to seperate Debit and credit note data +" and i.drcr_flag ='C'" //added by kaustubh on 26 july to seperate Debit and credit note data
+" 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 trim(i.tran_type) != 'PR' " +" and trim(i.tran_type) != 'PR' "
...@@ -9825,10 +9950,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9825,10 +9950,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as ECOM_REG_NO, " +" ' ' as ECOM_REG_NO, "
+" 'DRNRCP' as ref_ser " +" 'DRNRCP' as ref_ser "
+" from drcr_rcp i,customer c, site s, state, invoice inv , sordertype sot" +" from drcr_rcp i,customer c, site s, state, invoice inv , sordertype sot"
+" where (case when trim(sot.CUST_TAX_OPT) = '1' then " /* +" where (case when trim(sot.CUST_TAX_OPT) = '1' then "
+" c.CUST_CODE__BIL else c.cust_code end) = " +" c.CUST_CODE__BIL else c.cust_code end) = "
+"(case when trim(sot.CUST_TAX_OPT) = '1' then " +"(case when trim(sot.CUST_TAX_OPT) = '1' then "
+" inv.CUST_CODE__BIL else i.cust_code end)" +" inv.CUST_CODE__BIL else i.cust_code end)"*/
+" 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 inv.inv_type=sot.ORDER_TYPE " +" and inv.inv_type=sot.ORDER_TYPE "
...@@ -38001,8 +38127,22 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -38001,8 +38127,22 @@ dtlSql = " select '' as TRAN_ID, "
pstmtSelHdr.setTimestamp(2, toDate); pstmtSelHdr.setTimestamp(2, toDate);
if("9A(1)".equals(tranSer)) if("9A(1)".equals(tranSer))
{ {
pstmtSelHdr.setTimestamp(3, currMonthStartDate); pstmtSelHdr.setTimestamp(3, fromDate);
pstmtSelHdr.setTimestamp(4, julyMonthStartDate); pstmtSelHdr.setTimestamp(4, toDate);
pstmtSelHdr.setTimestamp(5, currMonthStartDate);
pstmtSelHdr.setTimestamp(6, julyMonthStartDate);
}
if("4(A) S-INV".equals(tranSer) || "4(C) S-INV(E-COMM)".equals(tranSer) || "(5A) S-INV".equals(tranSer) ||"(5B)B2CL-ECOMM".equals(tranSer)
|| "(6A) WPAY".equals(tranSer) || "(6A) WOPAY".equals(tranSer) || "(6B) SEWP".equals(tranSer) || "(6B) SEWOP".equals(tranSer)
|| "(6C) DE".equals(tranSer) || "7A(1) B2CS".equals(tranSer) || "7A(2) B2CS-ECOMM".equals(tranSer) || "7B(1) B2CS".equals(tranSer)
|| "7B(2) B2CS-ECOMM".equals(tranSer) || "8A(1) NIL".equals(tranSer) || "8B(1) NIL".equals(tranSer) || "8C(1) NIL".equals(tranSer)
|| "8D(1) NIL".equals(tranSer) || "CDNR(Intra-State)-B2CS".equals(tranSer) || "CDNR(Inter-State)-B2CS".equals(tranSer)
|| "CDNR(NILL)-Intra-REG".equals(tranSer) || "CDNR(NILL)-Intra-UNREG".equals(tranSer) || "CDNR(NILL)-Inter-UNREG".equals(tranSer)
|| "CDNR(NILL)-Inter-REG".equals(tranSer) || "9B1(CRN-REG)".equals(tranSer) || "9B2(CRN-UNREG)".equals(tranSer))
{
pstmtSelHdr.setTimestamp(3, fromDate);
pstmtSelHdr.setTimestamp(4, toDate);
} }
rsSelHdr = pstmtSelHdr.executeQuery(); rsSelHdr = pstmtSelHdr.executeQuery();
...@@ -38154,7 +38294,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -38154,7 +38294,7 @@ dtlSql = " select '' as TRAN_ID, "
pstmtInsHdr.setString(12,"M"); pstmtInsHdr.setString(12,"M");
pstmtInsHdr.setString(13,docCheckSum); pstmtInsHdr.setString(13,docCheckSum);
pstmtInsHdr.setString(14,docType); pstmtInsHdr.setString(14,docType);
pstmtInsHdr.setString(15,removeSpecialChar(docNo)); pstmtInsHdr.setString(15,docNo);
pstmtInsHdr.setTimestamp(16,docDate); pstmtInsHdr.setTimestamp(16,docDate);
pstmtInsHdr.setDouble(17,amount); pstmtInsHdr.setDouble(17,amount);
pstmtInsHdr.setString(18,"N"); pstmtInsHdr.setString(18,"N");
...@@ -38608,34 +38748,6 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -38608,34 +38748,6 @@ dtlSql = " select '' as TRAN_ID, "
/***
* Added New Method by kaustubh to remove special characters from doc_no 27 Nov 2018 Start
*/
private String removeSpecialChar (String billNo) throws ITMException, Exception
{
System.out.println("inside removeSpecialChar");
if(billNo != null && !billNo.equals(""))
{
Pattern pt = Pattern.compile("[^a-zA-Z0-9]");
Matcher match= pt.matcher(billNo);
while(match.find())
{
String s= match.group();
billNo=billNo.replaceAll("\\"+s, "");
}
System.out.println("Doc_no after Remove Specail Characters"+billNo);
}
return billNo;
}
/***
* Added New Method by kaustubh to remove special characters from doc_no 27 Nov 2018 End
*/
} }
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