DBA Data[Home] [Help]

APPS.FA_MASSADD_CREATE_PKG dependencies on FA_MASS_ADDITIONS

Line 35: l_calling_fn VARCHAR2(200) := 'FA_MASS_ADDITIONS_PKG.Get_Account_Segment';

31: l_result BOOLEAN;
32: l_num_of_segments NUMBER;
33: l_base_segments FND_FLEX_EXT.SEGMENTARRAY;
34: l_debug_info VARCHAR2(240);
35: l_calling_fn VARCHAR2(200) := 'FA_MASS_ADDITIONS_PKG.Get_Account_Segment';
36:
37: BEGIN
38:
39: if (g_log_level_rec.statement_level) then

Line 95: l_calling_fn VARCHAR2(200) := 'FA_MASS_ADDITIONS_PKG.Prepare_Clearing_GT';

91: ,p_coa_id number
92: ,p_segment_num number
93: ) return boolean is
94:
95: l_calling_fn VARCHAR2(200) := 'FA_MASS_ADDITIONS_PKG.Prepare_Clearing_GT';
96:
97: l_count number;
98: error_found exception;
99:

Line 301: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */fa_mass_additions_gt

297:
298: G_child_iteration_count := G_child_iteration_count + 1;
299:
300: forall i in 1..p_invoice_dist_id_tbl.count
301: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */fa_mass_additions_gt
302: set mass_addition_id = fa_mass_additions_s.nextval
303: ,book_type_code = p_book_type_code
304: ,line_status = p_line_status_tbl(i)
305: ,posting_status = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', p_posting_status_tbl(i), 'NEW') /* ER 14739752 */

Line 302: set mass_addition_id = fa_mass_additions_s.nextval

298: G_child_iteration_count := G_child_iteration_count + 1;
299:
300: forall i in 1..p_invoice_dist_id_tbl.count
301: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */fa_mass_additions_gt
302: set mass_addition_id = fa_mass_additions_s.nextval
303: ,book_type_code = p_book_type_code
304: ,line_status = p_line_status_tbl(i)
305: ,posting_status = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', p_posting_status_tbl(i), 'NEW') /* ER 14739752 */
306: ,queue_name = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', p_queue_name_tbl(i), 'NEW')

Line 407: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */ fa_mass_additions_gt

403:
404: begin
405:
406: forall i in 1..p_invoice_dist_id_tbl.count
407: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */ fa_mass_additions_gt
408: set mass_addition_id = fa_mass_additions_s.nextval
409: ,book_type_code = p_book_type_code
410: ,line_status = 'VALID'
411: ,posting_status = 'NEW'

Line 408: set mass_addition_id = fa_mass_additions_s.nextval

404: begin
405:
406: forall i in 1..p_invoice_dist_id_tbl.count
407: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */ fa_mass_additions_gt
408: set mass_addition_id = fa_mass_additions_s.nextval
409: ,book_type_code = p_book_type_code
410: ,line_status = 'VALID'
411: ,posting_status = 'NEW'
412: ,queue_name = 'NEW'

Line 451: update /*+ index(gt FA_MASS_ADDITIONS_GT_N3) */ fa_mass_additions_gt gt

447: end loop;
448:
449: -- flag these updated lines as parent MP where applicable
450: forall i in 1..l_mass_add_id_tbl.count
451: update /*+ index(gt FA_MASS_ADDITIONS_GT_N3) */ fa_mass_additions_gt gt
452: set split_merged_code = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'MP',NULL), /* ER 14739752 */
453: merged_code = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'MP',NULL)
454: where mass_addition_id = l_mass_add_id_tbl(i)
455: and book_type_code = p_book_type_code

Line 460: from fa_mass_additions_gt gt2

456: and invoice_payment_id is null -- exclude discounts
457: and ledger_category_code = 'P'
458: and exists
459: (select 1
460: from fa_mass_additions_gt gt2
461: where gt2.parent_invoice_dist_id = gt.invoice_distribution_id
462: and gt2.ledger_category_code = 'P' --Bug#10263900
463: and gt2.rowid <> gt.rowid);
464:

