The following lines contain the word 'select', 'insert', 'update' or 'delete':
select threshold_trx_id,
threshold_grp_id,
threshold_hdr_id,
tax_category_id,
tds_section_code,
taxable_amount,
tax_amount,
invoice_to_tds_authority_id,
invoice_to_vendor_id,
tds_event,
calc_tax_amount
from jai_ap_tds_thhold_trxs
where invoice_id = p_invoice_id
and (tds_event = 'INVOICE VALIDATE' or
tds_event like 'THRESHOLD TRANSITION%' or
tds_event = 'SURCHARGE_CALCULATE')
and tds_rollbacked is NULL
order by threshold_trx_id;
SELECT accounting_date
FROM ap_invoice_distributions_all
WHERE invoice_id = cp_invoice_id
AND distribution_line_number = 1;
SELECT accounting_date
FROM ap_invoice_lines_all
WHERE invoice_id = cp_invoice_id
AND line_number = 1;
select jattt.invoice_id,
jattt.tds_event,
jattt.invoice_to_tds_authority_id
from jai_ap_tds_inv_taxes jatit, jai_ap_tds_thhold_trxs jattt
where jatit.invoice_id = p_invoice_id
and jatit.default_cum_threshold_stage = 'BEFORE THRESHOLD'
and jatit.threshold_grp_id = jattt.threshold_grp_id
and jattt.tds_event like 'THRESHOLD%'
and not exists (select '1'
from jai_ap_tds_thhold_trxs
where invoice_id = jatit.invoice_id); /*to ensure that no TDS is deducted*/
select org_id
from ap_invoices_all
where invoice_id = p_invoice_id;
SELECT payment_status_flag
FROM ap_invoices_all
WHERE invoice_id = cp_invoice_id;
for tds_id in (select invoice_to_tds_authority_id
from jai_ap_tds_thhold_trxs
where invoice_id = r_threshold_breach.invoice_id) loop
if get_invoice_payment_status(tds_id.invoice_to_tds_authority_id) <> 'N' and
lv_payment = 'N' then
lv_payment := 'Y';
/* Update invoice Ids in TDS tables for TDS invoices */
if pv_action = jai_constants.inserting and pr_new.source = 'INDIA TDS' then /* 'TDS' then --Ramanand for bug#4388958 */
jai_ap_tds_generation_pkg.populate_tds_invoice_id
(
p_invoice_id => pr_new.invoice_id,
p_invoice_num => pr_new.invoice_num,
p_vendor_id => pr_new.vendor_id,
p_vendor_site_id => pr_new.vendor_site_id,
p_process_flag => lv_process_flag,
p_process_message => lv_process_message
);
end if; /* Update invoice Ids in TDS tables for TDS invoices */
/* Update invoice Ids in Third Party tables for Third Party invoices */
if pv_action = jai_constants.inserting and pr_new.source = 'INDIA TAX INVOICE' then /* 'RECEIPT' then --Ramanand for bug#4388958 */
jai_rcv_third_party_pkg.populate_tp_invoice_id
(
p_invoice_id => pr_new.invoice_id,
p_invoice_num => pr_new.invoice_num,
p_vendor_id => pr_new.vendor_id,
p_vendor_site_id => pr_new.vendor_site_id,
p_process_flag => lv_process_flag,
p_process_message => lv_process_message
);
|| Update invoice Ids in Third Party tables for Third Party invoices
*/
/* Deleting */
if pv_action = jai_constants.deleting then
jai_ap_tds_tax_defaultation.process_delete
(
p_invoice_id => pr_old.invoice_id,
p_process_flag => lv_process_flag,
P_process_message => lv_process_message
);