Commit b17a921b authored by kdabholkar's avatar kdabholkar

commited to add tax logic in detail query of GSTR 1


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106481 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6cb751fc
...@@ -508,11 +508,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -508,11 +508,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 "
/* commented by kaustubh on 21 july 2017*/ /* uncommented by kaustubh on 21 july 2017 / 3 aug*/
/*+"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')" ;
/* commented by kaustubh on 19 july 2017*/ /* commented by kaustubh on 19 july 2017*/
...@@ -521,8 +521,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -521,8 +521,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/* commented by kaustubh on 21 july 2017*/ /* commented by kaustubh on 21 july 2017 / 3 aug*/
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) 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 ";
...@@ -532,9 +532,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -532,9 +532,7 @@ 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*/ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/* commented by kaustubh on 19 july 2017* only Unit/ /* commented by kaustubh on 19 july 2017* only Unit/
/*+" and u.unit = item.unit ";*/ /*+" and u.unit = item.unit ";*/
...@@ -723,11 +721,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -723,11 +721,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and item.item_code = it.item_code " +" and item.item_code = it.item_code "
/*Commented by kaustubh on 21-7-17*/ /*Commented by kaustubh on 21-7-17 / 3 aug */
/* +"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 = '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*/ /*Commented by kaustubh on 19-7-17*/
/*+" and t.tax_code = tx.tax_code " /*+" and t.tax_code = tx.tax_code "
...@@ -735,8 +733,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -735,8 +733,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*Commented by kaustubh on 21-7-17*/ /*Commented by kaustubh on 21-7-17 / 3 aug */
/* if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) 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";
...@@ -746,7 +744,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -746,7 +744,7 @@ 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 */ dtlSql = dtlSql
+ " and i.tran_id = ? " ; + " and i.tran_id = ? " ;
/*commented by kaustubh*/ /*commented by kaustubh*/
...@@ -942,11 +940,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -942,11 +940,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and si.item_code = it.item_code "*/ +" and si.item_code = it.item_code "*/
+" and it.LINE_NO__RCP = pd.line_no" +" and it.LINE_NO__RCP = pd.line_no"
+" and item.item_code = it.item_code" +" and item.item_code = it.item_code"
/*commented by kaustubh on 21-7-2017*/ /*commented by kaustubh on 21-7-2017 / 3 aug*/
/* +"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 = '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 "
...@@ -955,8 +953,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -955,8 +953,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.tran_id = i.tran_id ";*/ +" and tx.tran_id = i.tran_id ";*/
/*commented by kaustubh on 21-7-2017*/ /*commented by kaustubh on 21-7-2017 / 3 aug*/
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) 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";
...@@ -967,7 +965,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -967,7 +965,7 @@ 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*/ dtlSql = dtlSql
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
/*commented by kaustubh*/ /*commented by kaustubh*/
...@@ -1174,14 +1172,14 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1174,14 +1172,14 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.tran_id = i.tran_id " +" and tx.tran_id = i.tran_id "
+" and t.TAX_GROUP = 'RCM' ";*/ +" and t.TAX_GROUP = 'RCM' ";*/
/*commented by kaustubh on 21-07-2017*/ /*commented by kaustubh on 21-07-2017 / 3 aug*/
/*+"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 = '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')" ;
/*commented by kaustubh on 21-07-2017*/ /*commented by kaustubh on 21-07-2017 / 3 aug*/
/*if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME )) 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";
...@@ -1192,7 +1190,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1192,7 +1190,7 @@ 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 */ dtlSql = dtlSql
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
/* +" and u.unit = item.unit ";*/ /* +" and u.unit = item.unit ";*/
...@@ -1398,19 +1396,19 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1398,19 +1396,19 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.line_no = it.line_no" +" and tx.line_no = it.line_no"
+" and t.TAX_GROUP = 'RCM' ";*/ +" and t.TAX_GROUP = 'RCM' ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/* +"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 = '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+") "
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
// if(taxClassAllStr.length() > 0) if(taxClassAllStr.length() > 0)
//{ {
// dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") "; dtlSql = dtlSql +" and tx.tax_class not in ("+taxClassAllStr+") ";
//} }
//dtlSql = dtlSql dtlSql = dtlSql
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -1608,8 +1606,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1608,8 +1606,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -1628,9 +1626,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1628,9 +1626,8 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017 only unit*/ /*changed by kaustubh on 19-07-2017 only unit*/
...@@ -1818,8 +1815,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1818,8 +1815,8 @@ 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/* +"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 = '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')" ;
...@@ -1838,7 +1835,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -1838,7 +1835,7 @@ 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*/ dtlSql = dtlSql
+" and i.tran_id = ? "; +" and i.tran_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -2030,8 +2027,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2030,8 +2027,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/* +"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')" ;
...@@ -2046,7 +2043,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2046,7 +2043,7 @@ 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*/ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
...@@ -2237,8 +2234,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2237,8 +2234,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -2253,7 +2250,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2253,7 +2250,7 @@ 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*/ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -2423,7 +2420,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2423,7 +2420,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' 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 "
...@@ -2442,8 +2438,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2442,8 +2438,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/* +"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')" ;
...@@ -2457,7 +2453,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2457,7 +2453,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -2643,8 +2639,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2643,8 +2639,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -2658,7 +2654,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2658,7 +2654,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -2843,8 +2839,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2843,8 +2839,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -2860,7 +2856,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -2860,7 +2856,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -3039,8 +3035,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3039,8 +3035,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/* +"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')" ;
...@@ -3054,7 +3050,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3054,7 +3050,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -3232,7 +3228,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3232,7 +3228,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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')" ;
...@@ -3240,14 +3236,13 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3240,14 +3236,13 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
{ {
//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";
} }
else else
{ {
//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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -3433,8 +3428,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3433,8 +3428,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*commented by kaustubh on 21-07-2017*/ /*commented by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -3448,7 +3443,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3448,7 +3443,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
...@@ -3632,8 +3627,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3632,8 +3627,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*commented by kaustubh on 21-07-2017*/ /*commented by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -3649,7 +3644,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3649,7 +3644,7 @@ 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*/ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
...@@ -3826,8 +3821,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3826,8 +3821,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*updated by kaustubh on 21-07-2017*/ /*updated by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -3841,7 +3836,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -3841,7 +3836,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*commited by kaustubh on 19-07-2017*/ /*commited by kaustubh on 19-07-2017*/
...@@ -4009,7 +4004,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4009,7 +4004,6 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
} }
dtlSql = dtlSql dtlSql = dtlSql
+" '' as REMARKS ," +" '' as REMARKS ,"
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
...@@ -4027,8 +4021,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4027,8 +4021,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -4042,7 +4036,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4042,7 +4036,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
...@@ -4226,8 +4220,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4226,8 +4220,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" and tx.tran_id = i.invoice_id ";*/ +" and tx.tran_id = i.invoice_id ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -4241,7 +4235,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4241,7 +4235,7 @@ 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*/ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
...@@ -4417,8 +4411,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4417,8 +4411,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*updated by kaustubh on 21-07-2017*/ /*updated by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -4432,7 +4426,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4432,7 +4426,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*commented by kaustubh on 19-07-2017*/ /*commented by kaustubh on 19-07-2017*/
...@@ -4619,8 +4613,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4619,8 +4613,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*commented by kaustubh on 21-07-2017*/ /*commented by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -4634,7 +4628,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4634,7 +4628,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -4822,8 +4816,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4822,8 +4816,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*updated by kaustubh on 21-07-2017*/ /*updated by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -4837,7 +4831,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -4837,7 +4831,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*updated by kaustubh on 19-07-2017*/ /*updated by kaustubh on 19-07-2017*/
...@@ -5015,8 +5009,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5015,8 +5009,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -5030,7 +5024,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5030,7 +5024,7 @@ 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*/ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*added by kaustubh on 19-07-2017*/ /*added by kaustubh on 19-07-2017*/
...@@ -5217,11 +5211,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5217,11 +5211,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*updated by kaustubh on 21-07-2017*/ /*updated by kaustubh on 21-07-2017 / 3 aug */
/*+"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 ))
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
...@@ -5232,7 +5226,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5232,7 +5226,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*commited by kaustubh on 19-07-2017*/ /*commited by kaustubh on 19-07-2017*/
...@@ -5418,11 +5412,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5418,11 +5412,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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 ))
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
...@@ -5433,7 +5427,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5433,7 +5427,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -5609,8 +5603,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5609,8 +5603,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*commited by kaustubh on 21-07-2017*/ /*commited by kaustubh on 21-07-2017 / 3 aug */
/*+"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')" ;
...@@ -5625,7 +5619,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5625,7 +5619,7 @@ 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*/ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*commited by kaustubh on 19-07-2017*/ /*commited by kaustubh on 19-07-2017*/
...@@ -5810,11 +5804,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5810,11 +5804,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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 ))
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
...@@ -5829,7 +5823,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -5829,7 +5823,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*changed by kaustubh on 19-07-2017*/ /*changed by kaustubh on 19-07-2017*/
...@@ -6110,11 +6104,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6110,11 +6104,11 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*added by kaustubh on 20-07-2017*/ /*added by kaustubh on 20-07-2017 / 3 aug */
/*+"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 = '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 ))
{ {
//dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no "; //dtlSql = dtlSql +" and cast(tx.line_no as integer) = it.line_no ";
...@@ -6125,7 +6119,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6125,7 +6119,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*added by kaustubh on 20-07-2017*/ /*added by kaustubh on 20-07-2017*/
...@@ -6326,8 +6320,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6326,8 +6320,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*added by kaustubh on 21-07-2017*/ /*added by kaustubh on 21-07-2017 / 3 aug*/
/*+"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 = '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')" ;
...@@ -6341,7 +6335,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6341,7 +6335,7 @@ 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 */ dtlSql = dtlSql
+" and i.invoice_id = ? "; +" and i.invoice_id = ? ";
/*added by kaustubh on 20-07-2017*/ /*added by kaustubh on 20-07-2017*/
...@@ -6535,8 +6529,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6535,8 +6529,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/* +"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 = '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')" ;
...@@ -6551,7 +6545,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6551,7 +6545,7 @@ 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*/ dtlSql = dtlSql
+" and it.ref_type = '1' " +" and it.ref_type = '1' "
// +" and i.conf_date between ? and ? " commented by kaustubh on 27 july // +" and i.conf_date between ? and ? " commented by kaustubh on 27 july
...@@ -6740,8 +6734,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6740,8 +6734,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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 = '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')" ;
...@@ -6755,7 +6749,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6755,7 +6749,7 @@ 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 */ dtlSql = dtlSql
+" and it.ref_type = '1' " +" and it.ref_type = '1' "
// +" and i.conf_date between ? and ? " commented by on kaustubh 27 july // +" and i.conf_date between ? and ? " commented by on kaustubh 27 july
...@@ -6961,8 +6955,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6961,8 +6955,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 20-07-2017*/ /*changed by kaustubh on 20-07-2017 / 3 aug */
/*+"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 = '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')" ;
...@@ -6976,7 +6970,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -6976,7 +6970,7 @@ 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 */ dtlSql = dtlSql
+" and it.ref_type = '2' " +" and it.ref_type = '2' "
//+" and i.conf_date between ? and ? " commented by kaustubh on 27 july //+" and i.conf_date between ? and ? " commented by kaustubh on 27 july
...@@ -7190,8 +7184,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7190,8 +7184,8 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
+" 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 ";*/
/*changed by kaustubh on 21-07-2017*/ /*changed by kaustubh on 21-07-2017 / 3 aug */
/*+"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 = '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')" ;
...@@ -7205,7 +7199,7 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -7205,7 +7199,7 @@ 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 */ dtlSql = dtlSql
+" and it.ref_type = '2' " +" and it.ref_type = '2' "
//+" and i.conf_date between ? and ? " commented by kaustubh on 27 july //+" and i.conf_date between ? and ? " commented by kaustubh on 27 july
...@@ -8058,10 +8052,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc ...@@ -8058,10 +8052,10 @@ public class GstDataPrc extends ProcessEJB implements GstDataPrcLocal,GstDataPrc
buex.printStackTrace(); buex.printStackTrace();
int [] updateCounts = buex.getUpdateCounts(); int [] updateCounts = buex.getUpdateCounts();
for (int i = 0; i < updateCounts.length; i++) /*for (int i = 0; i < updateCounts.length; i++) commmeneted by kaustubh on 3 aug 2017
{ {
System.err.println(" Statement " + i + ":" + updateCounts[i]); System.err.println(" Statement " + i + ":" + updateCounts[i]);
} }*/
System.err.println(" Message: " + buex.getMessage()); System.err.println(" Message: " + buex.getMessage());
System.err.println(" SQLSTATE: " + buex.getSQLState()); System.err.println(" SQLSTATE: " + buex.getSQLState());
System.err.println(" Error code: " + buex.getErrorCode()); System.err.println(" Error code: " + buex.getErrorCode());
......
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