Line 581: from fa_mass_additions mad

577:
578: cursor c_rejected is
579: select mad.invoice_distribution_id,
580: nvl(mad.parent_mass_addition_id,mad.mass_addition_id)
581: from fa_mass_additions mad
582: where book_type_code = p_book_type_code
583: and posting_status = 'DELETE'
584: and not exists
585: (select 1

Line 586: from fa_mass_additions mad2

582: where book_type_code = p_book_type_code
583: and posting_status = 'DELETE'
584: and not exists
585: (select 1
586: from fa_mass_additions mad2
587: where mad2.book_type_code = p_book_type_code
588: and mad2.invoice_distribution_id = mad.invoice_distribution_id
589: and mad2.posting_status not in ('DELETE', 'SPLIT'))
590: union

Line 593: from fa_mass_additions mad_c,

589: and mad2.posting_status not in ('DELETE', 'SPLIT'))
590: union
591: select mad_c.invoice_distribution_id,
592: nvl(mad_c.parent_mass_addition_id,mad_c.mass_addition_id)
593: from fa_mass_additions mad_c,
594: fa_mass_additions mad_p
595: where mad_p.book_type_code = p_book_type_code
596: and mad_p.posting_status = 'DELETE'
597: and mad_c.parent_mass_addition_id = mad_p.mass_addition_id

Line 594: fa_mass_additions mad_p

590: union
591: select mad_c.invoice_distribution_id,
592: nvl(mad_c.parent_mass_addition_id,mad_c.mass_addition_id)
593: from fa_mass_additions mad_c,
594: fa_mass_additions mad_p
595: where mad_p.book_type_code = p_book_type_code
596: and mad_p.posting_status = 'DELETE'
597: and mad_c.parent_mass_addition_id = mad_p.mass_addition_id
598: and not exists

Line 600: from fa_mass_additions mad2

596: and mad_p.posting_status = 'DELETE'
597: and mad_c.parent_mass_addition_id = mad_p.mass_addition_id
598: and not exists
599: (select 1
600: from fa_mass_additions mad2
601: where mad2.book_type_code = p_book_type_code
602: and mad2.invoice_distribution_id = mad_p.invoice_distribution_id
603: and mad2.posting_status not in ('DELETE', 'SPLIT')) ;
604:

Line 607: select /*+ index(gt FA_MASS_ADDITIONS_GT_N2) */ rowid,

