Commit 6da8d943 authored by pchavan's avatar pchavan

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@172460 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f0ca9f2e
...@@ -9439,7 +9439,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9439,7 +9439,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.STATE_CODE " +" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'VOUCH' and ti.tran_id = i.tran_id " // +" and ti.tran_code = 'VOUCH' and ti.tran_id = i.tran_id " changes on 27 oct 2017
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id "
+" and tm.TAX_GROUP IN ('ITC','NITC') " +" and tm.TAX_GROUP IN ('ITC','NITC') "
+" and tm.tax_type in ('G','H','I','J')"; +" and tm.tax_type in ('G','H','I','J')";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
...@@ -9818,7 +9819,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9818,7 +9819,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and state.state_code = c.STATE_CODE " //+" and state.state_code = c.STATE_CODE "
//+" and c.tax_reg_2 <> 'UNREGISTER' " //+" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'VOUCH' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')"; // +" and ti.tran_code = 'VOUCH' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')";
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')";
if(GST_PURSEZWP_TAXCLASS.length() > 0) if(GST_PURSEZWP_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURSEZWP_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURSEZWP_TAXCLASS+") ";
...@@ -9922,11 +9924,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9922,11 +9924,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+"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 ))
{ {
dtlSql = dtlSql +"fn_get_gst_rate('VOUCH',i.tran_id,CAST(it.line_no as char(3))) as gst_rate "; dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
} }
else else
{ {
dtlSql = dtlSql +"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate "; dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate ";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" from misc_voucher i,misc_vouchdet it, item item " +" from misc_voucher i,misc_vouchdet it, item item "
...@@ -10189,7 +10191,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10189,7 +10191,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and state.state_code = c.STATE_CODE " //+" and state.state_code = c.STATE_CODE "
//+" and c.tax_reg_2 <> 'UNREGISTER' " //+" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'VOUCH' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')"; +" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')";
if(GST_PURSEZWOP_TAXCLASS.length() > 0) if(GST_PURSEZWOP_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURSEZWOP_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURSEZWOP_TAXCLASS+") ";
...@@ -10560,7 +10562,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10560,7 +10562,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and state.state_code = c.STATE_CODE " //+" and state.state_code = c.STATE_CODE "
//+" and c.tax_reg_2 <> 'UNREGISTER' " //+" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'VOUCH' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')"; +" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')";
if(GST_PURDE_TAXCLASS.length() > 0) if(GST_PURDE_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURDE_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURDE_TAXCLASS+") ";
...@@ -10929,7 +10931,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10929,7 +10931,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.STATE_CODE " +" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'VOUCH' and ti.tran_id = i.tran_id " +" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id "
// +" and tm.tax_group in ('ITC','RCM') " commented on 14 aug // +" and tm.tax_group in ('ITC','RCM') " commented on 14 aug
+" and tm.tax_type in ('G','H','I') "; +" and tm.tax_type in ('G','H','I') ";
if(GST_RCM_TAXCLASS.length() > 0) if(GST_RCM_TAXCLASS.length() > 0)
...@@ -10952,7 +10954,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10952,7 +10954,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' "; hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
} }
hdrSql = hdrSql */ hdrSql = hdrSql */
+" 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 = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";
/** /**
...@@ -19020,6 +19022,209 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -19020,6 +19022,209 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"3(A)VOUC-GRN"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"3(A)VOUC-GRN");
/**
* 3 M-VOUCH Header Voucher*
*/
hdrSql = " select '' as TRAN_ID,"
/*+" 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 , "
+ "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'R' as GST_TYPE,"
+" '01' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE,"
+" c.supp_name 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
+"case when i.gp_no is null then i.tran_id else i.gp_no end as DOC_NO,"
+" i.tran_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,"
+" 'Y' as REVERSE_CHRG,"
+" ' ' as LR_NO,"
// +" null as LR_DATE," \
+" ' ' 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
//+" i.tran_id as REMARKS,"
+" s.site_code as REMARKS, " // on 9 aug
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS,"
// +" null SUBMIT_DATE,"
+" '' ADD_USER,"
// +" sysdate ADD_DATE,"
+" '' ADD_TERM,"
+" ' ' CHG_USER,"
// +" sysdate CHG_DATE,"
+" ' 'CHG_TERM,"
+" c.tax_reg_2 as TAX_REG_NO,"
+" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO,"
+" 'M-VOUC' as ref_ser"
+" from misc_voucher i,supplier c, site s, state state "
+" where c.supp_code = i.sundry_code "
+" and s.site_code = i.site_code "
+" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id "
+" and tm.TAX_GROUP IN ('ITC','NITC') "
+" 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 i.tran_date between ? and ? "
/* if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
}
hdrSql = hdrSql */
+" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";
/**
* Detail MISC-Voucher 3(A) M-VOUC *
*/
dtlSql = " select '' as TRAN_ID, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, ";
}
else
{
dtlSql = dtlSql +" to_number(trim(it.line_no)) as LINE_NO, ";
}
dtlSql = dtlSql +" 'A' as STATUS," // -- M – Modification, A – Accept D – Delete
+" 0 as SR_NO__OLD,"
// +" 'G' as LINE_TYPE," ;// -- G – Goods, S – Serice
+" case when it.item_code is null then 'S' else 'G' end as LINE_TYPE, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
//dtlSql = dtlSql; //+"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
}
else
{
//dtlSql = dtlSql
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
// + "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE,"
// +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
// +" item.descr as GS_DESCR,"
// +" accounts.sac_no as GS_DESCR, "
+" ' ' as GS_DESCR, "
// +" item.UNIT as UNIT,"
+" 'NA' as UNIT, "
+" (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('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))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS ,"
+" 'is' as ITC_TYPE , ";
// +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
+" from misc_voucher i,misc_vouchdet it, item item "
// +" from misc_voucher i,misc_vouchdet it,accounts "
+" where i.tran_id = it.tran_id "
+" and item.item_code = it.item_code "
// +"and accounts.acct_code=it.acct_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_id = i.tran_id "
+ " and tx.tax_group IN ('ITC') "
+"and tx.tax_type in ('G','H','I','J')" ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0";
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
}
else
{
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
}
dtlSql = dtlSql
+" and i.tran_id = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"3(A) M-VOUC");
/* 3(A) ---B2B Export to SEZ with payment 3(A) SEWP */ /* 3(A) ---B2B Export to SEZ with payment 3(A) SEWP */
...@@ -19032,7 +19237,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -19032,7 +19237,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+ " i.tran_date as PRD_CODE," + " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE, " +" '2' as REC_TYPE, "
+" 'I' as GST_TYPE," +" 'I' as GST_TYPE,"
+" '01' as TRAN_TYPE," +" '02' as TRAN_TYPE,"
+" i.supp_code as CUST_CODE, " +" i.supp_code as CUST_CODE, "
+" c.supp_name as CUST_NAME, " +" c.supp_name as CUST_NAME, "
+" state.GST_CODE, " +" state.GST_CODE, "
...@@ -19189,7 +19394,207 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -19189,7 +19394,207 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A)SEWP-GRN"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A)SEWP-GRN");
/**
* 3(a) MIS-VOUCH Header B2B Export to SEZ with payment *
*/
hdrSql = " select '' as TRAN_ID, "
/*+" to_date(i.GP_DATE) as TRAN_DATE, "*/
+" '' 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 , "
+ " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE, "
+" 'I' as GST_TYPE,"
+" '02' as TRAN_TYPE,"
+" i.sundry_code as CUST_CODE, "
+" c.supp_name as CUST_NAME, "
+" state.GST_CODE, "
+" '' as SUBMISSION_TYPE,"
+" '' as DOC_CHECKSUM,"
+" 'SEWP' as DOC_TYPE, "
/*+" 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.tran_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, "
// +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, "
+" ' ' as REF_ID__INV, "
// +" null REF_DATE__INV, "
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" ' ' as ORDER_NO,"
// +" null as ORDER_DATE, "
//+" i.invoice_id as REMARKS, "
+" s.site_code as REMARKS, " // 9 aug
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS, "
// +" null SUBMIT_DATE, "
+" '' ADD_USER, "
// +" sysdate as ADD_DATE, "
+" '' ADD_TERM, "
+" ' ' CHG_USER, "
// +" sysdate CHG_DATE, "
+" ' 'CHG_TERM, "
+" c.tax_reg_2 as TAX_REG_NO, "
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'M-VOUC' as ref_ser "
+" from misc_voucher i,supplier c, site s, state state "
+" where c.supp_code = i.sundry_code "
+" and i.sundry_type = 'S' "
+" and s.site_code = i.site_code "
+" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 <> 'UNREGISTER' "
//+" from voucher i,supplier c, site s, state state"
//+" where c.supp_code = i.supp_code "
//+" and s.site_code = i.site_code "
//+" and state.state_code = c.STATE_CODE "
//+" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')";
if(GST_PURSEZWP_TAXCLASS.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURSEZWP_TAXCLASS+") ";
}
if(GST_PURSEZWP_TAXENV.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURSEZWP_TAXENV+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? "
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
}
hdrSql = hdrSql */
+" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";
/**
* Detail ---B2B Export to SEZ with payment 3(A) SEWP *
*/
dtlSql = " select '' as TRAN_ID, "
+" it.line_no as LINE_NO, "
+" 'A' as STATUS, "
+" 0 as SR_NO__OLD, "
//+" 'G' as LINE_TYPE,";
+" case when it.item_code is null then 'S' else 'G' end as LINE_TYPE";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
//dtlSql = dtlSql //+"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
//+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), 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,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
//+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
//+" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, "
/*+" u.descr 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, "
+" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql + "fn_gst_rate_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))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS ,"
+" 'is' as ITC_TYPE , ";
//+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
+" from misc_voucher i,misc_vouchdet it, item item "
// +" from voucher i,vouchrcp it, item item "
+" where i.tran_id = it.tran_id "
+" and item.item_code = it.item_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_id = i.tran_id "
+"and tx.TAX_GROUP = 'RCM' "
+"and tx.tax_type in ('G','H','I','J')" ;
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 = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A) SEWP(M-VOUC)");
/** /**
* 3(A) SEWOP Header (porcp)--- B2B Export to SEZ without payment * * 3(A) SEWOP Header (porcp)--- B2B Export to SEZ without payment *
...@@ -19360,8 +19765,208 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -19360,8 +19765,208 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A) SEWOP-GRN"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A) SEWOP-GRN");
/**
* 3(A) SEWOP Header (MIS-VOUCHER)--- B2B Export to SEZ without payment *
*/
hdrSql = " select '' as TRAN_ID, "
/*+" to_date(i.GP_DATE) as TRAN_DATE, "*/
+" '' 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 ,"
+ "i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE, "
+" 'I' as GST_TYPE,"
+" '03' as TRAN_TYPE,"
+" i.sundry_code as CUST_CODE, "
+" c.supp_name as CUST_NAME, "
+" state.GST_CODE, "
+" '' as SUBMISSION_TYPE,"
+" '' as DOC_CHECKSUM,"
+" 'SEWOP' as DOC_TYPE, "
/*+" 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.tran_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, "
// +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, "
+" ' ' as REF_ID__INV, "
// +" null REF_DATE__INV, "
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" ' ' as ORDER_NO,"
// +" null as ORDER_DATE, "
//+" i.invoice_id as REMARKS, "
+" s.site_code as REMARKS, "
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS, "
// +" null SUBMIT_DATE, "
+" '' ADD_USER, "
// +" sysdate as ADD_DATE, "
+" '' ADD_TERM, "
+" ' ' CHG_USER, "
// +" sysdate CHG_DATE, "
+" ' 'CHG_TERM, "
+" c.tax_reg_2 as TAX_REG_NO, "
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'M-VOUC' as ref_ser "
+" from misc_voucher i,supplier c, site s, state state "
+" where c.supp_code = i.sundry_code "
+" and i.sundry_type = 'S' "
+" and s.site_code = i.site_code "
+" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 <> 'UNREGISTER' "
//+" from voucher i,supplier c, site s, state state"
//+" where c.supp_code = i.supp_code "
//+" and s.site_code = i.site_code "
//+" and state.state_code = c.STATE_CODE "
//+" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')";
if(GST_PURSEZWOP_TAXCLASS.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURSEZWOP_TAXCLASS+") ";
}
if(GST_PURSEZWOP_TAXENV.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURSEZWOP_TAXENV+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? "
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
}
hdrSql = hdrSql */
+" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";
/**
* Detail ---B2B Export to SEZ with payment 3(A) SEWP (MISC-VOUCHER) *
*/
dtlSql = " select '' as TRAN_ID, "
+" it.line_no as LINE_NO, "
+" 'A' as STATUS, "
+" 0 as SR_NO__OLD, "
//+" 'G' as LINE_TYPE,";
+"case when it.item_code is null then 'S' else 'G' end as LINE_TYPE ,";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
//dtlSql = dtlSql //+"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
//+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), 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,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
// +" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, "
/*+" u.descr as UNIT,"*/
+"item.UNIT as UNIT,"
+" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql + "fn_gst_rate_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))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS ,"
+" 'is' as ITC_TYPE , " ;
// +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate "
// +" from misc_voucher i,misc_vouchdet it, item item ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
// +" from voucher i,vouchrcp it, item item "
+" from misc_voucher i,misc_vouchdet it, item item "
+" where i.tran_id = it.tran_id "
+" and item.item_code = it.item_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_id = i.tran_id "
+"and tx.TAX_GROUP = 'RCM' "
+"and tx.tax_type in ('G','H','I','J')" ;
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 = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A) SEWOP(M-VOUC)");
/** /**
* 3(A) DE--Header (VOUCHER) 3A---B2B Deemed Exports* * 3(A) DE--Header (VOUCHER) 3A---B2B Deemed Exports*
*/ */
...@@ -19532,7 +20137,207 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -19532,7 +20137,207 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A) DE-GRN"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A) DE-GRN");
/**
* 3(A) DE--Header (MISC-VOUCHER) 3A---B2B Deemed Exports**
*/
hdrSql = " select '' as TRAN_ID, "
/*+" to_date(i.GP_DATE) as TRAN_DATE, "*/
+" '' 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 ,"
+ " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE, "
+" 'I' as GST_TYPE,"
+" '04' as TRAN_TYPE,"
+" i.sundry_code as CUST_CODE, "
+" c.supp_name as CUST_NAME, "
+" state.GST_CODE, "
+" '' as SUBMISSION_TYPE,"
+" '' as DOC_CHECKSUM,"
+" 'DE' as DOC_TYPE, "
/*+" 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.tran_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, "
// +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, "
+" ' ' as REF_ID__INV, "
// +" null REF_DATE__INV, "
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" ' ' as ORDER_NO,"
// +" null as ORDER_DATE, "
//+" i.invoice_id as REMARKS, "
+" s.site_code as REMARKS, "
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS, "
// +" null SUBMIT_DATE, "
+" '' ADD_USER, "
// +" sysdate as ADD_DATE, "
+" '' ADD_TERM, "
+" ' ' CHG_USER, "
// +" sysdate CHG_DATE, "
+" ' 'CHG_TERM, "
+" c.tax_reg_2 as TAX_REG_NO, "
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'M-VOUC' as ref_ser "
+" from misc_voucher i,supplier c, site s, state state "
+" where c.supp_code = i.sundry_code "
+" and i.sundry_type = 'S' "
+" and s.site_code = i.site_code "
+" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 <> 'UNREGISTER' "
//+" from voucher i,supplier c, site s, state state"
//+" where c.supp_code = i.supp_code "
//+" and s.site_code = i.site_code "
//+" and state.state_code = c.STATE_CODE "
//+" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')";
if(GST_PURDE_TAXCLASS.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURDE_TAXCLASS+") ";
}
if(GST_PURDE_TAXENV.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_PURDE_TAXENV+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? "
/* if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
}
hdrSql = hdrSql */
+" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";
/**
* Detail ---B2B 3A-- Deemed Exports (MISC-VOUCHER) *
*/
dtlSql = " select '' as TRAN_ID, "
+" it.line_no as LINE_NO, "
+" 'A' as STATUS, "
+" 0 as SR_NO__OLD, "
// +" 'G' as LINE_TYPE,";
+"case when it.item_code is null then 'S' else 'G' end as LINE_TYPE ,";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
//dtlSql = dtlSql //+"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
// +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , 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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
// +" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, "
/*+" u.descr as UNIT,"*/
+"item.UNIT as UNIT,"
+" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, , CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS ,"
+" 'is' as ITC_TYPE , ";
//+"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
+" from misc_voucher i,misc_vouchdet it, item item "
// +" from voucher i,vouchrcp it, item item "
+" where i.tran_id = it.tran_id "
+" and item.item_code = it.item_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_id = i.tran_id "
+"and tx.TAX_GROUP = 'RCM' "
+"and tx.tax_type in ('G','H','I','J')" ;
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 = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(3A) DE(M-VOUC)");
/******* 4A started ********/ /******* 4A started ********/
/** /**
...@@ -19709,7 +20514,205 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -19709,7 +20514,205 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(4A) B2B-GRN"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(4A) B2B-GRN");
/**
* 4(a) B2B supplies M-VOUC *
*/
hdrSql = " select '' as TRAN_ID, "
/*+" to_date(i.GP_DATE) as TRAN_DATE, "*/
+" '' 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 ,"
+ " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE, "
+" 'I' as GST_TYPE,"
+" '05' as TRAN_TYPE,"
+" i.sundry_code as CUST_CODE, "
+" c.supp_name as CUST_NAME, "
+" state.GST_CODE, "
+" '' as SUBMISSION_TYPE,"
+" '' as DOC_CHECKSUM,"
+" 'SEWP' as DOC_TYPE, "
/*+" 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.tran_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, "
// +" i.lr_date as LR_DATE,"
+" ' ' as REAS_CODE, "
+" ' ' as REF_ID__INV, "
// +" null REF_DATE__INV, "
+" 'N' as PROV_ASSMNT, "
//+" i.stan_code__init as ORDER_NO,"
+" ' ' as ORDER_NO,"
// +" null as ORDER_DATE, "
//+" i.invoice_id as REMARKS, "
+" 's.site_code' as REMARKS, " // on 9 aug
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS, "
// +" null SUBMIT_DATE, "
+" '' ADD_USER, "
// +" sysdate as ADD_DATE, "
+" '' ADD_TERM, "
+" ' ' CHG_USER, "
// +" sysdate CHG_DATE, "
+" ' 'CHG_TERM, "
+" c.tax_reg_2 as TAX_REG_NO, "
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'M-VOUC' as ref_ser "
+" from misc_voucher i,supplier c, site s, state state "
+" where c.supp_code = i.sundry_code "
+" and i.sundry_type = 'S' "
+" and s.site_code = i.site_code "
+" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 <> 'UNREGISTER' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id "
// +" and tm.tax_group in ('ITC','RCM') " commented on 14 aug
+" and tm.tax_type in ('G','H','I') ";
if(GST_RCM_TAXCLASS.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_class in ("+GST_RCM_TAXCLASS+") ";
}
if(GST_RCM_TAXENV.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_RCM_TAXENV+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? "
/* if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) commented on 10 aug.
{
hdrSql = hdrSql +" and i.tran_date < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
}
hdrSql = hdrSql */
+" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";
/**
* Detail --- B2B supplies M-VOUC *
*/
dtlSql = " select '' as TRAN_ID, "
+" it.line_no as LINE_NO, "
+" 'A' as STATUS, "
+" 0 as SR_NO__OLD, "
//+" 'G' as LINE_TYPE,";
+"case when it.item_code is null then 'S' else 'G' end as LINE_TYPE , ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
//dtlSql = dtlSql //+"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
//+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' 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('M-VOUC' 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('M-VOUC' 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('M-VOUC' 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('M-VOUC' 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('M-VOUC' 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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
//+" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, "
/*+" u.descr as UNIT,"*/
+"item.UNIT as UNIT,"
+" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql + "fn_gst_rate_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))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS ,"
+" 'is' as ITC_TYPE , ";
// +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
+" from misc_voucher i,misc_vouchdet it, item item "
+" where i.tran_id = it.tran_id "
+" and item.item_code = it.item_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_id = i.tran_id "
// +" and tx.TAX_GROUP <> 'NITC' " commented on 14 aug
// +" and tx.TAX_GROUP = 'RCM' "
+" and tx.tax_type in ('G','H','I','J')" ;
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 = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"(4A) B2B");
/******* 4B started Inward supplies received from an unregistered supplier********/ /******* 4B started Inward supplies received from an unregistered supplier********/
/** /**
...@@ -19895,6 +20898,192 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -19895,6 +20898,192 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(B) P-RCP-GRN"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(B) P-RCP-GRN");
/**
* 4(B) M-VOUC Header MISC-Voucher *
*/
hdrSql = " select '' as TRAN_ID,"
/*+" to_date(i.gp_date) as TRAN_DATE,"*/
+" '' 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 ,"
+ " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'U' as GST_TYPE,"
+" '06' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE,"
+" c.supp_name 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
/*+" 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.tran_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,"
+" 'Y' as REVERSE_CHRG,"
+" ' ' as LR_NO,"
// +" null as LR_DATE,"
+" ' ' as REAS_CODE,"
+" ' ' as REF_ID__INV,"
// +" null REF_DATE__INV,"
+" 'N' as PROV_ASSMNT,"// -- not required
+" '' as ORDER_NO,"// -- not required
// +" null as ORDER_DATE,"// -- not required
//+" i.tran_id as REMARKS,"
+" s.site_code as REMARKS, "
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS,"
// +" null SUBMIT_DATE,"
+" '' ADD_USER,"
// +" sysdate ADD_DATE,"
+" '' ADD_TERM,"
+" ' ' CHG_USER,"
// +" sysdate CHG_DATE,"
+" ' 'CHG_TERM,"
+" c.tax_reg_2 as TAX_REG_NO,"
+" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO,"
+" 'M-VOUC' as ref_ser"
+" from misc_voucher i,supplier c, site s, state state "
+" where c.supp_code = i.sundry_code "
+" and i.sundry_type = 'S' "
+" and s.site_code = i.site_code "
+" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 = 'UNREGISTER' "
+" and (select count(1) from taxtran ti,tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id ";
if(GST_RCM_TAXCLASS.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_class in ("+GST_RCM_TAXCLASS+") ";
}
if(GST_RCM_TAXENV.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_RCM_TAXENV+") ";
}
//hdrSql = hdrSql +" and tm.tax_group = 'RCM' ) = 0 "
hdrSql = hdrSql +" and tm.tax_group = 'RCM' ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" 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 ";
/**
* Detail MISC-Voucher 4(B) M-VOUC *
*/
dtlSql = " select '' as TRAN_ID, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, ";
}
else
{
dtlSql = dtlSql +" to_number(trim(it.line_no)) as LINE_NO, ";
}
dtlSql = dtlSql +" 'A' as STATUS," // -- M – Modification, A – Accept D – Delete
+" 0 as SR_NO__OLD,"
// +" 'G' as LINE_TYPE," ;// -- G – Goods, S – Serice
+"case when it.item_code is null then 'S' else 'G' end as LINE_TYPE ,";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
//dtlSql = dtlSql //+"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
//+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), 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,"
System.out.println("misc_vouch_code::"+MISC_VOUC_TYPE);
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
//+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
// +" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, "
/* +" u.descr as UNIT,"*/
+" item.UNIT as UNIT,"
+" (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('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))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS ,"
+" 'is' as ITC_TYPE , ";
//+"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
+" from misc_voucher i,misc_vouchdet it, item item "
+" where i.tran_id = it.tran_id "
+" and item.item_code = it.item_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_id = i.tran_id "
+" and tx.TAX_GROUP IN ('ITC') "
+"and tx.tax_type in ('G','H','I','J')) > 0 " ;
if(taxClassAllStr.length() > 0)
{
dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") ";
}
dtlSql = dtlSql
+" and i.tran_id = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(B) M-VOUC");
/*** --- 4(C) IMP_S Import of Service ****/ /*** --- 4(C) IMP_S Import of Service ****/
...@@ -19903,7 +21092,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -19903,7 +21092,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' 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 ,"
// + " case when i.conf_date is null then i.tran_date else i.conf_date end as PRD_CODE," // + " case when i.conf_date is null then i.tran_date else i.conf_date end as PRD_CODE,"
+ " i.tran_date as PRD_CODE," + " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
...@@ -20009,71 +21198,265 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -20009,71 +21198,265 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
else else
{ {
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,"
+" fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," +" fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC," +"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT," +"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC," +"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT," +"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC," +"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,"; +"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
//+" item.sh_descr as GS_DESCR,"
+" ' ' as GS_DESCR, "
+" item.UNIT as UNIT,"
+" it.quantity as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('P-RCP' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('P-RCP' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS, "
+" 'ig' as ITC_TYPE , ";
// +" fn_get_gst_rate('P-RCP',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('P-RCP',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('P-RCP',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
// +"from voucher i,vouchrcp it, item "
+"from porcp i,porcpdet it, item "
+" where i.tran_id = it.tran_id "
+" and item.item_code = it.item_code "
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'P-RCP' "
+"and ti.tran_id = i.tran_id "
+ " and tx.tax_group IN ('ITC') "
+"and tx.tax_type in ('G','H','I','J')" ;
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 +" 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 = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(C) VOUC-GRN");
/*********** 4C. Import of Service M- VOUCH ************/
hdrSql = " select '' as TRAN_ID,"
/*+" 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 ,"
+ " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'S' as GST_TYPE,"
+" '07' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE,"
+" c.supp_name 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
+"case when i.gp_no is null then i.tran_id else i.gp_no end as DOC_NO,"
+" i.tran_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,"
+" 'Y' as REVERSE_CHRG,"
+" ' ' as LR_NO,"
// +" null as LR_DATE," \
+" ' ' 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
//+" i.tran_id as REMARKS,"
+" s.site_code as REMARKS, "
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS,"
// +" null SUBMIT_DATE,"
+" '' ADD_USER,"
// +" sysdate ADD_DATE,"
+" '' ADD_TERM,"
+" ' ' CHG_USER,"
// +" sysdate CHG_DATE,"
+" ' 'CHG_TERM,"
+" c.tax_reg_2 as TAX_REG_NO,"
+" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO,"
+" 'M-VOUC' as ref_ser"
+" from misc_voucher i,supplier c, site s, state state "
+" where c.supp_code = i.sundry_code "
+" and s.site_code = i.site_code "
+" and state.state_code = c.STATE_CODE "
+" and c.tax_reg_2 <> 'UNREGISTER' "
/*+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I') ) = 0"*/
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I')";
if(GST_IMPSER_TAXCLASS.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_class in ("+GST_IMPSER_TAXCLASS+") ";
}
if(GST_IMPSER_TAXENV.length() > 0)
{
hdrSql = hdrSql +" and ti.tax_env in ("+GST_IMPSER_TAXENV+") ";
}
hdrSql = hdrSql +" ) > 0 "
+" and i.tran_date between ? and ? "
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +" and i.date_adv < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and i.tran_date < '"+strDate+"' ";
}
hdrSql = hdrSql */
+" and (select count(1) from gst_data_hdr where ref_ser = 'M-VOUC' and ref_id = i.tran_id ) = 0 ";
/** Detail MISC-Voucher 4(C) M-VOUC */
dtlSql = " select '' as TRAN_ID, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, ";
}
else
{
dtlSql = dtlSql +" to_number(trim(it.line_no)) as LINE_NO, ";
}
dtlSql = dtlSql +" 'A' as STATUS," // -- M – Modification, A – Accept D – Delete
+" 0 as SR_NO__OLD,"
+" 'G' as LINE_TYPE," // -- G – Goods, S – Serice
+"case when it.item_code is null then 'S' else 'G' end as LINE_TYPE ,";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
//dtlSql = dtlSql //+"fn_get_hsn_no(i.site_code,it.item_code) AS GS_CODE,"
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
//+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
}
else
{
//dtlSql = dtlSql
if ("A".equalsIgnoreCase(MISC_VOUC_TYPE))
{
dtlSql = dtlSql +"i.anal_code as GS_CODE,";
}
else
{
dtlSql = dtlSql +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,";
}
dtlSql = dtlSql
//+ "fn_get_hsn_no(i.site_code,it.item_code) as GS_CODE,"
+"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
//+" item.sh_descr as GS_DESCR," //+" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
+" item.UNIT as UNIT," +" item.UNIT as UNIT,"
+" it.quantity as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('P-RCP' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC," dtlSql = dtlSql + "fn_gst_rate_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))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('P-RCP' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,"; +"fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
} }
else else
{ {
dtlSql = dtlSql +"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," dtlSql = dtlSql +"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('P-RCP',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"; +"fn_gst_rate_amt('M-VOUC',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' as REMARKS, " +" '' as REMARKS ,"
+" 'ig' as ITC_TYPE , "; +" 'is' as ITC_TYPE , ";
// +" fn_get_gst_rate('P-RCP',i.tran_id, it.line_no) as gst_rate " //+"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate "
//+" from misc_voucher i,misc_vouchdet it, item item "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql +"fn_get_gst_rate('P-RCP',i.tran_id,CAST(it.line_no as char(3))) as gst_rate "; dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
} }
else else
{ {
dtlSql = dtlSql +"fn_get_gst_rate('P-RCP',i.tran_id, it.line_no) as gst_rate "; dtlSql = dtlSql +"fn_get_gst_rate('M-VOUC',i.tran_id, it.line_no) as gst_rate ";
} }
dtlSql = dtlSql dtlSql = dtlSql
// +"from voucher i,vouchrcp it, item " +" from misc_voucher i,misc_vouchdet it, item item "
+"from porcp i,porcpdet it, item "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
+" and item.item_code = it.item_code " +" and item.item_code = it.item_code "
+"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 = 'P-RCP' " +"and ti.tran_code = 'M-VOUC' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
+ " and tx.tax_group IN ('ITC') " // + " and tx.tax_group <> 'NITC' "
+ " and tx.tax_group IN ('ITC') "
+"and tx.tax_type in ('G','H','I','J')" ; +"and tx.tax_type in ('G','H','I','J')" ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if(taxClassAllStr.length() > 0)
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStrOfPurchase+"))>0 ";
dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0"; }
}
else
{
//dtlSql = dtlSql +" to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
}
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? ";
+" and i.tran_id = ? "; retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(C) M-VOUC");
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"4(C) VOUC-GRN");
/******* 5(A) started ********/ /******* 5(A) started ********/
/** /**
...@@ -22693,6 +24076,327 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -22693,6 +24076,327 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"10A(2)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"10A(2)");
/**
* --- HEADER 10B(3). Advance adjust through payment intra-state*
*/
hdrSql = " select '' as TRAN_ID,"
/*+" to_date(i.gp_date) as TRAN_DATE,"*/
+" '' 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, "
// +" ddf_get_siteregno(s.site_code,'OPRTNG_SITE') AS SITE_CODE ,"
+" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE ,"
+ " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'T' as GST_TYPE,"
+" '16' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE,"
+" c.supp_name 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
+"i.tran_id as DOC_NO,"
+"i.tran_date as DOC_DATE,"
+" i.NET_AMT__BC as AMOUNT,"
+" 'Y' as REVERSE_CHRG,"
+" ' ' as LR_NO,"
// +" null as LR_DATE,"
+" ' ' as REAS_CODE,"
+" ' ' as REF_ID__INV,"
// +" null REF_DATE__INV,"
+" 'N' as PROV_ASSMNT,"// -- not required
+" '' as ORDER_NO,"// -- not required
// +" null as ORDER_DATE,"// -- not required
//+" i.tran_id as REMARKS,"
+" s.site_code as REMARKS, "
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS,"
// +" null SUBMIT_DATE,"
+" '' ADD_USER,"
// +" sysdate ADD_DATE,"
+" '' ADD_TERM,"
+" ' ' CHG_USER,"
// +" sysdate CHG_DATE,"
+" ' 'CHG_TERM,"
+" c.tax_reg_2 as TAX_REG_NO, "
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'M-PAY' as ref_ser "
+"from misc_payment i,supplier c, site s, state "
+"where c.supp_code = i.sundry_code "
+"and i.sundry_type = 'S' "
+"and s.site_code = i.site_code "
+"and state.state_code = c.STATE_CODE "
//+"and c.tax_reg_2 = 'UNREGISTER'"
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-PAY' and ti.tran_id = i.tran_id "
+"and tm.tax_code = ti.tax_code and tm.tax_type in ('G','H','I','J') ) > 0 "
+" and (select count(1) from misc_paydet pd, misc_payables mp "
+" where mp.tran_ser = pd.tran_ser and mp.ref_no = pd.vouch_no and pd.tran_id = i.tran_id "
+" and pd.tran_ser in( 'P-ADV','M-ADV')";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +" and mp.ref_date < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and mp.ref_date < '"+strDate+"' ";
}
hdrSql = hdrSql +") > 0 "
+" and i.tran_date between ? and ? ";
/**
* --- Detail 10B(3). Advance adjust through payment intra-state*
*/
dtlSql = " select '' as TRAN_ID, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, ";
}
else
{
dtlSql = dtlSql +" to_number(trim(it.line_no)) as LINE_NO, ";
}
dtlSql = dtlSql +" 'A' as STATUS," // -- M – Modification, A – Accept D – Delete
+" 0 as SR_NO__OLD,"
+" 'G' as LINE_TYPE,"// -- G – Goods, S – Serice
+"case when it.item_code is null then 'S' else 'G' end as LINE_TYPE ,"
+" ' ' as GS_CODE, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
}
else
{
dtlSql = dtlSql + "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
+" ' ' as GS_DESCR,"
+" ' ' as UNIT,"
+" 0 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('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS ,"
+" 'is' as ITC_TYPE , ";
//+"fn_get_gst_rate('M-PAY',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('M-PAY',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('M-PAY',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
+"from misc_payment i,misc_paydet it "
+" where i.tran_id = it.tran_id "
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code and ti.tran_code = 'M-PAY' "
+" and ti.tran_id = i.tran_id and tx.tax_type in ('G','H','I','J') ";
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 = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"10B(3)");
/**
* --- HEADER 10B(4). Advance adjust through payment inter-state*
*/
hdrSql = " select '' as TRAN_ID,"
/*+" to_date(i.gp_date) as TRAN_DATE,"*/
+" '' 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, "
// +" ddf_get_siteregno(s.site_code,'OPRTNG_SITE') AS SITE_CODE ,"
+" ddf_get_siteregno(s.site_code,'OPTNG_SITE') AS SITE_CODE ,"
+ " i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'T' as GST_TYPE,"
+" '17' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE,"
+" c.supp_name 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
+"i.tran_id as DOC_NO,"
+"i.tran_date as DOC_DATE,"
+" i.NET_AMT__BC as AMOUNT,"
+" 'Y' as REVERSE_CHRG,"
+" ' ' as LR_NO,"
// +" null as LR_DATE,"
+" ' ' as REAS_CODE,"
+" ' ' as REF_ID__INV,"
// +" null REF_DATE__INV,"
+" 'N' as PROV_ASSMNT,"// -- not required
+" '' as ORDER_NO,"// -- not required
// +" null as ORDER_DATE,"// -- not required
//+" i.tran_id as REMARKS,"
+" s.site_code as REMARKS, "
+" i.tran_id as REF_ID, "
+" ' ' as SUBMIT_STATUS,"
// +" null SUBMIT_DATE,"
+" '' ADD_USER,"
// +" sysdate ADD_DATE,"
+" '' ADD_TERM,"
+" ' ' CHG_USER,"
// +" sysdate CHG_DATE,"
+" ' 'CHG_TERM,"
+" c.tax_reg_2 as TAX_REG_NO, "
+" ' ' as RECO_STATUS, "
+" ' ' as ECOM_REG_NO, "
+" 'M-PAY' as ref_ser "
+"from misc_payment i,supplier c, site s, state "
+"where c.supp_code = i.sundry_code "
+"and i.sundry_type = 'S' "
+"and s.site_code = i.site_code "
+"and state.state_code <> c.STATE_CODE "
//+"and c.tax_reg_2 = 'UNREGISTER'"
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'M-PAY' and ti.tran_id = i.tran_id "
+"and tm.tax_code = ti.tax_code and tm.tax_type in ('G','H','I','J') ) > 0 "
+" and (select count(1) from misc_paydet pd, misc_payables mp "
+" where mp.tran_ser = pd.tran_ser and mp.ref_no = pd.vouch_no and pd.tran_id = i.tran_id "
+" and pd.tran_ser in( 'P-ADV','M-ADV')";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +" and mp.ref_date < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and mp.ref_date < '"+strDate+"' ";
}
hdrSql = hdrSql +") > 0 "
+" and i.tran_date between ? and ? ";
/**
* --- Detail 10B(4). Advance adjust through payment inter-state*
*/
dtlSql = " select '' as TRAN_ID, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +" cast(it.line_no as integer) as LINE_NO, ";
}
else
{
dtlSql = dtlSql +" to_number(trim(it.line_no)) as LINE_NO, ";
}
dtlSql = dtlSql +" 'A' as STATUS," // -- M – Modification, A – Accept D – Delete
+" 0 as SR_NO__OLD,"
// +" 'G' as LINE_TYPE,"// -- G – Goods, S – Serice
+" case when it.item_code is null then 'S' else 'G' end as LINE_TYPE, "
+" ' ' as GS_CODE, ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
}
else
{
dtlSql = dtlSql + "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'I', 'R') as IGST_PERC,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'I', 'A') as IGST_AMT,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'H', 'R') as CGST_PERC,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'H', 'A') as CGST_AMT,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'G', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
}
dtlSql = dtlSql
+" ' ' as GS_DESCR,"
+" ' ' as UNIT,"
+" 0 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('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('M-PAY' AS VARCHAR(6)),i.tran_id, CAST(it.line_no as char(3)), CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
}
else
{
dtlSql = dtlSql +"fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('M-PAY',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
}
dtlSql = dtlSql
+" '' as REMARKS ,"
+" 'is' as ITC_TYPE , ";
//+"fn_get_gst_rate('M-PAY',i.tran_id, it.line_no) as gst_rate "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
dtlSql = dtlSql +"fn_get_gst_rate('M-PAY',i.tran_id,CAST(it.line_no as char(3))) as gst_rate ";
}
else
{
dtlSql = dtlSql +"fn_get_gst_rate('M-PAY',i.tran_id, it.line_no) as gst_rate ";
}
dtlSql = dtlSql
+" from misc_payment i,misc_paydet it "
+" where i.tran_id = it.tran_id "
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code and ti.tran_code = 'M-PAY' "
+" and ti.tran_id = i.tran_id and tx.tax_type in ('G','H','I','J') ";
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 = ? ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"10B(4)");
/******* 10B started ********/ /******* 10B 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