Commit 46fc35b5 authored by kdabholkar's avatar kdabholkar

commited to add new changes of GSTR1 and GSTR2 data queries.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106660 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e5aed7ef
......@@ -1153,8 +1153,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{
hdrSql = hdrSql +" and ti.tax_env not in ("+taxEnvAllStr+") ";
}
hdrSql = hdrSql +" ) = 0 "
// hdrSql = hdrSql +" ) > 0 " Commented on 14 aug 2017
// hdrSql = hdrSql +" ) = 0 " Commented on 22 aug 2017
hdrSql = hdrSql +" ) > 0 "
+"and (select count(1) from voucher vh, vouchrcp vr, porcp pr where vr.tran_id = vh.tran_id and vh.purc_order = pr.purc_order "
+"and pr.tran_ser = 'P-RET' and vr.PRCP_ID = pr.tran_id) > 0"
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
......@@ -1266,7 +1266,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/* +" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/
+" and it.LINE_NO__RCP = pd.line_no"
+" and item.item_code = it.item_code"
+" and item.item_code = it.item_code "
/*commented by kaustubh on 21-7-2017 / 3 aug */
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'P-RET' "
......@@ -1817,10 +1817,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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, 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') "; inter state changed on 22 aug
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('I','J') ";
if(taxClassAllStr.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_class in ("+taxClassAllStr+") ";
//hdrSql = hdrSql +" and ti.tax_class in ("+taxClassAllStr+") "; changed by kaustubh on 22 aug
hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
......@@ -2222,7 +2224,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" null REF_DATE__INV, " commented by kaustubh 27 july 2017
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" station.descr as ORDER_NO,"
// +" station.descr as ORDER_NO," COMMENTED ON 22 AUG 2017
+" (select descr from station where stan_code=i.stan_code__init) AS ORDER_NO, "
// +" null as ORDER_DATE, " commented by kaustubh 27 july 2017
//+" i.invoice_id as REMARKS, "
+" s.site_code as REMARKS, "
......@@ -2239,11 +2242,14 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state, station station"
// +" from invoice i,customer c, site s, state state, station station" COOMENTED BY KAUSTUBH ON 22 AUG
+" from invoice i,customer c, site s, state state"
+" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code "
+" and state.state_code = c.state_code "
+" and c.tax_reg_2 <> 'UNREGISTER' "
// +" and c.tax_reg_2 <> 'UNREGISTER' " commented by kautubh on 22 Aug 2017
// +" 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 ";
if(GST_EXPWP_TAXCLASS.length() > 0)
{
......@@ -2257,8 +2263,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
// +" and i.conf_date between ? and ? " commented by kaustubhh
+" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 "
+" and station.stan_code = i.stan_code__init ";
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 ";
// +" and station.stan_code = i.stan_code__init "; COMMENTED BY KAUSTUBH ON 22 AUG 2017
/**
* Detail Invoice Exports (Pure Export)- with Payment 6(A) WPAY *
*/
......@@ -2428,7 +2434,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" null REF_DATE__INV, " commented by kaustubh 27 july 2017
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" station.descr as ORDER_NO,"
// +" station.descr as ORDER_NO,"
+"(select descr from station where stan_code=i.stan_code__init) AS ORDER_NO, "
// +" null as ORDER_DATE, " commented by kaustubh 27 july 2017
//+" i.invoice_id as REMARKS, "
+" s.site_code as REMARKS, "
......@@ -2445,11 +2452,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state, station station "
// +" from invoice i,customer c, site s, state state, station station " COMMENTED BY KAUSTUBH ON 22 AUG 2017
+" from invoice i,customer c, site s, state state"
+" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_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 ";
if(GST_EXPWOP_TAXCLASS.length() > 0)
{
......@@ -2463,8 +2471,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 "
+" and station.stan_code = i.stan_code__init ";
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 ";
// +" and station.stan_code = i.stan_code__init ";
/**
* Detail Invoice Exports (Pure Export)- without Payment 6(A) WOPAY*
*/
......@@ -2635,7 +2643,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" null REF_DATE__INV, " commented by kaustubh 27 july 2017
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" station.descr as ORDER_NO,"
// +" station.descr as ORDER_NO," COMMENETED BY KAUSTUBH 22 AUG 2017
+"(select descr from station where stan_code=i.stan_code__init) AS ORDER_NO, "
// +" null as ORDER_DATE, " commented by kaustubh 27 july 2017
//+" i.invoice_id as REMARKS, "
+" s.site_code as REMARKS, "
......@@ -2652,7 +2661,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state,station station "
// +" from invoice i,customer c, site s, state state,station station " COMMENETED ON 22 JULY
+" from invoice i,customer c, site s, state state "
+" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code "
+" and state.state_code = c.state_code "
......@@ -2670,8 +2680,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 "
+" and station.stan_code = i.stan_code__init ";
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 ";
// +" and station.stan_code = i.stan_code__init "; COMMENTED BY KAUSTUBH ON 22 AUG
/**
* Detail ---B2B Export to SEZ with payment 6(B) SEWP *
......@@ -2841,7 +2851,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" null REF_DATE__INV, " commented by kaustubh 27 july 2017
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" station.descr as ORDER_NO,"
// +" station.descr as ORDER_NO,"
+"(select descr from station where stan_code=i.stan_code__init) AS ORDER_NO, "
// +" null as ORDER_DATE, " commented by kaustubh 27 july 2017
//+" i.invoice_id as REMARKS, "
+" s.site_code as REMARKS, "
......@@ -2858,7 +2869,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state, station station "
// +" from invoice i,customer c, site s, state state, station station " commented by kaustubh 22 aug
+" from invoice i,customer c, site s, state state"
+" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code "
+" and state.state_code = c.state_code "
......@@ -2876,8 +2888,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 "
+" and station.stan_code = i.stan_code__init ";
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 ";
// +" and station.stan_code = i.stan_code__init "; COMMENETED BY KAUSTUBH ON 22 AUG
/**
* Detail ---B2B Export to SEZ without payment 6(B) SEWOP *
*/
......@@ -3042,7 +3054,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" null REF_DATE__INV, " commented by kaustubh 27 july 2017
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" station.descr as ORDER_NO,"
// +" station.descr as ORDER_NO,"
+"(select descr from station where stan_code=i.stan_code__init) AS ORDER_NO, "
// +" null as ORDER_DATE, " commented by kaustubh 27 july 2017
//+" i.invoice_id as REMARKS, "
+" '' as REMARKS, "
......@@ -3059,7 +3072,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s, state state,station station "
// +" from invoice i,customer c, site s, state state,station station "
+" from invoice i,customer c, site s, state state "
+" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code "
+" and state.state_code = c.state_code "
......@@ -3077,8 +3092,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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
+" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 "
+" and station.stan_code = i.stan_code__init ";
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 ";
// +" and station.stan_code = i.stan_code__init ";
/**
* Detail ---B2B Deemed Exports 6(C) DE*
*/
......@@ -3271,6 +3286,15 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and c.tax_reg_2 = 'UNREGISTER' "
+" 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
/* 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 ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') ";
if(taxClassAllStr.length() > 0)
{
//hdrSql = hdrSql +" and ti.tax_class in ("+taxClassAllStr+") ";
hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 ";
......@@ -3465,6 +3489,15 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.net_amt <= "+GST_B2CL_INV_VAL+" "
+" 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
/*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 ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') ";
if(taxClassAllStr.length() > 0)
{
//hdrSql = hdrSql +" and ti.tax_class in ("+taxClassAllStr+") ";
hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'S-INV' and ref_id = i.invoice_id ) = 0 ";
......
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