1 PACKAGE BODY FA_MASS_ADDITIONS_PKG2 as
2 /* $Header: faxima2b.pls 120.6 2005/07/25 10:01:12 yyoon ship $ */
3 ----
4 PROCEDURE Lock_Row(X_Rowid VARCHAR2,
5 X_Mass_Addition_Id NUMBER DEFAULT NULL,
6 X_Asset_Number VARCHAR2 DEFAULT NULL,
7 X_Tag_Number VARCHAR2 DEFAULT NULL,
8 X_Description VARCHAR2 DEFAULT NULL,
9 X_Asset_Category_Id NUMBER DEFAULT NULL,
10 X_Manufacturer_Name VARCHAR2 DEFAULT NULL,
11 X_Serial_Number VARCHAR2 DEFAULT NULL,
12 X_Model_Number VARCHAR2 DEFAULT NULL,
13 X_Book_Type_Code VARCHAR2 DEFAULT NULL,
14 X_Date_Placed_In_Service DATE DEFAULT NULL,
15 X_Fixed_Assets_Cost NUMBER DEFAULT NULL,
16 X_Payables_Units NUMBER DEFAULT NULL,
17 X_Fixed_Assets_Units NUMBER DEFAULT NULL,
18 X_Payables_Code_Combination_Id NUMBER DEFAULT NULL,
19 X_Expense_Code_Combination_Id NUMBER DEFAULT NULL,
20 X_Location_Id NUMBER DEFAULT NULL,
21 X_Assigned_To NUMBER DEFAULT NULL,
22 X_Feeder_System_Name VARCHAR2 DEFAULT NULL,
23 X_Create_Batch_Date DATE DEFAULT NULL,
24 X_Create_Batch_Id NUMBER DEFAULT NULL,
25 X_Reviewer_Comments VARCHAR2 DEFAULT NULL,
26 X_Invoice_Number VARCHAR2 DEFAULT NULL,
27 X_Vendor_Number VARCHAR2 DEFAULT NULL,
28 X_Po_Vendor_Id NUMBER DEFAULT NULL,
29 X_Po_Number VARCHAR2 DEFAULT NULL,
30 X_Posting_Status VARCHAR2 DEFAULT NULL,
31 X_Queue_Name VARCHAR2 DEFAULT NULL,
32 X_Invoice_Date DATE DEFAULT NULL,
33 X_Invoice_Created_By NUMBER DEFAULT NULL,
34 X_Invoice_Updated_By NUMBER DEFAULT NULL,
35 X_Payables_Cost NUMBER DEFAULT NULL,
36 X_Invoice_Id NUMBER DEFAULT NULL,
37 X_Payables_Batch_Name VARCHAR2 DEFAULT NULL,
38 X_Depreciate_Flag VARCHAR2 DEFAULT NULL,
39 X_Parent_Mass_Addition_Id NUMBER DEFAULT NULL,
40 X_Parent_Asset_Id NUMBER DEFAULT NULL,
41 X_Split_Merged_Code VARCHAR2 DEFAULT NULL,
42 X_Ap_Distribution_Line_Number NUMBER DEFAULT NULL,
43 X_Post_Batch_Id NUMBER DEFAULT NULL,
44 X_Add_To_Asset_Id NUMBER DEFAULT NULL,
45 X_Amortize_Flag VARCHAR2 DEFAULT NULL,
46 X_New_Master_Flag VARCHAR2 DEFAULT NULL,
47 X_Asset_Key_Ccid NUMBER DEFAULT NULL,
48 X_Asset_Type VARCHAR2 DEFAULT NULL,
49 X_Deprn_Reserve NUMBER DEFAULT NULL,
50 X_Ytd_Deprn NUMBER DEFAULT NULL,
51 X_Beginning_Nbv NUMBER DEFAULT NULL,
52 X_Salvage_Value NUMBER DEFAULT NULL,
53 X_Accounting_Date DATE DEFAULT NULL,
54 X_Attribute1 VARCHAR2 DEFAULT NULL,
55 X_Attribute2 VARCHAR2 DEFAULT NULL,
56 X_Attribute3 VARCHAR2 DEFAULT NULL,
57 X_Attribute4 VARCHAR2 DEFAULT NULL,
58 X_Attribute5 VARCHAR2 DEFAULT NULL,
59 X_Attribute6 VARCHAR2 DEFAULT NULL,
60 X_Attribute7 VARCHAR2 DEFAULT NULL,
61 X_Attribute8 VARCHAR2 DEFAULT NULL,
62 X_Attribute9 VARCHAR2 DEFAULT NULL,
63 X_Attribute10 VARCHAR2 DEFAULT NULL,
64 X_Attribute11 VARCHAR2 DEFAULT NULL,
65 X_Attribute12 VARCHAR2 DEFAULT NULL,
66 X_Attribute13 VARCHAR2 DEFAULT NULL,
67 X_Attribute14 VARCHAR2 DEFAULT NULL,
68 X_Attribute15 VARCHAR2 DEFAULT NULL,
69 X_Attribute_Category_Code VARCHAR2 DEFAULT NULL,
70 X_Fully_Rsvd_Revals_Counter NUMBER DEFAULT NULL,
71 X_Merge_Invoice_Number VARCHAR2 DEFAULT NULL,
72 X_Merge_Vendor_Number VARCHAR2 DEFAULT NULL,
73 X_Production_Capacity NUMBER DEFAULT NULL,
74 X_Reval_Amortization_Basis NUMBER DEFAULT NULL,
75 X_Reval_Reserve NUMBER DEFAULT NULL,
76 X_Unit_Of_Measure VARCHAR2 DEFAULT NULL,
77 X_Unrevalued_Cost NUMBER DEFAULT NULL,
78 X_Ytd_Reval_Deprn_Expense NUMBER DEFAULT NULL,
79 X_Attribute16 VARCHAR2 DEFAULT NULL,
80 X_Attribute17 VARCHAR2 DEFAULT NULL,
81 X_Attribute18 VARCHAR2 DEFAULT NULL,
82 X_Attribute19 VARCHAR2 DEFAULT NULL,
83 X_Attribute20 VARCHAR2 DEFAULT NULL,
84 X_Attribute21 VARCHAR2 DEFAULT NULL,
85 X_Attribute22 VARCHAR2 DEFAULT NULL,
86 X_Attribute23 VARCHAR2 DEFAULT NULL,
87 X_Attribute24 VARCHAR2 DEFAULT NULL,
88 X_Attribute25 VARCHAR2 DEFAULT NULL,
89 X_Attribute26 VARCHAR2 DEFAULT NULL,
90 X_Attribute27 VARCHAR2 DEFAULT NULL,
91 X_Attribute28 VARCHAR2 DEFAULT NULL,
92 X_Attribute29 VARCHAR2 DEFAULT NULL,
93 X_Attribute30 VARCHAR2 DEFAULT NULL,
94 X_Merged_Code VARCHAR2 DEFAULT NULL,
95 X_Split_Code VARCHAR2 DEFAULT NULL,
96 X_Merge_Parent_Mass_Add_Id NUMBER DEFAULT NULL,
97 X_Split_Parent_Mass_Add_Id NUMBER DEFAULT NULL,
98 X_Sum_Units VARCHAR2 DEFAULT NULL,
99 X_GLOBAL_ATTRIBUTE1 VARCHAR2 DEFAULT NULL,
100 X_GLOBAL_ATTRIBUTE10 VARCHAR2 DEFAULT NULL,
101 X_GLOBAL_ATTRIBUTE11 VARCHAR2 DEFAULT NULL,
102 X_GLOBAL_ATTRIBUTE12 VARCHAR2 DEFAULT NULL,
103 X_GLOBAL_ATTRIBUTE13 VARCHAR2 DEFAULT NULL,
104 X_GLOBAL_ATTRIBUTE14 VARCHAR2 DEFAULT NULL,
105 X_GLOBAL_ATTRIBUTE15 VARCHAR2 DEFAULT NULL,
106 X_GLOBAL_ATTRIBUTE16 VARCHAR2 DEFAULT NULL,
107 X_GLOBAL_ATTRIBUTE17 VARCHAR2 DEFAULT NULL,
108 X_GLOBAL_ATTRIBUTE18 VARCHAR2 DEFAULT NULL,
109 X_GLOBAL_ATTRIBUTE19 VARCHAR2 DEFAULT NULL,
110 X_GLOBAL_ATTRIBUTE2 VARCHAR2 DEFAULT NULL,
111 X_GLOBAL_ATTRIBUTE20 VARCHAR2 DEFAULT NULL,
112 X_GLOBAL_ATTRIBUTE3 VARCHAR2 DEFAULT NULL,
113 X_GLOBAL_ATTRIBUTE4 VARCHAR2 DEFAULT NULL,
114 X_GLOBAL_ATTRIBUTE5 VARCHAR2 DEFAULT NULL,
115 X_GLOBAL_ATTRIBUTE6 VARCHAR2 DEFAULT NULL,
116 X_GLOBAL_ATTRIBUTE7 VARCHAR2 DEFAULT NULL,
117 X_GLOBAL_ATTRIBUTE8 VARCHAR2 DEFAULT NULL,
118 X_GLOBAL_ATTRIBUTE9 VARCHAR2 DEFAULT NULL,
119 X_GLOBAL_ATTRIBUTE_CATEGORY VARCHAR2 DEFAULT NULL,
120 X_INVENTORIAL VARCHAR2 DEFAULT NULL,
121 X_Transaction_type_code VARCHAR2 DEFAULT NULL,
122 X_transaction_date DATE DEFAULT NULL,
123 X_warranty_id NUMBER DEFAULT NULL,
124 X_lease_id NUMBER DEFAULT NULL,
125 X_lessor_id NUMBER DEFAULT NULL,
126 X_property_type_code VARCHAR2 DEFAULT NULL,
127 X_property_1245_1250_code VARCHAR2 DEFAULT NULL,
128 X_in_use_flag VARCHAR2 DEFAULT NULL,
129 X_owned_leased VARCHAR2 DEFAULT NULL,
130 X_new_used VARCHAR2 DEFAULT NULL,
131 X_asset_id NUMBER DEFAULT NULL,
132 X_invoice_distribution_id NUMBER DEFAULT NULL,
133 X_invoice_line_number NUMBER DEFAULT NULL,
134 X_po_distribution_id NUMBER DEFAULT NULL,
135 X_warranty_number VARCHAR2 DEFAULT NULL ,
136 p_log_level_rec in fa_api_types.log_level_rec_type default null) IS
137 CURSOR C IS
138 SELECT mass_addition_id,
139 asset_number,
140 tag_number,
141 description,
142 asset_category_id,
143 manufacturer_name,
144 serial_number,
145 model_number,
146 book_type_code,
147 date_placed_in_service,
148 fixed_assets_cost,
149 payables_units,
150 fixed_assets_units,
151 payables_code_combination_id,
152 expense_code_combination_id,
153 location_id,
154 assigned_to,
155 feeder_system_name,
156 create_batch_date,
157 create_batch_id,
158 last_update_date,
159 last_updated_by,
160 reviewer_comments,
161 invoice_number,
162 vendor_number,
163 po_vendor_id,
164 po_number,
165 posting_status,
166 queue_name,
167 invoice_date,
168 invoice_created_by,
169 invoice_updated_by,
170 payables_cost,
171 invoice_id,
172 payables_batch_name,
173 depreciate_flag,
174 parent_mass_addition_id,
175 parent_asset_id,
176 split_merged_code,
177 ap_distribution_line_number,
178 post_batch_id,
179 add_to_asset_id,
180 amortize_flag,
181 new_master_flag,
182 asset_key_ccid,
183 asset_type,
184 deprn_reserve,
185 ytd_deprn,
186 beginning_nbv,
187 created_by,
188 creation_date,
189 last_update_login,
190 salvage_value,
191 accounting_date,
192 attribute1,
193 attribute2,
194 attribute3,
195 attribute4,
196 attribute5,
197 attribute6,
198 attribute7,
199 attribute8,
200 attribute9,
201 attribute10,
202 attribute11,
203 attribute12,
204 attribute13,
205 attribute14,
206 attribute15,
207 attribute_category_code,
208 fully_rsvd_revals_counter,
209 merge_invoice_number,
210 merge_vendor_number,
211 production_capacity,
212 reval_amortization_basis,
213 reval_reserve,
214 unit_of_measure,
215 unrevalued_cost,
216 ytd_reval_deprn_expense,
217 attribute16,
218 attribute17,
219 attribute18,
220 attribute19,
221 attribute20,
222 attribute21,
223 attribute22,
224 attribute23,
225 attribute24,
226 attribute25,
227 attribute26,
228 attribute27,
229 attribute28,
230 attribute29,
231 attribute30,
232 merged_code,
233 split_code,
234 merge_parent_mass_additions_id,
235 split_parent_mass_additions_id,
236 project_asset_line_id,
237 project_id,
238 task_id,
239 sum_units,
240 dist_name,
241 global_attribute1,
242 global_attribute2,
243 global_attribute3,
244 global_attribute4,
245 global_attribute5,
246 global_attribute6,
247 global_attribute7,
248 global_attribute8,
249 global_attribute9,
250 global_attribute10,
251 global_attribute11,
252 global_attribute12,
253 global_attribute13,
254 global_attribute14,
255 global_attribute15,
256 global_attribute16,
257 global_attribute17,
258 global_attribute18,
259 global_attribute19,
260 global_attribute20,
261 global_attribute_category,
262 context,
263 inventorial,
264 short_fiscal_year_flag,
265 conversion_date,
266 original_deprn_start_date,
267 transaction_type_code,
268 transaction_date,
269 warranty_id,
270 lease_id,
271 lessor_id,
272 property_type_code,
273 property_1245_1250_code,
274 in_use_flag,
275 owned_leased,
276 new_used,
277 asset_id,
278 invoice_distribution_id,
279 invoice_line_number,
280 po_distribution_id,
281 warranty_number
282 FROM fa_mass_additions
283 WHERE rowid = X_Rowid
284 FOR UPDATE of Mass_Addition_Id NOWAIT;
285 Recinfo C%ROWTYPE;
286
287
288 BEGIN
289 OPEN C;
290 FETCH C INTO Recinfo;
291 if (C%NOTFOUND) then
292 CLOSE C;
293 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
294 APP_EXCEPTION.Raise_Exception;
295 end if;
296 CLOSE C;
297 if ( ( (Recinfo.mass_addition_id = X_Mass_Addition_Id)
298 OR ( (Recinfo.mass_addition_id IS NULL)
299 AND (X_Mass_Addition_Id IS NULL)))
300 AND ( (Recinfo.asset_number = X_Asset_Number)
301 OR ( (Recinfo.asset_number IS NULL)
302 AND (X_Asset_Number IS NULL)))
303 AND ( (Recinfo.tag_number = X_Tag_Number)
304 OR ( (Recinfo.tag_number IS NULL)
305 AND (X_Tag_Number IS NULL)))
306 AND ( (Recinfo.description = X_Description)
307 OR ( (Recinfo.description IS NULL)
308 AND (X_Description IS NULL)))
309 AND ( (Recinfo.asset_category_id = X_Asset_Category_Id)
310 OR ( (Recinfo.asset_category_id IS NULL)
311 AND (X_Asset_Category_Id IS NULL)))
312 AND ( (Recinfo.manufacturer_name = X_Manufacturer_Name)
313 OR ( (Recinfo.manufacturer_name IS NULL)
314 AND (X_Manufacturer_Name IS NULL)))
315 AND ( (Recinfo.serial_number = X_Serial_Number)
316 OR ( (Recinfo.serial_number IS NULL)
317 AND (X_Serial_Number IS NULL)))
318 AND ( (Recinfo.model_number = X_Model_Number)
319 OR ( (Recinfo.model_number IS NULL)
320 AND (X_Model_Number IS NULL)))
321 AND ( (Recinfo.book_type_code = X_Book_Type_Code)
322 OR ( (Recinfo.book_type_code IS NULL)
323 AND (X_Book_Type_Code IS NULL)))
324 AND ( (Recinfo.date_placed_in_service = X_Date_Placed_In_Service)
325 OR ( (Recinfo.date_placed_in_service IS NULL) ))
326 /* fixing for bug #586288.. mass_addition_3.s_date_placed_in_service
327 modifies the date if it is null... so we would get FORM_RECORD_CHANGED
328 error... only generate error if it is original is NOT null
329 AND (X_Date_Placed_In_Service IS NULL)))
330 */
334 AND ( (Recinfo.payables_units = X_Payables_Units)
331 AND ( (Recinfo.fixed_assets_cost = X_Fixed_Assets_Cost)
332 OR ( (Recinfo.fixed_assets_cost IS NULL)
333 AND (X_Fixed_Assets_Cost IS NULL)))
335 OR ( (Recinfo.payables_units IS NULL)
336 AND (X_Payables_Units IS NULL)))
337 AND ( (Recinfo.fixed_assets_units = X_Fixed_Assets_Units)
338 OR ( (Recinfo.fixed_assets_units IS NULL)
339 AND (X_Fixed_Assets_Units IS NULL)))
340 /*
341 AND ( (Recinfo.payables_code_combination_id = X_Payables_Code_Combination_Id)
342 OR ( (Recinfo.payables_code_combination_id IS NULL)
343 AND (X_Payables_Code_Combination_Id IS NULL)))
344 AND ( (Recinfo.expense_code_combination_id = X_Expense_Code_Combination_Id)
345 OR ( (Recinfo.expense_code_combination_id IS NULL)
346 AND (X_Expense_Code_Combination_Id IS NULL)
347 )
348 )
349 AND ( (Recinfo.location_id = X_Location_Id)
350 OR ( (Recinfo.location_id IS NULL)
351 AND (X_Location_Id IS NULL)))
352 AND ( (Recinfo.assigned_to = X_Assigned_To)
353 OR ( (Recinfo.assigned_to IS NULL)
354 AND (X_Assigned_To IS NULL)))
355 AND ( (Recinfo.feeder_system_name = X_Feeder_System_Name)
356 OR ( (Recinfo.feeder_system_name IS NULL)
357 AND (X_Feeder_System_Name IS NULL)))
358
359 AND ( (Recinfo.create_batch_date = X_Create_Batch_Date)
360 OR ( (Recinfo.create_batch_date IS NULL)
361 AND (X_Create_Batch_Date IS NULL)))
362 */
363 AND ( (Recinfo.create_batch_id = X_Create_Batch_Id)
364 OR ( (Recinfo.create_batch_id IS NULL)
365 AND (X_Create_Batch_Id IS NULL)))
366 AND ( (Recinfo.reviewer_comments = X_Reviewer_Comments)
367 OR ( (Recinfo.reviewer_comments IS NULL)
368 AND (X_Reviewer_Comments IS NULL)))
369 AND ( (Recinfo.invoice_number = X_Invoice_Number)
370 OR ( (Recinfo.invoice_number IS NULL)
371 AND (X_Invoice_Number IS NULL)))
372 /*
373 AND ( (Recinfo.vendor_number = X_Vendor_Number)
374 OR ( (Recinfo.vendor_number IS NULL)
375 AND (X_Vendor_Number IS NULL)))
376 */
377 AND ( (Recinfo.po_vendor_id = X_Po_Vendor_Id)
378 OR ( (Recinfo.po_vendor_id IS NULL)
379 AND (X_Po_Vendor_Id IS NULL)))
380 AND ( (Recinfo.po_number = X_Po_Number)
381 OR ( (Recinfo.po_number IS NULL)
382 AND (X_Po_Number IS NULL)))
383 AND ( (Recinfo.posting_status = X_Posting_Status)
384 OR ( (Recinfo.posting_status IS NULL)
385 AND (X_Posting_Status IS NULL)))
386 AND ( (Recinfo.queue_name = X_Queue_Name)
387 OR ( (Recinfo.queue_name IS NULL)
388 AND (X_Queue_Name IS NULL)))
389 AND ( (Recinfo.invoice_date = X_Invoice_Date)
390 OR ( (Recinfo.invoice_date IS NULL)
391 AND (X_Invoice_Date IS NULL)))
392 AND ( (Recinfo.invoice_created_by = X_Invoice_Created_By)
393 OR ( (Recinfo.invoice_created_by IS NULL)
394 AND (X_Invoice_Created_By IS NULL)))
395 AND ( (Recinfo.invoice_updated_by = X_Invoice_Updated_By)
396 OR ( (Recinfo.invoice_updated_by IS NULL)
397 AND (X_Invoice_Updated_By IS NULL)))) then
398 null;
399 else
400 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
401 APP_EXCEPTION.Raise_Exception;
402 end if;
403
404 if ( ((Recinfo.payables_cost = X_Payables_Cost)
405 OR ( (Recinfo.payables_cost IS NULL)
406 AND (X_Payables_Cost IS NULL)))
407 AND ( (Recinfo.invoice_id = X_Invoice_Id)
408 OR ( (Recinfo.invoice_id IS NULL)
409 AND (X_Invoice_Id IS NULL)))
410 AND ( (Recinfo.payables_batch_name = X_Payables_Batch_Name)
411 OR ( (Recinfo.payables_batch_name IS NULL)
412 AND (X_Payables_Batch_Name IS NULL)))
413 AND ( (Recinfo.depreciate_flag = X_Depreciate_Flag)
414 OR ( (Recinfo.depreciate_flag IS NULL)
415 AND (X_Depreciate_Flag IS NULL)))
416 AND ( (Recinfo.parent_mass_addition_id = X_Parent_Mass_Addition_Id)
417 OR ( (Recinfo.parent_mass_addition_id IS NULL)
418 AND (X_Parent_Mass_Addition_Id IS NULL)))
419 AND ( (Recinfo.parent_asset_id = X_Parent_Asset_Id)
420 OR ( (Recinfo.parent_asset_id IS NULL)
421 AND (X_Parent_Asset_Id IS NULL)))
422 AND ( (Recinfo.split_merged_code = X_Split_Merged_Code)
423 OR ( (Recinfo.split_merged_code IS NULL)
424 AND (X_Split_Merged_Code IS NULL)))
425 AND ( (Recinfo.ap_distribution_line_number = X_Ap_Distribution_Line_Number)
426 OR ( (Recinfo.ap_distribution_line_number IS NULL)
427 AND (X_Ap_Distribution_Line_Number IS NULL)))
428 AND ( (Recinfo.post_batch_id = X_Post_Batch_Id)
429 OR ( (Recinfo.post_batch_id IS NULL)
433 AND (X_Add_To_Asset_Id IS NULL)))
430 AND (X_Post_Batch_Id IS NULL)))
431 AND ( (Recinfo.add_to_asset_id = X_Add_To_Asset_Id)
432 OR ( (Recinfo.add_to_asset_id IS NULL)
434 AND ( (Recinfo.amortize_flag = X_Amortize_Flag)
435 OR ( (Recinfo.amortize_flag IS NULL)
436 AND (X_Amortize_Flag IS NULL)))
437 AND ( (Recinfo.new_master_flag = X_New_Master_Flag)
438 OR ( (Recinfo.new_master_flag IS NULL)
439 AND (X_New_Master_Flag IS NULL)))
440 AND ( (Recinfo.asset_key_ccid = X_Asset_Key_Ccid)
441 OR ( (Recinfo.asset_key_ccid IS NULL)
442 AND (X_Asset_Key_Ccid IS NULL)))
443 AND ( (Recinfo.asset_type = X_Asset_Type)
444 OR ( (Recinfo.asset_type IS NULL)
445 AND (X_Asset_Type IS NULL)))
446 AND ( (Recinfo.deprn_reserve = X_Deprn_Reserve)
447 OR ( (Recinfo.deprn_reserve IS NULL)
448 AND (X_Deprn_Reserve IS NULL)))
449 AND ( (Recinfo.ytd_deprn = X_Ytd_Deprn)
450 OR ( (Recinfo.ytd_deprn IS NULL)
451 AND (X_Ytd_Deprn IS NULL)))
452 AND ( (Recinfo.beginning_nbv = X_Beginning_Nbv)
453 OR ( (Recinfo.beginning_nbv IS NULL)
454 AND (X_Beginning_Nbv IS NULL)))
455 AND ( (Recinfo.salvage_value = X_Salvage_Value)
456 OR ( (Recinfo.salvage_value IS NULL)
457 AND (X_Salvage_Value IS NULL)))
458 AND ( (Recinfo.accounting_date = X_Accounting_Date)
459 OR ( (Recinfo.accounting_date IS NULL)
460 AND (X_Accounting_Date IS NULL)))
461 AND ( (Recinfo.attribute1 = X_Attribute1)
462 OR ( (Recinfo.attribute1 IS NULL)
463 AND (X_Attribute1 IS NULL)))
464 AND ( (Recinfo.attribute2 = X_Attribute2)
465 OR ( (Recinfo.attribute2 IS NULL)
466 AND (X_Attribute2 IS NULL)))
467 AND ( (Recinfo.attribute3 = X_Attribute3)
468 OR ( (Recinfo.attribute3 IS NULL)
469 AND (X_Attribute3 IS NULL)))
470 AND ( (Recinfo.attribute4 = X_Attribute4)
471 OR ( (Recinfo.attribute4 IS NULL)
472 AND (X_Attribute4 IS NULL)))
473 AND ( (Recinfo.attribute5 = X_Attribute5)
474 OR ( (Recinfo.attribute5 IS NULL)
475 AND (X_Attribute5 IS NULL)))
476 AND ( (Recinfo.attribute6 = X_Attribute6)
477 OR ( (Recinfo.attribute6 IS NULL)
478 AND (X_Attribute6 IS NULL)))
479 AND ( (Recinfo.attribute7 = X_Attribute7)
480 OR ( (Recinfo.attribute7 IS NULL)
481 AND (X_Attribute7 IS NULL)))
482 AND ( (Recinfo.attribute8 = X_Attribute8)
483 OR ( (Recinfo.attribute8 IS NULL)
484 AND (X_Attribute8 IS NULL)))
485 AND ( (Recinfo.attribute9 = X_Attribute9)
486 OR ( (Recinfo.attribute9 IS NULL)
487 AND (X_Attribute9 IS NULL)))
488 AND ( (Recinfo.attribute10 = X_Attribute10)
489 OR ( (Recinfo.attribute10 IS NULL)
490 AND (X_Attribute10 IS NULL)))
491 AND ( (Recinfo.attribute11 = X_Attribute11)
492 OR ( (Recinfo.attribute11 IS NULL)
493 AND (X_Attribute11 IS NULL)))
494 AND ( (Recinfo.invoice_distribution_id = X_Invoice_Distribution_id)
495 OR ( (Recinfo.invoice_distribution_id IS NULL)
496 AND (X_invoice_distribution_id IS NULL)))
497 AND ( (Recinfo.invoice_line_number = X_invoice_Line_Number)
498 OR ( (Recinfo.invoice_line_number IS NULL)
499 AND (X_invoice_Line_Number IS NULL)))
500 AND ( (Recinfo.po_distribution_id = X_po_Distribution_id)
501 OR ( (Recinfo.po_distribution_id IS NULL)
502 AND (X_po_distribution_id IS NULL)))
503 AND ( (Recinfo.warranty_number = X_warranty_number )
504 OR ( (Recinfo.warranty_number IS NULL)
505 AND (X_warranty_number IS NULL)))) then
506 null;
507 else
508 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
509 APP_EXCEPTION.Raise_Exception;
510 end if;
511
512 if ( ((Recinfo.attribute12 = X_Attribute12)
513 OR ( (Recinfo.attribute12 IS NULL)
514 AND (X_Attribute12 IS NULL)))
515 AND ( (Recinfo.attribute13 = X_Attribute13)
516 OR ( (Recinfo.attribute13 IS NULL)
517 AND (X_Attribute13 IS NULL)))
518 AND ( (Recinfo.attribute14 = X_Attribute14)
519 OR ( (Recinfo.attribute14 IS NULL)
520 AND (X_Attribute14 IS NULL)))
521 AND ( (Recinfo.attribute15 = X_Attribute15)
522 OR ( (Recinfo.attribute15 IS NULL)
523 AND (X_Attribute15 IS NULL)))
524 AND ( (Recinfo.attribute_category_code = X_Attribute_Category_Code)
525 OR ( (Recinfo.attribute_category_code IS NULL)
529 AND (X_Fully_Rsvd_Revals_Counter IS NULL)))
526 AND (X_Attribute_Category_Code IS NULL)))
527 AND ( (Recinfo.fully_rsvd_revals_counter = X_Fully_Rsvd_Revals_Counter)
528 OR ( (Recinfo.fully_rsvd_revals_counter IS NULL)
530 AND ( (Recinfo.merge_invoice_number = X_Merge_Invoice_Number)
531 OR ( (Recinfo.merge_invoice_number IS NULL)
532 AND (X_Merge_Invoice_Number IS NULL)))
533 AND ( (Recinfo.merge_vendor_number = X_Merge_Vendor_Number)
534 OR ( (Recinfo.merge_vendor_number IS NULL)
535 AND (X_Merge_Vendor_Number IS NULL)))
536 AND ( (Recinfo.production_capacity = X_Production_Capacity)
537 OR ( (Recinfo.production_capacity IS NULL)
538 AND (X_Production_Capacity IS NULL)))
539 AND ( (Recinfo.reval_amortization_basis = X_Reval_Amortization_Basis)
540 OR ( (Recinfo.reval_amortization_basis IS NULL)
541 AND (X_Reval_Amortization_Basis IS NULL)))
542 AND ( (Recinfo.reval_reserve = X_Reval_Reserve)
543 OR ( (Recinfo.reval_reserve IS NULL)
544 AND (X_Reval_Reserve IS NULL)))
545 AND ( (Recinfo.unit_of_measure = X_Unit_Of_Measure)
546 OR ( (Recinfo.unit_of_measure IS NULL)
547 AND (X_Unit_Of_Measure IS NULL)))
548 AND ( (Recinfo.unrevalued_cost = X_Unrevalued_Cost)
549 OR ( (Recinfo.unrevalued_cost IS NULL)
550 AND (X_Unrevalued_Cost IS NULL)))
551 AND ( (Recinfo.ytd_reval_deprn_expense = X_Ytd_Reval_Deprn_Expense)
552 OR ( (Recinfo.ytd_reval_deprn_expense IS NULL)
553 AND (X_Ytd_Reval_Deprn_Expense IS NULL)))
554 AND ( (Recinfo.attribute16 = X_Attribute16)
555 OR ( (Recinfo.attribute16 IS NULL)
556 AND (X_Attribute16 IS NULL)))
557 AND ( (Recinfo.attribute17 = X_Attribute17)
558 OR ( (Recinfo.attribute17 IS NULL)
559 AND (X_Attribute17 IS NULL)))
560 AND ( (Recinfo.attribute18 = X_Attribute18)
561 OR ( (Recinfo.attribute18 IS NULL)
562 AND (X_Attribute18 IS NULL)))
563 AND ( (Recinfo.attribute19 = X_Attribute19)
564 OR ( (Recinfo.attribute19 IS NULL)
565 AND (X_Attribute19 IS NULL)))
566 AND ( (Recinfo.attribute20 = X_Attribute20)
567 OR ( (Recinfo.attribute20 IS NULL)
568 AND (X_Attribute20 IS NULL)))
569 AND ( (Recinfo.attribute21 = X_Attribute21)
570 OR ( (Recinfo.attribute21 IS NULL)
571 AND (X_Attribute21 IS NULL)))
572 AND ( (Recinfo.attribute22 = X_Attribute22)
573 OR ( (Recinfo.attribute22 IS NULL)
574 AND (X_Attribute22 IS NULL)))
575 AND ( (Recinfo.attribute23 = X_Attribute23)
576 OR ( (Recinfo.attribute23 IS NULL)
577 AND (X_Attribute23 IS NULL)))
578 AND ( (Recinfo.attribute24 = X_Attribute24)
579 OR ( (Recinfo.attribute24 IS NULL)
580 AND (X_Attribute24 IS NULL)))
581 AND ( (Recinfo.attribute25 = X_Attribute25)
582 OR ( (Recinfo.attribute25 IS NULL)
583 AND (X_Attribute25 IS NULL)))
584 AND ( (Recinfo.attribute26 = X_Attribute26)
585 OR ( (Recinfo.attribute26 IS NULL)
586 AND (X_Attribute26 IS NULL)))
587 AND ( (Recinfo.attribute27 = X_Attribute27)
588 OR ( (Recinfo.attribute27 IS NULL)
589 AND (X_Attribute27 IS NULL)))
590 AND ( (Recinfo.attribute28 = X_Attribute28)
591 OR ( (Recinfo.attribute28 IS NULL)
592 AND (X_Attribute28 IS NULL)))
593 AND ( (Recinfo.attribute29 = X_Attribute29)
594 OR ( (Recinfo.attribute29 IS NULL)
595 AND (X_Attribute29 IS NULL)))
596 AND ( (Recinfo.attribute30 = X_Attribute30)
597 OR ( (Recinfo.attribute30 IS NULL)
598 AND (X_Attribute30 IS NULL)))
599 AND ( (Recinfo.merged_code = X_Merged_Code)
600 OR ( (Recinfo.merged_code IS NULL)
601 AND (X_Merged_Code IS NULL)))
602 AND ( (Recinfo.split_code = X_Split_Code)
603 OR ( (Recinfo.split_code IS NULL)
604 AND (X_Split_Code IS NULL)))
605 AND ( (Recinfo.merge_parent_mass_additions_id = X_Merge_Parent_Mass_Add_Id)
606 OR ( (Recinfo.merge_parent_mass_additions_id IS NULL)
607 AND (X_Merge_Parent_Mass_Add_Id IS NULL)))
608 AND ( (Recinfo.split_parent_mass_additions_id = X_Split_Parent_Mass_Add_Id)
609 OR ( (Recinfo.split_parent_mass_additions_id IS NULL)
610 AND (X_Split_Parent_Mass_Add_Id IS NULL)))
611 AND ( (Recinfo.sum_units = X_Sum_Units)
612 OR ( (Recinfo.sum_units IS NULL)
613 AND (X_Sum_Units IS NULL)))) then
614 null;
615 else
616 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
617 APP_EXCEPTION.Raise_Exception;
618 end if;
619
620 --
621
622 /*
623 if ( ( (Recinfo.inventorial = X_inventorial)
624 OR ( (Recinfo.inventorial IS NULL)
628 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
625 AND (X_inventorial IS NULL)))) then
626 null;
627 else
629 APP_EXCEPTION.Raise_Exception;
630 end if;
631 */
632
633 --
634 if ( ( (Recinfo.global_attribute1 = X_global_Attribute1)
635 OR ( (Recinfo.global_attribute1 IS NULL)
636 AND (X_global_Attribute1 IS NULL)))
637 AND ( (Recinfo.global_attribute2 = X_global_Attribute2)
638 OR ( (Recinfo.global_attribute2 IS NULL)
639 AND (X_global_Attribute2 IS NULL)))
640 AND ( (Recinfo.global_attribute3 = X_global_Attribute3)
641 OR ( (Recinfo.global_attribute3 IS NULL)
642 AND (X_global_Attribute3 IS NULL)))
643 AND ( (Recinfo.global_attribute4 = X_global_Attribute4)
644 OR ( (Recinfo.global_attribute4 IS NULL)
645 AND (X_global_Attribute4 IS NULL)))
646 AND ( (Recinfo.global_attribute5 = X_global_Attribute5)
647 OR ( (Recinfo.global_attribute5 IS NULL)
648 AND (X_global_Attribute5 IS NULL)))
649 AND ( (Recinfo.global_attribute6 = X_global_Attribute6)
650 OR ( (Recinfo.global_attribute6 IS NULL)
651 AND (X_global_Attribute6 IS NULL)))
652 AND ( (Recinfo.global_attribute7 = X_global_Attribute7)
653 OR ( (Recinfo.global_attribute7 IS NULL)
654 AND (X_global_Attribute7 IS NULL)))
655 AND ( (Recinfo.global_attribute8 = X_global_Attribute8)
656 OR ( (Recinfo.global_attribute8 IS NULL)
657 AND (X_global_Attribute8 IS NULL)))
658 AND ( (Recinfo.global_attribute9 = X_global_Attribute9)
659 OR ( (Recinfo.global_attribute9 IS NULL)
660 AND (X_global_Attribute9 IS NULL)))
661 AND ( (Recinfo.global_attribute10 = X_global_Attribute10)
662 OR ( (Recinfo.global_attribute10 IS NULL)
663 AND (X_global_Attribute10 IS NULL)))
664 AND ( (Recinfo.global_attribute11 = X_global_Attribute11)
665 OR ( (Recinfo.global_attribute11 IS NULL)
666 AND (X_global_Attribute11 IS NULL)))
667 AND ( (Recinfo.global_attribute12 = X_global_Attribute12)
668 OR ( (Recinfo.global_attribute12 IS NULL)
669 AND (X_global_Attribute12 IS NULL)))
670 AND ( (Recinfo.global_attribute13 = X_global_Attribute13)
671 OR ( (Recinfo.global_attribute13 IS NULL)
672 AND (X_global_Attribute13 IS NULL)))
673 AND ( (Recinfo.global_attribute14 = X_global_Attribute14)
674 OR ( (Recinfo.global_attribute14 IS NULL)
675 AND (X_global_Attribute14 IS NULL)))
676 AND ( (Recinfo.global_attribute15 = X_global_Attribute15)
677 OR ( (Recinfo.global_attribute15 IS NULL)
678 AND (X_global_Attribute15 IS NULL)))
679 AND ( (Recinfo.global_attribute16 = X_global_Attribute16)
680 OR ( (Recinfo.global_attribute16 IS NULL)
681 AND (X_global_Attribute16 IS NULL)))
682 AND ( (Recinfo.global_attribute17 = X_global_Attribute17)
683 OR ( (Recinfo.global_attribute17 IS NULL)
684 AND (X_global_Attribute17 IS NULL)))
685 AND ( (Recinfo.global_attribute18 = X_global_Attribute18)
686 OR ( (Recinfo.global_attribute18 IS NULL)
687 AND (X_global_Attribute18 IS NULL)))
688 AND ( (Recinfo.global_attribute19 = X_global_Attribute19)
689 OR ( (Recinfo.global_attribute19 IS NULL)
690 AND (X_global_Attribute19 IS NULL)))
691 AND ( (Recinfo.global_attribute20 = X_global_Attribute20)
692 OR ( (Recinfo.global_attribute20 IS NULL)
693 AND (X_global_Attribute20 IS NULL)))) then
694
695 return;
696 else
697 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
698 APP_EXCEPTION.Raise_Exception;
699 end if;
700 --
701 /* added the following code for FT enhancement RefBug: 1399562 */
702 /****
703 if ( ( (Recinfo.transaction_type_code = X_transaction_type_code )
704 OR ( (Recinfo.transaction_type_code IS NULL )
705 AND (X_transaction_type_code IS NULL )))
706 AND ( (Recinfo.transaction_date = X_transaction_date )
707 OR ( (Recinfo.transaction_date IS NULL)
708 AND (X_transaction_date IS NULL )))
709 AND ( (Recinfo.warranty_id = X_warranty_id )
710 OR ( (Recinfo.warranty_id IS NULL)
711 AND (X_warranty_id IS NULL )))
712 AND ( (Recinfo.lease_id = X_lease_id )
713 OR ( (Recinfo.lease_id IS NULL)
714 AND (X_lease_id IS NULL )))
715 AND ( (Recinfo.lessor_id = X_lessor_id )
716 OR ( (Recinfo.lessor_id IS NULL)
717 AND (X_lessor_id IS NULL )))
718 AND ( (Recinfo.property_type_code = X_property_type_code )
719 OR ( (Recinfo.property_type_code IS NULL)
720 AND (X_property_type_code IS NULL )))
721 AND ( (Recinfo.property_1245_1250_code = X_property_1245_1250_code )
722 OR ( (Recinfo.property_1245_1250_code IS NULL)
723 AND (X_property_1245_1250_code IS NULL )))
724 AND ( (Recinfo.in_use_flag = X_in_use_flag )
725 OR ( (Recinfo.in_use_flag IS NULL)
726 AND (X_in_use_flag IS NULL)))
727 AND ( (Recinfo.owned_leased = X_owned_leased )
728 OR ( (Recinfo.owned_leased IS NULL)
729 AND (X_owned_leased IS NULL )))
730 AND ( (Recinfo.new_used = X_new_used )
731 OR ( (Recinfo.new_used IS NULL)
732 AND (X_new_used IS NULL )))
733 AND ( (Recinfo.asset_id = X_asset_id )
734 OR ( (Recinfo.asset_id IS NULL)
735 AND (X_asset_id IS NULL )))) then
736 null;
737 else
738 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
739 APP_EXCEPTION.Raise_Exception;
740 end if;
741
742 ****/
743 END Lock_Row;
744
745 ---
746
747 PROCEDURE Delete_Row(X_Rowid VARCHAR2,p_log_level_rec in fa_api_types.log_level_rec_type default null) IS
748 BEGIN
749 DELETE FROM fa_mass_additions
750 WHERE rowid = X_Rowid;
751
752 if (SQL%NOTFOUND) then
753 Raise NO_DATA_FOUND;
754 end if;
755 END Delete_Row;
756
757 ---
758 PROCEDURE Select_Summary(X_MAss_Addition_ID IN NUMBER,
759 X_TOTAL_COST IN OUT NOCOPY NUMBER,
760 X_TOTAL_COST_RTOT_DB IN OUT NOCOPY NUMBER,
761 X_TOTAL_UNITS IN OUT NOCOPY NUMBER,
762 X_TOTAL_UNITS_RTOT_DB IN OUT NOCOPY NUMBER,
763 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) IS
764 Begin
765 Select NVL(Sum(Fixed_Assets_Cost), 0), NVL(Sum(Fixed_Assets_Cost), 0),
766 NVL(Sum(Fixed_Assets_Units), 0), NVL(Sum(Fixed_Assets_Units), 0)
767 Into X_Total_Cost, X_TOTAL_Cost_RTOT_DB,
768 X_Total_Units, X_Total_Units_RTOT_DB
769 From Fa_MAss_Additions
770 Where Merge_PArent_MAss_Additions_ID = X_Mass_Addition_ID;
771
772 End Select_Summary;
773
774 END FA_MASS_ADDITIONS_PKG2;