603: and mad2.posting_status not in ('DELETE', 'SPLIT')) ;
604:
605: -- Bug 13809266 : Allow unallocated lines from AP
606: cursor c_item_accrual is
607: select /*+ index(gt FA_MASS_ADDITIONS_GT_N2) */ rowid,
608: fa_mass_additions_s.nextval
609: from fa_mass_additions_gt gt
610: where (gt.line_type_lookup_code in ('ITEM', 'ACCRUAL') OR
611: (gt.line_type_lookup_code in ('NONREC_TAX','FREIGHT','MISCELLANEOUS') and

Line 608: fa_mass_additions_s.nextval

604:
605: -- Bug 13809266 : Allow unallocated lines from AP
606: cursor c_item_accrual is
607: select /*+ index(gt FA_MASS_ADDITIONS_GT_N2) */ rowid,
608: fa_mass_additions_s.nextval
609: from fa_mass_additions_gt gt
610: where (gt.line_type_lookup_code in ('ITEM', 'ACCRUAL') OR
611: (gt.line_type_lookup_code in ('NONREC_TAX','FREIGHT','MISCELLANEOUS') and
612: gt.parent_invoice_dist_id is null and

Line 609: from fa_mass_additions_gt gt

605: -- Bug 13809266 : Allow unallocated lines from AP
606: cursor c_item_accrual is
607: select /*+ index(gt FA_MASS_ADDITIONS_GT_N2) */ rowid,
608: fa_mass_additions_s.nextval
609: from fa_mass_additions_gt gt
610: where (gt.line_type_lookup_code in ('ITEM', 'ACCRUAL') OR
611: (gt.line_type_lookup_code in ('NONREC_TAX','FREIGHT','MISCELLANEOUS') and
612: gt.parent_invoice_dist_id is null and
613: nvl(fa_cache_pkg.fazcbc_record.allow_unallocated_lines_flag,'N') = 'Y')

Line 628: from fa_mass_additions_gt gt,

624: min(ad.asset_id),
625: min(mad.posting_status),
626: max(mad.asset_type),
627: count(distinct mad.rowid)
628: from fa_mass_additions_gt gt,
629: fa_mass_additions mad,
630: fa_additions_b ad
631: where ad.asset_number(+) = mad.asset_number
632: and mad.book_type_code = p_book_type_code

Line 629: fa_mass_additions mad,

625: min(mad.posting_status),
626: max(mad.asset_type),
627: count(distinct mad.rowid)
628: from fa_mass_additions_gt gt,
629: fa_mass_additions mad,
630: fa_additions_b ad
631: where ad.asset_number(+) = mad.asset_number
632: and mad.book_type_code = p_book_type_code
633: and mad.invoice_distribution_id = gt.parent_invoice_dist_id

Line 651: fa_mass_additions_gt gt

647: count(distinct ai.rowid),
648: count(distinct ai.asset_id)
649: from fa_asset_invoices ai,
650: fa_additions_b ad,
651: fa_mass_additions_gt gt
652: where ai.invoice_distribution_id = gt.parent_invoice_dist_id
653: and ad.asset_id = ai.asset_id
654: and gt.ledger_category_code = 'P'
655: and gt.line_status = 'NEW'

Line 797: update fa_mass_additions_gt gt

793:
794:
795: /*code for second decode changed for Bug:10028857*/
796: l_sql := '
797: update fa_mass_additions_gt gt
798: set (asset_type, line_status, book_type_code, mass_addition_id) =
799: (select /*+ index(fca FA_CATEGORY_ACCOUNTS_GT_N2 */
800: decode(gt.asset_type,
801: null, decode(glcc.account_type,

Line 899: update fa_mass_additions_gt gt

895: end if;
896: /*10209969 - Need to update inside loop as l_mass_add_id_tbl is fetched in each iteration */
897: -- flag the parent as MP
898: forall i in 1..l_mass_add_id_tbl.count
899: update fa_mass_additions_gt gt
900: set split_merged_code = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'MP',NULL), /* ER 14739752 */
901: merged_code = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'MP',NULL)
902: where mass_addition_id = l_mass_add_id_tbl(i)
903: and book_type_code = p_book_type_code

Line 908: from fa_mass_additions_gt gt2

904: and invoice_payment_id is null
905: and ledger_category_code = 'P'
906: and exists
907: (select 1
908: from fa_mass_additions_gt gt2
909: where gt2.parent_invoice_dist_id = gt.invoice_distribution_id
910: and gt2.ledger_category_code = 'P' --Bug#10263900
911: and gt2.rowid <> gt.rowid);
912: end loop; -- bulk

Line 1027: update fa_mass_additions

1023:
1024: -- flag the parent as MP
1025: -- no need for existance check as we're already driving by child
1026: forall i in 1..l_child_mass_add_id1_tbl.count
1027: update fa_mass_additions
1028: set split_merged_code = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'MP',NULL), /* ER 14739752 */
1029: merged_code = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'MP',NULL)
1030: where mass_addition_id = l_child_mass_add_id1_tbl(i)
1031: and book_type_code = p_book_type_code;

Line 1152: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */ fa_mass_additions_gt

1148: -- will not be a MC line (unlike MAD case) and thus
1149: -- we need to do one update outside the recursive routine here
1150:
1151: forall i in 1..l_child_inv_dist_id1_tbl.count
1152: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */ fa_mass_additions_gt
1153: set mass_addition_id = fa_mass_additions_s.nextval,
1154: --book_type_code = p_book_type_code,
1155: line_status = 'VALID',
1156: posting_status = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'ON HOLD','NEW'), /* ER 14739752 */

Line 1153: set mass_addition_id = fa_mass_additions_s.nextval,

1149: -- we need to do one update outside the recursive routine here
1150:
1151: forall i in 1..l_child_inv_dist_id1_tbl.count
1152: update /*+ index(FA_MASS_ADDITIONS_GT FA_MASS_ADDITIONS_GT_N4) */ fa_mass_additions_gt
1153: set mass_addition_id = fa_mass_additions_s.nextval,
1154: --book_type_code = p_book_type_code,
1155: line_status = 'VALID',
1156: posting_status = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'ON HOLD','NEW'), /* ER 14739752 */
1157: queue_name = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'ON HOLD','NEW'),

Line 1228: update /*+ index(gt FA_MASS_ADDITIONS_GT_N3) */ fa_mass_additions_gt gt

1224: end if;
1225:
1226: -- flag these updated lines as parent MP where applicable
1227: forall i in 1..l_child_mass_add_id1_tbl.count
1228: update /*+ index(gt FA_MASS_ADDITIONS_GT_N3) */ fa_mass_additions_gt gt
1229: set split_merged_code = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'MP',NULL), /* ER 14739752 */
1230: merged_code = decode (nvl(fa_cache_pkg.fazcbc_record.IMPORT_ALLOC_INV_LINES_AS_NEW,'N'), 'N', 'MP',NULL)
1231: where invoice_distribution_id = l_child_inv_dist_id1A_tbl(i)
1232: and invoice_payment_id is null -- exclude discounts

