Commit 60ccd8d0 authored by kdabholkar's avatar kdabholkar

commit the section 4B from GSTR1

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@157308 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d135aeb9
...@@ -1477,24 +1477,24 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1477,24 +1477,24 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//--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','' //--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,"4(A) P-RET"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(A) P-RET");
/******* 4B started ********/ /******* 4B started ********/
/** /**
* 4(B) VOUCH Header Voucher* * 4(B) VOUCH Header Voucher*
*/ */
hdrSql = " select '' as TRAN_ID," /* hdrSql = " select '' as TRAN_ID,"
/*modified by kaustubh*/ modified by kaustubh
/*+" to_date(i.gp_date) as TRAN_DATE,"*/ +" 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*/ +" 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," +" '' 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 // +" 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,'OPRTNG_SITE') AS SITE_CODE ,"
+" 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,"
/* modify by kaustubh */ modify by kaustubh
/*+" to_char(i.gp_date,'MMYYYY') as PRD_CODE,"*/ +" to_char(i.gp_date,'MMYYYY') as PRD_CODE,"
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) commented by kaustubh on 25 july 2017 if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) commented by kaustubh on 25 july 2017
{ {
hdrSql = hdrSql +" cast(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end,'MMYYYY') as PRD_CODE, "; hdrSql = hdrSql +" cast(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end,'MMYYYY') as PRD_CODE, ";
} }
...@@ -1502,7 +1502,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1502,7 +1502,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql = hdrSql +"to_char(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end,'MMYYYY') as PRD_CODE,"; hdrSql = hdrSql +"to_char(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end,'MMYYYY') as PRD_CODE,";
} }
hdrSql=hdrSql*/ hdrSql=hdrSql
+" '1' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '1' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'R' as GST_TYPE," +" 'R' as GST_TYPE,"
+" '02' as TRAN_TYPE,"// -- b2b,b2c +" '02' as TRAN_TYPE,"// -- b2b,b2c
...@@ -1512,11 +1512,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1512,11 +1512,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as SUBMISSION_TYPE,"// -- M-Modify, D-Delete, A-Accept, R-Reject +" ' ' as SUBMISSION_TYPE,"// -- M-Modify, D-Delete, A-Accept, R-Reject
+" ' ' as DOC_CHECKSUM," +" ' ' as DOC_CHECKSUM,"
+" 'R' as DOC_TYPE,"// -- R- Regular B2B Invoices, DE – Deemed Exports, SEWP – SEZ Exports with payment,SEWOP – SEZ exports without payment +" 'R' as DOC_TYPE,"// -- R- Regular B2B Invoices, DE – Deemed Exports, SEWP – SEZ Exports with payment,SEWOP – SEZ exports without payment
/*modified by kaustubh*/ modified by kaustubh
/*+" i.gp_no as DOC_NO,"*/ +" 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," +"case when i.gp_no is null then i.tran_id else i.gp_no end as DOC_NO,"
//+" i.tran_id as DOC_NO," //+" i.tran_id as DOC_NO,"
/*+" i.gp_date as DOC_DATE,"*/ +" 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," // +"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE,"
+" i.tran_date as DOC_DATE," +" i.tran_date as DOC_DATE,"
+" i.net_amt as AMOUNT," +" i.net_amt as AMOUNT,"
...@@ -1559,12 +1559,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1559,12 +1559,12 @@ 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 i.conf_date between ? and ? " commented by kaustubh on 27 july 2017 //+" and i.conf_date between ? and ? " commented by kaustubh on 27 july 2017
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'VOUCH' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'VOUCH' and ref_id = i.tran_id ) = 0 "; */
/** /**
* Detail Voucher 4(B) VOUCH * * Detail Voucher 4(B) VOUCH *
*/ */
dtlSql = " select '' as TRAN_ID, "; /*dtlSql = " select '' as TRAN_ID, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, "; dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, ";
...@@ -1577,8 +1577,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1577,8 +1577,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 0 as SR_NO__OLD," +" 0 as SR_NO__OLD,"
+" 'G' as LINE_TYPE,";// -- G – Goods, S – Serice +" 'G' as LINE_TYPE,";// -- G – Goods, S – Serice
/* changed by kaustubh */ changed by kaustubh
/* +" si.hsn_no as GS_CODE," +" si.hsn_no as GS_CODE,"
+" tx.TAXABLE_AMT as TAXABLE_AMT," +" tx.TAXABLE_AMT as TAXABLE_AMT,"
+" case when t.tax_type = 'I' then tx.tax_perc else 0 end as IGST_PERC," +" case when t.tax_type = 'I' then tx.tax_perc else 0 end as IGST_PERC,"
//-- sum(case when t.tax_type = 'I' then tx.tax_amt else 0 end) as IGST_AMT, //-- sum(case when t.tax_type = 'I' then tx.tax_amt else 0 end) as IGST_AMT,
...@@ -1588,9 +1588,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1588,9 +1588,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" (case when t.tax_type = 'H' then tx.tax_amt else 0 end) as CGST_AMT," +" (case when t.tax_type = 'H' then tx.tax_amt else 0 end) as CGST_AMT,"
+" case when t.tax_type = 'G' then tx.tax_perc else 0 end as SGST_PERC," +" case when t.tax_type = 'G' then tx.tax_perc else 0 end as SGST_PERC,"
//--sum(case when t.tax_type = 'G' then tx.tax_amt else 0 end) as SGST_AMT, //--sum(case when t.tax_type = 'G' then tx.tax_amt else 0 end) as SGST_AMT,
+" (case when t.tax_type = 'G' then tx.tax_amt else 0 end) as SGST_AMT,"*/ +" (case when t.tax_type = 'G' then tx.tax_amt else 0 end) as SGST_AMT,"
/* changed by kaustubh on 28 july 2017*/ changed by kaustubh on 28 july 2017
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql +"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE," dtlSql = dtlSql +"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
...@@ -1617,29 +1617,29 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1617,29 +1617,29 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql dtlSql = dtlSql
/*+ "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE," + "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,"*/ + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,"
// +" item.sh_descr GS_DESCR," commented by kaustubh on 28 july // +" item.sh_descr GS_DESCR," commented by kaustubh on 28 july
// +" item.descr as GS_DESCR," // +" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
/* +" u.descr as UNIT,"*/ +" u.descr as UNIT,"
// +"item.UNIT as UNIT," // +"item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
//--sum(it.quantity__stduom) as QUANTITY, //--sum(it.quantity__stduom) as QUANTITY,
+" (it.rcp_qty) as QUANTITY," +" (it.rcp_qty) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
/*chnaged by kaustubh on 19-07-2017*/ chnaged by kaustubh on 19-07-2017
/*+" case when t.tax_type = 'J' then tx.tax_perc else 0 end as CESS_PERC," +" case when t.tax_type = 'J' then tx.tax_perc else 0 end as CESS_PERC,"
//--sum(case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT, //--sum(case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT,
+" (case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT,"*/ +" (case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT,"
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -1658,11 +1658,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1658,11 +1658,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql dtlSql = dtlSql
/* +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"*/ +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS, "; +" '' as REMARKS, ";
/*added by kaustubh on 19-07-2017*/ added by kaustubh on 19-07-2017
//+" fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate " //+" fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -1674,28 +1674,28 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1674,28 +1674,28 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
dtlSql = dtlSql dtlSql = dtlSql
/*changed by kaustubh on 19-07-2017*/ changed by kaustubh on 19-07-2017
/* +" from voucher i,vouchrcp it,taxtran tx, siteitem si, tax t, item item,uom u " */ +" from voucher i,vouchrcp it,taxtran tx, siteitem si, tax t, item item,uom u "
+" from voucher i,vouchrcp it, item item " +" from voucher i,vouchrcp it, item item "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/*commented by kaustubh on 19-07-2017*/ commented by kaustubh on 19-07-2017
/* +" and si.site_code = i.site_code " +" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "
+" and item.item_code = it.item_code " +" and item.item_code = it.item_code "
/*commented by kaustubh on 19-07-2017*/ commented by kaustubh on 19-07-2017
/* +" and t.tax_code = tx.tax_code " +" and t.tax_code = tx.tax_code "
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'VOUCH' " +" and tx.tran_code = 'VOUCH' "
+" and tx.tran_id = i.tran_id " +" and tx.tran_id = i.tran_id "
+" and t.TAX_GROUP = 'RCM' ";*/ +" and t.TAX_GROUP = 'RCM' ";
/*commented by kaustubh on 21-07-2017 / 3 aug */ commented by kaustubh on 21-07-2017 / 3 aug
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code " +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'VOUCH' " +"and ti.tran_code = 'VOUCH' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
+"and tx.tax_type in ('G','H','I','J')" ; +"and tx.tax_type in ('G','H','I','J')" ;
/*commented by kaustubh on 21-07-2017 / 3 aug */ commented by kaustubh on 21-07-2017 / 3 aug
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
...@@ -1710,25 +1710,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1710,25 +1710,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
/* +" and u.unit = item.unit ";*/ +" 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','' //--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,"4(B) VOUCH"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(B) VOUCH");*/
/** /**
* 4(B) M-VOUC Header MISC-Voucher * * 4(B) M-VOUC Header MISC-Voucher *
*/ */
hdrSql = " select '' as TRAN_ID," /*hdrSql = " select '' as TRAN_ID,"
/* modified by Kaustubh*/ modified by Kaustubh
/*+" to_date(i.gp_date) as TRAN_DATE,"*/ +" 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*/ +" 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," +" '' 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, " // +" case when s.SITE_CODE__EXC is null then s.site_code else s.SITE_CODE__EXC end as SITE_CODE, "
// +" ddf_get_siteregno(s.site_code,'OPRTNG_SITE') AS SITE_CODE ," // +" ddf_get_siteregno(s.site_code,'OPRTNG_SITE') AS SITE_CODE ,"
+" 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,"
/*+" to_char(i.gp_date,'MMYYYY') as PRD_CODE,"*/ +" to_char(i.gp_date,'MMYYYY') as PRD_CODE,"
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) commented by kaustubh on 25 july 2017 if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) commented by kaustubh on 25 july 2017
{ {
hdrSql = hdrSql +" cast(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end,'MMYYYY') as PRD_CODE, "; hdrSql = hdrSql +" cast(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end,'MMYYYY') as PRD_CODE, ";
} }
...@@ -1736,7 +1736,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1736,7 +1736,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql = hdrSql +"to_char(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end,'MMYYYY') as PRD_CODE,"; hdrSql = hdrSql +"to_char(case when i.GP_DATE is null then i.tran_date else i.GP_DATE end,'MMYYYY') as PRD_CODE,";
} }
hdrSql=hdrSql*/ hdrSql=hdrSql
+" '1' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '1' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'R' as GST_TYPE," +" 'R' as GST_TYPE,"
+" '02' as TRAN_TYPE,"// -- b2b,b2c +" '02' as TRAN_TYPE,"// -- b2b,b2c
...@@ -1758,11 +1758,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1758,11 +1758,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" ' ' as SUBMISSION_TYPE,"// -- M-Modify, D-Delete, A-Accept, R-Reject +" ' ' as SUBMISSION_TYPE,"// -- M-Modify, D-Delete, A-Accept, R-Reject
+" ' ' as DOC_CHECKSUM," +" ' ' as DOC_CHECKSUM,"
+" 'R' as DOC_TYPE,"// -- R- Regular B2B Invoices, DE – Deemed Exports, SEWP – SEZ Exports with payment,SEWOP – SEZ exports without payment +" 'R' as DOC_TYPE,"// -- R- Regular B2B Invoices, DE – Deemed Exports, SEWP – SEZ Exports with payment,SEWOP – SEZ exports without payment
/* modified by Kaustubh*/ modified by Kaustubh
/*+" i.gp_no as DOC_NO,"*/ +" 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," +"case when i.gp_no is null then i.tran_id else i.gp_no end as DOC_NO,"
// +" i.tran_id as DOC_NO, " // +" i.tran_id as DOC_NO, "
/*+" i.gp_date as DOC_DATE,"*/ +" 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," changed on 7 sep // +"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE," changed on 7 sep
+" i.tran_date as DOC_DATE," +" i.tran_date as DOC_DATE,"
+" i.net_amt as AMOUNT," +" i.net_amt as AMOUNT,"
...@@ -1830,12 +1830,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1830,12 +1830,12 @@ 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 i.conf_date between ? and ? " changed by kaustubh on 27 july 2017 //+" and i.conf_date between ? and ? " changed by kaustubh on 27 july 2017
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";*/
/** /**
* Detail MISC-Voucher 4(B) M-VOUC * * Detail MISC-Voucher 4(B) M-VOUC *
*/ */
dtlSql = " select '' as TRAN_ID, "; /*dtlSql = " select '' as TRAN_ID, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, "; dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, ";
...@@ -1849,8 +1849,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1849,8 +1849,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'G' as LINE_TYPE," ;// -- G – Goods, S – Serice +" 'G' as LINE_TYPE," ;// -- G – Goods, S – Serice
// +" si.hsn_no as GS_CODE, "; // +" si.hsn_no as GS_CODE, ";
/*changed by kaustubh on 19-07-2017*/ changed by kaustubh on 19-07-2017
/*+" tx.TAXABLE_AMT as TAXABLE_AMT," +" tx.TAXABLE_AMT as TAXABLE_AMT,"
+" case when t.tax_type = 'I' then tx.tax_perc else 0 end as IGST_PERC," +" case when t.tax_type = 'I' then tx.tax_perc else 0 end as IGST_PERC,"
//-- sum(case when t.tax_type = 'I' then tx.tax_amt else 0 end) as IGST_AMT, //-- sum(case when t.tax_type = 'I' then tx.tax_amt else 0 end) as IGST_AMT,
+" (case when t.tax_type = 'I' then tx.tax_amt else 0 end) as IGST_AMT," +" (case when t.tax_type = 'I' then tx.tax_amt else 0 end) as IGST_AMT,"
...@@ -1859,10 +1859,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1859,10 +1859,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" (case when t.tax_type = 'H' then tx.tax_amt else 0 end) as CGST_AMT," +" (case when t.tax_type = 'H' then tx.tax_amt else 0 end) as CGST_AMT,"
+" case when t.tax_type = 'G' then tx.tax_perc else 0 end as SGST_PERC," +" case when t.tax_type = 'G' then tx.tax_perc else 0 end as SGST_PERC,"
//--sum(case when t.tax_type = 'G' then tx.tax_amt else 0 end) as SGST_AMT, //--sum(case when t.tax_type = 'G' then tx.tax_amt else 0 end) as SGST_AMT,
+" (case when t.tax_type = 'G' then tx.tax_amt else 0 end) as SGST_AMT,"*/ +" (case when t.tax_type = 'G' then tx.tax_amt else 0 end) as SGST_AMT,"
/* changed by kaustubh on 28 july 2017*/ changed by kaustubh on 28 july 2017
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql +"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE," dtlSql = dtlSql +"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
...@@ -1890,7 +1890,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1890,7 +1890,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql dtlSql = dtlSql
/*
+ "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE," + "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
...@@ -1898,26 +1898,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1898,26 +1898,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC," + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,"*/ + "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,"
// +" item.sh_descr GS_DESCR," commented by kaustubh on 28 july // +" item.sh_descr GS_DESCR," commented by kaustubh on 28 july
// +" accounts.descr as GS_DESCR," // +" accounts.descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
/* +" u.descr as UNIT,"*/ +" u.descr as UNIT,"
+" '1' as UNIT," +" '1' as UNIT,"
//--sum(it.quantity__stduom) as QUANTITY, //--sum(it.quantity__stduom) as QUANTITY,
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
/*changed by kaustubh on 19-07-2017*/ changed by kaustubh on 19-07-2017
/* +" case when t.tax_type = 'J' then tx.tax_perc else 0 end as CESS_PERC," +" case when t.tax_type = 'J' then tx.tax_perc else 0 end as CESS_PERC,"
//--sum(case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT, //--sum(case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT,
+" (case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT," +" (case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT,"
*/
/* changed by kaustubh on 28 july 2017*/
changed by kaustubh on 28 july 2017
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_gp_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id,CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1)), CAST('RCM' AS CHAR(3))) AS CESS_PERC," dtlSql = dtlSql + "fn_gst_rate_gp_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id,CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1)), CAST('RCM' AS CHAR(3))) AS CESS_PERC,"
...@@ -1933,8 +1933,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1933,8 +1933,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
dtlSql = dtlSql dtlSql = dtlSql
/* +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"*/ +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ,"; +" '' as REMARKS ,";
//+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate " //+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -1946,25 +1946,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1946,25 +1946,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql +" fn_get_gst_gp_rate('M-VOUC',i.tran_id, it.line_no,'RCM') as gst_rate "; dtlSql = dtlSql +" fn_get_gst_gp_rate('M-VOUC',i.tran_id, it.line_no,'RCM') as gst_rate ";
} }
dtlSql = dtlSql dtlSql = dtlSql
/*changed by kaustubh on 19-07-2017*/ changed by kaustubh on 19-07-2017
/*+" from misc_voucher i,misc_vouchdet it,taxtran tx, siteitem si, tax t, item item,uom u " */ +" from misc_voucher i,misc_vouchdet it,taxtran tx, siteitem si, tax t, item item,uom u "
// +" from misc_voucher i,misc_vouchdet it, item item " // +" from misc_voucher i,misc_vouchdet it, item item "
+" from misc_voucher i,misc_vouchdet it, accounts " +" from misc_voucher i,misc_vouchdet it, accounts "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/*changed by kaustubh on 19-07-2017*/ changed by kaustubh on 19-07-2017
/* +" and si.site_code = i.site_code " +" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "
// +" and item.item_code = it.item_code " // +" and item.item_code = it.item_code "
+" and accounts.acct_code=it.acct_code " +" and accounts.acct_code=it.acct_code "
/*changed by kaustubh on 19-07-2017*/ changed by kaustubh on 19-07-2017
/* +" and t.tax_code = tx.tax_code " +" and t.tax_code = tx.tax_code "
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'VOUCH' " +" and tx.tran_code = 'VOUCH' "
+" and tx.tran_id = i.tran_id " +" and tx.tran_id = i.tran_id "
+" and tx.line_no = it.line_no" +" and tx.line_no = it.line_no"
+" and t.TAX_GROUP = 'RCM' ";*/ +" and t.TAX_GROUP = 'RCM' ";
/*changed by kaustubh on 21-07-2017 / 3 aug */ changed by kaustubh on 21-07-2017 / 3 aug
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code " +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'M-VOUC' " +"and ti.tran_code = 'M-VOUC' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
...@@ -1985,19 +1985,19 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1985,19 +1985,19 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
//+" and tx.tax_class not in ("+taxClassStr+") " //+" and tx.tax_class not in ("+taxClassStr+") "
/*changed by kaustubh on 21-07-2017 / 3 aug */ changed by kaustubh on 21-07-2017 / 3 aug
/* if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") "; dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") ";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? ";*/ +" and i.tran_id = ? ";
/*changed by kaustubh on 19-07-2017*/ changed by kaustubh on 19-07-2017
/*+" and u.unit = item.unit ";*/ +" 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','' //--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,"4(B) M-VOUC"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(B) M-VOUC");*/
/************* 5A started ****************/ /************* 5A started ****************/
/** /**
......
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