Commit 1756beae authored by kdabholkar's avatar kdabholkar

to add distributed issue login for null rated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106691 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 716700d1
......@@ -940,10 +940,14 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO,"
+" 'D-ISS' as ref_ser"
+" from distord_iss i,site c, site s, state state"
//+" from distord_iss i,site c, site s, state state"
+" from distord_iss i,site c, site s, site d, state state , state st"
+" where c.site_code = i.site_code"
+" and s.site_code = c.site_code"
+" and state.state_code = c.STATE_CODE "
+"and d.site_code= i.site_code__dlv "
+"and st.state_code = d.state_code "
+"and st.state_code <> state.state_code "
//+" 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 ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') ";
......@@ -4246,6 +4250,190 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"8A(3) NIL");
/************* 8B DIS Nill rated ditribution issue (intra-state register suppliers) *****************************/
hdrSql = " select '' as TRAN_ID,"
/*modified by kaustubh*/
/*+" to_date(i.GP_DATE) as TRAN_DATE,"*/
/*+" to_date(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end ) as TRAN_DATE," commented by kaustubh on 25 july 2017*/
+" '' as TRAN_ID__REF,"
// +" case when s.SITE_CODE__EXC is null then s.site_code else s.SITE_CODE__EXC end as SITE_CODE, " on 9 aug
// +" ddf_get_siteregno(s.site_code,'OPRTNG_SITE') AS SITE_CODE ,"
+" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE ,"
+ " case when i.GP_DATE is null then i.tran_date else i.GP_DATE end as PRD_CODE,"
+" '1' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'L' as GST_TYPE,"
+" '18' as TRAN_TYPE,"// -- b2b,b2c
+" i.site_code__dlv as CUST_CODE,"
+" c.descr as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code
+" ' ' as SUBMISSION_TYPE,"// -- M-Modify, D-Delete, A-Accept, R-Reject
+" ' ' as DOC_CHECKSUM,"
+" 'R' as DOC_TYPE,"// -- R- Regular B2B Invoices, DE – Deemed Exports, SEWP – SEZ Exports with payment,SEWOP – SEZ exports without payment
/*modified by kaustubh*/
/*+" i.GP_NO as DOC_NO,"*/
+" case when i.GP_NO is null then i.tran_id else i.GP_NO end as DOC_NO, "
/*+" i.gp_date 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,"
+" 'N' as REVERSE_CHRG,"
+" ' ' as LR_NO,"
+" ' ' as LR_DATE," //changed by kaustubh 27 july 2017
+" ' ' as REAS_CODE,"
+" ' ' as REF_ID__INV,"
// +" null REF_DATE__INV," commented by kaustubh 27 july 2017
+" 'N' as PROV_ASSMNT,"// -- not required
+" '' as ORDER_NO,"// -- not required
// +" null as ORDER_DATE,"// -- not required commented by kaustubh 27 july 2017
//+" i.tran_id as REMARKS,"
+" s.site_code as REMARKS, "
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS,"
// +" null SUBMIT_DATE," commented by kaustubh 27 july 2017
+" '' ADD_USER,"
// +" sysdate ADD_DATE," commented by kaustubh 27 july 2017
+" '' ADD_TERM,"
+" ' ' CHG_USER,"
// +" sysdate CHG_DATE," commented by kaustubh 27 july 2017
+" ' 'CHG_TERM,"
+" ddf_get_siteregno(c.site_code,'GSTIN_NO') as TAX_REG_NO,"
+" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO,"
+" 'D-ISS' as ref_ser"
//+" from distord_iss i,site c, site s, state state"
+" from distord_iss i,site c, site s, site d, state state , state st"
+" where c.site_code = i.site_code"
+" and s.site_code = c.site_code"
+" and state.state_code = c.STATE_CODE "
+"and d.site_code= i.site_code__dlv "
+"and st.state_code = d.state_code "
+"and st.state_code = state.state_code "
//+" 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 ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') ";
if(taxClassAllStr.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_class not in ("+taxClassAllStr+") ";
}
if(taxEnvAllStr.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env not in ("+taxEnvAllStr+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
/*+" and i.conf_date between ? and ? " modified by kaustubh on 27 july */
+" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'D-ISS' and ref_id = i.tran_id ) = 0 ";
/**
* Detail DistOrd Issue 8(B) Nill rated ditribution issue (D-ISS)*
*/
dtlSql = " select '' as TRAN_ID, "
+" it.line_no as LINE_NO, "
+" 'A' as STATUS," // -- M – Modification, A – Accept D – Delete
+" 0 as SR_NO__OLD,"
+" 'G' as LINE_TYPE," ;// -- G – Goods, S – Serice
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT,"
+" fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC,"
+" fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT,"
+" fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC,"
+" fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT,"
+" fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC,"
+" fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT,";
}
else
{
dtlSql = dtlSql + "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE,"
+ "fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
// +" item.sh_descr GS_DESCR," commented by kaustubh on 28 july
+" item.descr as GS_DESCR,"
+"item.UNIT as UNIT,"
/* +" u.descr as UNIT,"*/
//--sum(it.quantity__stduom) as QUANTITY,
+" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('D-ISS' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
/* +"fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"*/
+" '' as REMARKS ,"
/* added by kaustubh */
+"fn_get_gst_rate('D-ISS',i.tran_id, it.line_no) as gst_rate "
+" from distord_iss i,distord_issdet it, item"
+" where i.tran_id = it.tran_id "
/*Commented by kaustubh on 19-7-17*/
/*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/
+" and item.item_code = it.item_code "
/*Commented by kaustubh on 21-7-17 / 3 aug*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'D-ISS' "
+"and ti.tran_id = i.tran_id "
+"and tx.tax_type in ('G','H','I','J')" ;
/*Commented by kaustubh on 19-7-17*/
/*+" and t.tax_code = tx.tax_code "
+" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'D-ISS' "
+" and tx.tran_id = i.tran_id ";*/
/*Commented by kaustubh on 21-7-17 / 3 aug */
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0";
}
else
{
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
}
dtlSql = dtlSql
+ " and i.tran_id = ? " ;
/*commented by kaustubh*/
/* +" and u.unit = item.unit ";*/
//--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE',''
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"8B DIS");
/******* 8B started ********/
/**
* 8B(1) NIL Header Intra-state to registered suppliers *
......@@ -7309,10 +7497,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'R-ADV' and ref_id = i.tran_id ) = 0 "
// +" group by state.gst_code,case when s.SITE_CODE__EXC is null then s.site_code else s.SITE_CODE__EXC end, " ;
+ " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPRTNG_SITE')";
// + " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPRTNG_SITE')";
+ " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPTNG_SITE')";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +"current date";
hdrSql = hdrSql +", current date";
}
else
......@@ -7523,10 +7712,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and (select count(1) from gst_data_hdr where ref_ser = 'R-ADV' and ref_id = i.tran_id ) = 0 "
// +" group by state.gst_code,case when s.SITE_CODE__EXC is null then s.site_code else s.SITE_CODE__EXC end, ";
+ " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPRTNG_SITE') ";
// + " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPRTNG_SITE') ";
+ " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPTNG_SITE') ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +"current date";
hdrSql = hdrSql +", current date";
}
else
......@@ -7762,10 +7952,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and (select count(1) from gst_data_hdr where ref_ser = 'R-ADV' and ref_id = i.tran_id ) = 0 "
// +" group by state.gst_code,case when s.SITE_CODE__EXC is null then s.site_code else s.SITE_CODE__EXC end, " ;
+ " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPRTNG_SITE')";
// + " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPRTNG_SITE')";
+ " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPTNG_SITE')";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +"current date";
hdrSql = hdrSql +", current date";
}
else
......@@ -8011,10 +8202,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// +" group by state.gst_code,case when s.SITE_CODE__EXC is null then s.site_code else s.SITE_CODE__EXC end," ;
+ " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPRTNG_SITE')";
// + " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPRTNG_SITE')";
+ " group by state.gst_code,ddf_get_siteregno(s.site_code,'OPTNG_SITE')";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +"current date";
hdrSql = hdrSql +", current date";
}
else
......
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