Commit 9bcb83b3 authored by kdabholkar's avatar kdabholkar

commited the changes of apply_tax and misc_voucher GSTR2

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187899 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 24c0bb24
...@@ -16671,7 +16671,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -16671,7 +16671,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,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'C' as GST_TYPE," +" 'C' as GST_TYPE,"
+" '10' as TRAN_TYPE,"// -- b2b,b2c +" '12' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.supp_name as CUST_NAME," +" c.supp_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -16811,7 +16811,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -16811,7 +16811,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-CNR"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-CNR");
...@@ -16826,7 +16827,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -16826,7 +16827,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,"// -- GSTR1,GSTR2,etc. +" '2' as REC_TYPE,"// -- GSTR1,GSTR2,etc.
+" 'C' as GST_TYPE," +" 'C' as GST_TYPE,"
+" '10' as TRAN_TYPE,"// -- b2b,b2c +" '13' as TRAN_TYPE,"// -- b2b,b2c
+" i.sundry_code as CUST_CODE," +" i.sundry_code as CUST_CODE,"
+" c.supp_name as CUST_NAME," +" c.supp_name as CUST_NAME,"
+" state.GST_CODE,"// -- 2 digit code +" state.GST_CODE,"// -- 2 digit code
...@@ -16965,8 +16966,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -16965,8 +16966,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-CNR"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-CNR");
...@@ -17120,7 +17122,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17120,7 +17122,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-TP-CNR"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-TP-CNR");
...@@ -17276,8 +17279,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17276,8 +17279,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-TP-CNR"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-TP-CNR");
}// ending of Credit Note for suplier/transporter query }// ending of Credit Note for suplier/transporter query
...@@ -17358,24 +17361,24 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17358,24 +17361,24 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql 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(' ' 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('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('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('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('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('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,"; +" -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 else
{ {
dtlSql = dtlSql 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, ' ', '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', '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, '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', '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, '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', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',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
...@@ -17387,12 +17390,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17387,12 +17390,12 @@ 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('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," 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,"; +"-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('M-VOUC',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('M-VOUC',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,";
} }
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -17431,8 +17434,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17431,8 +17434,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(REG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(REG)");
...@@ -17513,24 +17517,24 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17513,24 +17517,24 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql 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(' ' 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('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('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('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('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('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,"; +" -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 else
{ {
dtlSql = dtlSql 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, ' ', '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', '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, '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', '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, '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', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',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
...@@ -17542,12 +17546,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17542,12 +17546,12 @@ 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('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," 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,"; +"-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('M-VOUC',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('M-VOUC',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,";
} }
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -17586,8 +17590,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17586,8 +17590,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(UNREG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(UNREG)");
...@@ -17742,8 +17747,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17742,8 +17747,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-TRN(REG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-TRN(REG)");
...@@ -17899,7 +17905,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -17899,7 +17905,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(UNREG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(UNREG)");
...@@ -25124,7 +25131,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -25124,7 +25131,7 @@ dtlSql = " select '' as TRAN_ID, "
+" 0 AS CGST_PERC," +" 0 AS CGST_PERC,"
+" 0 AS SGST_PERC," +" 0 AS SGST_PERC,"
+" ' ' AS GS_DESCR," +" ' ' AS GS_DESCR,"
+" ' ' AS UNIT," +" 'OTH' AS UNIT,"
+" 0 AS QUANTITY," +" 0 AS QUANTITY,"
+" 'OE' AS SUPPLY_TYPE," +" 'OE' AS SUPPLY_TYPE,"
+" 0 AS CESS_PERC," +" 0 AS CESS_PERC,"
...@@ -25238,7 +25245,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -25238,7 +25245,8 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" it.quantity as QUANTITY," +" it.quantity as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -25573,7 +25581,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -25573,7 +25581,8 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" 0 as QUANTITY," +" 0 as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
...@@ -25739,7 +25748,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -25739,7 +25748,8 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
...@@ -25939,7 +25949,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -25939,7 +25949,8 @@ dtlSql = " select '' as TRAN_ID, "
//+" item.sh_descr as GS_DESCR," //+" item.sh_descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
//+" item.UNIT as UNIT," //+" item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" it.quantity as QUANTITY," +" it.quantity as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -26744,7 +26755,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -26744,7 +26755,8 @@ dtlSql = " select '' as TRAN_ID, "
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
/*+" u.descr as UNIT,"*/ /*+" u.descr as UNIT,"*/
//+"item.UNIT as UNIT," //+"item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.rcp_qty) as QUANTITY," +" (it.rcp_qty) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
...@@ -27499,7 +27511,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -27499,7 +27511,8 @@ dtlSql = " select '' as TRAN_ID, "
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
/*+" u.descr as UNIT,"*/ /*+" u.descr as UNIT,"*/
//+"item.UNIT as UNIT," //+"item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
...@@ -28194,7 +28207,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -28194,7 +28207,8 @@ dtlSql = " select '' as TRAN_ID, "
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
/*+" u.descr as UNIT,"*/ /*+" u.descr as UNIT,"*/
//+"item.UNIT as UNIT," //+"item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
...@@ -28954,8 +28968,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -28954,8 +28968,9 @@ dtlSql = " select '' as TRAN_ID, "
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
/*+" u.descr as UNIT,"*/ /*+" u.descr as UNIT,"*/
//+"item.UNIT as UNIT," //+"item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -29646,6 +29661,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29646,6 +29661,7 @@ dtlSql = " select '' as TRAN_ID, "
+"from porcp i,supplier c, site s,state state" +"from porcp i,supplier c, site s,state state"
+" where c.supp_code = i.supp_code " +" where c.supp_code = i.supp_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" AND state.state_code = c.STATE_CODE "
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(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.Tax_Perc > 0 " //added on 20 june 2018 +" and ti.Tax_Perc > 0 " //added on 20 june 2018
...@@ -29702,7 +29718,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29702,7 +29718,8 @@ dtlSql = " select '' as TRAN_ID, "
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
/* +" u.descr as UNIT,"*/ /* +" u.descr as UNIT,"*/
// +"item.UNIT as UNIT," // +"item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
//--sum(it.quantity__stduom) as QUANTITY, //--sum(it.quantity__stduom) as QUANTITY,
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
...@@ -29839,6 +29856,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29839,6 +29856,7 @@ dtlSql = " select '' as TRAN_ID, "
+"from porcp i,supplier c, site s,state state" +"from porcp i,supplier c, site s,state state"
+" where c.supp_code = i.supp_code " +" where c.supp_code = i.supp_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" AND state.state_code = c.STATE_CODE "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(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.Tax_Perc > 0 " //added on 20 june 2018 +" and ti.Tax_Perc > 0 " //added on 20 june 2018
...@@ -29895,7 +29913,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -29895,7 +29913,8 @@ dtlSql = " select '' as TRAN_ID, "
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
/* +" u.descr as UNIT,"*/ /* +" u.descr as UNIT,"*/
// +"item.UNIT as UNIT," // +"item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
//--sum(it.quantity__stduom) as QUANTITY, //--sum(it.quantity__stduom) as QUANTITY,
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
...@@ -31684,7 +31703,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -31684,7 +31703,8 @@ dtlSql = " select '' as TRAN_ID, "
//+" item.sh_descr as GS_DESCR," //+" item.sh_descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
//+" item.UNIT as UNIT," //+" item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" it.QUANTITY as QUANTITY," +" it.QUANTITY as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -31865,7 +31885,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -31865,7 +31885,8 @@ dtlSql = " select '' as TRAN_ID, "
// +" item.sh_descr as GS_DESCR," // +" item.sh_descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
// +" item.UNIT as UNIT," // +" item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" it.quantity as QUANTITY," +" it.quantity as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -32023,8 +32044,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32023,8 +32044,9 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" it.quantity as QUANTITY," +"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" it.quantity as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -32173,8 +32195,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32173,8 +32195,9 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" it.quantity as QUANTITY," +"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" it.quantity as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -32384,8 +32407,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32384,8 +32407,9 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-CNR"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-CNR");
...@@ -32538,7 +32562,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32538,7 +32562,8 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-CNR"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-CNR");
...@@ -32693,7 +32718,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32693,7 +32718,9 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-TP-CNR"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-TP-CNR");
...@@ -32849,7 +32876,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32849,7 +32876,8 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-TP-CNR"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"M-VOUC-TP-CNR");
...@@ -32937,24 +32965,24 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32937,24 +32965,24 @@ dtlSql = " select '' as TRAN_ID, "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql 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(' ' 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('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('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('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('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('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,"; +" -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 else
{ {
dtlSql = dtlSql 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, ' ', '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', '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, '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', '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, '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', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',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
...@@ -32966,12 +32994,12 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32966,12 +32994,12 @@ dtlSql = " select '' as TRAN_ID, "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) 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," 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,"; +"-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('M-VOUC',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('M-VOUC',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,";
} }
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -33010,8 +33038,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33010,8 +33038,9 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(REG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(REG)");
...@@ -33092,24 +33121,24 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33092,24 +33121,24 @@ dtlSql = " select '' as TRAN_ID, "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql 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(' ' 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('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('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('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('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('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,"; +" -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 else
{ {
dtlSql = dtlSql 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, ' ', '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', '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, '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', '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, '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', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',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
...@@ -33121,12 +33150,12 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33121,12 +33150,12 @@ dtlSql = " select '' as TRAN_ID, "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) 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," 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,"; +"-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('M-VOUC',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('M-VOUC',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,";
} }
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -33165,8 +33194,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33165,8 +33194,9 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(UNREG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(UNREG)");
...@@ -33249,24 +33279,24 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33249,24 +33279,24 @@ dtlSql = " select '' as TRAN_ID, "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql 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(' ' 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('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('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('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('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('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,"; +" -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 else
{ {
dtlSql = dtlSql 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, ' ', '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', '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, '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', '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, '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', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',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
...@@ -33278,12 +33308,12 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33278,12 +33308,12 @@ dtlSql = " select '' as TRAN_ID, "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) 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," 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,"; +"-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('M-VOUC',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('M-VOUC',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,";
} }
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -33321,7 +33351,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33321,7 +33351,8 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-TRN(REG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-TRN(REG)");
...@@ -33406,24 +33437,24 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33406,24 +33437,24 @@ dtlSql = " select '' as TRAN_ID, "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql = dtlSql 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(' ' 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('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('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('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('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('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,"; +" -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 else
{ {
dtlSql = dtlSql 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, ' ', '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', '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, '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', '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, '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', 'R') as SGST_PERC,"
+ "fn_gst_rate_amt('M-VOUC',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
...@@ -33435,12 +33466,12 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33435,12 +33466,12 @@ dtlSql = " select '' as TRAN_ID, "
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) 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," 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,"; +"-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('M-VOUC',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('M-VOUC',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,";
} }
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -33478,8 +33509,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -33478,8 +33509,9 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.APPLY_TAX = 'Y' "; +" and i.tran_id = ? ";
//+ " and it.APPLY_TAX = 'Y' "; Commented on 19 july 2018 temporary purpose need to confirm and enble in future
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(UNREG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"DN-SUPP(UNREG)");
}// end of debit note queries (transport/supplier case) }// end of debit note queries (transport/supplier case)
...@@ -34942,8 +34974,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -34942,8 +34974,9 @@ dtlSql = " select '' as TRAN_ID, "
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
// +"item.UNIT as UNIT," // +"item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
/* +" u.descr as UNIT,"*/ +"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
/* +" u.descr as UNIT,"*/
//--sum(it.quantity__stduom) as QUANTITY, //--sum(it.quantity__stduom) as QUANTITY,
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
...@@ -35572,7 +35605,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -35572,7 +35605,8 @@ dtlSql = " select '' as TRAN_ID, "
} }
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -35735,7 +35769,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -35735,7 +35769,8 @@ dtlSql = " select '' as TRAN_ID, "
//+" item.descr as GS_DESCR," //+" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
//+" item.UNIT as UNIT," //+" item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -36349,8 +36384,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -36349,8 +36384,9 @@ dtlSql = " select '' as TRAN_ID, "
} }
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -36509,7 +36545,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -36509,7 +36545,8 @@ dtlSql = " select '' as TRAN_ID, "
//+" item.descr as GS_DESCR," //+" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
//+" item.UNIT as UNIT," //+" item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -36674,7 +36711,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -36674,7 +36711,8 @@ dtlSql = " select '' as TRAN_ID, "
// +" item.descr as GS_DESCR," // +" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
// +" item.UNIT as UNIT," // +" item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -36840,8 +36878,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -36840,8 +36878,9 @@ dtlSql = " select '' as TRAN_ID, "
// +" item.descr as GS_DESCR," // +" item.descr as GS_DESCR,"
+" ' ' as GS_DESCR, " +" ' ' as GS_DESCR, "
// +" item.UNIT as UNIT," // +" item.UNIT as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY," +"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" (it.quantity) as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
...@@ -37008,7 +37047,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -37008,7 +37047,8 @@ dtlSql = " select '' as TRAN_ID, "
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR," +" ' ' as GS_DESCR,"
//+" ' ' as UNIT," //+" ' ' as UNIT,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" 0 as QUANTITY," +" 0 as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
...@@ -37170,8 +37210,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -37170,8 +37210,9 @@ dtlSql = " select '' as TRAN_ID, "
} }
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR," +" ' ' as GS_DESCR,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" 0 as QUANTITY," +"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" 0 as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -37671,7 +37712,8 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -37671,7 +37712,8 @@ dtlSql = " select '' as TRAN_ID, "
} }
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR," +" ' ' as GS_DESCR,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " //+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" 0 as QUANTITY," +" 0 as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
...@@ -37841,8 +37883,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -37841,8 +37883,9 @@ dtlSql = " select '' as TRAN_ID, "
} }
dtlSql = dtlSql dtlSql = dtlSql
+" ' ' as GS_DESCR," +" ' ' as GS_DESCR,"
+"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, " // +"(select case when udf_str2 is null then descr else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" 0 as QUANTITY," +"(select case when udf_str2 is null then 'OTH' else udf_str2 end as Unit from uom where unit=it.unit) as UNIT, "
+" 0 as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom) +" 'OE' as SUPPLY_TYPE," ;// -- E/OE (Ecom/Other than Ecom)
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -38080,7 +38123,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -38080,7 +38123,7 @@ dtlSql = " select '' as TRAN_ID, "
currDate = Timestamp.valueOf(genericUtility.getValidDateString(currDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); currDate = Timestamp.valueOf(genericUtility.getValidDateString(currDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("current2 Date"+currDate); System.out.println("current2 Datee"+currDate);
int updCnt = 0; int updCnt = 0;
int detCnts = 0,hdrCnts = 0,lineNo = 0; int detCnts = 0,hdrCnts = 0,lineNo = 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment