Commit ca253c58 authored by kdabholkar's avatar kdabholkar

commit the changes regarding tran_type change in GSTR2 queries and

If condition of fetching invoice_id in case of misc DN/CN.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183913 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f3c14c90
...@@ -3,8 +3,6 @@ package ibase.webitm.ejb.gstclient; ...@@ -3,8 +3,6 @@ package ibase.webitm.ejb.gstclient;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
//import ibase.utility.E12GenericUtility;
//import ibase.utility.GenericUtility;
//import ibase.utility.GenericUtility; //import ibase.utility.GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB; import ibase.webitm.ejb.ProcessEJB;
...@@ -137,7 +135,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -137,7 +135,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
System.out.println("START TIME FOR GST DATA POPULATION PROCESS IN SECONDS:::["+startTime/1000+"]"); System.out.println("START TIME FOR GST DATA POPULATION PROCESS IN SECONDS:::["+startTime/1000+"]");
connGST = getConnection(); connGST = getConnection();
/*connDriverGST = new ConnDriver(); /*connDriverGST = new ConnDriver();
connGST = connDriverGST.getConnectDB("DriverITM"); //will be changed as DriverITM as using stddbtest database for testing temporary connGST = connDriverGST.getConnectDB("DriverITM"); //will be changed as DriverITM as using stddbtest database for testing temporary
connGST.setAutoCommit(false); connGST.setAutoCommit(false);
...@@ -8516,6 +8514,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8516,6 +8514,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND state.state_code = c.STATE_CODE " +"AND state.state_code = c.STATE_CODE "
+"AND i.drcr_flag ='C' " +"AND i.drcr_flag ='C' "
+"AND i.tran_id = d.tran_id " +"AND i.tran_id = d.tran_id "
+"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 (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 c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
...@@ -8623,7 +8622,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8623,7 +8622,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? and it.invoice_ref = ? "; +" and i.tran_id = ? ";
// + "and it.invoice_ref = ? ";
//+" and i.tran_id = ? and it.invoice_ref = REF_ID__INV "; //+" and i.tran_id = ? and it.invoice_ref = REF_ID__INV ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"9B1(MISC-CRN-REG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"9B1(MISC-CRN-REG)");
...@@ -8688,6 +8688,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8688,6 +8688,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND state.state_code = c.STATE_CODE " +"AND state.state_code = c.STATE_CODE "
+"AND i.drcr_flag ='D' " +"AND i.drcr_flag ='D' "
+"AND i.tran_id = d.tran_id " +"AND i.tran_id = d.tran_id "
+"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 (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 c.tax_reg_2 <> 'UNREGISTER' " +" and c.tax_reg_2 <> 'UNREGISTER' "
...@@ -8797,7 +8798,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8797,7 +8798,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql dtlSql = dtlSql
//+" and i.tran_id = ? "; //+" and i.tran_id = ? ";
+" and i.tran_id = ? and it.invoice_ref = ? "; +" and i.tran_id = ? ";
// + "and it.invoice_ref = ? ";
// +" and i.tran_id = ? and it.invoice_ref = REF_ID__INV "; // +" and i.tran_id = ? and it.invoice_ref = REF_ID__INV ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"9B1(MISC-DN-REG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"9B1(MISC-DN-REG)");
} }
...@@ -8862,6 +8864,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8862,6 +8864,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND state.state_code = c.STATE_CODE " +"AND state.state_code = c.STATE_CODE "
+"AND i.drcr_flag ='C' " +"AND i.drcr_flag ='C' "
+"AND i.tran_id = d.tran_id " +"AND i.tran_id = d.tran_id "
+"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 (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 c.tax_reg_2 = 'UNREGISTER' " +" and c.tax_reg_2 = 'UNREGISTER' "
...@@ -8969,7 +8972,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8969,7 +8972,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql dtlSql = dtlSql
//+" and i.tran_id = ? "; //+" and i.tran_id = ? ";
+" and i.tran_id = ? and it.invoice_ref = ? "; +" and i.tran_id = ? ";
// + "and it.invoice_ref = ? ";
// +" and i.tran_id = ? and it.invoice_ref = REF_ID__INV "; // +" and i.tran_id = ? and it.invoice_ref = REF_ID__INV ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"9B2(MISC-CRN-UNREG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"9B2(MISC-CRN-UNREG)");
...@@ -9035,6 +9039,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9035,6 +9039,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"AND state.state_code = c.STATE_CODE " +"AND state.state_code = c.STATE_CODE "
+"AND i.drcr_flag ='D' " +"AND i.drcr_flag ='D' "
+"AND i.tran_id = d.tran_id " +"AND i.tran_id = d.tran_id "
+"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 (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 c.tax_reg_2 = 'UNREGISTER' " +" and c.tax_reg_2 = 'UNREGISTER' "
...@@ -9144,7 +9149,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9144,7 +9149,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql dtlSql = dtlSql
//+" and i.tran_id = ? "; //+" and i.tran_id = ? ";
+" and i.tran_id = ? and it.invoice_ref = ? "; +" and i.tran_id = ? ";
//+ "and it.invoice_ref = ? ";
// +" and i.tran_id = ? and it.invoice_ref = REF_ID__INV "; // +" and i.tran_id = ? and it.invoice_ref = REF_ID__INV ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"9B2(MISC-DN-UNREG)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"9B2(MISC-DN-UNREG)");
} }
...@@ -15853,7 +15859,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -15853,7 +15859,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'R' as DOC_TYPE,"// -- R- Regular B2B Invoices, DE – Deemed Exports, SEWP – SEZ Exports with payment,SEWOP – SEZ exports without payment +" 'R' as DOC_TYPE,"// -- R- Regular B2B Invoices, DE – Deemed Exports, SEWP – SEZ Exports with payment,SEWOP – SEZ exports without payment
/*+" i.GP_NO as DOC_NO,"*/ /*+" i.GP_NO as DOC_NO,"*/
//+" case when i.GP_NO is null then i.tran_id__ISS else i.GP_NO end as DOC_NO, " //+" case when i.GP_NO is null then i.tran_id__ISS else i.GP_NO end as DOC_NO, "
+" i.tran_id as DOC_NO, " +"i.tran_id__ISS as DOC_NO,"
//+" i.tran_id as DOC_NO, "
/*+" i.gp_date as DOC_DATE,"*/ /*+" i.gp_date as DOC_DATE,"*/
// +"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE," // +"case when i.gp_date is null then i.tran_date else i.gp_date end as DOC_DATE,"
+" i.tran_date as DOC_DATE," +" i.tran_date as DOC_DATE,"
...@@ -36499,12 +36506,12 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -36499,12 +36506,12 @@ dtlSql = " select '' as TRAN_ID, "
pstmtSelDet = connGST.prepareStatement(sql); pstmtSelDet = connGST.prepareStatement(sql);
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)))
{ {
pstmtSelDet.setString(1, refID); pstmtSelDet.setString(1, refID);
pstmtSelDet.setString(2, refIdInv); pstmtSelDet.setString(2, refIdInv);
} }*/
if("11(A.1)".equals(tranSer) || "11(A.2)".equals(tranSer) || "11(B.1)".equals(tranSer) || "11(B.2)".equals(tranSer)) if("11(A.1)".equals(tranSer) || "11(A.2)".equals(tranSer) || "11(B.1)".equals(tranSer) || "11(B.2)".equals(tranSer))
{ {
...@@ -36902,8 +36909,6 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -36902,8 +36909,6 @@ dtlSql = " select '' as TRAN_ID, "
} }
} }
} }
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