Commit 510a2834 authored by kdabholkar's avatar kdabholkar

commited changes of detail SQL


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106360 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6531766c
...@@ -434,27 +434,31 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -434,27 +434,31 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19 july 2017*/ /*added by kaustubh on 19 july 2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/
+"from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item"
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*added by kaustubh on 19 july 2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code(+) = it.item_code "*/ +" and si.item_code(+) = it.item_code "*/
+" 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 " /* commented by kaustubh on 21 july 2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_id "
+"and tx.tax_type in ('G','H','I','J')" ; +"and tx.tax_type in ('G','H','I','J')" ;*/
/* commented by kaustubh on 19 july 2017*/
/*+" and t.tax_code = tx.tax_code " /*+" and t.tax_code = tx.tax_code "
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) /* commented by kaustubh on 21 july 2017*/
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0"; dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0";
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
...@@ -464,7 +468,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -464,7 +468,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql*/
+" and i.invoice_id = ? ";
/* commented by kaustubh on 19 july 2017* only Unit/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
//--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE','' //--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE',''
...@@ -597,22 +605,30 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -597,22 +605,30 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('D-ISS',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
/* added by kaustubh */ /* added by kaustubh */
+"fn_get_gst_rate('D-ISS',i.tran_id, it.line_no) as gst_rate" +"fn_get_gst_rate('D-ISS',i.tran_id, it.line_no) as gst_rate "
+" from distord_iss i,distord_issdet it, item" +" from distord_iss i,distord_issdet it, item"
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/*Commented by kaustubh on 19-7-17*/ /*Commented by kaustubh on 19-7-17*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
+" 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 "
/*Commented by kaustubh on 21-7-17*/
/* +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'D-ISS' " +"and ti.tran_code = 'D-ISS' "
+"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')" ;*/
/*Commented by kaustubh on 19-7-17*/
/*+" and t.tax_code = tx.tax_code " /*+" and t.tax_code = tx.tax_code "
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'D-ISS' " +" and tx.tran_code = 'D-ISS' "
+" and tx.tran_id = i.tran_id ";*/ +" and tx.tran_id = i.tran_id ";*/
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
/*Commented by kaustubh on 21-7-17*/
/* if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0"; dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0";
...@@ -622,7 +638,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -622,7 +638,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql + " and i.tran_id = ? " ; dtlSql = dtlSql */
+ " and i.tran_id = ? " ;
/*commented by kaustubh*/ /*commented by kaustubh*/
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
//--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE','' //--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE',''
...@@ -753,10 +771,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -753,10 +771,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('P-RET',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('P-RET',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS , " +" '' as REMARKS , "
+" fn_get_gst_rate('P-RET',i.tran_id, it.line_no) as gst_rate" +" fn_get_gst_rate('P-RET',i.tran_id, it.line_no) as gst_rate "
/*commented by kaustubh */ /*commented by kaustubh */
+"from porcp i,porcpdet it,item item" +" from porcp i,porcpdet it,item item"
/*+" from porcp i,porcpdet it,taxtran tx, siteitem si, tax t, item item, uom u " */ /*+" from porcp i,porcpdet it,taxtran tx, siteitem si, tax t, item item, uom u " */
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/* commented by kaustubh*/ /* commented by kaustubh*/
...@@ -764,10 +782,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -764,10 +782,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
+" 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 " /*commented by kaustubh on 21-7-2017*/
/* +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'P-RET' " +"and ti.tran_code = 'P-RET' "
+"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')" ;*/
/*commented by kaustubh on 19-7-2017*/ /*commented by kaustubh on 19-7-2017*/
/* +" and t.tax_code = tx.tax_code " /* +" and t.tax_code = tx.tax_code "
...@@ -775,7 +794,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -775,7 +794,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.tran_code = 'P-RET' " +" and tx.tran_code = 'P-RET' "
+" and tx.tran_id = i.tran_id ";*/ +" and tx.tran_id = i.tran_id ";*/
if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
/*commented by kaustubh on 21-7-2017*/
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0"; dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0";
...@@ -786,7 +807,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -786,7 +807,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.tran_id = ? "; dtlSql = dtlSql*/
+" and i.tran_id = ? ";
/*commented by kaustubh*/ /*commented by kaustubh*/
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
//--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE','' //--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE',''
...@@ -926,11 +949,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -926,11 +949,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS" +" '' as REMARKS"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+" fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate" +" fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" from voucher i,vouchrcp it,taxtran tx, siteitem si, tax t, item item,uom u " */ /* +" from voucher i,vouchrcp it,taxtran tx, siteitem si, tax t, item item,uom u " */
+" from voucher i,vouchrcp it, item item" +" from voucher i,vouchrcp it, item item "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
/* +" and si.site_code = i.site_code " /* +" and si.site_code = i.site_code "
...@@ -942,13 +965,15 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -942,13 +965,15 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.tran_code = 'VOUCH' " +" and tx.tran_code = 'VOUCH' "
+" and tx.tran_id = i.tran_id " +" and tx.tran_id = i.tran_id "
+" and t.TAX_GROUP = 'RCM' ";*/ +" and t.TAX_GROUP = 'RCM' ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code " /*commented by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'VOUCH' " +"and ti.tran_code = 'VOUCH' "
+"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 )) /*commented by kaustubh on 21-07-2017*/
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0"; dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0";
...@@ -959,7 +984,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -959,7 +984,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.tran_id = ? "; dtlSql = dtlSql */
+" and i.tran_id = ? ";
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
//--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE','' //--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE',''
...@@ -1096,10 +1123,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1096,10 +1123,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('VOUCH',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
+"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate" +"fn_get_gst_rate('VOUCH',i.tran_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from misc_voucher i,misc_vouchdet it,taxtran tx, siteitem si, tax t, item item,uom u " */ /*+" from misc_voucher i,misc_vouchdet it,taxtran tx, siteitem si, tax t, item item,uom u " */
+" from misc_voucher i,misc_vouchdet it, item item" +" from misc_voucher i,misc_vouchdet it, item item "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" and si.site_code = i.site_code " /* +" and si.site_code = i.site_code "
...@@ -1112,18 +1139,22 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1112,18 +1139,22 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.tran_id = i.tran_id " +" and tx.tran_id = i.tran_id "
+" and tx.line_no = it.line_no" +" and tx.line_no = it.line_no"
+" and t.TAX_GROUP = 'RCM' ";*/ +" and t.TAX_GROUP = 'RCM' ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code " /*changed by kaustubh on 21-07-2017*/
/* +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'VOUCH' " +"and ti.tran_code = 'VOUCH' "
+"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')" ;*/
//+" and tx.tax_class not in ("+taxClassStr+") " //+" and tx.tax_class not in ("+taxClassStr+") "
if(taxClassAllStr.length() > 0) /*changed by kaustubh on 21-07-2017*/
{ // if(taxClassAllStr.length() > 0)
dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") "; //{
} // dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") ";
dtlSql = dtlSql +" and i.tran_id = ? "; //}
//dtlSql = dtlSql
+" and i.tran_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
//--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE','' //--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE',''
...@@ -1258,7 +1289,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1258,7 +1289,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item item, uom u " */ /* +" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item item, uom u " */
...@@ -1274,10 +1305,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1274,10 +1305,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code " /*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -1294,9 +1326,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1294,9 +1326,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") "; dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") ";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017 only unit*/
/* +" and u.unit = item.unit "; */ /* +" and u.unit = item.unit "; */
//--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE','' //--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE',''
...@@ -1420,10 +1455,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1420,10 +1455,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS," +" '' as REMARKS,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('P-RET',i.tran_id, it.line_no) as gst_rate" +"fn_get_gst_rate('P-RET',i.tran_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" from porcp i,porcpdet it,taxtran tx, siteitem si, tax t, item item,uom u " */ /* +" from porcp i,porcpdet it,taxtran tx, siteitem si, tax t, item item,uom u " */
+" from porcp i,porcpdet it,item item" +" from porcp i,porcpdet it,item item "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" and si.site_code = i.site_code " /* +" and si.site_code = i.site_code "
...@@ -1436,9 +1471,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1436,9 +1471,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.tran_code = 'P-RET' " +" and tx.tran_code = 'P-RET' "
+" and tx.tran_id = i.tran_id ";*/ +" and tx.tran_id = i.tran_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code " /*changed by kaustubh on 21-07-2017*/
/* +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'P-RET' " +"and ti.tran_code = 'P-RET' "
+"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 ))
...@@ -1455,7 +1491,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1455,7 +1491,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") "; dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") ";
} }
dtlSql = dtlSql +" and i.tran_id = ? "; dtlSql = dtlSql*/
+" and i.tran_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
//--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE','' //--group by '',it.line_no, 'A', 0, 'G', si.hsn_no, tx.TAXABLE_AMT,t.tax_type,tx.tax_perc, item.sh_descr, item.UNIT, 'OE',''
...@@ -1582,8 +1620,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1582,8 +1620,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -1594,9 +1632,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1594,9 +1632,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/* +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
...@@ -1609,7 +1650,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1609,7 +1650,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql*/
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -1733,10 +1777,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1733,10 +1777,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
+" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it,item" +" from invoice i,invoice_trace it,item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -1749,9 +1793,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1749,9 +1793,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and t.tax_type in ('G','H','I','J') " //+" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
...@@ -1764,7 +1810,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1764,7 +1810,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql*/
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -1888,10 +1936,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1888,10 +1936,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -1903,9 +1951,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1903,9 +1951,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/* +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -1917,7 +1967,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1917,7 +1967,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/// dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; /// dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
...@@ -2042,10 +2094,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2042,10 +2094,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it,item" +" from invoice i,invoice_trace it,item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -2056,9 +2108,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2056,9 +2108,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and t.tax_type in ('G','H','I','J') " //+" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -2070,7 +2124,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2070,7 +2124,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
...@@ -2196,9 +2252,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2196,9 +2252,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate," +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
...@@ -2209,9 +2265,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2209,9 +2265,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//+" and t.tax_type in ('G','H','I','J') " //+" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_id "
+"and tx.tax_type in ('G','H','I','J')" ; +"and tx.tax_type in ('G','H','I','J')" ;
...@@ -2225,7 +2283,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2225,7 +2283,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -2344,10 +2404,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2344,10 +2404,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -2359,9 +2419,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2359,9 +2419,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/* +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -2373,7 +2435,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2373,7 +2435,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -2491,10 +2555,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2491,10 +2555,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
...@@ -2504,9 +2568,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2504,9 +2568,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"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-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -2519,7 +2585,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2519,7 +2585,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -2645,9 +2713,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2645,9 +2713,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
+" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/
+" from invoice i,invoice_trace it,item" +" from invoice i,invoice_trace it,item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -2658,9 +2726,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2658,9 +2726,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*commented by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -2672,7 +2742,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2672,7 +2742,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -2795,23 +2867,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2795,23 +2867,26 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT," +" fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
/*+" and item.item_code = it.item_code " +" and item.item_code = it.item_code "
+" and t.tax_code = tx.tax_code "
/*+" and t.tax_code = tx.tax_code "
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*commented by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
...@@ -2825,7 +2900,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2825,7 +2900,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql*/
+" and i.invoice_id = ? ";
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -2942,10 +3019,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2942,10 +3019,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
...@@ -2955,9 +3032,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2955,9 +3032,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type not in ('G','H','I','J') " +" and t.tax_type not in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*updated by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -2969,7 +3048,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2969,7 +3048,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*commited by kaustubh on 19-07-2017*/ /*commited by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -3094,10 +3175,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3094,10 +3175,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/
+" from invoice i,invoice_trace it,item" +" from invoice i,invoice_trace it,item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
...@@ -3107,9 +3188,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3107,9 +3188,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -3121,7 +3204,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3121,7 +3204,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -3244,10 +3329,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3244,10 +3329,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*updated by kaustubh on 19-07-2017*/ /*updated by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
...@@ -3258,9 +3343,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3258,9 +3343,12 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -3272,7 +3360,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3272,7 +3360,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql*/
+" and i.invoice_id = ? ";
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -3389,11 +3479,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3389,11 +3479,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/
+" from invoice i,invoice_trace it,item " +" from invoice i,invoice_trace it,item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
+" and item.item_code = it.item_code " +" and item.item_code = it.item_code "
...@@ -3402,9 +3492,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3402,9 +3492,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type not in ('G','H','I','J') " +" and t.tax_type not in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*updated by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -3416,7 +3508,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3416,7 +3508,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
// dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; // dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -3542,10 +3636,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3542,10 +3636,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/
+" from invoice i,invoice_trace it,item" +" from invoice i,invoice_trace it,item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -3556,9 +3650,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3556,9 +3650,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*commented by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -3570,7 +3666,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3570,7 +3666,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
...@@ -3697,10 +3795,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3697,10 +3795,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS, " +" '' as REMARKS, "
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item, uom u "*/
+" from invoice i,invoice_trace it,item" +" from invoice i,invoice_trace it,item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -3711,9 +3809,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3711,9 +3809,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*updated by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -3725,7 +3825,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3725,7 +3825,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*updated by kaustubh on 19-07-2017*/ /*updated by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -3842,10 +3944,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3842,10 +3944,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
...@@ -3855,9 +3957,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3855,9 +3957,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type not in ('G','H','I','J') " +" and t.tax_type not in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -3869,7 +3973,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3869,7 +3973,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql+" and i.invoice_id = ? "; dtlSql = dtlSql*/
+" and i.invoice_id = ? ";
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
...@@ -3996,10 +4102,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3996,10 +4102,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS, " +" '' as REMARKS, "
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*updated by kaustubh on 19-07-2017*/ /*updated by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
...@@ -4009,9 +4115,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4009,9 +4115,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*updated by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -4023,7 +4131,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4023,7 +4131,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*commited by kaustubh on 19-07-2017*/ /*commited by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -4145,23 +4255,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4145,23 +4255,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" (case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT,"*/ +" (case when t.tax_type = 'J' then tx.tax_amt else 0 end) as CESS_AMT,"*/
+" '' as REMARKS, " +" '' as REMARKS, "
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +"fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*commited by kaustubh on 19-07-2017*/ /*commited by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
+" and item.item_code = it.item_code " +" and item.item_code = it.item_code "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and t.tax_code = tx.tax_code " /*+" and t.tax_code = tx.tax_code "
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -4173,7 +4285,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4173,7 +4285,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0"; dtlSql =dtlSql +" and cast(ti.line_no as integer) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -4289,10 +4403,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4289,10 +4403,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
+" '' as REMARKS ," +" '' as REMARKS ,"
+" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it, item" +" from invoice i,invoice_trace it, item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*commited by kaustubh on 19-07-2017*/ /*commited by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -4303,9 +4417,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4303,9 +4417,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type not in ('G','H','I','J') " +" and t.tax_type not in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*commited by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
...@@ -4318,7 +4434,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4318,7 +4434,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql*/
+" and i.invoice_id = ? ";
/*commited by kaustubh on 19-07-2017*/ /*commited by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -4441,10 +4559,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4441,10 +4559,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('S-INV',i.invoice_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
+" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('S-INV',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from invoice i,invoice_trace it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from invoice i,invoice_trace it,item," +" from invoice i,invoice_trace it,item "
+" where i.invoice_id = it.invoice_id " +" where i.invoice_id = it.invoice_id "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
...@@ -4455,9 +4573,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4455,9 +4573,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'S-INV' " +" and tx.tran_code = 'S-INV' "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'S-INV' " +"and ti.tran_code = 'S-INV' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -4473,7 +4593,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4473,7 +4593,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") "; dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") ";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -4598,7 +4720,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4598,7 +4720,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 20-07-2017*/ /*added by kaustubh on 20-07-2017*/
+" fn_get_gst_rate('CRNRCP',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('CRNRCP',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 20-07-2017*/ /*changed by kaustubh on 20-07-2017*/
/*+" from drcr_rcp i,drcr_rdet it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from drcr_rcp i,drcr_rdet it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from drcr_rcp i,drcr_rdet it, item " +" from drcr_rcp i,drcr_rdet it, item "
...@@ -4612,9 +4734,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4612,9 +4734,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code in ( 'CRNRCP','DRNRCP') " +" and tx.tran_code in ( 'CRNRCP','DRNRCP') "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*added by kaustubh on 20-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'CRNRCP' " +"and ti.tran_code = 'CRNRCP' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -4626,7 +4750,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4626,7 +4750,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*added by kaustubh on 20-07-2017*/ /*added by kaustubh on 20-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -4748,23 +4874,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4748,23 +4874,25 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 20-07-2017*/ /*added by kaustubh on 20-07-2017*/
+" fn_get_gst_rate('DRNRCP',i.invoice_id, it.line_no) as gst_rate" +" fn_get_gst_rate('DRNRCP',i.invoice_id, it.line_no) as gst_rate "
/*changed by kaustubh on 20-07-2017*/ /*changed by kaustubh on 20-07-2017*/
/*+" from drcr_rcp i,drcr_rdet it,taxtran tx, siteitem si, tax t, item,uom u "*/ /*+" from drcr_rcp i,drcr_rdet it,taxtran tx, siteitem si, tax t, item,uom u "*/
+" from drcr_rcp i,drcr_rdet it, item " +" from drcr_rcp i,drcr_rdet it, item "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/*added by kaustubh on 20-07-2017*/ /*added by kaustubh on 20-07-2017*/
/*+" and si.site_code = i.site_code " /*+" and si.site_code = i.site_code "
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
+" and item.item_code = it.item_code " +" and item.item_code = it.item_code "
/*+" and t.tax_code = tx.tax_code " /*+" and t.tax_code = tx.tax_code "
+" and t.tax_type in ('G','H','I','J') " +" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code in ( 'CRNRCP','DRNRCP') " +" and tx.tran_code in ( 'CRNRCP','DRNRCP') "
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*added by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'DRNRCP' " +"and ti.tran_code = 'DRNRCP' "
+"and ti.tran_id = i.invoice_id" +"and ti.tran_id = i.invoice_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 ))
{ {
...@@ -4776,7 +4904,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4776,7 +4904,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and i.invoice_id = ? "; dtlSql = dtlSql */
+" and i.invoice_id = ? ";
/*added by kaustubh on 20-07-2017*/ /*added by kaustubh on 20-07-2017*/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -4898,7 +5028,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4898,7 +5028,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC," +"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'R') as CESS_PERC,"
+"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS, " +" '' as REMARKS, "
+" fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) as gst_rate " +" fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) as gst_rate "
/*changed by kaustubh on 20-07-2017*/ /*changed by kaustubh on 20-07-2017*/
/*+" from adv_rcp_tax i,adv_rcp_tax_det it,taxtran tx, tax t, customer c, state, site s "*/ /*+" from adv_rcp_tax i,adv_rcp_tax_det it,taxtran tx, tax t, customer c, state, site s "*/
+" from adv_rcp_tax i,adv_rcp_tax_det it, customer c, state, site s " +" from adv_rcp_tax i,adv_rcp_tax_det it, customer c, state, site s "
...@@ -4913,9 +5043,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4913,9 +5043,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/*+" and t.tax_type in ('G','H','I','J') " /*+" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'R-ADV' " +" and tx.tran_code = 'R-ADV' "
+" and tx.tran_id = i.tran_id ";*/ +" and tx.tran_id = i.tran_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/* +"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'R-ADV' " +"and ti.tran_code = 'R-ADV' "
+"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 ))
{ {
...@@ -4928,7 +5060,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4928,7 +5060,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" and to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and it.ref_type = '1' " dtlSql = dtlSql*/
+" and it.ref_type = '1' "
+" and i.conf_date between ? and ? " +" and i.conf_date between ? and ? "
+" and state.state_code = ? " +" and state.state_code = ? "
+" group by fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) "; +" group by fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) ";
...@@ -5049,11 +5183,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5049,11 +5183,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS, " +" '' as REMARKS, "
+" fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) as gst_rate " +" fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) as gst_rate "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" from adv_rcp_tax i,adv_rcp_tax_det it,taxtran tx, tax t, customer c, state, site s "*/ /*+" from adv_rcp_tax i,adv_rcp_tax_det it,taxtran tx, tax t, customer c, state, site s "*/
+" from adv_rcp_tax i,adv_rcp_tax_det it, customer c, state, site s " +" from adv_rcp_tax i,adv_rcp_tax_det it, customer c, state, site s "
+" where i.tran_id = it.tran_id " +" where i.tran_id = it.tran_id "
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
/*+" and t.tax_code = tx.tax_code "*/ /*+" and t.tax_code = tx.tax_code "*/
+" and c.cust_code = it.cust_code " +" and c.cust_code = it.cust_code "
...@@ -5064,9 +5198,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5064,9 +5198,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/*+" and t.tax_type in ('G','H','I','J') " /*+" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'R-ADV' " +" and tx.tran_code = 'R-ADV' "
+" and tx.tran_id = i.tran_id ";*/ +" and tx.tran_id = i.tran_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'R-ADV' " +"and ti.tran_code = 'R-ADV' "
+"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 ))
{ {
...@@ -5078,7 +5214,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5078,7 +5214,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and it.ref_type = '1' " dtlSql = dtlSql */
+" and it.ref_type = '1' "
+" and i.conf_date between ? and ? " +" and i.conf_date between ? and ? "
+" and state.state_code = ? " +" and state.state_code = ? "
+" group by fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) "; +" group by fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) ";
...@@ -5203,7 +5341,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5203,7 +5341,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS, " +" '' as REMARKS, "
+" fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) as gst_rate " +" fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) as gst_rate "
/*changed by kaustubh on 20-07-2017*/ /*changed by kaustubh on 20-07-2017*/
/*+" from adv_rcp_tax i,adv_rcp_tax_det it,taxtran tx, tax t, customer c, state, site s "*/ /*+" from adv_rcp_tax i,adv_rcp_tax_det it,taxtran tx, tax t, customer c, state, site s "*/
+" from adv_rcp_tax i,adv_rcp_tax_det it, customer c, state, site s " +" from adv_rcp_tax i,adv_rcp_tax_det it, customer c, state, site s "
...@@ -5218,9 +5356,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5218,9 +5356,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/*+" and t.tax_type in ('G','H','I','J') " /*+" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'R-ADV' " +" and tx.tran_code = 'R-ADV' "
+" and tx.tran_id = i.tran_id ";*/ +" and tx.tran_id = i.tran_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 20-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'R-ADV' " +"and ti.tran_code = 'R-ADV' "
+"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 ))
{ {
...@@ -5232,7 +5372,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5232,7 +5372,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and it.ref_type = '2' " dtlSql = dtlSql */
+" and it.ref_type = '2' "
+" and i.conf_date between ? and ? " +" and i.conf_date between ? and ? "
+" and state.state_code = ? " +" and state.state_code = ? "
+" and it.date_adv < '"+currMonthStartDate+"' " +" and it.date_adv < '"+currMonthStartDate+"' "
...@@ -5353,7 +5495,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5353,7 +5495,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT," +"fn_gst_rate_amt('R-ADV',i.tran_id, it.line_no, 'J', 'A') as CESS_AMT,"
+" '' as REMARKS, " +" '' as REMARKS, "
+" fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) as gst_rate " +" fn_get_gst_rate('R-ADV',i.tran_id, it.line_no) as gst_rate "
/*changed by kaustubh on 20-07-2017*/ /*changed by kaustubh on 20-07-2017*/
/*+" from adv_rcp_tax i,adv_rcp_tax_det it,taxtran tx, tax t, customer c, state, site s "*/ /*+" from adv_rcp_tax i,adv_rcp_tax_det it,taxtran tx, tax t, customer c, state, site s "*/
+" from adv_rcp_tax i,adv_rcp_tax_det it, customer c, state, site s " +" from adv_rcp_tax i,adv_rcp_tax_det it, customer c, state, site s "
...@@ -5367,9 +5509,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5367,9 +5509,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
/*+" and t.tax_type in ('G','H','I','J') " /*+" and t.tax_type in ('G','H','I','J') "
+" and tx.tran_code = 'R-ADV' " +" and tx.tran_code = 'R-ADV' "
+" and tx.tran_id = i.tran_id ";*/ +" and tx.tran_id = i.tran_id ";*/
+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
/*changed by kaustubh on 21-07-2017*/
/*+"and (select count(1) from taxtran ti, tax tx where tx.tax_code = ti.tax_code "
+"and ti.tran_code = 'R-ADV' " +"and ti.tran_code = 'R-ADV' "
+"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 ))
{ {
...@@ -5381,7 +5525,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5381,7 +5525,9 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
//dtlSql = dtlSql +" to_number(trim(tx.line_no)) = it.line_no "; //dtlSql = dtlSql +" to_number(trim(tx.line_no)) = it.line_no ";
dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0"; dtlSql =dtlSql +" and to_number(trim(ti.line_no)) = it.line_no ) > 0";
} }
dtlSql = dtlSql +" and it.ref_type = '2' " dtlSql = dtlSql */
+" and it.ref_type = '2' "
+" and i.conf_date between ? and ? " +" and i.conf_date between ? and ? "
+" and state.state_code = ? " +" and state.state_code = ? "
+" and it.date_adv < '"+currMonthStartDate+"' " +" and it.date_adv < '"+currMonthStartDate+"' "
...@@ -5864,10 +6010,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5864,10 +6010,17 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
cessPerc = rsSelDet.getDouble("CESS_PERC"); cessPerc = rsSelDet.getDouble("CESS_PERC");
cessAmt = rsSelDet.getDouble("CESS_AMT"); cessAmt = rsSelDet.getDouble("CESS_AMT");
remarksDet = rsSelDet.getString("REMARKS"); remarksDet = rsSelDet.getString("REMARKS");
if("11(A.1)".equals(tranSer) || "11(A.2)".equals(tranSer) || "11(B.1)".equals(tranSer) || "11(B.2)".equals(tranSer))
/* commented by kaustubh on 21 july 2017*/
gstRate = rsSelDet.getDouble("GST_RATE");
/*commented by kaustubh*/
/*if("11(A.1)".equals(tranSer) || "11(A.2)".equals(tranSer) || "11(B.1)".equals(tranSer) || "11(B.2)".equals(tranSer))
{ {
gstRate = rsSelDet.getDouble("GST_RATE"); gstRate = rsSelDet.getDouble("GST_RATE");
} }*/
/*sql= " INSERT INTO GST_DATA_DET (TRAN_ID,LINE_NO,STATUS,SR_NO__OLD,LINE_TYPE,GS_CODE,TAXABLE_AMT,IGST_PERC," /*sql= " INSERT INTO GST_DATA_DET (TRAN_ID,LINE_NO,STATUS,SR_NO__OLD,LINE_TYPE,GS_CODE,TAXABLE_AMT,IGST_PERC,"
+" IGST_AMT,CGST_PERC,CGST_AMT,SGST_PERC,SGST_AMT,GS_DESCR,UNIT,QUANTITY,SUPPLY_TYPE,CESS_PERC,CESS_AMT,REMARKS)" +" IGST_AMT,CGST_PERC,CGST_AMT,SGST_PERC,SGST_AMT,GS_DESCR,UNIT,QUANTITY,SUPPLY_TYPE,CESS_PERC,CESS_AMT,REMARKS)"
+" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) "; +" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
......
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