Line 1237: from fa_mass_additions_gt gt2

1233: and book_type_code = p_book_type_code
1234: and ledger_category_code = 'P'
1235: and exists
1236: (select 1
1237: from fa_mass_additions_gt gt2
1238: where gt2.parent_invoice_dist_id = gt.invoice_distribution_id
1239: and gt2.rowid <> gt.rowid);
1240:
1241: -- process singles

Line 1277: ,'fa_mass_additions_gt'

1273:
1274: if (g_log_level_rec.statement_level) then
1275: fa_debug_pkg.add(l_calling_fn
1276: ,'Updating depreciate_flag in'
1277: ,'fa_mass_additions_gt'
1278: ,p_log_level_rec => g_log_level_rec);
1279: end if;
1280:
1281: -- update the depreciate_flag and inventorial on valid lines

Line 1282: update /*+ index(gt FA_MASS_ADDITIONS_GT_N1) */ fa_mass_additions_gt gt

1278: ,p_log_level_rec => g_log_level_rec);
1279: end if;
1280:
1281: -- update the depreciate_flag and inventorial on valid lines
1282: update /*+ index(gt FA_MASS_ADDITIONS_GT_N1) */ fa_mass_additions_gt gt
1283: set depreciate_flag =
1284: (select decode(gt.asset_type
1285: ,'EXPENSED','NO'
1286: ,nvl(CBD.depreciate_flag, 'YES'))

Line 1340: l_calling_fn varchar2(40) := 'FA_MASS_ADDITIONS_PKG.create_lines';

1336: ,x_msg_data OUT NOCOPY VARCHAR2
1337: ) IS
1338:
1339:
1340: l_calling_fn varchar2(40) := 'FA_MASS_ADDITIONS_PKG.create_lines';
1341:
1342: l_count INTEGER;
1343:
1344: l_date_ineffective FA_BOOK_CONTROLS.DATE_INEFFECTIVE%TYPE;

Line 1530: ,'Insert FA_MASS_ADDITIONS lines for primary ledger '

1526: end if;
1527:
1528: if (g_log_level_rec.statement_level) then
1529: fa_debug_pkg.add(l_calling_fn
1530: ,'Insert FA_MASS_ADDITIONS lines for primary ledger '
1531: ,p_book_type_code
1532: ,p_log_level_rec => g_log_level_rec);
1533: end if;
1534:

