Commit a0f3fe26 authored by kdabholkar's avatar kdabholkar

commit new changes regarding 'PR' type credit/debit notes in GSTR1

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@190095 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cd376b54
...@@ -5016,6 +5016,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5016,6 +5016,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') " +" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') "
// +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP // +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+" and st_c.GST_CODE = '00' " +" and st_c.GST_CODE = '00' "
+" and trim(i.tran_type) != 'PR' "
+"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 = 'MDRCRC' " + " and ti.tran_code = 'MDRCRC' "
+ " and i.TRAN_ID =ti.TRAN_ID " + " and i.TRAN_ID =ti.TRAN_ID "
...@@ -5195,6 +5196,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5195,6 +5196,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND d.line_no='1' " +"AND d.line_no='1' "
+"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' " +"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "
+" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') " +" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') "
+ " and trim(i.tran_type) != 'PR' "
+" and st_c.GST_CODE = '00' " +" and st_c.GST_CODE = '00' "
// +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP // +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+"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 "
...@@ -5337,8 +5339,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5337,8 +5339,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(i.amount * i.EXCH_RATE) AS AMOUNT," +"(i.amount * i.EXCH_RATE) AS AMOUNT,"
+"'N' AS REVERSE_CHRG," +"'N' AS REVERSE_CHRG,"
+"' ' AS LR_NO," +"' ' AS LR_NO,"
+"' ' AS REAS_CODE,"; +"' ' AS REAS_CODE,"
if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY)) +" d.invoice_ref AS REF_ID__INV, "
/* if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY))
{ {
hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
...@@ -5347,7 +5350,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5347,7 +5350,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql =hdrSql + "'' AS REF_ID__INV,"; hdrSql =hdrSql + "'' AS REF_ID__INV,";
} }
hdrSql =hdrSql hdrSql =hdrSql*/
+" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */ +" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */
+"'N' AS PROV_ASSMNT," +"'N' AS PROV_ASSMNT,"
+"' ' AS ORDER_NO," +"' ' AS ORDER_NO,"
...@@ -5376,6 +5379,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5376,6 +5379,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' " +"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "
+" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') " +" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') "
+" and st_c.GST_CODE <> '00' " +" and st_c.GST_CODE <> '00' "
+" and trim(i.tran_type) != 'PR' "
// +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP // +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+"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 = 'MDRCRC'" + " and ti.tran_code = 'MDRCRC'"
...@@ -5529,8 +5533,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5529,8 +5533,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(i.amount * i.EXCH_RATE) AS AMOUNT," +"(i.amount * i.EXCH_RATE) AS AMOUNT,"
+"'N' AS REVERSE_CHRG," +"'N' AS REVERSE_CHRG,"
+"' ' AS LR_NO," +"' ' AS LR_NO,"
+"' ' AS REAS_CODE,"; +"' ' AS REAS_CODE,"
if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY)) +" d.invoice_ref AS REF_ID__INV, "
/* if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY))
{ {
hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
...@@ -5539,7 +5544,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5539,7 +5544,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql =hdrSql + "'' AS REF_ID__INV,"; hdrSql =hdrSql + "'' AS REF_ID__INV,";
} }
hdrSql =hdrSql hdrSql =hdrSql*/
+" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */ +" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */
+"'N' AS PROV_ASSMNT," +"'N' AS PROV_ASSMNT,"
+"' ' AS ORDER_NO," +"' ' AS ORDER_NO,"
...@@ -5568,6 +5573,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5568,6 +5573,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' " +"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "
+" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') " +" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') "
+" and st_c.GST_CODE <> '00' " +" and st_c.GST_CODE <> '00' "
+ " and trim(i.tran_type) != 'PR'"
// +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP // +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+"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 = 'MDRCRC'" + " and ti.tran_code = 'MDRCRC'"
...@@ -5716,8 +5722,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5716,8 +5722,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(i.amount * i.EXCH_RATE) AS AMOUNT," +"(i.amount * i.EXCH_RATE) AS AMOUNT,"
+"'N' AS REVERSE_CHRG," +"'N' AS REVERSE_CHRG,"
+"' ' AS LR_NO," +"' ' AS LR_NO,"
+"' ' AS REAS_CODE,"; +"' ' AS REAS_CODE,"
if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY)) +" d.invoice_ref AS REF_ID__INV, "
/* if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY))
{ {
hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
...@@ -5726,7 +5733,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5726,7 +5733,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql =hdrSql + "'' AS REF_ID__INV,"; hdrSql =hdrSql + "'' AS REF_ID__INV,";
} }
hdrSql =hdrSql hdrSql =hdrSql*/
+" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */ +" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */
+"'N' AS PROV_ASSMNT," +"'N' AS PROV_ASSMNT,"
+"' ' AS ORDER_NO," +"' ' AS ORDER_NO,"
...@@ -5755,6 +5762,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5755,6 +5762,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' " +"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "
+" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') " +" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') "
+" and st_c.GST_CODE <> '00' " +" and st_c.GST_CODE <> '00' "
+" and trim(i.tran_type) != 'PR' "
// +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP // +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+"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 = 'MDRCRD'" + " and ti.tran_code = 'MDRCRD'"
...@@ -5902,8 +5910,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5902,8 +5910,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(i.amount * i.EXCH_RATE) AS AMOUNT," +"(i.amount * i.EXCH_RATE) AS AMOUNT,"
+"'N' AS REVERSE_CHRG," +"'N' AS REVERSE_CHRG,"
+"' ' AS LR_NO," +"' ' AS LR_NO,"
+"' ' AS REAS_CODE,"; +"' ' AS REAS_CODE,"
if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY)) +" d.invoice_ref AS REF_ID__INV, "
/*if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY))
{ {
hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
...@@ -5912,7 +5921,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5912,7 +5921,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
hdrSql =hdrSql + "'' AS REF_ID__INV,"; hdrSql =hdrSql + "'' AS REF_ID__INV,";
} }
hdrSql =hdrSql hdrSql =hdrSql*/
+" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */ +" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */
+"'N' AS PROV_ASSMNT," +"'N' AS PROV_ASSMNT,"
+"' ' AS ORDER_NO," +"' ' AS ORDER_NO,"
...@@ -5941,6 +5950,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5941,6 +5950,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' " +"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "
+" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') " +" and i.sundry_code in (select cust_code from customer where trim(tax_reg_2) = 'UNREGISTER') "
+" and st_c.GST_CODE <> '00' " +" and st_c.GST_CODE <> '00' "
+" and trim(i.tran_type) != 'PR' "
// +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP // +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+"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 = 'MDRCRC'" + " and ti.tran_code = 'MDRCRC'"
...@@ -6121,6 +6131,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6121,6 +6131,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer " +" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer "
+" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and trim(c.TAX_REG_2) = 'UNREGISTER'))" +" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and trim(c.TAX_REG_2) = 'UNREGISTER'))"
+" and st_c.GST_CODE <> '00' " +" and st_c.GST_CODE <> '00' "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'CRNRCP' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'CRNRCP' "
+" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') " +" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
...@@ -6270,6 +6281,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6270,6 +6281,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer " +" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer "
+" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and trim(c.TAX_REG_2) = 'UNREGISTER'))" +" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and trim(c.TAX_REG_2) = 'UNREGISTER'))"
+" and st_c.GST_CODE <> '00' " +" and st_c.GST_CODE <> '00' "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'CRNRCP' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'CRNRCP' "
+" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') " +" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
...@@ -6415,6 +6427,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6415,6 +6427,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer " +" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer "
+" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and trim(c.TAX_REG_2) = 'UNREGISTER'))" +" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and trim(c.TAX_REG_2) = 'UNREGISTER'))"
+" and st_c.GST_CODE <> '00' " +" and st_c.GST_CODE <> '00' "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'DRNRCP' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'DRNRCP' "
+" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') " +" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
...@@ -6560,6 +6573,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6560,6 +6573,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer " +" and (i.cust_code in (select distinct invoice.cust_code from invoice,customer "
+" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and trim(c.TAX_REG_2) = 'UNREGISTER'))" +" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and trim(c.TAX_REG_2) = 'UNREGISTER'))"
+" and st_c.GST_CODE <> '00' " +" and st_c.GST_CODE <> '00' "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'DRNRCP' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'DRNRCP' "
+" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') " +" and ti.tran_id = i.tran_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
...@@ -6716,6 +6730,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6716,6 +6730,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'CRNRCP' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'CRNRCP' and ref_id = i.tran_id ) = 0 ";
...@@ -6865,6 +6880,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6865,6 +6880,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'CRNRCP' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'CRNRCP' and ref_id = i.tran_id ) = 0 ";
...@@ -7014,6 +7030,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7014,6 +7030,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'CRNRCP' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'CRNRCP' and ref_id = i.tran_id ) = 0 ";
...@@ -7161,6 +7178,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7161,6 +7178,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'CRNRCP' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'CRNRCP' and ref_id = i.tran_id ) = 0 ";
...@@ -7306,6 +7324,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7306,6 +7324,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'DRNRCP' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'DRNRCP' and ref_id = i.tran_id ) = 0 ";
...@@ -7448,6 +7467,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7448,6 +7467,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'DRNRCP' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'DRNRCP' and ref_id = i.tran_id ) = 0 ";
...@@ -7590,6 +7610,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7590,6 +7610,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'DRNRCP' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'DRNRCP' and ref_id = i.tran_id ) = 0 ";
...@@ -7732,6 +7753,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7732,6 +7753,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'DRNRCP' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'DRNRCP' and ref_id = i.tran_id ) = 0 ";
...@@ -7882,6 +7904,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7882,6 +7904,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 ";
...@@ -8027,6 +8050,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8027,6 +8050,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 ";
/** /**
...@@ -8170,6 +8194,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8170,6 +8194,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 ";
/** /**
...@@ -8313,6 +8338,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8313,6 +8338,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 ";
...@@ -8460,6 +8486,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8460,6 +8486,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 ";
/** /**
...@@ -8603,6 +8630,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8603,6 +8630,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 ";
...@@ -8745,6 +8773,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8745,6 +8773,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 ";
...@@ -8890,6 +8919,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8890,6 +8919,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql = hdrSql +" ) > 0 " hdrSql = hdrSql +" ) > 0 "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 ";
/** /**
...@@ -9074,6 +9104,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9074,6 +9104,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
hdrSql = hdrSql hdrSql = hdrSql
+" and i.drcr_flag ='C'" //added by kaustubh on 26 july to seperate Debit and credit note data +" and i.drcr_flag ='C'" //added by kaustubh on 26 july to seperate Debit and credit note data
+" and trim(i.tran_type) != 'PR' "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
/* +" and to_date(inv.conf_date) < '"+currMonthStartDate+"' " commented by kaustubh on 26 july remove to_date for DB2*/ /* +" and to_date(inv.conf_date) < '"+currMonthStartDate+"' " commented by kaustubh on 26 july remove to_date for DB2*/
...@@ -9319,6 +9350,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9319,6 +9350,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and state.state_code = c.STATE_CODE " +" and state.state_code = c.STATE_CODE "
+" and inv.invoice_id = i.invoice_id " +" and inv.invoice_id = i.invoice_id "
+" and i.drcr_flag ='D'" //added by kaustubh on 26 july to seperate Debit and credit note data +" and i.drcr_flag ='D'" //added by kaustubh on 26 july to seperate Debit and credit note data
+" and trim(i.tran_type) != 'PR' "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'DRNRCP' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'DRNRCP' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
/* +" and to_date(inv.conf_date) < '"+currMonthStartDate+"' " commented by kaustubh on 26 july remove to_date for DB2*/ /* +" and to_date(inv.conf_date) < '"+currMonthStartDate+"' " commented by kaustubh on 26 july remove to_date for DB2*/
...@@ -9651,6 +9683,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9651,6 +9683,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql = hdrSql hdrSql = hdrSql
+" and i.drcr_flag ='C'" //added by kaustubh on 26 july to seperate Debit and credit note data +" and i.drcr_flag ='C'" //added by kaustubh on 26 july to seperate Debit and credit note data
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
/* +" and to_date(inv.conf_date) < '"+currMonthStartDate+"' " commented by kaustubh on 26 july remove to_date for DB2*/ /* +" and to_date(inv.conf_date) < '"+currMonthStartDate+"' " commented by kaustubh on 26 july remove to_date for DB2*/
// +" and inv.conf_date < '"+currMonthStartDate+"' " commented by kaustubh on 27 july // +" and inv.conf_date < '"+currMonthStartDate+"' " commented by kaustubh on 27 july
...@@ -9890,6 +9923,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9890,6 +9923,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and inv.invoice_id = i.invoice_id " +" and inv.invoice_id = i.invoice_id "
+" and i.drcr_flag ='D'" //added by kaustubh on 26 july to seperate Debit and credit note data +" and i.drcr_flag ='D'" //added by kaustubh on 26 july to seperate Debit and credit note data
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'DRNRCP' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'DRNRCP' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
/* +" and to_date(inv.conf_date) < '"+currMonthStartDate+"' " commented by kaustubh on 26 july remove to_date for DB2*/ /* +" and to_date(inv.conf_date) < '"+currMonthStartDate+"' " commented by kaustubh on 26 july remove to_date for DB2*/
// +" and inv.conf_date < '"+currMonthStartDate+"' " commented by kaustubh on 27 july 2017 // +" and inv.conf_date < '"+currMonthStartDate+"' " commented by kaustubh on 27 july 2017
...@@ -10075,8 +10109,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10075,8 +10109,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(i.amount * i.EXCH_RATE) AS AMOUNT," +"(i.amount * i.EXCH_RATE) AS AMOUNT,"
+"'N' AS REVERSE_CHRG," +"'N' AS REVERSE_CHRG,"
+"' ' AS LR_NO," +"' ' AS LR_NO,"
+"' ' AS REAS_CODE,"; +"' ' AS REAS_CODE,"
if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY)) +" d.invoice_ref AS REF_ID__INV, "
/* if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY))
{ {
hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
...@@ -10086,7 +10121,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10086,7 +10121,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql =hdrSql + "'' AS REF_ID__INV,"; hdrSql =hdrSql + "'' AS REF_ID__INV,";
// hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; // hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
} }
hdrSql =hdrSql hdrSql =hdrSql*/
+" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */ +" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */
+"'N' AS PROV_ASSMNT," +"'N' AS PROV_ASSMNT,"
+"' ' AS ORDER_NO," +"' ' AS ORDER_NO,"
...@@ -10111,6 +10146,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10111,6 +10146,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND i.tran_id = d.tran_id " +"AND i.tran_id = d.tran_id "
+"AND d.line_no='1' " +"AND d.line_no='1' "
+"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' " +"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
...@@ -10251,8 +10287,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10251,8 +10287,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(i.amount * i.EXCH_RATE) AS AMOUNT," +"(i.amount * i.EXCH_RATE) AS AMOUNT,"
+"'N' AS REVERSE_CHRG," +"'N' AS REVERSE_CHRG,"
+"' ' AS LR_NO," +"' ' AS LR_NO,"
+"' ' AS REAS_CODE,"; +"' ' AS REAS_CODE,"
if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY)) +" d.invoice_ref AS REF_ID__INV, "
/* if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY))
{ {
hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
...@@ -10262,7 +10299,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10262,7 +10299,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql =hdrSql + "'' AS REF_ID__INV,"; hdrSql =hdrSql + "'' AS REF_ID__INV,";
// hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; // hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
} }
hdrSql =hdrSql hdrSql =hdrSql*/
+" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */ +" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */
+"'N' AS PROV_ASSMNT," +"'N' AS PROV_ASSMNT,"
+"' ' AS ORDER_NO," +"' ' AS ORDER_NO,"
...@@ -10290,6 +10327,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10290,6 +10327,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 )" +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRD' and ref_id = i.tran_id ) = 0 )"
+" group by " +" group by "
...@@ -10429,8 +10467,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10429,8 +10467,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(i.amount * i.EXCH_RATE) AS AMOUNT," +"(i.amount * i.EXCH_RATE) AS AMOUNT,"
+"'N' AS REVERSE_CHRG," +"'N' AS REVERSE_CHRG,"
+"' ' AS LR_NO," +"' ' AS LR_NO,"
+"' ' AS REAS_CODE,"; +"' ' AS REAS_CODE,"
if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY)) +" d.invoice_ref AS REF_ID__INV, "
/*if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY))
{ {
hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
...@@ -10440,7 +10479,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10440,7 +10479,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql =hdrSql + "'' AS REF_ID__INV,"; hdrSql =hdrSql + "'' AS REF_ID__INV,";
// hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; // hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
} }
hdrSql =hdrSql hdrSql =hdrSql*/
+" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */ +" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */
+"'N' AS PROV_ASSMNT," +"'N' AS PROV_ASSMNT,"
+"' ' AS ORDER_NO," +"' ' AS ORDER_NO,"
...@@ -10468,6 +10507,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10468,6 +10507,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRC' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and i.tran_date between ? and ? " +" and i.tran_date between ? and ? "
+" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 )" +" and (select count(1) from gst_data_hdr where ref_ser = 'MDRCRC' and ref_id = i.tran_id ) = 0 )"
+" group by " +" group by "
...@@ -10606,8 +10646,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10606,8 +10646,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"(i.amount * i.EXCH_RATE) AS AMOUNT," +"(i.amount * i.EXCH_RATE) AS AMOUNT,"
+"'N' AS REVERSE_CHRG," +"'N' AS REVERSE_CHRG,"
+"' ' AS LR_NO," +"' ' AS LR_NO,"
+"' ' AS REAS_CODE,"; +"' ' AS REAS_CODE,"
if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY)) +" d.invoice_ref AS REF_ID__INV, "
/* if ("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY))
{ {
hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
...@@ -10617,7 +10658,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10617,7 +10658,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
hdrSql =hdrSql + "'' AS REF_ID__INV,"; hdrSql =hdrSql + "'' AS REF_ID__INV,";
// hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,"; // hdrSql =hdrSql +"d.invoice_ref AS REF_ID__INV,";
} }
hdrSql =hdrSql hdrSql =hdrSql*/
+" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */ +" d.INV_REF_DATE AS REF_DATE__INV," /*Added on 11 June 2018 by Kaustubh */
+"'N' AS PROV_ASSMNT," +"'N' AS PROV_ASSMNT,"
+"' ' AS ORDER_NO," +"' ' AS ORDER_NO,"
...@@ -10642,6 +10683,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -10642,6 +10683,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND i.tran_id = d.tran_id " +"AND i.tran_id = d.tran_id "
+"AND d.line_no='1' " +"AND d.line_no='1' "
+"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' " +"AND CASE WHEN i.confirmed IS NULL THEN 'N' ELSE i.confirmed END = 'Y' "
+" and trim(i.tran_type) != 'PR' "
+" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP +" and (select count(1) from taxtran ti where ti.tran_code = 'MDRCRD' ) > 0 " //modified by kaustubh on 26 july 2017 add DRNCRP
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' " +" and case when i.confirmed is null then 'N' else i.confirmed end = 'Y' "
...@@ -24774,7 +24816,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -24774,7 +24816,7 @@ dtlSql = " select '' as TRAN_ID, "
+" 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.tran_code = 'S-RET' and ti.tran_id = i.tran_id " +" and ti.tran_code = 'S-RET' and ti.tran_id = i.tran_id "
+" and tm.TAX_GROUP IN ('ITC','NITC') " //+" and tm.TAX_GROUP IN ('ITC','NITC') "
+" and tm.tax_type in ('G','H','I','J')"; +" and tm.tax_type in ('G','H','I','J')";
if(taxClassAllStrOfPurchase.length() > 0) if(taxClassAllStrOfPurchase.length() > 0)
{ {
...@@ -24861,7 +24903,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -24861,7 +24903,7 @@ dtlSql = " select '' as 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 = 'S-RET' " +"and ti.tran_code = 'S-RET' "
+" and tx.TAX_GROUP IN ('ITC','NITC') " //+" and tx.TAX_GROUP IN ('ITC','NITC') "
+" and ti.tran_id = i.tran_id " +" and ti.tran_id = i.tran_id "
+"and tx.tax_type in ('G','H','I','J') " ; +"and tx.tax_type in ('G','H','I','J') " ;
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
...@@ -37549,7 +37591,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -37549,7 +37591,7 @@ dtlSql = " select '' as TRAN_ID, "
//Added by Kaustubh on 23 jan 2018 start //Added by Kaustubh on 23 jan 2018 start
if("Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY) && ("9B1(MISC-CRN-REG)".equals(tranSer) || "9B1(MISC-DN-REG)".equals(tranSer) || "9B2(MISC-CRN-UNREG)".equals(tranSer) || "9B2(MISC-DN-UNREG)".equals(tranSer) if(/*"Y".equalsIgnoreCase(IMPL_MIN_RATE_HISTORY) &&*/ ("9B1(MISC-CRN-REG)".equals(tranSer) || "9B1(MISC-DN-REG)".equals(tranSer) || "9B2(MISC-CRN-UNREG)".equals(tranSer) || "9B2(MISC-DN-UNREG)".equals(tranSer)
|| "(MISC(INTRA)-CRN-B2CS".equals(tranSer) || "(MISC(INTER)-CRN-B2CS".equals(tranSer) || "(MISC-DN-(B2CS)INTRA)".equals(tranSer) || "(MISC-DN-(B2CS)INTER)".equals(tranSer) )) || "(MISC(INTRA)-CRN-B2CS".equals(tranSer) || "(MISC(INTER)-CRN-B2CS".equals(tranSer) || "(MISC-DN-(B2CS)INTRA)".equals(tranSer) || "(MISC-DN-(B2CS)INTER)".equals(tranSer) ))
{ {
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