The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_inserted_flag Varchar2(1);
select org_id from pa_projects_all
where project_id = c_project_id;
inserted_flag => l_inserted_flag,
exemption_type => l_exemption_type,
tax_exemption_id => l_exemption_id);
select hz_c.party_id, hz_cs.party_site_id, pc.bill_to_address_id
into l_bill_to_party_id, l_bill_to_party_site_id, l_bill_to_address_id
from hz_cust_accounts hz_c, hz_cust_acct_sites hz_cs, pa_project_customers pc
where pc.project_id = p_project_id
and pc.customer_id = p_customer_id
and hz_cs.cust_acct_site_id = pc.bill_to_address_id
and hz_c.cust_account_id = p_customer_id;
select hz_c.party_id, hz_cs.party_site_id, pc.ship_to_address_id
into l_ship_to_party_id, l_ship_to_party_site_id, l_ship_to_address_id
from hz_cust_accounts hz_c, hz_cust_acct_sites hz_cs, pa_project_customers pc
where pc.project_id = p_project_id
and pc.customer_id = p_customer_id
and hz_cs.cust_acct_site_id = pc.ship_to_address_id
and hz_c.cust_account_id = p_customer_id;
l_program_update_date DATE := sysdate;
SELECT agreement_currency_code,
nvl(start_date,to_date('01/01/1952', 'DD/MM/YYYY')),
nvl(expiration_date,sysdate)
INTO l_funding_currency_code,
l_agreement_start_date, l_agreement_exp_date
FROM PA_AGREEMENTS_ALL
WHERE agreement_id = p_agreement_id;
tmp_denominator_tab.delete;
tmp_numerator_tab.delete;
PA_MCB_INVOICE_PKG.log_message('GET_DEFAULT_TAX_INFO: ' || 'Update RDL and EI');
Update PA_CUST_REV_DIST_LINES_ALL
Set
-- invoice_eligible_flag = tmp_invoice_eligible_flag, for bug 2649243, 2645634
-- output_vat_tax_id = l_Output_vat_tax_id, --commented by hsiu
output_tax_classification_code = l_output_tax_code,
output_tax_exempt_flag = l_Output_tax_exempt_flag,
output_tax_exempt_reason_code = l_Output_exempt_reason_code,
output_tax_exempt_number = l_Output_tax_exempt_number,
project_inv_rate_type =
DECODE(tmp_status_tab(loop_index),'N',
tmp_project_rate_type(loop_index), NULL),
project_inv_rate_date =
DECODE(tmp_status_tab(loop_index),'N',
--tmp_project_rate_date(loop_index), NULL), --Modified for Bug 3137196
decode(tmp_project_rate_type(loop_index), 'User', null, tmp_project_rate_date(loop_index)), NULL),
project_inv_exchange_rate =
DECODE(tmp_status_tab(loop_index),'N',
tmp_project_exchange_rate(loop_index), NULL),
project_bill_amount =
DECODE(tmp_status_tab(loop_index),'N',
tmp_project_bill_amount(loop_index), NULL),
projfunc_inv_rate_type =
DECODE(tmp_status_tab(loop_index),'N',
tmp_projfunc_rate_type(loop_index), NULL),
projfunc_inv_rate_date =
DECODE(tmp_status_tab(loop_index),'N',
--tmp_projfunc_rate_date(loop_index), NULL), --Modified for Bug 3137196
decode(tmp_projfunc_rate_type(loop_index), 'User', null, tmp_projfunc_rate_date(loop_index)), NULL),
projfunc_inv_exchange_rate =
DECODE(tmp_status_tab(loop_index),'N',
tmp_projfunc_exchange_rate(loop_index), NULL),
projfunc_bill_amount =
DECODE(tmp_status_tab(loop_index),'N',
tmp_projfunc_bill_amount(loop_index), NULL),
invproc_rate_type =
DECODE(tmp_status_tab(loop_index),'N',
tmp_invproc_rate_type(loop_index), NULL),
invproc_rate_date =
DECODE(tmp_status_tab(loop_index),'N',
--tmp_invproc_rate_date(loop_index), NULL), --Modified for Bug 3137196
decode(tmp_invproc_rate_type(loop_index), 'User', null, tmp_invproc_rate_date(loop_index)), NULL),
invproc_exchange_rate =
DECODE(tmp_status_tab(loop_index),'N',
tmp_invproc_exchange_rate(loop_index), NULL),
bill_amount =
DECODE(tmp_status_tab(loop_index),'N',
tmp_invproc_bill_amount(loop_index), NULL),
funding_inv_rate_type =
DECODE(tmp_status_tab(loop_index),'N',
tmp_funding_rate_type(loop_index), NULL),
funding_inv_rate_date =
DECODE(tmp_status_tab(loop_index),'N',
--tmp_funding_rate_date(loop_index), NULL), --Modified for Bug 3137196
decode(tmp_funding_rate_type(loop_index), 'User', null, tmp_funding_rate_date(loop_index)), NULL),
funding_inv_exchange_rate =
DECODE(tmp_status_tab(loop_index),'N',
tmp_funding_exchange_rate(loop_index), NULL),
project_currency_code =
DECODE(tmp_status_tab(loop_index),'N',
tmp_project_currency_code(loop_index), NULL),
projfunc_currency_code =
DECODE(tmp_status_tab(loop_index),'N',
tmp_projfunc_currency_code(loop_index), NULL),
invproc_currency_code =
DECODE(tmp_status_tab(loop_index),'N',
tmp_invproc_currency_code(loop_index), NULL),
funding_currency_code =
DECODE(tmp_status_tab(loop_index),'N',
tmp_funding_currency_code(loop_index), NULL),
funding_bill_amount =
DECODE(tmp_status_tab(loop_index),'N',
tmp_funding_bill_amount(loop_index), NULL),
inv_gen_rejection_code = tmp_status_tab(loop_index),
request_id = P_Request_id,
program_id = l_program_id,
program_application_id = l_program_application_id,
program_update_date = l_program_update_date
Where expenditure_item_id = P_Expenditure_item_id(loop_index)
and line_num = P_Line_num(loop_index);
PA_MCB_INVOICE_PKG.log_message('GET_DEFAULT_TAX_INFO: ' || ' updateing ei ');
Update PA_EXPENDITURE_ITEMS_ALL
Set
invproc_rate_type =
DECODE(tmp_status_tab(loop_index),'N',
tmp_invproc_rate_type(loop_index), NULL),
invproc_rate_date =
DECODE(tmp_status_tab(loop_index),'N',
--tmp_invproc_rate_date(loop_index), NULL), --Modified for Bug 3137196
decode(tmp_invproc_rate_type(loop_index), 'User', null, tmp_invproc_rate_date(loop_index)), NULL),
invproc_exchange_rate =
DECODE(tmp_status_tab(loop_index),'N',
tmp_invproc_exchange_rate(loop_index), NULL),
bill_amount =
DECODE(tmp_status_tab(loop_index),'N',NVL(bill_amount,0) +
tmp_invproc_bill_amount(loop_index), NULL), --for bug#2251021,
invproc_currency_code =
DECODE(tmp_status_tab(loop_index),'N',
tmp_invproc_currency_code(loop_index), NULL),
projfunc_inv_rate_type =
DECODE(tmp_status_tab(loop_index),'N',
tmp_projfunc_rate_type(loop_index), NULL),
projfunc_inv_rate_date =
DECODE(tmp_status_tab(loop_index),'N',
--tmp_projfunc_rate_date(loop_index), NULL), --Modified for Bug 3137196
decode(tmp_projfunc_rate_type(loop_index), 'User', null, tmp_projfunc_rate_date(loop_index)), NULL),
projfunc_inv_exchange_rate =
DECODE(tmp_status_tab(loop_index),'N',
tmp_projfunc_exchange_rate(loop_index), NULL),
projfunc_bill_amount =
DECODE(tmp_status_tab(loop_index),'N',NVL(projfunc_bill_amount,0) +
tmp_projfunc_bill_amount(loop_index), NULL), --bug2251021
projfunc_currency_code =
DECODE(tmp_status_tab(loop_index),'N',
tmp_projfunc_currency_code(loop_index), NULL),
project_inv_rate_type =
DECODE(tmp_status_tab(loop_index),'N',
tmp_project_rate_type(loop_index), NULL),
project_inv_rate_date =
DECODE(tmp_status_tab(loop_index),'N',
--tmp_project_rate_date(loop_index), NULL), --Modified for Bug 3137196
decode(tmp_project_rate_type(loop_index), 'User', null, tmp_project_rate_date(loop_index)), NULL),
project_inv_exchange_rate =
DECODE(tmp_status_tab(loop_index),'N',
tmp_project_exchange_rate(loop_index), NULL),
project_bill_amount =
DECODE(tmp_status_tab(loop_index),'N',NVL(project_bill_amount,0) +
tmp_project_bill_amount(loop_index), NULL), --bug2251021
inv_gen_rejection_code = tmp_status_tab(loop_index),
request_id = P_Request_id,
program_id = l_program_id,
program_application_id = l_program_application_id,
program_update_date = l_program_update_date
Where expenditure_item_id = P_Expenditure_item_id(loop_index);
Select count(*)
Into l_count
From AR_SYSTEM_PARAMETERS;
Select sum(TRX_LINE.EXTENDED_AMOUNT)
Into l_tax_amout
From RA_Customer_Trx_Lines TRX_LINE
Where TRX_LINE.Customer_Trx_Id = P_Trx_Id
And TRX_LINE.Line_Type = 'TAX'
And TRX_LINE.LINK_TO_CUST_TRX_LINE_ID Is Not Null;
select rtrim(tax_classification_code)
into l_tax_code
from zx_id_tcc_mapping_all
where tax_rate_code_id = p_tax_id
and org_id = p_org_id
and tax_class = 'OUTPUT'; -- added for bug 5061887
SELECT business_group_id,
proj_org_structure_version_id,
invoice_batch_source_id
INTO l_business_grp_id,
l_org_struct_ver_id,
l_batch_source_id
FROM pa_implementations;
SELECT PROJ.Carrying_Out_Organization_ID
INTO l_carry_out_org_id
FROM pa_projects proj
WHERE project_id = p_project_id;
SELECT language_code
INTO l_basic_language_code
FROM fnd_languages
WHERE installed_flag = 'B';