Commit ad3cfb5f authored by kdabholkar's avatar kdabholkar

commit new ISD related changes

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187278 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f55d7125
...@@ -52,7 +52,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -52,7 +52,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
GST_IMPGDSEZ_TAXCLASS="",GST_IMPGDSEZ_TAXENV="",GST_PURSEZWP_TAXENV="",GST_PURSEZWP_TAXCLASS="",GST_PURSEZWOP_TAXENV="",GST_PURSEZWOP_TAXCLASS="", GST_IMPGDSEZ_TAXCLASS="",GST_IMPGDSEZ_TAXENV="",GST_PURSEZWP_TAXENV="",GST_PURSEZWP_TAXCLASS="",GST_PURSEZWOP_TAXENV="",GST_PURSEZWOP_TAXCLASS="",
GST_PURDE_TAXENV="",GST_PURDE_TAXCLASS="",GST_RCM_TAXCLASS="",GST_RCM_TAXENV="",SALES_DATA_MISC="",PURCHASE_DATA_PORCP="",MISC_VOUC_TYPE="",INV_ACCT_PORCP="",IMPL_MIN_RATE_HISTORY="", GST_PURDE_TAXENV="",GST_PURDE_TAXCLASS="",GST_RCM_TAXCLASS="",GST_RCM_TAXENV="",SALES_DATA_MISC="",PURCHASE_DATA_PORCP="",MISC_VOUC_TYPE="",INV_ACCT_PORCP="",IMPL_MIN_RATE_HISTORY="",
GST_BANKCHANGES_ACC_CODES="",GST_TRANSFER_TOSHOW_INNILRATED="",GST_EXCLUDE_NILL_CDNR = "",GST_ISD_OP_IGSTAC="",GST_ISD_OP_CGSTAC="",GST_ISD_OP_SGSTAC="",GST_ISD_OP_CESSAC="", GST_BANKCHANGES_ACC_CODES="",GST_TRANSFER_TOSHOW_INNILRATED="",GST_EXCLUDE_NILL_CDNR = "",GST_ISD_OP_IGSTAC="",GST_ISD_OP_CGSTAC="",GST_ISD_OP_SGSTAC="",GST_ISD_OP_CESSAC="",
GST_ISD_IN_IGSTAC="",GST_ISD_IN_CGSTAC="",GST_ISD_IN_SGSTAC="",GST_ISD_IN_CESSAC=""; GST_ISD_IN_IGSTAC="",GST_ISD_IN_CGSTAC="",GST_ISD_IN_SGSTAC="",GST_ISD_IN_CESSAC="", nulldata ="NULLFOUND";
Timestamp fromDate = null, toDate = null , fromdateOracle = null, todateOracle=null; Timestamp fromDate = null, toDate = null , fromdateOracle = null, todateOracle=null;
...@@ -6428,7 +6429,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6428,7 +6429,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 c.TAX_REG_2 = 'UNREGISTER'))" +" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and c.TAX_REG_2 = 'UNREGISTER'))"
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = '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.invoice_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 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
...@@ -6568,7 +6569,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6568,7 +6569,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 c.TAX_REG_2 = 'UNREGISTER'))" +" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and c.TAX_REG_2 = 'UNREGISTER'))"
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = '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.invoice_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 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
...@@ -6709,7 +6710,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6709,7 +6710,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 c.TAX_REG_2 = 'UNREGISTER'))" +" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and c.TAX_REG_2 = 'UNREGISTER'))"
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = '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.invoice_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 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
...@@ -6850,7 +6851,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6850,7 +6851,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 c.TAX_REG_2 = 'UNREGISTER'))" +" where invoice.cust_code = customer.cust_code and invoice.net_amt <= "+GST_B2CL_INV_VAL+" and c.TAX_REG_2 = 'UNREGISTER'))"
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = '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.invoice_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 ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
{ {
...@@ -11903,7 +11904,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -11903,7 +11904,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" FROM journal i where i.TRAN_TYPE='ISD' " +" FROM journal i where i.TRAN_TYPE='ISD' "
+" 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 (select count(1) from gst_data_hdr where ref_ser = 'JOUR' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'JOUR' and ref_id = i.tran_id and rec_type = 1 ) = 0 ";
dtlSql = "SELECT '' AS TRAN_ID," dtlSql = "SELECT '' AS TRAN_ID,"
...@@ -11913,33 +11914,33 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -11913,33 +11914,33 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'G' AS LINE_TYPE," +" 'G' AS LINE_TYPE,"
+" ' ' AS GS_CODE," +" ' ' AS GS_CODE,"
+" 0 AS TAXABLE_AMT,"; +" 0 AS TAXABLE_AMT,";
if(GST_ISD_OP_IGSTAC.length() > 0) if(GST_ISD_OP_IGSTAC.length() > 0 && !GST_ISD_OP_IGSTAC.equalsIgnoreCase(nulldata))
{ {
dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_IGSTAC+") AS IGST_AMT, "; dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_IGSTAC+" and tran_id = i.tran_id ) AS IGST_AMT, ";
} }
else else
{ {
dtlSql = dtlSql +" 0 AS IGST_AMT,"; dtlSql = dtlSql +" 0 AS IGST_AMT,";
} }
if(GST_ISD_OP_CGSTAC.length() > 0) if(GST_ISD_OP_CGSTAC.length() > 0 && !GST_ISD_OP_CGSTAC.equalsIgnoreCase(nulldata))
{ {
dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_CGSTAC+") AS CGST_AMT, "; dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_CGSTAC+" and tran_id = i.tran_id ) AS CGST_AMT, ";
} }
else else
{ {
dtlSql = dtlSql +" 0 AS CGST_AMT,"; dtlSql = dtlSql +" 0 AS CGST_AMT,";
} }
if(GST_ISD_OP_SGSTAC.length() > 0) if(GST_ISD_OP_SGSTAC.length() > 0 && !GST_ISD_OP_SGSTAC.equalsIgnoreCase(nulldata))
{ {
dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_SGSTAC+") AS SGST_AMT, "; dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_SGSTAC+" and tran_id = i.tran_id ) AS SGST_AMT, ";
} }
else else
{ {
dtlSql = dtlSql +" 0 AS SGST_AMT,"; dtlSql = dtlSql +" 0 AS SGST_AMT,";
} }
if(GST_ISD_OP_CESSAC.length() > 0) if(GST_ISD_OP_CESSAC.length() > 0 && !GST_ISD_OP_CESSAC.equalsIgnoreCase(nulldata))
{ {
dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_CESSAC+") AS CESS_AMT, "; dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_CESSAC+" and tran_id = i.tran_id ) AS CESS_AMT, ";
} }
else else
{ {
...@@ -11961,8 +11962,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -11961,8 +11962,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" JOURDET it" +" JOURDET it"
+" WHERE i.tran_id = it.tran_id" +" WHERE i.tran_id = it.tran_id"
+" and it.drcr_flag = 'D'" +" and it.drcr_flag = 'D'"
+" and it.line_no = '1'" +" AND i.TRAN_ID = ? "
+" AND i.TRAN_ID = ? "; +" AND ROWNUM = '1' ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"ISD-OP(Data)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"ISD-OP(Data)");
}//end of ISD queries }//end of ISD queries
...@@ -24503,9 +24504,9 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -24503,9 +24504,9 @@ dtlSql = " select '' as TRAN_ID, "
+" '' as TRAN_ID__REF, " +" '' as TRAN_ID__REF, "
+" ddf_get_siteregno(i.site_code,'OPTNG_SITE') AS SITE_CODE ," +" ddf_get_siteregno(i.site_code,'OPTNG_SITE') AS SITE_CODE ,"
+" i.tran_date as PRD_CODE," +" i.tran_date as PRD_CODE,"
+" '6' as REC_TYPE, " // GSTR1,GSTR2,etc. +" '2' as REC_TYPE, " // GSTR1,GSTR2,etc.
+" 'I' as GST_TYPE," +" 'I' as GST_TYPE,"
+" '12' as TRAN_TYPE," // b2b,b2c +" '33' as TRAN_TYPE," // b2b,b2c
+" ' ' as CUST_CODE, " +" ' ' as CUST_CODE, "
+" ' ' as CUST_NAME, " +" ' ' as CUST_NAME, "
+" ' ' as GST_CODE, " // 2 digit code +" ' ' as GST_CODE, " // 2 digit code
...@@ -24536,7 +24537,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -24536,7 +24537,7 @@ dtlSql = " select '' as TRAN_ID, "
+" FROM journal i where i.TRAN_TYPE='ISD' " +" FROM journal i where i.TRAN_TYPE='ISD' "
+" 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 (select count(1) from gst_data_hdr where ref_ser = 'JOUR' and ref_id = i.tran_id ) = 0 "; +" and (select count(1) from gst_data_hdr where ref_ser = 'JOUR' and ref_id = i.tran_id and rec_type = 2) = 0 ";
dtlSql = "SELECT '' AS TRAN_ID," dtlSql = "SELECT '' AS TRAN_ID,"
...@@ -24546,33 +24547,33 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -24546,33 +24547,33 @@ dtlSql = " select '' as TRAN_ID, "
+" 'G' AS LINE_TYPE," +" 'G' AS LINE_TYPE,"
+" ' ' AS GS_CODE," +" ' ' AS GS_CODE,"
+" 0 AS TAXABLE_AMT,"; +" 0 AS TAXABLE_AMT,";
if(GST_ISD_OP_IGSTAC.length() > 0) if(GST_ISD_IN_IGSTAC.length() > 0 && !GST_ISD_IN_IGSTAC.equalsIgnoreCase(nulldata))
{ {
dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_IGSTAC+") AS IGST_AMT, "; dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_IN_IGSTAC+" and tran_id = i.tran_id) AS IGST_AMT, ";
} }
else else
{ {
dtlSql = dtlSql +" 0 AS IGST_AMT,"; dtlSql = dtlSql +" 0 AS IGST_AMT,";
} }
if(GST_ISD_OP_CGSTAC.length() > 0) if(GST_ISD_IN_CGSTAC.length() > 0 && !GST_ISD_IN_CGSTAC.equalsIgnoreCase(nulldata))
{ {
dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_CGSTAC+") AS CGST_AMT, "; dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_IN_CGSTAC+" and tran_id = i.tran_id) AS CGST_AMT, ";
} }
else else
{ {
dtlSql = dtlSql +" 0 AS CGST_AMT,"; dtlSql = dtlSql +" 0 AS CGST_AMT,";
} }
if(GST_ISD_OP_SGSTAC.length() > 0) if(GST_ISD_IN_SGSTAC.length() > 0 && !GST_ISD_IN_SGSTAC.equalsIgnoreCase(nulldata))
{ {
dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_SGSTAC+") AS SGST_AMT, "; dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_IN_SGSTAC+" and tran_id = i.tran_id) AS SGST_AMT, ";
} }
else else
{ {
dtlSql = dtlSql +" 0 AS SGST_AMT,"; dtlSql = dtlSql +" 0 AS SGST_AMT,";
} }
if(GST_ISD_OP_CESSAC.length() > 0) if(GST_ISD_IN_CESSAC.length() > 0 && !GST_ISD_IN_CESSAC.equalsIgnoreCase(nulldata))
{ {
dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_OP_CESSAC+") AS CESS_AMT, "; dtlSql = dtlSql +" (select sum(it.amount) from JOURDET it where it.ACCT_CODE ="+GST_ISD_IN_CESSAC+" and tran_id = i.tran_id) AS CESS_AMT, ";
} }
else else
{ {
...@@ -24594,10 +24595,10 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -24594,10 +24595,10 @@ dtlSql = " select '' as TRAN_ID, "
+" JOURDET it" +" JOURDET it"
+" WHERE i.tran_id = it.tran_id" +" WHERE i.tran_id = it.tran_id"
+" and it.drcr_flag = 'D'" +" and it.drcr_flag = 'D'"
+" and it.line_no = '1'" +" AND i.TRAN_ID = ? "
+" AND i.TRAN_ID = ? "; +" AND ROWNUM = '1' ";
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"ISD-OP(Data)"); retString = executeSqlAndPopulateData(hdrSql,dtlSql,"ISD-IN(Data)");
} }
/**Added New Queries for ISD outword on 19 june 2018 End */ /**Added New Queries for ISD outword on 19 june 2018 End */
...@@ -36869,7 +36870,6 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -36869,7 +36870,6 @@ dtlSql = " select '' as TRAN_ID, "
//Added by kaustubh on 4 April 2018 start //Added by kaustubh on 4 April 2018 start
//if("2".equalsIgnoreCase(recType)) //if("2".equalsIgnoreCase(recType))
//{ //{
chgDate = rsSelHdr.getTimestamp("CHG_DATE"); chgDate = rsSelHdr.getTimestamp("CHG_DATE");
//} //}
//Added by kaustubh on 4 April 2018 end //Added by kaustubh on 4 April 2018 end
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