Line 1537: insert into fa_mass_additions(

1533: end if;
1534:
1535: savepoint FAMADC_create2;
1536:
1537: insert into fa_mass_additions(
1538: mass_addition_id ,
1539: asset_number ,
1540: tag_number ,
1541: description ,

Line 1639: select /*+ index(gt FA_MASS_ADDITIONS_GT_N1) */

1635: invoice_distribution_id ,
1636: invoice_line_number ,
1637: invoice_payment_id ,
1638: warranty_number)
1639: select /*+ index(gt FA_MASS_ADDITIONS_GT_N1) */
1640: gt.mass_addition_id , --fa_mass_additions_s.nextval,
1641: gt.asset_number ,
1642: gt.tag_number ,
1643: gt.description ,

Line 1640: gt.mass_addition_id , --fa_mass_additions_s.nextval,

1636: invoice_line_number ,
1637: invoice_payment_id ,
1638: warranty_number)
1639: select /*+ index(gt FA_MASS_ADDITIONS_GT_N1) */
1640: gt.mass_addition_id , --fa_mass_additions_s.nextval,
1641: gt.asset_number ,
1642: gt.tag_number ,
1643: gt.description ,
1644: gt.asset_category_id ,

Line 1747: from fa_mass_additions_gt gt

1743: gt.invoice_distribution_id ,
1744: gt.invoice_line_number ,
1745: gt.invoice_payment_id ,
1746: gt.warranty_number
1747: from fa_mass_additions_gt gt
1748: where gt.book_type_code = p_book_type_code
1749: and gt.ledger_category_code = 'P'
1750: and gt.line_status = 'VALID';
1751:

Line 1778: from fa_mass_additions mad,

1774: gt.ledger_id,
1775: mad.mass_addition_id,
1776: gt.fixed_assets_cost,
1777: 0
1778: from fa_mass_additions mad,
1779: fa_mass_additions_gt gt,
1780: fa_mc_book_controls mcbc
1781: where mad.book_type_code = p_book_type_code
1782: and mad.invoice_distribution_id = gt.invoice_distribution_id

Line 1779: fa_mass_additions_gt gt,

1775: mad.mass_addition_id,
1776: gt.fixed_assets_cost,
1777: 0
1778: from fa_mass_additions mad,
1779: fa_mass_additions_gt gt,
1780: fa_mc_book_controls mcbc
1781: where mad.book_type_code = p_book_type_code
1782: and mad.invoice_distribution_id = gt.invoice_distribution_id
1783: and nvl(mad.invoice_payment_id, -99) = nvl(gt.invoice_payment_id, -99)

Line 1803: ,'fa_mass_additions_gt'

1799:
1800: if (g_log_level_rec.statement_level) then
1801: fa_debug_pkg.add(l_calling_fn
1802: ,'Updating successful/processed rows in '
1803: ,'fa_mass_additions_gt'
1804: ,p_log_level_rec => g_log_level_rec);
1805: end if;
1806:
1807: savepoint FAMADC_create7;

Line 1809: update /*+ index(gt FA_MASS_ADDITIONS_GT_N1) */ fa_mass_additions_gt gt

1805: end if;
1806:
1807: savepoint FAMADC_create7;
1808:
1809: update /*+ index(gt FA_MASS_ADDITIONS_GT_N1) */ fa_mass_additions_gt gt
1810: set gt.line_status = 'PROCESSED'
1811: where book_type_code = p_book_type_code
1812: and line_status = 'VALID'
1813: and ledger_category_code = 'P'

Line 1816: from fa_mass_additions mad

1812: and line_status = 'VALID'
1813: and ledger_category_code = 'P'
1814: and exists
1815: ( select 1
1816: from fa_mass_additions mad
1817: where mad.mass_addition_id = gt.mass_addition_id);
1818:
1819:
1820: l_count := SQL%ROWCOUNT;