Commit f9668994 authored by kdabholkar's avatar kdabholkar

commited new changes of taxes in GSTR2 purchase queries.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106602 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 58924625
...@@ -21,6 +21,8 @@ import java.sql.Timestamp; ...@@ -21,6 +21,8 @@ import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
//import javax.ejb.Stateless;
//import oracle.sql.TIMESTAMP;
import javax.ejb.Stateless; import javax.ejb.Stateless;
...@@ -7536,7 +7538,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7536,7 +7538,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 "
+" and tm.TAX_GROUP = 'ITC' " +" 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(taxClassAllStrOfPurchase.length() > 0) if(taxClassAllStrOfPurchase.length() > 0)
{ {
...@@ -7627,7 +7629,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7627,7 +7629,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"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_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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -7699,7 +7701,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7699,7 +7701,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 "
+" and tm.TAX_GROUP = 'ITC' " +" 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)
{ {
...@@ -7743,26 +7745,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7743,26 +7745,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('M-VOUC' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' 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('R' AS CHAR(1))) AS IGST_PERC, "
+" fn_gst_rate_amt(CAST('VOUCH' 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('I' AS CHAR(1)), CAST('A' AS CHAR(1))) AS IGST_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' 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('R' AS CHAR(1))) AS CGST_PERC, "
+" fn_gst_rate_amt(CAST('VOUCH' 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('H' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CGST_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' 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('R' AS CHAR(1))) AS SGST_PERC, "
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, "; +" 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 else
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('M-VOUC',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('M-VOUC',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('M-VOUC',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('M-VOUC',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('M-VOUC',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('M-VOUC',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('M-VOUC',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
...@@ -7773,26 +7775,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7773,26 +7775,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, 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, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, 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, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
} }
else else
{ {
dtlSql = dtlSql +"fn_gst_rate_amt('VOUCH',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('VOUCH',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 ,"
+" 'is' as ITC_TYPE , " +" 'is' as ITC_TYPE , "
+"fn_get_gst_rate('VOUCH',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 " +" from misc_voucher i,misc_vouchdet it, item 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 = 'M-VOUC' " +"and ti.tran_code = 'M-VOUC' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
+ " 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -8067,26 +8069,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8067,26 +8069,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, "; +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
} }
else else
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('M-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('M-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('M-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('M-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('M-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('M-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('M-VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
...@@ -8098,13 +8100,13 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8098,13 +8100,13 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC," dtlSql = dtlSql + "fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,"; +"fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
} }
else else
{ {
dtlSql = dtlSql +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," dtlSql = dtlSql +"fn_gst_rate_amt('M-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('M-VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' as REMARKS ," +" '' as REMARKS ,"
...@@ -8393,26 +8395,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8393,26 +8395,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, "; +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
} }
else else
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('M-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('M-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('M-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('M-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('M-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('M-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('M-VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
...@@ -8424,18 +8426,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8424,18 +8426,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC," dtlSql = dtlSql + "fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,"; +"fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
} }
else else
{ {
dtlSql = dtlSql +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," dtlSql = dtlSql +"fn_gst_rate_amt('M-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('M-VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' as REMARKS ," +" '' as REMARKS ,"
+" 'is' as ITC_TYPE , " +" 'is' as ITC_TYPE , "
+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate " +"fn_get_gst_rate('M-VOUCH',i.tran_id, it.line_no) as gst_rate "
+" from misc_voucher i,misc_vouchdet it, item item " +" from misc_voucher i,misc_vouchdet it, item item "
// +" from voucher i,vouchrcp it, item item " // +" from voucher i,vouchrcp it, item item "
...@@ -8723,26 +8725,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8723,26 +8725,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, "; +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
} }
else else
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('M-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('M-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('M-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('M-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('M-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('M-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('M-VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
...@@ -8754,18 +8756,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8754,18 +8756,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC," dtlSql = dtlSql + "fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,"; +"fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
} }
else else
{ {
dtlSql = dtlSql +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," dtlSql = dtlSql +"fn_gst_rate_amt('M-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('M-VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' as REMARKS ," +" '' as REMARKS ,"
+" 'is' as ITC_TYPE , " +" 'is' as ITC_TYPE , "
+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate " +"fn_get_gst_rate('M-VOUCH',i.tran_id, it.line_no) as gst_rate "
+" from misc_voucher i,misc_vouchdet it, item item " +" from misc_voucher i,misc_vouchdet it, item item "
// +" 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 "
...@@ -8849,7 +8851,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8849,7 +8851,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 "
+" and tm.tax_group in ('ITC','RCM') " // +" and tm.tax_group in ('ITC','RCM') "
+" 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)
{ {
...@@ -8887,28 +8889,33 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8887,28 +8889,33 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
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,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, ";
+" fn_gst_rate_amt(CAST('VOUCH' 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('VOUCH' 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('VOUCH' 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('VOUCH' 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('VOUCH' 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('VOUCH' 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('VOUCH' 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('VOUCH' 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('VOUCH' 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('VOUCH' 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('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, "; +" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";*/
} }
else else
{ {
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,";*/
} }
dtlSql = dtlSql dtlSql = dtlSql
+" 0 as IGST_PERC "
+" 0 as IGST_AMT "
+" 0 as CGST_PERC "
+" 0 as CGST_AMT "
+" 0 as SGST_PERC "
+" 0 as SGST_AMT "
+" item.descr as GS_DESCR," +" item.descr as GS_DESCR,"
/*+" u.descr as UNIT,"*/ /*+" u.descr as UNIT,"*/
+"item.UNIT as UNIT," +"item.UNIT as UNIT,"
...@@ -8935,8 +8942,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8935,8 +8942,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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_GROUP <> 'NITC' " // +" and tx.TAX_GROUP <> 'NITC' " commented on 14 aug
+" and tx.TAX_GROUP = 'RCM' " // +" and tx.TAX_GROUP = 'RCM' "
+" 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -9011,7 +9018,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9011,7 +9018,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 "
+" and tm.tax_group in ('ITC','RCM') " // +" 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)
{ {
...@@ -9050,29 +9057,34 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9050,29 +9057,34 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, ";
+" fn_gst_rate_amt(CAST('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, "; +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";*/
} }
else else
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('M-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('M-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('M-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('M-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('M-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('M-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('M-VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";*/
} }
dtlSql = dtlSql dtlSql = dtlSql
+" 0 as IGST_PERC "
+" 0 as IGST_AMT "
+" 0 as CGST_PERC "
+" 0 as CGST_AMT "
+" 0 as SGST_PERC "
+" 0 as SGST_AMT "
+" item.descr as GS_DESCR," +" item.descr as GS_DESCR,"
/*+" u.descr as UNIT,"*/ /*+" u.descr as UNIT,"*/
+"item.UNIT as UNIT," +"item.UNIT as UNIT,"
...@@ -9081,18 +9093,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9081,18 +9093,18 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC," dtlSql = dtlSql + "fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,"; +"fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
} }
else else
{ {
dtlSql = dtlSql +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," dtlSql = dtlSql +"fn_gst_rate_amt('M-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('M-VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' as REMARKS ," +" '' as REMARKS ,"
+" 'is' as ITC_TYPE , " +" 'is' as ITC_TYPE , "
+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate " +"fn_get_gst_rate('M-VOUCH',i.tran_id, it.line_no) as gst_rate "
+" from misc_voucher i,misc_vouchdet it, item item " +" from misc_voucher i,misc_vouchdet it, item item "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
...@@ -9100,8 +9112,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9100,8 +9112,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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-VOUCH' " +" and ti.tran_code = 'M-VOUCH' "
+" and ti.tran_id = i.tran_id " +" and ti.tran_id = i.tran_id "
+" and tx.TAX_GROUP <> 'NITC' " // +" and tx.TAX_GROUP <> 'NITC' " commented on 14 aug
+" and tx.TAX_GROUP = 'RCM' " // +" and tx.TAX_GROUP = 'RCM' "
+" 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -9269,6 +9281,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9269,6 +9281,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"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_GROUP IN ('ITC') "
+"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*/
...@@ -9380,26 +9393,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9380,26 +9393,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, "; +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
} }
else else
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('M-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('M-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('M-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('M-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('M-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('M-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('M-VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
...@@ -9411,24 +9424,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9411,24 +9424,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC," dtlSql = dtlSql + "fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,"; +"fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
} }
else else
{ {
dtlSql = dtlSql +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," dtlSql = dtlSql +"fn_gst_rate_amt('M-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('M-VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' as REMARKS ," +" '' as REMARKS ,"
+" 'is' as ITC_TYPE , " +" 'is' as ITC_TYPE , "
+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate " +"fn_get_gst_rate('M-VOUCH',i.tran_id, it.line_no) as gst_rate "
+" from misc_voucher i,misc_vouchdet it, item item " +" from misc_voucher i,misc_vouchdet it, item 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 = 'VOUCH' " +"and ti.tran_code = 'VOUCH' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
+" and tm.TAX_GROUP IN ('ITC') "
+"and tx.tax_type in ('G','H','I','J')" ; +"and tx.tax_type in ('G','H','I','J')" ;
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
...@@ -9584,7 +9598,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9584,7 +9598,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"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_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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -9657,7 +9671,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9657,7 +9671,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/*+" 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 = 'M-VOUC' and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I') ) = 0"*/ +" 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 (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_IMPSER_TAXCLASS.length() > 0) if(GST_IMPSER_TAXCLASS.length() > 0)
{ {
hdrSql = hdrSql +" and ti.tax_env in ("+GST_IMPSER_TAXCLASS+") "; hdrSql = hdrSql +" and ti.tax_env in ("+GST_IMPSER_TAXCLASS+") ";
...@@ -9702,26 +9716,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9702,26 +9716,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+" fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, " +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST(' ' AS CHAR(1)), CAST('T' AS CHAR(1))) AS TAXABLE_AMT, "
+" fn_gst_rate_amt(CAST('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' 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-VOUCH' 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('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, "; +" fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('G' AS CHAR(1)), CAST('A' AS CHAR(1))) AS SGST_AMT, ";
} }
else else
{ {
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_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE," +"fn_get_hsn_sac(i.site_code,it.item_code,it.acct_code) AS GS_CODE,"
+ "fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, ' ', 'T') as TAXABLE_AMT," + "fn_gst_rate_amt('M-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('M-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('M-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('M-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('M-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('M-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('M-VOUCH',i.tran_id, it.line_no, 'G', 'A') as SGST_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
...@@ -9732,25 +9746,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9732,25 +9746,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql + "fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC," dtlSql = dtlSql + "fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('R' AS CHAR(1))) AS CESS_PERC,"
+"fn_gst_rate_amt(CAST('VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,"; +"fn_gst_rate_amt(CAST('M-VOUCH' AS VARCHAR(6)),i.tran_id, it.line_no, CAST('J' AS CHAR(1)), CAST('A' AS CHAR(1))) AS CESS_AMT,";
} }
else else
{ {
dtlSql = dtlSql +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," dtlSql = dtlSql +"fn_gst_rate_amt('M-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('M-VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' as REMARKS ," +" '' as REMARKS ,"
+" 'is' as ITC_TYPE , " +" 'is' as ITC_TYPE , "
+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate " +"fn_get_gst_rate('M-VOUCH',i.tran_id, it.line_no) as gst_rate "
+" from misc_voucher i,misc_vouchdet it, item item " +" from misc_voucher i,misc_vouchdet it, item 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 = 'VOUCH' " +"and ti.tran_code = 'M-VOUC' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
+ " and tx.tax_group <> 'NITC' " // + " 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(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
...@@ -9911,7 +9926,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9911,7 +9926,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"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_group <> 'NITC' " // +" and tx.tax_group <> 'NITC' " COMMENTED ON 14 AUG
+ " 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -10070,7 +10086,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10070,7 +10086,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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_id = i.tran_id " +" and ti.tran_id = i.tran_id "
+" and tx.tax_group <> 'NITC' " // +" 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -10215,7 +10232,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10215,7 +10232,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"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 = 'CRNPAY' " +"and ti.tran_code = 'CRNPAY' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
+" and tx.tax_group <> 'NITC' " // +" 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -10296,7 +10314,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10296,7 +10314,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) = 0 " hdrSql = hdrSql +" ) = 0 "
// +"ti.tax_class in ('BOND' ,'REB' ,'DEEM' ,'SEWP' ,'SEWOP') ) = 0 " // +"ti.tax_class in ('BOND' ,'REB' ,'DEEM' ,'SEWP' ,'SEWOP') ) = 0 "
+" and i.tran_date between ? and ? "; +" and i.tran_date between ? and ? ";
...@@ -10361,7 +10378,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10361,7 +10378,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"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 = 'CRNPAY' " +"and ti.tran_code = 'CRNPAY' "
+" and ti.tran_id = i.tran_id " +" and ti.tran_id = i.tran_id "
+" and tx.tax_group <> 'NITC'" //+" 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -10503,7 +10521,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10503,7 +10521,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"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 = 'DRNPAY' " +"and ti.tran_code = 'DRNPAY' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
+" and tx.tax_group <> 'NITC' " // +" and tx.tax_group <> 'NITC' " COMMENTED ON 14 AUG
+ " 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -10646,7 +10665,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10646,7 +10665,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"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 = 'DRNPAY' " +"and ti.tran_code = 'DRNPAY' "
+"and ti.tran_id = i.tran_id " +"and ti.tran_id = i.tran_id "
+" and tx.tax_group <> 'NITC' " // +" 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 ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -10741,7 +10761,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10741,7 +10761,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
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 = 'VOUCH' and ref_id = i.tran_id ) = 0 ";
/* commented on 8 aug 2017*/ /* commented on 8 aug 2017*/
/* +" and (select count(1) from taxtran ti tax tm where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "; /* +" and (select count(1) from taxtran ti tax tm where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id ";
if(GST_COMP_TAXCLASS.length() > 0) if(GST_COMP_TAXCLASS.length() > 0)
...@@ -12350,67 +12369,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -12350,67 +12369,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
* --- Header 10B(2). advance adjustment through voucher (inter-state Supply rate-wise)* * --- Header 10B(2). advance adjustment through voucher (inter-state Supply rate-wise)*
*/ */
/* 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, "
+"i.tran_date as PRD_CODE,"
+" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'R' as GST_TYPE,"
+" '01' as TRAN_TYPE,"// -- b2b,b2c
+" i.supp_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,"
+" '' as REMARKS, "
+" ' ' 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, "
+" i.tran_id as REF_ID "
+" 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 = 'VOUCH' 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 taxtran ti, tax tm where tm.tax_code = ti.tax_code "
+" and (select count(1) from vouchadv pd, misc_payables mp where mp.tran_ser = pd.ref_ser and mp.ref_no = pd.ref_no"
+"and pd.tran_id = i.tran_id and pd.ref_ser = 'P-ADV' ";
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{
hdrSql = hdrSql +" and mp.ref_date < '"+currMonthStartDate+"' ";
}
else
{
hdrSql = hdrSql +" and mp.ref_date < '"+strDate+"' ";
}
dtlSql = dtlSql +") > 0"
+" and i.tran_date between ? and ? ";*/
hdrSql = " select '' as TRAN_ID," hdrSql = " select '' as TRAN_ID,"
...@@ -12547,71 +12505,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -12547,71 +12505,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/** /**
* --- HEADER 10B(3). Advance adjust through payment intra-state* * --- 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, "
+"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
+" 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,"
+" '' as REMARKS, "
+" ' ' 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,"
hdrSql
+" ' ' as RECO_STATUS,"
+" ' ' as ECOM_REG_NO,"
+" 'M-PAY' as ref_ser ,"
+" i.tran_id as REF_ID "
+"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+"' ";
}
dtlSql = dtlSql +") > 0"
+" and i.tran_date between ? and ? ";*/
hdrSql = " select '' as TRAN_ID," hdrSql = " select '' as TRAN_ID,"
/*+" to_date(i.gp_date) as TRAN_DATE,"*/ /*+" to_date(i.gp_date) as TRAN_DATE,"*/
...@@ -12924,8 +12817,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -12924,8 +12817,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
System.out.println("GST_DATA_SYNC not found or blank"); System.out.println("GST_DATA_SYNC not found or blank");
} }
//else if("Y".equalsIgnoreCase(gstDataSink)) else if("Y".equalsIgnoreCase(gstDataSink))
else if ("Y".equalsIgnoreCase(gstDataSink) && (retString == null || retString.trim().length() == 0)) // else if ("Y".equalsIgnoreCase(gstDataSink) && (retString == null || retString.trim().length() == 0))
{ {
GetGstTableData gstDataSinkObj = new GetGstTableData(); GetGstTableData gstDataSinkObj = new GetGstTableData();
retString = gstDataSinkObj.getGstTableData("", xtraParams, "" ,connGST); retString = gstDataSinkObj.getGstTableData("", xtraParams, "" ,connGST);
...@@ -12997,8 +12890,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -12997,8 +12890,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//connLocal.rollback(); //connLocal.rollback();
connGST.rollback(); connGST.rollback();
//retString = itmDBAccessEJB.getErrorString("","VTPRCESERR","","",connLocal); //retString = itmDBAccessEJB.getErrorString("","VTPRCESERR","","",connLocal);
//retString = itmDBAccessEJB.getErrorString("","VTPRCESERR","","",connGST); retString = itmDBAccessEJB.getErrorString("","VTPRCESERR","","",connGST);
retString = getError(errorMessage.toString(),"PRCSUCCESS",connGST); //retString = getError(errorMessage.toString(),"PRCSUCCESS",connGST);
} }
if(!isError) if(!isError)
{ {
...@@ -13218,6 +13111,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -13218,6 +13111,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
double amount = 0, taxableAmt = 0, igstPerc = 0, igstAmt = 0, cgstPerc = 0, cgstAmt = 0, sgstPerc= 0,sgstAmt = 0,quantity = 0, double amount = 0, taxableAmt = 0, igstPerc = 0, igstAmt = 0, cgstPerc = 0, cgstAmt = 0, sgstPerc= 0,sgstAmt = 0,quantity = 0,
cessPerc = 0,cessAmt = 0,gstRate = 0; cessPerc = 0,cessAmt = 0,gstRate = 0;
boolean isError = false;
try try
{ {
System.out.println("\n\n\n XXXXXXXXXXXXXXXXXXXX Started Populating ["+tranSer+"] Data XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX "); System.out.println("\n\n\n XXXXXXXXXXXXXXXXXXXX Started Populating ["+tranSer+"] Data XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ");
...@@ -13677,6 +13572,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -13677,6 +13572,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
catch(Exception e) catch(Exception e)
{ {
isError = true;
e.printStackTrace(); e.printStackTrace();
System.out.println("Inside Exception executeSqlAndPopulateData==>=="+e.getMessage()); System.out.println("Inside Exception executeSqlAndPopulateData==>=="+e.getMessage());
errorMessage.append("\nSection ["+tranSer+"] ["+e.getMessage()+"]"); errorMessage.append("\nSection ["+tranSer+"] ["+e.getMessage()+"]");
...@@ -13684,6 +13580,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -13684,6 +13580,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
finally finally
{ {
System.out.println("Inside finally isError["+isError+"] connStatus[]");
try try
{ {
if(rs != null) if(rs != null)
...@@ -13718,6 +13615,29 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -13718,6 +13615,29 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
rsSelDet.close();rsSelDet = null; rsSelDet.close();rsSelDet = null;
} }
if(isError)
{
System.out.println("GstDataPrc connection RollBack.....");
//connLocal.rollback();
connGST.rollback();
//retString = itmDBAccessEJB.getErrorString("","VTPRCESERR","","",connLocal);
//retString = itmDBAccessEJB.getErrorString("","VTPRCESERR","","",connGST);
retString = getError(errorMessage.toString(),"VTPRCESERR",connGST);
System.out.println("IS ERROR TRUE "+retString);
}
if(!isError)
{
System.out.println("GstDataPrc connection Commit.....");
//connLocal.commit();//Temporary commented
//connLocal.rollback();
connGST.commit();
//retString = itmDBAccessEJB.getErrorString("","PRCSUCCESS","","",connLocal);
//retString = itmDBAccessEJB.getErrorString("","PRCSUCCESS","","",connGST);
retString = getError(errorMessage.toString(),"PRCSUCCESS",connGST);
System.out.println("IS ERROR FALSE "+retString);
}
} }
catch(Exception ex) catch(Exception ex)
{ {
......
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