47:
48: cursor c_get_tax_details (p_tax_id number) is
49: select tax_type, tax_rate, stform_type
50: , mod_cr_percentage -- 5763527
51: from JAI_CMN_TAXES_ALL
52: where tax_id = p_tax_id;
53:
54: v_mod_cr_pctg JAI_CMN_TAXES_ALL.mod_cr_percentage%type ;-- 5763527
55: lv_recoverable_flag JAI_AP_MATCH_INV_TAXES.recoverable_flag%type ;-- 5763527
50: , mod_cr_percentage -- 5763527
51: from JAI_CMN_TAXES_ALL
52: where tax_id = p_tax_id;
53:
54: v_mod_cr_pctg JAI_CMN_TAXES_ALL.mod_cr_percentage%type ;-- 5763527
55: lv_recoverable_flag JAI_AP_MATCH_INV_TAXES.recoverable_flag%type ;-- 5763527
56:
57:
58: cursor c_get_ven_info(p_invoice_id number) is
124: and nvl(match_status_flag, 'N') <> 'A');
125:
126:
127:
128: v_tax_id JAI_CMN_TAXES_ALL.tax_id%type;
129: v_tax_type JAI_CMN_TAXES_ALL.tax_type%type;
130: v_tax_rate JAI_CMN_TAXES_ALL.tax_rate%type;
131: v_stform_type JAI_CMN_TAXES_ALL.stform_type%type;
132:
125:
126:
127:
128: v_tax_id JAI_CMN_TAXES_ALL.tax_id%type;
129: v_tax_type JAI_CMN_TAXES_ALL.tax_type%type;
130: v_tax_rate JAI_CMN_TAXES_ALL.tax_rate%type;
131: v_stform_type JAI_CMN_TAXES_ALL.stform_type%type;
132:
133: v_vendor_id ap_invoices_all.vendor_id%type;
126:
127:
128: v_tax_id JAI_CMN_TAXES_ALL.tax_id%type;
129: v_tax_type JAI_CMN_TAXES_ALL.tax_type%type;
130: v_tax_rate JAI_CMN_TAXES_ALL.tax_rate%type;
131: v_stform_type JAI_CMN_TAXES_ALL.stform_type%type;
132:
133: v_vendor_id ap_invoices_all.vendor_id%type;
134: v_vendor_site_id ap_invoices_all.vendor_site_id%type;
127:
128: v_tax_id JAI_CMN_TAXES_ALL.tax_id%type;
129: v_tax_type JAI_CMN_TAXES_ALL.tax_type%type;
130: v_tax_rate JAI_CMN_TAXES_ALL.tax_rate%type;
131: v_stform_type JAI_CMN_TAXES_ALL.stform_type%type;
132:
133: v_vendor_id ap_invoices_all.vendor_id%type;
134: v_vendor_site_id ap_invoices_all.vendor_site_id%type;
135: v_org_id ap_invoices_all.org_id%type;
469: )
470: and exists (select '1'
471: from JAI_AP_MATCH_INV_TAXES
472: where invoice_id = a.invoice_id
473: and tax_id in (select tax_id from JAI_CMN_TAXES_ALL where stform_type is not null)
474: ) -- to ensure that loc taxes exists for the invoice and are of st forms type.
475:
476: order by invoice_date asc
477: )
622: from JAI_AP_MATCH_INV_TAXES
623: where invoice_id = b.invoice_id
624: --and distribution_line_number = b.distribution_line_number
625: and invoice_line_number = b.line_number
626: and tax_id in (select tax_id from JAI_CMN_TAXES_ALL where stform_type is not null)
627: ) -- to ensure that the line is an india local tax line for a st form type tax
628: order by line_number --distribution_line_number
629: )
630: loop
1219: AND trunc(jspl.creation_date) between p_from_date and p_to_date
1220: AND EXISTS
1221: (SELECT 1
1222: FROM JAI_OM_WSH_LINE_TAXES jsptl ,
1223: JAI_CMN_TAXES_ALL jtc
1224: WHERE jtc.tax_id = jsptl.tax_id
1225: AND jsptl.delivery_detail_id = jspl.delivery_detail_id
1226: AND jtc.tax_type IN ( jai_constants.tax_type_sales, jai_constants.tax_type_cst) --('Sales Tax','CST') /* Modified by Ramananda for removal of SQL LITERALs :bug#4428980*/
1227: AND jtc.stform_type IS NOT NULL
1260: jsptl.TAX_AMOUNT ,
1261: jsptl.base_tax_amount ,
1262: jtc.stform_type
1263: from JAI_OM_WSH_LINE_TAXES jsptl ,
1264: JAI_CMN_TAXES_ALL jtc
1265: where delivery_detail_id in
1266: (
1267: select delivery_detail_id
1268: from JAI_OM_WSH_LINES_ALL
1675: WHERE customer_trx_id = trx.customer_trx_id AND
1676: EXISTS
1677: (SELECT 1
1678: FROM JAI_AR_TRX_TAX_LINES tax_lines ,
1679: JAI_CMN_TAXES_ALL jtc
1680: WHERE link_to_cust_trx_line_id = trx_lines.customer_trx_line_id AND
1681: tax_type IN ( jai_constants.tax_type_sales, jai_constants.tax_type_cst) --('Sales Tax','CST') /* Modified by Ramananda for removal of SQL LITERALs :bug#4428980*/
1682: AND jtc.tax_id = tax_lines.tax_id AND
1683: jtc.stform_type IS NOT NULL
1709: jtxn.INVOICE_CLASS ,
1710: jtxn.base_tax_amount ,
1711: jtc.stform_type
1712: from JAI_AR_TRX_TAX_LINES jtxn ,
1713: JAI_CMN_TAXES_ALL jtc
1714: where link_to_cust_Trx_line_id in
1715: (
1716: select customer_Trx_line_id
1717: from JAI_AR_TRX_LINES