Commit a74791d7 authored by kdabholkar's avatar kdabholkar

Adding new queries for custom mismatch sheet .

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@188765 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 027ea6e6
...@@ -42,7 +42,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -42,7 +42,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
String taxClassAllStr = "", taxEnvAllStr = "",GST_EXPWP_TAXCLASS = "",GST_EXPWOP_TAXCLASS = "",GST_SEZWP_TAXCLASS = "", String taxClassAllStr = "", taxEnvAllStr = "",GST_EXPWP_TAXCLASS = "",GST_EXPWOP_TAXCLASS = "",GST_SEZWP_TAXCLASS = "",
GST_SEZWOP_TAXCLASS = "",GST_DE_TAXCLASS = "", GST_SEZWOP_TAXCLASS = "",GST_DE_TAXCLASS = "",
GST_NIL_TAXCLASS = "",GST_EXE_TAXCLASS = "",GST_EXPWP_TAXENV = "",GST_EXPWOP_TAXENV = "",GST_SEZWP_TAXENV = "", GST_NIL_TAXCLASS = "",GST_EXE_TAXCLASS = "",GST_EXPWP_TAXENV = "",GST_EXPWOP_TAXENV = "",GST_SEZWP_TAXENV = "",
GST_SEZWOP_TAXENV = "",GST_DE_TAXENV = "",GST_NIL_TAXENV = "",GST_EXE_TAXENV = "",gstB2CLInvValStr = "",taxChapAllStr="",TAX_CHAP_STR="",RCM_DATA_VOUCH=""; GST_SEZWOP_TAXENV = "",GST_DE_TAXENV = "",GST_NIL_TAXENV = "",GST_EXE_TAXENV = "",gstB2CLInvValStr = "",taxChapAllStr="",TAX_CHAP_STR="",SRET_FULL_TRANTYPE="",RCM_DATA_VOUCH="";
/*disparm of purchase 4C */ /*disparm of purchase 4C */
...@@ -52,7 +52,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -52,7 +52,7 @@ 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="", nulldata ="NULLFOUND"; GST_ISD_IN_IGSTAC="",GST_ISD_IN_CGSTAC="",GST_ISD_IN_SGSTAC="",GST_ISD_IN_CESSAC="", nulldata ="NULLFOUND", GST_SALES_ACC_CODES ="",GST_PURCHASE_ACC_CODES ="";
...@@ -195,6 +195,14 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -195,6 +195,14 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
prcType = genericUtility.getColumnValue("prc_type",headerDom); prcType = genericUtility.getColumnValue("prc_type",headerDom);
sitecode= genericUtility.getColumnValue("site_code",headerDom); sitecode= genericUtility.getColumnValue("site_code",headerDom);
/**Changed By Kustubh on 1 Aug 2018 start ***/
String oneSales = period.substring(0,4);
String periodSales=period.substring(4,6)+oneSales;
System.out.println("two::"+periodSales+"NewType"+type);
/**Changed By Kustubh on 1 Aug 2018 end ***/
System.out.println("Login SiteCode["+loginSiteCode+"] PrdCode["+period+"] Type["+type+"] ProcessType[::"+prcType+"] sitecode["+sitecode+"]" ); System.out.println("Login SiteCode["+loginSiteCode+"] PrdCode["+period+"] Type["+type+"] ProcessType[::"+prcType+"] sitecode["+sitecode+"]" );
if(period == null || period.trim().length() == 0) if(period == null || period.trim().length() == 0)
...@@ -224,7 +232,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -224,7 +232,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
System.out.println("Wrong month entered, it should not be more than 12 and less than 01"); System.out.println("Wrong month entered, it should not be more than 12 and less than 01");
retString = itmDBAccessEJB.getErrorString("","VTPRDMONTH","","",connGST); retString = itmDBAccessEJB.getErrorString("","VTPRDMONTH","","",connGST);
return retString; return retString;
} }
System.out.println("Month ["+month+"] Year ["+year+"] ");*/ System.out.println("Month ["+month+"] Year ["+year+"] ");*/
...@@ -349,9 +357,22 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -349,9 +357,22 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
GST_TRANSFER_TOSHOW_INNILRATED = distCommon.getDisparams("999999", "GST_TRANSFER_TOSHOW_INNILRATED", connGST); GST_TRANSFER_TOSHOW_INNILRATED = distCommon.getDisparams("999999", "GST_TRANSFER_TOSHOW_INNILRATED", connGST);
GST_EXCLUDE_NILL_CDNR = distCommon.getDisparams("999999", "GST_EXCLUDE_NILL_CDNR", connGST); GST_EXCLUDE_NILL_CDNR = distCommon.getDisparams("999999", "GST_EXCLUDE_NILL_CDNR", connGST);
TAX_CHAP_STR = distCommon.getDisparams("999999", "TAX_CHAP_STR", connGST); TAX_CHAP_STR = distCommon.getDisparams("999999", "TAX_CHAP_STR", connGST);
GST_SALES_ACC_CODES = distCommon.getDisparams("999999", "GST_SALES_ACC_CODES", connGST);
GST_PURCHASE_ACC_CODES = distCommon.getDisparams("999999", "GST_PURCHASE_ACC_CODES", connGST);
SRET_FULL_TRANTYPE = distCommon.getDisparams("999999", "SRET_FULL_TRANTYPE", connGST);
TAX_CHAP_STR=TAX_CHAP_STR.replace(",", "','"); TAX_CHAP_STR=TAX_CHAP_STR.replace(",", "','");
TAX_CHAP_STR="'"+TAX_CHAP_STR+"'"; TAX_CHAP_STR="'"+TAX_CHAP_STR+"'";
GST_SALES_ACC_CODES=GST_SALES_ACC_CODES.replace(",", "','");
GST_SALES_ACC_CODES="'"+GST_SALES_ACC_CODES+"'";
GST_PURCHASE_ACC_CODES=GST_PURCHASE_ACC_CODES.replace(",", "','");
GST_PURCHASE_ACC_CODES="'"+GST_PURCHASE_ACC_CODES+"'";
SRET_FULL_TRANTYPE=SRET_FULL_TRANTYPE.replace(",", "','");
SRET_FULL_TRANTYPE="'"+SRET_FULL_TRANTYPE+"'";
RCM_DATA_VOUCH = distCommon.getDisparams("999999", "RCM_DATA_VOUCH", connGST); RCM_DATA_VOUCH = distCommon.getDisparams("999999", "RCM_DATA_VOUCH", connGST);
...@@ -560,7 +581,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -560,7 +581,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.inv_type <> 'EC' " +" and i.inv_type <> 'EC' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV'" +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV'"
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') " +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
...@@ -1533,7 +1559,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1533,7 +1559,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" AND i.desp_id= d.desp_id " +" AND i.desp_id= d.desp_id "
+" and state.state_code = d.STATE_CODE__DLV " +" and state.state_code = d.STATE_CODE__DLV "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' "
+" and i.inv_type='EC' " +" and i.inv_type='EC' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV'" +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV'"
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') " +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
...@@ -1700,7 +1731,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1700,7 +1731,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and st_c.gst_code <> st_own.gst_code " //-- inter-state only +" and st_c.gst_code <> st_own.gst_code " //-- inter-state only
+" and i.net_amt > "+GST_B2CL_INV_VAL+" " //-- amount is more than 2.5 lakh " +" and i.net_amt > "+GST_B2CL_INV_VAL+" " //-- amount is more than 2.5 lakh "
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.inv_type <> 'EC' " +" and i.inv_type <> 'EC' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('I','J') " +" and ti.tran_id = i.invoice_id and tm.tax_type in ('I','J') "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
...@@ -2011,7 +2047,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2011,7 +2047,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" AND st_c.state_code = d.STATE_CODE__DLV " //+" AND st_c.state_code = d.STATE_CODE__DLV "
+" AND state.state_code = d.STATE_CODE__DLV " +" AND state.state_code = d.STATE_CODE__DLV "
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" AND i.inv_type ='EC' " +" AND i.inv_type ='EC' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and i.net_amt >= "+GST_B2CL_INV_VAL+" " //-- amount is more than 2.5 lakh " +" and i.net_amt >= "+GST_B2CL_INV_VAL+" " //-- amount is more than 2.5 lakh "
+ "AND s.state_code = d.STATE_CODE__DLV " + "AND s.state_code = d.STATE_CODE__DLV "
+" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
...@@ -2174,7 +2215,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2174,7 +2215,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s " +" from invoice i,customer c, site s "
+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" 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-INV' and ti.tran_id = i.invoice_id " +" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and tm.tax_type in ('G','H','I','J')" ; +" and tm.tax_type in ('G','H','I','J')" ;
...@@ -2330,7 +2376,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2330,7 +2376,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 'S-INV' as ref_ser " +" 'S-INV' as ref_ser "
+" from invoice i,customer c, site s " +" from invoice i,customer c, site s "
+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti, " +" and (select count(1) from taxtran ti, "
+" tax tm where tm.tax_code = ti.tax_code " +" tax tm where tm.tax_code = ti.tax_code "
+" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id " +" and ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
...@@ -2489,7 +2540,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2489,7 +2540,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
if(GST_SEZWP_TAXCLASS.length() > 0) if(GST_SEZWP_TAXCLASS.length() > 0)
...@@ -2640,7 +2696,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2640,7 +2696,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
if(GST_SEZWOP_TAXCLASS.length() > 0) if(GST_SEZWOP_TAXCLASS.length() > 0)
...@@ -2794,7 +2855,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2794,7 +2855,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc <> 0 "; +" and ti.tax_perc <> 0 ";
if(GST_DE_TAXCLASS.length() > 0) if(GST_DE_TAXCLASS.length() > 0)
...@@ -2948,7 +3014,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2948,7 +3014,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.state_code = st_own.state_code " +" and s.state_code = st_own.state_code "
+" and st_own.gst_code = st_c.gst_code " //Intra-state supply. Site.GST_CODE = Customer's SITE.GST_CODE +" and st_own.gst_code = st_c.gst_code " //Intra-state supply. Site.GST_CODE = Customer's SITE.GST_CODE
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.inv_type <> 'EC' " +" and i.inv_type <> 'EC' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" 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, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') " +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
...@@ -3110,7 +3181,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3110,7 +3181,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" AND i.desp_id= d.desp_id " +" AND i.desp_id= d.desp_id "
+" AND state.state_code = d.STATE_CODE__DLV" +" AND state.state_code = d.STATE_CODE__DLV"
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.inv_type = 'EC' " +" and i.inv_type = 'EC' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and i.net_amt < "+GST_B2CL_INV_VAL+" " //-- amount is more than 2.5 lakh " +" and i.net_amt < "+GST_B2CL_INV_VAL+" " //-- amount is more than 2.5 lakh "
+" AND S.state_code = d.STATE_CODE__DLV " +" AND S.state_code = d.STATE_CODE__DLV "
...@@ -3278,7 +3354,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3278,7 +3354,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and st_own.gst_code <> st_c.gst_code " //Site.GST_CODE<>Customer's SITE.GST_CODE +" and st_own.gst_code <> st_c.gst_code " //Site.GST_CODE<>Customer's SITE.GST_CODE
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' "
+" and i.net_amt <= "+GST_B2CL_INV_VAL+" " +" and i.net_amt <= "+GST_B2CL_INV_VAL+" "
+" and i.inv_type <> 'EC' " +" and i.inv_type <> 'EC' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" 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, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti, tax tm where tm.tax_code = ti.tax_code and ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') " +" and ti.tran_id = i.invoice_id and tm.tax_type in ('G','H','I','J') "
...@@ -3603,7 +3684,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3603,7 +3684,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " // site.state_CODE<>customer' state.state_code +" and s.state_code <> c.state_code " // site.state_CODE<>customer' state.state_code
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -3984,7 +4070,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3984,7 +4070,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -4219,7 +4310,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4219,7 +4310,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -4449,7 +4545,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4449,7 +4545,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' and ti.tran_id = i.invoice_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -4679,7 +4780,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4679,7 +4780,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and i.invoice_id = a.invoice_id " +" and i.invoice_id = a.invoice_id "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.inv_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' " +" and (select count(1) from taxtran ti where ti.tran_code = 'S-INV' "
+" and ti.tran_id = i.invoice_id "; +" and ti.tran_id = i.invoice_id ";
if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
...@@ -6005,7 +6111,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6005,7 +6111,12 @@ 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 ='C'" +" and i.drcr_flag ='C'"
+" AND s.state_code = st_own.state_code " +" AND s.state_code = st_own.state_code "
+" AND st_own.gst_code = st_c.gst_code " +" AND st_own.gst_code = st_c.gst_code ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" 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.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'))"
...@@ -6150,7 +6261,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6150,7 +6261,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and i.drcr_flag ='C'" +" and i.drcr_flag ='C'"
+" AND s.state_code = st_own.state_code " +" AND s.state_code = st_own.state_code "
+" AND st_own.gst_code <> st_c.gst_code " +" AND st_own.gst_code <> st_c.gst_code "
+" 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' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" 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' "
...@@ -6585,7 +6701,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6585,7 +6701,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -6729,7 +6850,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6729,7 +6850,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code = c.state_code " +" and s.state_code = c.state_code "
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -6873,7 +6999,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6873,7 +6999,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and trim(c.tax_reg_2) = 'UNREGISTER' " +" and trim(c.tax_reg_2) = 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -7015,7 +7146,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7015,7 +7146,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" and state.state_code = c.state_code " +" and state.state_code = c.state_code "
+" and s.state_code <> c.state_code " +" and s.state_code <> c.state_code "
+" and trim(c.tax_reg_2) <> 'UNREGISTER' " +" and trim(c.tax_reg_2) <> 'UNREGISTER' ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") ";
}
hdrSql = hdrSql
+" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id " +" and (select count(1) from taxtran ti where ti.tran_code = 'CRNRCP' and ti.tran_id = i.tran_id "
+" and ti.tax_perc = 0 "; +" and ti.tax_perc = 0 ";
if(GST_NIL_TAXCLASS.length() > 0) if(GST_NIL_TAXCLASS.length() > 0)
...@@ -8931,7 +9067,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8931,7 +9067,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" 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 ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") ";
}
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 (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
...@@ -9502,7 +9643,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -9502,7 +9643,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" where c.cust_code = i.cust_code " +" where c.cust_code = i.cust_code "
+" and s.site_code = i.site_code " +" and s.site_code = i.site_code "
+" 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 ";
if(SRET_FULL_TRANTYPE.length() > 0)
{
hdrSql = hdrSql +" and i.tran_type not in ("+SRET_FULL_TRANTYPE+") ";
}
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 (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
...@@ -11726,6 +11872,63 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -11726,6 +11872,63 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/**New Query added by Kaustubh on 19 june 2018 for ISD Include in GSTR 3B end **/ /**New Query added by Kaustubh on 19 june 2018 for ISD Include in GSTR 3B end **/
/**New Query added by Kaustubh on 1 Aug 2018 for Mismatch Sheet data start **/
{
hdrSql = "SELECT '' AS TRAN_ID," +
" '' AS TRAN_ID__REF," +
" ddf_get_siteregno(i.site_code,'OPTNG_SITE') AS SITE_CODE ," +
" i.tran_date AS PRD_CODE," +
" '1' AS REC_TYPE," +
" 'I' AS GST_TYPE," +
" '50' AS TRAN_TYPE," +
" '' AS CUST_CODE," +
" '' AS CUST_NAME," +
" '00' AS GST_CODE," +
" '' AS SUBMISSION_TYPE," +
" '' AS DOC_CHECKSUM," +
" 'R' AS DOC_TYPE," +
" i.ref_id AS DOC_NO," +
" i.tran_date AS DOC_DATE," +
" '' AS AMOUNT," +
" 'N' AS REVERSE_CHRG," +
" ' ' AS LR_NO," +
" ' ' AS REAS_CODE," +
" ' ' AS REF_ID__INV," +
" 'N' AS PROV_ASSMNT," +
" '' AS ORDER_NO," +
" '' AS REMARKS," +
" i.ref_id AS REF_ID," +
" ' ' AS SUBMIT_STATUS," +
" '' ADD_USER," +
" '' ADD_TERM," +
" ' ' CHG_USER," +
" i.TRAN_DATE AS CHG_DATE," +
" ' 'CHG_TERM," +
" ' ' AS TAX_REG_NO," +
" ' ' AS RECO_STATUS," +
" ' ' AS ECOM_REG_NO," +
" i.ref_ser AS ref_ser " +
"FROM gltrace i ";
if(GST_SALES_ACC_CODES.length() > 0 && !GST_SALES_ACC_CODES.equalsIgnoreCase(nulldata))
{
hdrSql = hdrSql + "where Acct_Code In(" + GST_SALES_ACC_CODES+")" ;
}
hdrSql = hdrSql +
"AND i.tran_date BETWEEN ? AND ? " +
"and i.REF_ID not in (select ref_id from gst_data_hdr where prd_code = "+periodSales+" and rec_type ='1' )" +
"AND (SELECT COUNT(1)" +
" FROM gst_data_hdr" +
" where ref_id = i.ref_id) = 0 " ;
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"MisMatched-List-GSTR1");
}
/**New Query added by Kaustubh on 1 Aug 2018 for Mismatch Sheet data end **/
}//if ("Y".equalsIgnoreCase(SALES_DATA_MISC)) }//if ("Y".equalsIgnoreCase(SALES_DATA_MISC))
}//if ("S".equalsIgnoreCase(type)) }//if ("S".equalsIgnoreCase(type))
if ("P".equalsIgnoreCase(type)) if ("P".equalsIgnoreCase(type))
...@@ -11883,7 +12086,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -11883,7 +12086,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
if ("G".equalsIgnoreCase(PURCHASE_DATA_PORCP)) if ("G".equalsIgnoreCase(PURCHASE_DATA_PORCP))
{ {
System.out.println("Inside GRN SQLs"); System.out.println("Inside GRN SQLs");
retString= processForGRNPurchaseData(); retString= processForGRNPurchaseData(periodSales);
} }
/*Voucher SQLs /*Voucher SQLs
...@@ -24405,13 +24608,16 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -24405,13 +24608,16 @@ dtlSql = " select '' as TRAN_ID, "
return retString; return retString;
} }
public String processForGRNPurchaseData() public String processForGRNPurchaseData(String period)
{ {
System.out.println("inside processForGRNPurchaseData"); System.out.println("inside processForGRNPurchaseData");
String hdrSql = "",dtlSql = "",retString = ""; String hdrSql = "",dtlSql = "",retString = "";
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy"); SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy");
String strDate= formatter.format(fromDate); String strDate= formatter.format(fromDate);
System.out.println("strDte"+strDate); System.out.println("strDte"+strDate);
System.out.println("periodPurchase"+period);
try{ try{
/**Added New Queries for ISD outword on 19 june 2018 Start*/ /**Added New Queries for ISD outword on 19 june 2018 Start*/
...@@ -32619,7 +32825,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32619,7 +32825,7 @@ 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,"
+"OTH as UNIT," +" 'OTH' as UNIT,"
// +" (it.quantity__stduom) as QUANTITY," // +" (it.quantity__stduom) as QUANTITY,"
+" 0 as QUANTITY," +" 0 as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
...@@ -32794,7 +33000,7 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -32794,7 +33000,7 @@ 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,"
+"'OTH as UNIT,'" +" 'OTH' as UNIT,"
// +" (it.quantity__stduom) as QUANTITY," // +" (it.quantity__stduom) as QUANTITY,"
+" 0 as QUANTITY," +" 0 as QUANTITY,"
+" 'OE' as SUPPLY_TYPE," ; +" 'OE' as SUPPLY_TYPE," ;
...@@ -36969,6 +37175,63 @@ dtlSql = " select '' as TRAN_ID, " ...@@ -36969,6 +37175,63 @@ dtlSql = " select '' as TRAN_ID, "
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
// retString = executeSqlAndPopulateData(hdrSql,dtlSql,"10B(2)"); // retString = executeSqlAndPopulateData(hdrSql,dtlSql,"10B(2)");
/*****New Query Added by Kaustubh on 1 Aug 2018 to find the which data is not populated start ******/
{
hdrSql = "SELECT '' AS TRAN_ID," +
" '' AS TRAN_ID__REF," +
" ddf_get_siteregno(i.site_code,'OPTNG_SITE') AS SITE_CODE ," +
" i.tran_date AS PRD_CODE," +
" '2' AS REC_TYPE," +
" 'I' AS GST_TYPE," +
" '50' AS TRAN_TYPE," +
" '' AS CUST_CODE," +
" '' AS CUST_NAME," +
" '00' AS GST_CODE," +
" '' AS SUBMISSION_TYPE," +
" '' AS DOC_CHECKSUM," +
" 'R' AS DOC_TYPE," +
" i.ref_id AS DOC_NO," +
" i.tran_date AS DOC_DATE," +
" '' AS AMOUNT," +
" 'N' AS REVERSE_CHRG," +
" ' ' AS LR_NO," +
" ' ' AS REAS_CODE," +
" ' ' AS REF_ID__INV," +
" 'N' AS PROV_ASSMNT," +
" '' AS ORDER_NO," +
" '' AS REMARKS," +
" i.ref_id AS REF_ID," +
" ' ' AS SUBMIT_STATUS," +
" '' ADD_USER," +
" '' ADD_TERM," +
" ' ' CHG_USER," +
" i.TRAN_DATE AS CHG_DATE," +
" ' 'CHG_TERM," +
" ' ' AS TAX_REG_NO," +
" ' ' AS RECO_STATUS," +
" ' ' AS ECOM_REG_NO," +
" i.ref_ser AS ref_ser " +
"FROM gltrace i ";
if(GST_PURCHASE_ACC_CODES.length() > 0 && !GST_PURCHASE_ACC_CODES.equalsIgnoreCase(nulldata))
{
hdrSql = hdrSql + "where Acct_Code In(" + GST_PURCHASE_ACC_CODES+")" ;
}
hdrSql = hdrSql +
"AND i.tran_date BETWEEN ? AND ? " +
"and i.REF_ID not in (select ref_id from gst_data_hdr where prd_code = "+period+" and rec_type ='2' )" +
"AND (SELECT COUNT(1)" +
" FROM gst_data_hdr" +
" where ref_id = i.ref_id) = 0 " ;
retString = executeSqlAndPopulateData(hdrSql,dtlSql,"MisMatched-List-GSTR2");
}
/*****New Query Added by Kaustubh on 1 Aug 2018 to find the which data is not populated start ******/
} }
} }
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