The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT cia.fa_asset_id,
cia.fa_book_type_code
FROM csi_item_instances cii,
csi_i_assets cia, wip_discrete_jobs wdj
WHERE cii.instance_id = cia.instance_id
AND wdj.maintenance_object_id = cii.instance_id
AND wdj.wip_entity_id = pc_wip_entity_id
AND cii.inventory_item_id = NVL(pc_rebuild_item_id, pc_asset_group_id)
AND cii.instance_number = NVL(pc_rebuild_serial_number, pc_asset_number)
AND cia.asset_quantity > 0
AND cia.update_status = 'IN_SERVICE'
AND wdj.date_completed between cia.active_start_date and nvl(cia.active_end_date,wdj.date_completed+1); -- added this for bug 15877819
SELECT fa.asset_category_id,
fa.asset_number,
fa.in_use_flag,
fa.asset_type
FROM fa_additions_b fa
WHERE asset_id = pc_fixed_asset_id;
SELECT END_DATE
FROM FA_CALENDAR_PERIODS FAP,
fa_book_controls FAC
WHERE FAP.calendar_type=c_calendar_type
AND FAC.BOOk_TYPE_CODE =c_book_type_code
AND FAP.PERIOD_NAME=c_period_name;
Select dp.period_name,
bc.last_deprn_run_date,
bc.deprn_calendar
from fa_deprn_periods dp,
fa_deprn_periods dp2,
fa_deprn_periods dp3,
fa_book_controls bc
where dp.book_type_code =c_book_type_code
and dp.period_close_date is null
and dp2.book_type_code(+) = bc.distribution_source_book
and dp2.period_counter(+) = bc.last_mass_copy_period_counter
and dp3.book_type_code(+) = bc.book_type_code
and dp3.period_counter(+) = bc.last_purge_period_counter
and bc.book_type_code = c_book_type_code;
SELECT fa_mass_additions_s.nextval
INTO l_mass_addition_id
FROM SYS.DUAL ;
select count(1) into l_count
from dual
where exists (
select 1 from fa_transaction_headers
where book_type_code = l_book_type_code
and asset_id = l_fa_asset_id
and (transaction_subtype = 'AMORTIZED' OR transaction_key = 'UA'));
INSERT INTO fa_mass_additions
(mass_addition_id,
add_to_asset_id,
asset_category_id,
book_type_code,
fixed_assets_cost,
feeder_system_name,
posting_status,
queue_name,
transaction_date, -- Bug 6640036
transaction_type_code,
asset_type, -- Bug 9095320
in_use_flag,
reviewer_comments,
payables_code_combination_id,
payables_cost,
merged_code,
split_merged_code,
MERGE_PARENT_MASS_ADDITIONS_ID, -- Bug 7678186
AMORTIZE_FLAG, -- Bug 9557969
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN
)
VALUES
(l_mass_addition_id,
l_fa_asset_id,
l_post_asset_category_id,
l_book_type_code,
p_eam_wo_bills_tbl(i).billed_amount, -- Add to table will be passed in from form
'ENTERPRISE ASSET MANAGEMENT',
decode(l_fa_asset_id, null, l_posting_status,'NEW'/*'POST' FP 8632973*/),
decode(l_fa_asset_id, null, l_queue_name,'ADD TO ASSET'), --Added decode for CU Project
null, --As per FA team recommendation.Bug 8632973
null, --As per FA team recommendation.Bug 8632973
l_asset_type, -- Bug 9095320
nvl(l_in_use_flag,'N'),
p_eam_wo_bills_tbl(i).comments,
p_eam_wo_bills_tbl(i).offset_account_ccid, -- Offset/Clearance Account
p_eam_wo_bills_tbl(i).billed_amount, -- To credit Clearance A/C with this amount
l_merged_code,
l_split_merged_code,--As per FA team recommendation.Bug 8632973
l_merge_parent_id,
l_amortize_flag, -- bug 9557969
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
fnd_global.user_id);
INSERT INTO eam_work_order_bills(
organization_id,
wip_entity_id,
operation_seq_num,
inventory_item_id,
resource_id,
billed_inventory_item_id,
billed_uom_code,
billed_quantity,
cost_or_listprice,
costplus_percentage,
billed_amount,
billing_method,
fixed_asset_number,
mass_addition_id,
capitalization_date,
comments,
offset_account_ccid,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN )
VALUES (
p_eam_wo_bills_tbl(i).organization_id,
p_eam_wo_bills_tbl(i).wip_entity_id,
p_eam_wo_bills_tbl(i).operation_seq_num,
p_eam_wo_bills_tbl(i).billed_inventory_item_id,
p_eam_wo_bills_tbl(i).resource_id,
nvl(p_eam_wo_bills_tbl(i).billed_inventory_item_id,-123456),
p_eam_wo_bills_tbl(i).billed_uom_code,
p_eam_wo_bills_tbl(i).billed_quantity,
l_cost,
p_eam_wo_bills_tbl(i).COSTPLUS_PERCENTAGE, -- = as entered by the user
p_eam_wo_bills_tbl(i).billed_amount, -- = Calculated Amount
3, -- (Capitalzation)
l_fa_asset_id,
l_mass_addition_id,
sysdate,
p_eam_wo_bills_tbl(i).comments,
p_eam_wo_bills_tbl(i).offset_account_ccid,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
fnd_global.user_id);
SELECT cost
INTO l_cost
FROM fa_books
WHERE transaction_header_id_out IS NULL
AND asset_id = l_asset_id
AND book_type_code = l_book_type_code;
SELECT ood.operating_unit
INTO l_txn_ou_context
FROM org_organization_definitions ood
WHERE ood.organization_id = l_org_id
AND ROWNUM = 1;
select asset_category_id
into l_post_asset_category_id
from mtl_system_items_b
where inventory_item_id = l_inventory_item_id
and organization_id = l_org_id;