The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT *
FROM jai_ar_trx_lines
WHERE customer_trx_line_id = pn_customer_trx_line_id;
v_last_update_date Date;
v_last_updated_by Number;
v_last_update_login Number;
SELECT a.type
FROM RA_CUST_TRX_TYPES_ALL a, RA_CUSTOMER_TRX_ALL b
WHERE a.cust_trx_type_id = b.cust_trx_type_id
AND b.customer_trx_id = v_header_id
AND NVL(a.org_id, 0) = NVL(pr_new.org_id, 0);
SELECT DISTINCT gl_date
FROM RA_CUST_TRX_LINE_GL_DIST_ALL
WHERE CUSTOMER_TRX_LINE_ID = v_prev_customer_trx_line_id;
SELECT assessable_value, tax_category_id, service_type_code
FROM JAI_AR_TRX_LINES
WHERE customer_trx_line_id = v_prev_customer_trx_line_id;
SELECT a.tax_id,
a.tax_line_no lno,
a.precedence_1 p_1,
a.precedence_2 p_2,
a.precedence_3 p_3,
a.precedence_4 p_4,
a.precedence_5 p_5,
a.precedence_6 p_6,
a.precedence_7 p_7,
a.precedence_8 p_8,
a.precedence_9 p_9,
a.precedence_10 p_10,
a.tax_rate,
a.tax_amount,
a.uom uom_code,
a.qty_rate,
decode(upper(b.tax_type),
'EXCISE',
1,
'ADDL. EXCISE',
1,
'OTHER EXCISE',
1,
'CVD',
1,
'TDS',
2,
0) tax_type_val,
b.tax_type
FROM JAI_AR_TRX_TAX_LINES a, JAI_CMN_TAXES_ALL b
WHERE a.customer_trx_line_id = v_prev_customer_trx_line_id
AND a.tax_id = b.tax_id;
SELECT created_from,
set_of_books_id,
invoice_currency_code,
exchange_rate_type,
nvl(exchange_date, trx_date),
exchange_rate
FROM RA_CUSTOMER_TRX_ALL
WHERE customer_trx_id = v_header_id;
SELECT organization_id
FROM JAI_AR_TRXS
WHERE customer_trx_id = v_header_id;
v_last_update_date := pr_new.last_update_date;
v_last_updated_by := pr_new.last_updated_by;
v_last_update_login := pr_new.last_update_login;
INSERT INTO JAI_AR_TRX_LINES
(customer_trx_line_id,
line_number,
customer_trx_id,
description,
inventory_item_id,
unit_code,
quantity,
tax_category_id,
auto_invoice_flag,
unit_selling_price,
line_amount,
gl_date,
tax_amount,
total_amount,
assessable_value,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login,
service_type_code)
VALUES
(v_customer_trx_line_id,
pr_new.line_number,
v_header_id,
pr_new.description,
v_inventory_item_id,
pr_new.uom_code,
NVL(NVL(pr_new.quantity_credited, pr_new.quantity_invoiced), 0),
v_tax_category_id,
'N',
pr_new.unit_selling_price,
v_line_amount,
v_gl_date,
0,
v_line_amount,
v_price_list,
v_creation_date,
v_created_by,
v_last_update_date,
v_last_updated_by,
v_last_update_login,
lv_service_type_code);
lv_action := JAI_CONSTANTS.INSERTING;
Update JAI_AR_TRXS
Set line_amount = nvl(line_amount, 0) + nvl(v_line_amount, 0)
Where Customer_Trx_Id = v_header_id;
INSERT INTO JAI_AR_TRX_TAX_LINES
(customer_trx_line_id,
link_to_cust_trx_line_id,
tax_line_no,
precedence_1,
precedence_2,
precedence_3,
precedence_4,
precedence_5,
precedence_6,
precedence_7,
precedence_8,
precedence_9,
precedence_10,
tax_id,
tax_rate,
qty_rate,
uom,
tax_amount,
base_tax_amount,
func_tax_amount,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login)
VALUES
(v_customer_trx_line_id,
v_link_to_cust_id,
rec.lno,
rec.p_1,
rec.p_2,
rec.p_3,
rec.p_4,
rec.p_5,
rec.p_6,
rec.p_7,
rec.p_8,
rec.p_9,
rec.p_10,
rec.tax_id,
rec.tax_rate,
rec.qty_rate,
rec.uom_code,
pr_new.extended_amount,
pr_new.extended_amount,
pr_new.extended_amount * v_converted_rate,
v_creation_date,
v_created_by,
v_last_update_date,
v_last_updated_by,
v_last_update_login);
Update JAI_AR_TRXS
Set total_amount = nvl(total_amount, 0) +
nvl(pr_new.extended_amount, 0),
tax_amount = nvl(tax_amount, 0) +
nvl(pr_new.extended_amount, 0)
Where Customer_Trx_Id = v_header_id;
Update JAI_AR_TRX_LINES
Set total_amount = nvl(total_amount, 0) +
nvl(pr_new.extended_amount, 0),
tax_amount = nvl(tax_amount, 0) +
nvl(pr_new.extended_amount, 0)
Where Customer_Trx_Id = v_header_id
and Customer_Trx_Line_Id = v_link_to_cust_id;
SELECT *
FROM jai_ar_trx_lines
WHERE customer_trx_line_id = pn_customer_trx_line_id;
select gl_date
from ra_cust_trx_line_gl_dist_all
where customer_trx_id = cp_customer_trx_id
and account_class = jai_constants.account_class_rec
and latest_rec_flag = jai_constants.yes;
SELECT REGIME_ID
FROM JAI_RGM_DEFINITIONS
WHERE REGIME_CODE = CP_REGIME_CODE;
SELECT COUNT(1)
FROM JAI_CMN_TAX_CTG_LINES CATL,
JAI_CMN_TAXES_ALL CODES,
JAI_REGIME_TAX_TYPES_V JRTTV
WHERE CATL.TAX_CATEGORY_ID = CP_TAX_CATEGORY_ID
AND CATL.TAX_ID = CODES.TAX_ID
AND CODES.TAX_TYPE = JRTTV.TAX_TYPE
AND JRTTV.REGIME_CODE = CP_REGIME_CODE;
v_last_update_date Date;
v_last_updated_by Number;
v_last_update_login Number;
SELECT A.org_id,
A.ship_to_customer_id,
NVL(A.ship_to_site_use_id, 0),
A.bill_to_customer_id,
NVL(A.bill_to_site_use_id, 0)
FROM RA_CUSTOMER_TRX_ALL A
WHERE customer_trx_id = v_header_id;
SELECT set_of_books_id,
invoice_currency_code,
exchange_rate_type,
exchange_date,
exchange_rate,
trx_date
FROM RA_CUSTOMER_TRX_ALL
WHERE customer_trx_id = v_header_id;
SELECT cust_acct_site_id address_id
FROM HZ_CUST_SITE_USES_ALL A
WHERE A.site_use_id = NVL(p_ship_to_site_use_id, 0);
SELECT A.tax_id, A.tax_rate, A.tax_amount tax_amt, b.tax_type t_type
FROM JAI_AR_TRX_TAX_LINES A, JAI_CMN_TAXES_ALL B
WHERE link_to_cust_trx_line_id = v_customer_trx_line_id
AND A.tax_id = B.tax_id
ORDER BY 1;
SELECT organization_id, location_id FROM JAI_AR_TRX_APPS_RELS_T;
SELECT A.organization_id, location_id
FROM JAI_AR_TRXS A, RA_CUSTOMER_TRX_ALL B
WHERE A.trx_number = B.recurred_from_trx_number
AND B.customer_trx_id = v_header_id;
SELECT created_from, trx_date
FROM ra_customer_trx_all
WHERE customer_trx_id = v_header_id;
SELECT once_completed_flag
FROM JAI_AR_TRXS
WHERE customer_trx_id = v_header_id;
SELECT rowid
FROM RA_CUSTOMER_TRX_ALL
WHERE customer_trx_id = v_header_id;
SELECT line_amount
FROM JAI_AR_TRX_LINES
WHERE CUSTOMER_TRX_ID = pr_old.CUSTOMER_TRX_ID
AND CUSTOMER_TRX_LINE_ID = pr_old.CUSTOMER_TRX_LINE_ID;
SELECT DISTINCT gl_date
FROM RA_CUST_TRX_LINE_GL_DIST_ALL
WHERE CUSTOMER_TRX_LINE_ID = v_customer_trx_line_id;
Select a.type
From RA_CUST_TRX_TYPES_ALL a, RA_CUSTOMER_TRX_ALL b
Where a.cust_trx_type_id = b.cust_trx_type_id
And b.customer_trx_id = v_header_id
And NVL(a.org_id, 0) = NVL(pr_new.org_id, 0);
v_last_update_date := pr_new.last_update_date;
v_last_updated_by := pr_new.last_updated_by;
v_last_update_login := pr_new.last_update_login;
UPDATE JAI_AR_TRXS
SET line_amount = nvl(line_amount, 0) -
nvl(v_old_line_amount, 0),
tax_amount = nvl(tax_amount, 0) - nvl(v_old_tax_tot, 0),
total_amount = nvl(total_amount, 0) -
(nvl(v_old_line_amount, 0) +
nvl(v_old_tax_tot, 0))
WHERE customer_trx_id = pr_old.CUSTOMER_TRX_ID;
DELETE JAI_AR_TRX_TAX_LINES
WHERE LINK_TO_CUST_TRX_LINE_ID = pr_old.CUSTOMER_TRX_LINE_ID;
DELETE JAI_AR_TRX_LINES
WHERE CUSTOMER_TRX_ID = pr_old.CUSTOMER_TRX_ID
AND CUSTOMER_TRX_LINE_ID = pr_old.CUSTOMER_TRX_LINE_ID;
v_last_update_date,
v_last_updated_by,
v_last_update_login,
NULL,
ln_vat_assessable_value,
p_thhold_cat_base_tax_typ => jai_constants.tax_type_tcs,
p_threshold_tax_cat_id => ln_threshold_tax_cat_id,
p_source_trx_type => null,
p_source_table_name => null,
p_action => jai_constants.default_taxes);
UPDATE JAI_AR_TRXS
SET line_amount = NVL(line_amount, 0) + NVL(v_line_amount, 0),
total_amount = NVL(total_amount, 0) + NVL(v_tot_amt, 0),
tax_amount = NVL(tax_amount, 0) + NVL(v_total_tax_amount, 0)
WHERE JAI_AR_TRXS.customer_trx_id = v_header_id;
INSERT INTO JAI_AR_TRX_LINES
(customer_trx_line_id,
line_number,
customer_trx_id,
description,
inventory_item_id,
unit_code,
quantity,
tax_category_id,
auto_invoice_flag,
unit_selling_price,
line_amount,
gl_date,
tax_amount,
total_amount,
assessable_value,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login,
vat_assessable_value,
service_type_code)
VALUES
(v_customer_trx_line_id,
pr_new.line_number,
v_header_id,
pr_new.description,
pr_new.inventory_item_id,
pr_new.uom_code,
nvl(v_quantity, 0),
v_tax_category_id,
'N',
pr_new.unit_selling_price,
v_line_amount,
v_gl_date,
v_line_tax_amount,
(v_line_amount + v_line_tax_amount),
v_price_list,
v_creation_date,
v_created_by,
v_last_update_date,
v_last_updated_by,
v_last_update_login,
ln_vat_assessable_value,
v_service_type);
lv_action := JAI_CONSTANTS.INSERTING;
SELECT hzcas.cust_acct_site_id
FROM hz_cust_site_uses_all hzcsu, hz_cust_acct_sites_all hzcas
WHERE hzcas.cust_acct_site_id = hzcsu.cust_acct_site_id
AND hzcsu.site_use_id = pn_party_site_id
AND hzcas.cust_account_id = pn_party_id;
SELECT service_type_code
FROM JAI_CMN_CUS_ADDRESSES
WHERE customer_id = pn_cust_id
AND address_id = pn_address_id;
SELECT service_type_code
FROM JAI_CMN_VENDOR_SITES
WHERE vendor_id = cp_vendor_id
AND vendor_site_id = cp_vendor_site_id;
SELECT *
FROM jai_ar_trx_lines
WHERE customer_trx_line_id = pn_customer_trx_line_id;
v_last_update_date Date;
v_last_updated_by Number;
v_last_update_login Number;
SELECT A.org_id, A.bill_to_customer_id, NVL(A.bill_to_site_use_id, 0)
FROM RA_CUSTOMER_TRX_ALL A
WHERE customer_trx_id = v_header_id;
SELECT set_of_books_id,
invoice_currency_code,
exchange_rate_type,
exchange_date,
exchange_rate,
trx_date
FROM RA_CUSTOMER_TRX_ALL
WHERE customer_trx_id = v_header_id;
select A.tax_id, A.tax_rate, A.tax_amount tax_amt, b.tax_type t_type
from JAI_AR_TRX_TAX_LINES A, JAI_CMN_TAXES_ALL B
where link_to_cust_trx_line_id = pr_old.customer_trx_line_id
and A.tax_id = B.tax_id
order by 1;
SELECT organization_id FROM JAI_AR_TRX_APPS_RELS_T;
SELECT organization_id
FROM JAI_AR_TRXS
WHERE trx_number =
(SELECT recurred_from_trx_number
FROM RA_CUSTOMER_TRX_ALL
WHERE customer_trx_id = v_header_id);
SELECT created_from
FROM ra_customer_trx_all
WHERE customer_trx_id = v_header_id;
Select a.type
From RA_CUST_TRX_TYPES_ALL a, RA_CUSTOMER_TRX_ALL b
Where a.cust_trx_type_id = b.cust_trx_type_id
And b.customer_trx_id = v_header_id
And (a.org_id = pr_new.org_id OR
(a.org_id is null and pr_new.org_id is null));
v_last_update_date := pr_new.last_update_date;
v_last_updated_by := pr_new.last_updated_by;
v_last_update_login := pr_new.last_update_login;
jai_ar_utils_pkg.recalculate_tax('AR_LINES_UPDATE',
null,
v_header_id,
v_customer_trx_line_id,
v_price_list_val,
v_line_tax_amount,
v_converted_rate,
v_inventory_item_id,
NVL(pr_new.quantity_credited, 0),
pr_new.uom_code,
NULL,
NULL,
v_creation_date,
v_created_by,
v_last_update_date,
v_last_updated_by,
v_last_update_login);
UPDATE JAI_AR_TRXS
SET line_amount = NVL(line_amount, 0) + NVL(v_line_amount, 0) -
NVL(v_old_amount, 0),
total_amount = NVL(total_amount, 0) + NVL(v_tot_amt, 0) -
nvl(v_old_amount, 0) - NVL(v_old_tax_tot, 0),
tax_amount = NVL(tax_amount, 0) + NVL(v_tax_tot, 0) -
NVL(v_old_tax_tot, 0),
creation_date = v_creation_date,
created_by = v_created_by,
last_update_date = v_last_update_date,
last_updated_by = v_last_updated_by,
last_update_login = v_last_update_login
WHERE customer_trx_id = v_header_id;
UPDATE JAI_AR_TRX_LINES
SET description = pr_new.description,
inventory_item_id = pr_new.inventory_item_id,
unit_code = pr_new.uom_code,
quantity = pr_new.quantity_credited,
auto_invoice_flag = 'N',
tax_category_id = v_tax_category_id,
unit_selling_price = pr_new.unit_selling_price,
line_amount = v_line_amount,
tax_amount = v_line_tax_amount,
total_amount = v_line_amount + v_line_tax_amount,
creation_date = v_creation_date,
created_by = v_created_by,
last_update_date = v_last_update_date,
last_updated_by = v_last_updated_by,
last_update_login = v_last_update_login
WHERE customer_trx_line_id = pr_old.customer_trx_line_id
AND customer_trx_id = v_header_id;
SELECT *
FROM jai_ar_trx_lines
WHERE customer_trx_line_id = pn_customer_trx_line_id;
select * from jai_ar_trxs where customer_trx_id = cn_customer_trx_id;
v_last_update_date Date;
v_last_updated_by Number;
v_last_update_login Number;
SELECT A.org_id, A.bill_to_customer_id, NVL(A.bill_to_site_use_id, 0)
FROM RA_CUSTOMER_TRX_ALL A
WHERE customer_trx_id = v_header_id;
SELECT set_of_books_id,
invoice_currency_code,
exchange_rate_type,
exchange_date,
exchange_rate,
trx_date
FROM RA_CUSTOMER_TRX_ALL
WHERE customer_trx_id = v_header_id;
SELECT line_no
FROM JAI_CMN_TAX_CTG_LINES A
WHERE A.tax_category_id = p_tax_category_id
ORDER BY line_no;
SELECT cust_acct_site_id address_id
FROM hz_cust_site_uses_all A
WHERE A.site_use_id = p_ship_to_site_use_id;
select A.tax_id, A.tax_rate, A.tax_amount tax_amt, b.tax_type t_type
from JAI_AR_TRX_TAX_LINES A, JAI_CMN_TAXES_ALL B
where link_to_cust_trx_line_id = pr_old.customer_trx_line_id
and A.tax_id = B.tax_id
order by 1;
SELECT organization_id, location_id FROM JAI_AR_TRX_APPS_RELS_T;
SELECT organization_id, location_id
FROM JAI_AR_TRXS
WHERE trx_number =
(SELECT recurred_from_trx_number
FROM RA_CUSTOMER_TRX_ALL
WHERE customer_trx_id = v_header_id);
SELECT created_from, trx_date
FROM ra_customer_trx_all
WHERE customer_trx_id = v_header_id;
SELECT once_completed_flag
FROM JAI_AR_TRXS
WHERE customer_trx_id = v_header_id;
Select a.type
From RA_CUST_TRX_TYPES_ALL a, RA_CUSTOMER_TRX_ALL b
Where a.cust_trx_type_id = b.cust_trx_type_id
And b.customer_trx_id = v_header_id
And (a.org_id = pr_new.org_id OR
(a.org_id is NULL AND pr_new.org_id is NULL));
v_last_update_date := pr_new.last_update_date;
v_last_updated_by := pr_new.last_updated_by;
v_last_update_login := pr_new.last_update_login;
jai_ar_utils_pkg.recalculate_tax('AR_LINES_UPDATE',
v_tax_category_id,
v_header_id,
v_customer_trx_line_id,
v_price_list_val,
v_line_tax_amount,
v_converted_rate,
v_inventory_item_id,
NVL(v_new_quantity, 0),
pr_new.uom_code,
NULL,
NULL,
v_creation_date,
v_created_by,
v_last_update_date,
v_last_updated_by,
v_last_update_login,
ln_vat_assessable_value);
UPDATE JAI_AR_TRXS
SET line_amount = NVL(line_amount, 0) + NVL(v_line_amount, 0) -
NVL(v_old_amount, 0),
total_amount = NVL(total_amount, 0) + NVL(v_tot_amt, 0) -
nvl(v_old_amount, 0) - NVL(v_old_tax_tot, 0),
tax_amount = NVL(tax_amount, 0) + NVL(v_tax_tot, 0) -
NVL(v_old_tax_tot, 0),
creation_date = v_creation_date,
created_by = v_created_by,
last_update_date = v_last_update_date,
last_updated_by = v_last_updated_by,
last_update_login = v_last_update_login
WHERE customer_trx_id = v_header_id;
UPDATE JAI_AR_TRX_LINES
SET description = pr_new.description,
inventory_item_id = pr_new.inventory_item_id,
unit_code = pr_new.uom_code,
quantity = v_new_quantity,
auto_invoice_flag = 'N',
tax_category_id = v_tax_category_id,
unit_selling_price = pr_new.unit_selling_price,
line_amount = v_line_amount,
tax_amount = v_line_tax_amount,
total_amount = v_line_amount + v_line_tax_amount,
creation_date = v_creation_date,
created_by = v_created_by,
last_update_date = v_last_update_date,
last_updated_by = v_last_updated_by,
last_update_login = v_last_update_login,
assessable_value = v_price_list,
vat_assessable_value = ln_vat_assessable_value
WHERE customer_trx_line_id = pr_old.customer_trx_line_id
AND customer_trx_id = v_header_id;
PROCEDURE DELETE_AR_TRX_LINES(pr_old t_jai_rec%type,
pr_new t_rec%type,
pv_action varchar2,
pv_return_code out NOCOPY varchar2,
pv_return_message out NOCOPY varchar2) IS
lv_api_name CONSTANT VARCHAR2(100) := 'DELETE_AR_TRX_LINES';
SELECT A.tax_id, A.tax_rate, A.tax_amount tax_amt, b.tax_type t_type
FROM JAI_AR_TRX_TAX_LINES A, JAI_CMN_TAXES_ALL B
WHERE link_to_cust_trx_line_id = v_customer_trx_line_id
and A.tax_id = B.tax_id
order by 1;
SELECT line_amount, tax_amount
FROM JAI_AR_TRX_LINES
WHERE CUSTOMER_TRX_ID = v_customer_trx_id
AND CUSTOMER_TRX_LINE_ID = v_customer_trx_line_id;
SELECT once_completed_flag
FROM JAI_AR_TRXS
WHERE customer_trx_id = v_customer_trx_id;
UPDATE JAI_AR_TRXS
SET line_amount = nvl(line_amount, 0) - nvl(v_old_line_amount, 0),
tax_amount = nvl(tax_amount, 0) - nvl(v_old_tax_tot, 0),
total_amount = nvl(total_amount, 0) -
(nvl(v_old_line_amount, 0) + nvl(v_old_tax_tot, 0))
WHERE customer_trx_id = v_customer_trx_id;
DELETE FROM JAI_AR_TRXS trx
WHERE customer_trx_id = v_customer_trx_id
AND EXISTS (SELECT 1
FROM ra_interface_lines_all il
WHERE il.customer_trx_id = v_customer_trx_id
AND NVL(il.interface_status, '~') <> 'P');
DELETE JAI_AR_TRX_TAX_LINES
WHERE LINK_TO_CUST_TRX_LINE_ID = v_customer_trx_line_id;
DELETE JAI_AR_TRX_INS_LINES_T
WHERE CUSTOMER_TRX_ID = v_customer_trx_id
AND LINK_TO_CUST_TRX_LINE_ID = v_customer_trx_line_id;
DELETE JAI_AR_TRX_LINES
WHERE CUSTOMER_TRX_ID = v_customer_trx_id
AND CUSTOMER_TRX_LINE_ID = v_customer_trx_line_id;
END DELETE_AR_TRX_LINES;