The following lines contain the word 'select', 'insert', 'update' or 'delete':
G_API_NAME CONSTANT VARCHAR2(30) := 'Update Asset Description API';
FUNCTION update_row(
p_trans_rec IN fa_api_types.trans_rec_type,
p_asset_hdr_rec IN fa_api_types.asset_hdr_rec_type,
p_asset_desc_rec_new IN fa_api_types.asset_desc_rec_type,
p_asset_cat_rec_new IN fa_api_types.asset_cat_rec_type,
p_old_warranty_id IN number,
p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) return boolean;
PROCEDURE update_desc(
-- Standard Parameters --
p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_calling_fn IN VARCHAR2,
-- Transaction Object --
px_trans_rec IN OUT NOCOPY fa_api_types.trans_rec_type,
-- Asset Object --
px_asset_hdr_rec IN OUT NOCOPY fa_api_types.asset_hdr_rec_type,
px_asset_desc_rec_new IN OUT NOCOPY fa_api_types.asset_desc_rec_type,
px_asset_cat_rec_new IN OUT NOCOPY fa_api_types.asset_cat_rec_type) IS
l_asset_desc_rec FA_API_TYPES.asset_desc_rec_type;
l_calling_fn := 'FA_ASSET_DESC_PUB.update_desc';
SAVEPOINT do_desc_update;
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
select bc.book_type_code
into px_asset_hdr_rec.book_type_code
from fa_book_controls bc
where bc.book_class = 'CORPORATE'
and exists
(
select 'X'
from fa_books bks
where bks.asset_id = px_asset_hdr_rec.asset_id
and bks.book_type_code = bc.book_type_code
);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
l_err_stage:= 'Update Row';
fa_debug_pkg.add('Update_desc', 'before', l_err_stage
,p_log_level_rec => g_log_level_rec);
if (NOT update_row(
p_trans_rec => px_trans_rec,
p_asset_hdr_rec => px_asset_hdr_rec,
p_asset_desc_rec_new => l_asset_desc_rec,
p_asset_cat_rec_new => l_asset_cat_rec,
p_old_warranty_id => l_old_warranty_id,
p_log_level_rec => g_log_level_rec)) then
raise pub_error;
ROLLBACK TO do_desc_update;
(calling_fn => 'fa_asset_desc_pub.update_desc',
p_log_level_rec => g_log_level_rec);
ROLLBACK TO do_desc_update;
(calling_fn => 'fa_asset_desc_pub.update_desc'
,p_log_level_rec => g_log_level_rec);
END update_desc;
FUNCTION update_row(
p_trans_rec IN fa_api_types.trans_rec_type,
p_asset_hdr_rec IN fa_api_types.asset_hdr_rec_type,
p_asset_desc_rec_new IN fa_api_types.asset_desc_rec_type,
p_asset_cat_rec_new IN fa_api_types.asset_cat_rec_type,
p_old_warranty_id IN number,
p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) return boolean IS
l_return_status boolean:= FALSE;
update_error EXCEPTION;
l_calling_fn := 'FA_ASSET_DESC_PUB.update_row';
fa_additions_pkg.update_row (
X_Rowid => l_rowid,
X_Asset_Id => p_asset_hdr_rec.asset_id,
X_Asset_Number => upper(p_asset_desc_rec_new.asset_number),
X_Asset_Key_Ccid => p_asset_desc_rec_new.asset_key_ccid,
X_Current_Units => p_asset_desc_rec_new.current_units,
X_Tag_Number => upper(p_asset_desc_rec_new.tag_number),
X_Description => p_asset_desc_rec_new.description,
X_Asset_Category_Id => p_asset_cat_rec_new.category_id,
X_Parent_Asset_Id => p_asset_desc_rec_new.parent_asset_id,
X_Manufacturer_Name => p_asset_desc_rec_new.manufacturer_name,
X_Serial_Number => p_asset_desc_rec_new.serial_number,
X_Model_Number => p_asset_desc_rec_new.model_number,
X_Property_Type_Code => upper(p_asset_desc_rec_new.property_type_code),
X_Property_1245_1250_Code =>
p_asset_desc_rec_new.property_1245_1250_code,
X_In_Use_Flag => upper(p_asset_desc_rec_new.in_use_flag),
X_Owned_Leased => upper(p_asset_desc_rec_new.owned_leased),
X_New_Used => upper(p_asset_desc_rec_new.new_used),
X_Unit_Adjustment_Flag => upper(p_asset_desc_rec_new.unit_adjustment_flag),
X_Add_Cost_Je_Flag => upper(p_asset_desc_rec_new.add_cost_je_flag),
X_Attribute1 => p_asset_cat_rec_new.desc_flex.attribute1,
X_Attribute2 => p_asset_cat_rec_new.desc_flex.attribute2,
X_Attribute3 => p_asset_cat_rec_new.desc_flex.attribute3,
X_Attribute4 => p_asset_cat_rec_new.desc_flex.attribute4,
X_Attribute5 => p_asset_cat_rec_new.desc_flex.attribute5,
X_Attribute6 => p_asset_cat_rec_new.desc_flex.attribute6,
X_Attribute7 => p_asset_cat_rec_new.desc_flex.attribute7,
X_Attribute8 => p_asset_cat_rec_new.desc_flex.attribute8,
X_Attribute9 => p_asset_cat_rec_new.desc_flex.attribute9,
X_Attribute10 => p_asset_cat_rec_new.desc_flex.attribute10,
X_Attribute11 => p_asset_cat_rec_new.desc_flex.attribute11,
X_Attribute12 => p_asset_cat_rec_new.desc_flex.attribute12,
X_Attribute13 => p_asset_cat_rec_new.desc_flex.attribute13,
X_Attribute14 => p_asset_cat_rec_new.desc_flex.attribute14,
X_Attribute15 => p_asset_cat_rec_new.desc_flex.attribute15,
X_Attribute16 => p_asset_cat_rec_new.desc_flex.attribute16,
X_Attribute17 => p_asset_cat_rec_new.desc_flex.attribute17,
X_Attribute18 => p_asset_cat_rec_new.desc_flex.attribute18,
X_Attribute19 => p_asset_cat_rec_new.desc_flex.attribute19,
X_Attribute20 => p_asset_cat_rec_new.desc_flex.attribute20,
X_Attribute21 => p_asset_cat_rec_new.desc_flex.attribute21,
X_Attribute22 => p_asset_cat_rec_new.desc_flex.attribute22,
X_Attribute23 => p_asset_cat_rec_new.desc_flex.attribute23,
X_Attribute24 => p_asset_cat_rec_new.desc_flex.attribute24,
X_Attribute25 => p_asset_cat_rec_new.desc_flex.attribute25,
X_Attribute26 => p_asset_cat_rec_new.desc_flex.attribute26,
X_Attribute27 => p_asset_cat_rec_new.desc_flex.attribute27,
X_Attribute28 => p_asset_cat_rec_new.desc_flex.attribute28,
X_Attribute29 => p_asset_cat_rec_new.desc_flex.attribute29,
X_Attribute30 => p_asset_cat_rec_new.desc_flex.attribute30,
X_Attribute_Category_Code =>
p_asset_cat_rec_new.desc_flex.attribute_category_code,
X_gf_Attribute1 =>
p_asset_desc_rec_new.global_desc_flex.attribute1,
X_gf_Attribute2 =>
p_asset_desc_rec_new.global_desc_flex.attribute2,
X_gf_Attribute3 =>
p_asset_desc_rec_new.global_desc_flex.attribute3,
X_gf_Attribute4 =>
p_asset_desc_rec_new.global_desc_flex.attribute4,
X_gf_Attribute5 =>
p_asset_desc_rec_new.global_desc_flex.attribute5,
X_gf_Attribute6 =>
p_asset_desc_rec_new.global_desc_flex.attribute6,
X_gf_Attribute7 =>
p_asset_desc_rec_new.global_desc_flex.attribute7,
X_gf_Attribute8 =>
p_asset_desc_rec_new.global_desc_flex.attribute8,
X_gf_Attribute9 =>
p_asset_desc_rec_new.global_desc_flex.attribute9,
X_gf_Attribute10 =>
p_asset_desc_rec_new.global_desc_flex.attribute10,
X_gf_Attribute11 =>
p_asset_desc_rec_new.global_desc_flex.attribute11,
X_gf_Attribute12 =>
p_asset_desc_rec_new.global_desc_flex.attribute12,
X_gf_Attribute13 =>
p_asset_desc_rec_new.global_desc_flex.attribute13,
X_gf_Attribute14 =>
p_asset_desc_rec_new.global_desc_flex.attribute14,
X_gf_Attribute15 =>
p_asset_desc_rec_new.global_desc_flex.attribute15,
X_gf_Attribute16 =>
p_asset_desc_rec_new.global_desc_flex.attribute16,
X_gf_Attribute17 =>
p_asset_desc_rec_new.global_desc_flex.attribute17,
X_gf_Attribute18 =>
p_asset_desc_rec_new.global_desc_flex.attribute18,
X_gf_Attribute19 =>
p_asset_desc_rec_new.global_desc_flex.attribute19,
X_gf_Attribute20 =>
p_asset_desc_rec_new.global_desc_flex.attribute20,
X_gf_Attribute_Category_Code =>
p_asset_desc_rec_new.global_desc_flex.attribute_category_code,
X_Context => p_asset_cat_rec_new.desc_flex.context,
X_Lease_Id => p_asset_desc_rec_new.lease_id,
X_Inventorial => upper(p_asset_desc_rec_new.inventorial),
X_Commitment => p_asset_desc_rec_new.commitment,
X_Investment_Law => p_asset_desc_rec_new.investment_law,
X_Status => upper(p_asset_desc_rec_new.status),
X_Last_Update_Date => p_trans_rec.who_info.last_update_date,
X_Last_Updated_By => p_trans_rec.who_info.last_updated_by,
X_Last_Update_Login => p_trans_rec.who_info.last_update_login,
x_return_status => l_return_status,
X_Calling_Fn => l_calling_fn,
p_log_level_rec => p_log_level_rec);
raise update_error;
FA_DET_ADD_PKG.UPDATE_LEASE_DF
(X_Lease_Id => p_asset_desc_rec_new.Lease_Id,
X_Last_Update_Date => p_trans_rec.who_info.Last_Update_Date,
X_Last_Updated_By => p_trans_rec.who_info.Last_Updated_By,
X_Last_Update_Login => p_trans_rec.who_info.Last_Update_Login,
X_Attribute1 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute1,
X_Attribute2 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute2,
X_Attribute3 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute3,
X_Attribute4 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute4,
X_Attribute5 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute5,
X_Attribute6 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute6,
X_Attribute7 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute7,
X_Attribute8 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute8,
X_Attribute9 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute9,
X_Attribute10 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute10,
X_Attribute11 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute11,
X_Attribute12 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute12,
X_Attribute13 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute13,
X_Attribute14 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute14,
X_Attribute15 =>
p_asset_desc_rec_new.lease_desc_flex.Attribute15,
X_Attribute_Category_Code
=>
p_asset_desc_rec_new.lease_desc_flex.Attribute_Category_Code,
X_Return_Status => l_return_status,
X_Calling_Fn => l_calling_fn,
p_log_level_rec => p_log_level_rec);
raise update_error;
FA_ADD_WARRANTY_PKG.Update_table(
WR_warranty_id => NULL,
WR_old_warranty_id => p_old_warranty_id,
WR_asset_id => p_asset_hdr_rec.asset_id,
WR_date_effective => NULL,
WR_date_ineffective => p_trans_rec.who_info.last_update_date,
WR_last_update_date => p_trans_rec.who_info.last_update_date,
WR_last_updated_by => p_trans_rec.who_info.last_updated_by,
WR_created_by => NULL,
WR_creation_date => NULL,
WR_last_update_login => p_trans_rec.who_info.last_update_login,
WR_Update_Row => 'YES',
WR_Insert_Row => 'NO',
WR_calling_fn => 'fa_asset_desc_pub.update_row' ,
p_log_level_rec => p_log_level_rec);
FA_ADD_WARRANTY_PKG.Update_table(
WR_warranty_id => p_asset_desc_rec_new.warranty_id,
WR_old_warranty_id => NULL,
WR_asset_id => p_asset_hdr_rec.asset_id,
WR_date_effective => p_trans_rec.who_info.last_update_date,
WR_date_ineffective => NULL,
WR_last_update_date => p_trans_rec.who_info.last_update_date,
WR_last_updated_by => p_trans_rec.who_info.last_updated_by,
WR_created_by => p_trans_rec.who_info.last_updated_by,
WR_creation_date => p_trans_rec.who_info.last_update_date,
WR_last_update_login => p_trans_rec.who_info.last_update_login,
WR_Update_Row => 'NO',
WR_Insert_Row => 'YES',
WR_calling_fn => 'fa_asset_desc_pub.update_row' ,
p_log_level_rec => p_log_level_rec);
FA_ADD_WARRANTY_PKG.Update_table(
WR_warranty_id => p_asset_desc_rec_new.warranty_id,
WR_old_warranty_id => p_old_warranty_id,
WR_asset_id => p_asset_hdr_rec.asset_id,
WR_date_effective => p_trans_rec.who_info.last_update_date,
WR_date_ineffective => p_trans_rec.who_info.last_update_date,
WR_last_update_date => p_trans_rec.who_info.last_update_date,
WR_last_updated_by => p_trans_rec.who_info.last_updated_by,
WR_created_by => p_trans_rec.who_info.last_updated_by,
WR_creation_date => p_trans_rec.who_info.last_update_date,
WR_last_update_login => p_trans_rec.who_info.last_update_login,
WR_Update_Row => 'YES',
WR_Insert_Row => 'YES',
WR_calling_fn => 'fa_asset_desc_pub.update_row' ,
p_log_level_rec => p_log_level_rec);
when update_error then
FA_SRVR_MSG.Add_Message(
Calling_Fn => l_calling_fn
,p_log_level_rec => p_log_level_rec);
END update_row;
PROCEDURE update_invoice_desc(
-- Standard Parameters --
p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_calling_fn IN VARCHAR2,
-- Transaction Object --
px_trans_rec IN OUT NOCOPY fa_api_types.trans_rec_type,
-- Asset Object --
px_asset_hdr_rec IN OUT NOCOPY fa_api_types.asset_hdr_rec_type,
px_inv_tbl_new IN OUT NOCOPY fa_api_types.inv_tbl_type) IS
inv_err exception;
l_calling_fn varchar2(40) := 'FA_ASSET_DESC_PUB.update_invoice_desc';
SELECT bc.book_type_code
FROM fa_books bks,
fa_book_controls bc
WHERE bks.book_type_code = bc.distribution_source_book
AND bks.book_type_code = bc.book_type_code
AND bks.asset_id = p_asset_id
AND bks.transaction_header_id_out is null;
SAVEPOINT do_invoice_desc_update;
if (px_inv_tbl_new(i).deleted_flag is NOT NULL) then
if (nvl(l_inv_rec.deleted_flag, '-999') <>
px_inv_tbl_new(i).deleted_flag) then
if (px_inv_tbl_new(i).deleted_flag = FND_API.G_MISS_CHAR) then
--px_inv_tbl_new(i).deleted_flag := NULL;
l_inv_rec.deleted_flag := px_inv_tbl_new(i).deleted_flag;
FA_ASSET_INVOICES_PKG.Update_Row (
X_Rowid => l_rowid,
X_Source_Line_id => l_inv_rec.Source_Line_Id,
X_Asset_Id => l_mrc_asset_hdr_rec.asset_id,
X_Po_Vendor_Id => l_inv_rec.Po_Vendor_Id,
X_Asset_Invoice_Id => l_inv_rec.Asset_Invoice_Id,
X_Fixed_Assets_Cost => l_inv_rec.Fixed_Assets_Cost,
X_Deleted_Flag => l_inv_rec.Deleted_Flag,
X_Po_Number => l_inv_rec.Po_Number,
X_Invoice_Number => l_inv_rec.Invoice_Number,
X_Payables_Batch_Name => l_inv_rec.Payables_Batch_Name,
X_Payables_Code_Combination_Id
=>
l_inv_rec.Payables_Code_Combination_Id,
X_Feeder_System_Name =>
l_inv_rec.Feeder_System_Name,
X_Create_Batch_Date => l_inv_rec.Create_Batch_Date,
X_Create_Batch_Id => l_inv_rec.Create_Batch_Id,
X_Invoice_Date => l_inv_rec.Invoice_Date,
X_Payables_Cost => l_inv_rec.Payables_Cost,
X_Post_Batch_Id => l_inv_rec.Post_Batch_Id,
X_Invoice_Id => l_inv_rec.Invoice_Id,
X_Ap_Distribution_Line_Number
=>
l_inv_rec.Ap_Distribution_Line_Number,
X_Payables_Units => l_inv_rec.Payables_Units,
X_Split_Merged_Code => l_inv_rec.Split_Merged_Code,
X_Description => l_inv_rec.Description,
X_Parent_Mass_Addition_Id => l_inv_rec.Parent_Mass_Addition_Id,
X_Last_Update_Date =>
px_trans_rec.who_info.Last_Update_Date,
X_Last_Updated_By =>
px_trans_rec.who_info.Last_Updated_By,
X_Last_Update_Login =>
px_trans_rec.who_info.Last_Update_Login,
X_Attribute1 => l_inv_rec.Attribute1,
X_Attribute2 => l_inv_rec.Attribute2,
X_Attribute3 => l_inv_rec.Attribute3,
X_Attribute4 => l_inv_rec.Attribute4,
X_Attribute5 => l_inv_rec.Attribute5,
X_Attribute6 => l_inv_rec.Attribute6,
X_Attribute7 => l_inv_rec.Attribute7,
X_Attribute8 => l_inv_rec.Attribute8,
X_Attribute9 => l_inv_rec.Attribute9,
X_Attribute10 => l_inv_rec.Attribute10,
X_Attribute11 => l_inv_rec.Attribute11,
X_Attribute12 => l_inv_rec.Attribute12,
X_Attribute13 => l_inv_rec.Attribute13,
X_Attribute14 => l_inv_rec.Attribute14,
X_Attribute15 => l_inv_rec.Attribute15,
X_Attribute_Category_Code =>
l_inv_rec.Attribute_Category_Code,
X_Unrevalued_Cost => l_inv_rec.Unrevalued_Cost,
X_Merged_Code => l_inv_rec.Merged_Code,
X_Split_Code => l_inv_rec.Split_Code,
X_Merge_Parent_Mass_Add_Id =>
l_inv_rec.Merge_Parent_Mass_Additions_Id,
X_Split_Parent_Mass_Add_Id =>
l_inv_rec.Split_Parent_Mass_Additions_Id,
X_Project_Asset_Line_Id =>
l_inv_rec.Project_Asset_Line_Id,
X_Project_Id => l_inv_rec.Project_Id,
X_Task_Id => l_inv_rec.Task_Id,
X_Material_Indicator_Flag => l_inv_rec.Material_Indicator_Flag,
X_invoice_distribution_id => l_inv_rec.Invoice_distribution_id,
X_invoice_line_number => l_inv_rec.Invoice_line_number,
X_po_distribution_id => l_inv_rec.Po_distribution_id,
X_mrc_sob_type_code => l_reporting_flag,
X_Calling_Fn => p_calling_fn,
p_log_level_rec => g_log_level_rec);
ROLLBACK TO do_invoice_desc_update;
ROLLBACK TO do_invoice_desc_update;
END update_invoice_desc;
PROCEDURE update_retirement_desc(
-- Standard Parameters --
p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_calling_fn IN VARCHAR2,
-- Transaction Object --
px_trans_rec IN OUT NOCOPY fa_api_types.trans_rec_type,
-- Asset Object --
px_asset_hdr_rec IN OUT NOCOPY fa_api_types.asset_hdr_rec_type,
px_asset_retire_rec_new IN OUT NOCOPY fa_api_types.asset_retire_rec_type) AS
ret_err exception;
l_calling_fn varchar2(40) := 'FA_ASSET_DESC_PUB.update_retirement_desc';
SAVEPOINT do_retirement_desc_update;
select br1.avg_exchange_rate
into l_rate
from fa_mc_books_rates br1
where br1.asset_id = l_mrc_asset_hdr_rec.asset_id
and br1.book_type_code = l_mrc_asset_hdr_rec.book_type_code
and br1.set_of_books_id =
l_mrc_asset_hdr_rec.set_of_books_id
and br1.transaction_header_id =
(
select max(br2.transaction_header_id)
from fa_mc_books_rates br2
where br2.asset_id = l_mrc_asset_hdr_rec.asset_id
and br2.book_type_code =
l_mrc_asset_hdr_rec.book_type_code
and br2.set_of_books_id =
l_mrc_asset_hdr_rec.set_of_books_id
);
select br1.avg_exchange_rate
into l_rate
from fa_mc_books_rates br1
where br1.asset_id = l_mrc_asset_hdr_rec.asset_id
and br1.book_type_code = l_mrc_asset_hdr_rec.book_type_code
and br1.set_of_books_id =
l_mrc_asset_hdr_rec.set_of_books_id
and br1.transaction_header_id =
(
select max(br2.transaction_header_id)
from fa_mc_books_rates br2
where br2.asset_id = l_mrc_asset_hdr_rec.asset_id
and br2.book_type_code =
l_mrc_asset_hdr_rec.book_type_code
and br2.set_of_books_id =
l_mrc_asset_hdr_rec.set_of_books_id
);
FA_RETIREMENTS_PKG.Update_Row(
X_Rowid => l_rowid,
X_Retirement_Id => l_asset_retire_rec.retirement_id,
X_Book_Type_Code =>
l_asset_retire_rec.detail_info.book_type_code,
X_Asset_Id => l_asset_retire_rec.detail_info.asset_id,
X_Date_Retired => l_asset_retire_rec.date_retired,
X_Cost_Retired => l_asset_retire_rec.cost_retired,
X_Status => l_asset_retire_rec.status,
X_Last_Update_Date => px_trans_rec.who_info.last_update_date,
X_Last_Updated_By => px_trans_rec.who_info.last_updated_by,
X_Ret_Prorate_Convention
=>
l_asset_retire_rec.retirement_prorate_convention,
X_Units => l_asset_retire_rec.units_retired,
X_Cost_Of_Removal => l_asset_retire_rec.cost_of_removal,
X_Nbv_Retired => l_asset_retire_rec.detail_info.nbv_retired,
X_Gain_Loss_Amount =>
l_asset_retire_rec.detail_info.gain_loss_amount,
X_Proceeds_Of_Sale => l_asset_retire_rec.proceeds_of_sale,
X_Gain_Loss_Type_Code =>
l_asset_retire_rec.detail_info.gain_loss_type_code,
X_Retirement_Type_Code => l_asset_retire_rec.retirement_type_code,
X_Itc_Recaptured =>
l_asset_retire_rec.detail_info.itc_recaptured,
X_Itc_Recapture_Id =>
l_asset_retire_rec.detail_info.itc_recapture_id,
X_Reference_Num => l_asset_retire_rec.reference_num,
X_Sold_To => l_asset_retire_rec.sold_to,
X_Trade_In_Asset_Id => l_asset_retire_rec.trade_in_asset_id,
X_Stl_Method_Code =>
l_asset_retire_rec.detail_info.stl_method_code,
X_Stl_Life_In_Months =>
l_asset_retire_rec.detail_info.stl_life_in_months,
X_Last_Update_Login => px_trans_rec.who_info.last_update_login,
X_Attribute1 => l_asset_retire_rec.desc_flex.attribute1,
X_Attribute2 => l_asset_retire_rec.desc_flex.attribute2,
X_Attribute3 => l_asset_retire_rec.desc_flex.attribute3,
X_Attribute4 => l_asset_retire_rec.desc_flex.attribute4,
X_Attribute5 => l_asset_retire_rec.desc_flex.attribute5,
X_Attribute6 => l_asset_retire_rec.desc_flex.attribute6,
X_Attribute7 => l_asset_retire_rec.desc_flex.attribute7,
X_Attribute8 => l_asset_retire_rec.desc_flex.attribute8,
X_Attribute9 => l_asset_retire_rec.desc_flex.attribute9,
X_Attribute10 => l_asset_retire_rec.desc_flex.attribute10,
X_Attribute11 => l_asset_retire_rec.desc_flex.attribute11,
X_Attribute12 => l_asset_retire_rec.desc_flex.attribute12,
X_Attribute13 => l_asset_retire_rec.desc_flex.attribute13,
X_Attribute14 => l_asset_retire_rec.desc_flex.attribute14,
X_Attribute15 => l_asset_retire_rec.desc_flex.attribute15,
X_Attribute_Category_Code
=>
l_asset_retire_rec.desc_flex.attribute_category_code,
X_mrc_sob_type_code => l_reporting_flag,
X_Calling_Fn => p_calling_fn
,p_log_level_rec => g_log_level_rec);
ROLLBACK TO do_retirement_desc_update;
ROLLBACK TO do_retirement_desc_update;
END update_retirement_desc;