1: PACKAGE BODY FA_UTIL_PVT as
2: /* $Header: FAVUTILB.pls 120.32.12020000.2 2012/10/19 07:11:38 saalampa ship $ */
3:
4: FUNCTION get_asset_fin_rec
5: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
6: px_asset_fin_rec IN OUT NOCOPY FA_API_TYPES.asset_fin_rec_type,
7: p_transaction_header_id IN FA_BOOKS.TRANSACTION_HEADER_ID_IN%TYPE DEFAULT NULL,
8: p_mrc_sob_type_code IN VARCHAR2
9: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null
2: /* $Header: FAVUTILB.pls 120.32.12020000.2 2012/10/19 07:11:38 saalampa ship $ */
3:
4: FUNCTION get_asset_fin_rec
5: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
6: px_asset_fin_rec IN OUT NOCOPY FA_API_TYPES.asset_fin_rec_type,
7: p_transaction_header_id IN FA_BOOKS.TRANSACTION_HEADER_ID_IN%TYPE DEFAULT NULL,
8: p_mrc_sob_type_code IN VARCHAR2
9: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null
10: ) RETURN BOOLEAN IS
5: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
6: px_asset_fin_rec IN OUT NOCOPY FA_API_TYPES.asset_fin_rec_type,
7: p_transaction_header_id IN FA_BOOKS.TRANSACTION_HEADER_ID_IN%TYPE DEFAULT NULL,
8: p_mrc_sob_type_code IN VARCHAR2
9: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null
10: ) RETURN BOOLEAN IS
11:
12: error_found EXCEPTION;
13:
957: END get_asset_fin_rec;
958:
959:
960: FUNCTION get_asset_deprn_rec
961: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
962: px_asset_deprn_rec IN OUT NOCOPY FA_API_TYPES.asset_deprn_rec_type,
963: p_period_counter IN FA_DEPRN_SUMMARY.period_counter%TYPE DEFAULT NULL,
964: p_mrc_sob_type_code IN VARCHAR2
965: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null
958:
959:
960: FUNCTION get_asset_deprn_rec
961: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
962: px_asset_deprn_rec IN OUT NOCOPY FA_API_TYPES.asset_deprn_rec_type,
963: p_period_counter IN FA_DEPRN_SUMMARY.period_counter%TYPE DEFAULT NULL,
964: p_mrc_sob_type_code IN VARCHAR2
965: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null
966: ) RETURN BOOLEAN IS
961: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
962: px_asset_deprn_rec IN OUT NOCOPY FA_API_TYPES.asset_deprn_rec_type,
963: p_period_counter IN FA_DEPRN_SUMMARY.period_counter%TYPE DEFAULT NULL,
964: p_mrc_sob_type_code IN VARCHAR2
965: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null
966: ) RETURN BOOLEAN IS
967:
968: l_dpr FA_STD_TYPES.FA_DEPRN_ROW_STRUCT;
969: l_status BOOLEAN;
1026:
1027:
1028:
1029: FUNCTION get_asset_cat_rec
1030: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1031: px_asset_cat_rec IN OUT NOCOPY FA_API_TYPES.asset_cat_rec_type,
1032: p_date_effective IN FA_ASSET_HISTORY.date_effective%TYPE DEFAULT NULL
1033: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type
1034: ) RETURN BOOLEAN IS
1027:
1028:
1029: FUNCTION get_asset_cat_rec
1030: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1031: px_asset_cat_rec IN OUT NOCOPY FA_API_TYPES.asset_cat_rec_type,
1032: p_date_effective IN FA_ASSET_HISTORY.date_effective%TYPE DEFAULT NULL
1033: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type
1034: ) RETURN BOOLEAN IS
1035:
1029: FUNCTION get_asset_cat_rec
1030: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1031: px_asset_cat_rec IN OUT NOCOPY FA_API_TYPES.asset_cat_rec_type,
1032: p_date_effective IN FA_ASSET_HISTORY.date_effective%TYPE DEFAULT NULL
1033: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type
1034: ) RETURN BOOLEAN IS
1035:
1036: l_asset_category_id FA_ADDITIONS.asset_category_id%TYPE;
1037:
1134:
1135:
1136:
1137: FUNCTION get_asset_type_rec
1138: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1139: px_asset_type_rec IN OUT NOCOPY FA_API_TYPES.asset_type_rec_type,
1140: p_date_effective IN FA_ASSET_HISTORY.date_effective%TYPE DEFAULT NULL
1141: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type
1142: ) RETURN BOOLEAN IS
1135:
1136:
1137: FUNCTION get_asset_type_rec
1138: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1139: px_asset_type_rec IN OUT NOCOPY FA_API_TYPES.asset_type_rec_type,
1140: p_date_effective IN FA_ASSET_HISTORY.date_effective%TYPE DEFAULT NULL
1141: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type
1142: ) RETURN BOOLEAN IS
1143:
1137: FUNCTION get_asset_type_rec
1138: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1139: px_asset_type_rec IN OUT NOCOPY FA_API_TYPES.asset_type_rec_type,
1140: p_date_effective IN FA_ASSET_HISTORY.date_effective%TYPE DEFAULT NULL
1141: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type
1142: ) RETURN BOOLEAN IS
1143:
1144: BEGIN
1145:
1163: END get_asset_type_rec;
1164:
1165:
1166: FUNCTION get_asset_desc_rec
1167: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1168: px_asset_desc_rec IN OUT NOCOPY FA_API_TYPES.asset_desc_rec_type
1169: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) RETURN BOOLEAN IS
1170:
1171: BEGIN
1164:
1165:
1166: FUNCTION get_asset_desc_rec
1167: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1168: px_asset_desc_rec IN OUT NOCOPY FA_API_TYPES.asset_desc_rec_type
1169: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) RETURN BOOLEAN IS
1170:
1171: BEGIN
1172:
1165:
1166: FUNCTION get_asset_desc_rec
1167: (p_asset_hdr_rec IN FA_API_TYPES.asset_hdr_rec_type,
1168: px_asset_desc_rec IN OUT NOCOPY FA_API_TYPES.asset_desc_rec_type
1169: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) RETURN BOOLEAN IS
1170:
1171: BEGIN
1172:
1173: select asset_number ,
1363: END get_asset_desc_rec;
1364:
1365:
1366: FUNCTION get_inv_rec
1367: (px_inv_rec IN OUT NOCOPY FA_API_TYPES.inv_rec_type,
1368: p_mrc_sob_type_code IN VARCHAR2,
1369: p_set_of_books_id IN NUMBER,
1370: p_inv_trans_rec IN FA_API_TYPES.inv_trans_rec_type DEFAULT NULL
1371: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) RETURN BOOLEAN IS
1366: FUNCTION get_inv_rec
1367: (px_inv_rec IN OUT NOCOPY FA_API_TYPES.inv_rec_type,
1368: p_mrc_sob_type_code IN VARCHAR2,
1369: p_set_of_books_id IN NUMBER,
1370: p_inv_trans_rec IN FA_API_TYPES.inv_trans_rec_type DEFAULT NULL
1371: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) RETURN BOOLEAN IS
1372:
1373: error_found EXCEPTION;
1374:
1367: (px_inv_rec IN OUT NOCOPY FA_API_TYPES.inv_rec_type,
1368: p_mrc_sob_type_code IN VARCHAR2,
1369: p_set_of_books_id IN NUMBER,
1370: p_inv_trans_rec IN FA_API_TYPES.inv_trans_rec_type DEFAULT NULL
1371: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) RETURN BOOLEAN IS
1372:
1373: error_found EXCEPTION;
1374:
1375: BEGIN
1848: FUNCTION check_asset_key_req
1849: (p_asset_key_chart_id IN NUMBER,
1850: p_asset_key_required OUT NOCOPY BOOLEAN,
1851: p_calling_fn IN VARCHAR2
1852: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) RETURN BOOLEAN IS
1853:
1854: cursor asset_key_req is
1855: select 1
1856: from fnd_id_flex_segments
1895: FUNCTION get_current_units
1896: (p_calling_fn in VARCHAR2
1897: ,p_asset_id in NUMBER
1898: ,x_current_units out NOCOPY NUMBER
1899: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) return BOOLEAN IS
1900:
1901: BEGIN
1902:
1903: select units
1928: (p_calling_fn in VARCHAR2
1929: ,p_asset_id in NUMBER
1930: ,p_book in VARCHAR2
1931: ,x_latest_trans_date out NOCOPY DATE
1932: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) return BOOLEAN IS
1933:
1934: BEGIN
1935:
1936: /* commenting for bug 3768867
1970: FUNCTION get_period_rec
1971: (p_book in varchar2
1972: ,p_period_counter in number default null
1973: ,p_effective_date in date default null
1974: ,x_period_rec out NOCOPY FA_API_TYPES.period_rec_type
1975: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) return BOOLEAN IS
1976:
1977: error_found EXCEPTION;
1978:
1971: (p_book in varchar2
1972: ,p_period_counter in number default null
1973: ,p_effective_date in date default null
1974: ,x_period_rec out NOCOPY FA_API_TYPES.period_rec_type
1975: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) return BOOLEAN IS
1976:
1977: error_found EXCEPTION;
1978:
1979: BEGIN
2018: END get_period_rec;
2019:
2020:
2021: FUNCTION get_asset_retire_rec
2022: (px_asset_retire_rec in out NOCOPY FA_API_TYPES.asset_retire_rec_type,
2023: p_mrc_sob_type_code IN VARCHAR2,
2024: p_set_of_books_id IN NUMBER
2025: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
2026:
2021: FUNCTION get_asset_retire_rec
2022: (px_asset_retire_rec in out NOCOPY FA_API_TYPES.asset_retire_rec_type,
2023: p_mrc_sob_type_code IN VARCHAR2,
2024: p_set_of_books_id IN NUMBER
2025: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
2026:
2027: error_found EXCEPTION;
2028:
2029: BEGIN
2266: END get_asset_retire_rec;
2267:
2268: FUNCTION get_corp_book( p_asset_id IN NUMBER,
2269: p_corp_book IN OUT NOCOPY VARCHAR2
2270: , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) return boolean IS
2271:
2272: BEGIN
2273:
2274: SELECT bc.book_type_code
2306:
2307: PROCEDURE load_char_value
2308: (p_char_old IN VARCHAR2,
2309: p_char_adj IN VARCHAR2,
2310: x_char_new IN OUT NOCOPY VARCHAR2, p_log_level_rec IN FA_API_TYPES.log_level_rec_type) IS
2311:
2312: BEGIN
2313:
2314: if (p_char_adj is null) then
2323:
2324: PROCEDURE load_date_value
2325: (p_date_old IN VARCHAR2,
2326: p_date_adj IN VARCHAR2,
2327: x_date_new IN OUT NOCOPY VARCHAR2, p_log_level_rec IN FA_API_TYPES.log_level_rec_type) IS
2328:
2329: BEGIN
2330:
2331: if (p_date_adj is null) then
2340:
2341: PROCEDURE load_num_value
2342: (p_num_old IN VARCHAR2,
2343: p_num_adj IN VARCHAR2,
2344: x_num_new IN OUT NOCOPY VARCHAR2, p_log_level_rec IN FA_API_TYPES.log_level_rec_type) IS
2345:
2346: BEGIN
2347:
2348: if (p_num_adj is null) then
2360: FUNCTION check_deprn_run
2361: (X_book IN VARCHAR2,
2362: X_asset_id IN NUMBER DEFAULT 0,
2363: X_deprn_amount OUT NOCOPY NUMBER,
2364: p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null)
2365: return BOOLEAN IS
2366:
2367: deprn_run VARCHAR2(1);
2368: h_count NUMBER;
2459: p_set_of_books_id IN NUMBER,
2460: p_period_counter IN NUMBER default null,
2461: p_mrc_sob_type_code IN VARCHAR2
2462: ) RETURN NUMBER is
2463: l_asset_hdr_rec FA_API_TYPES.asset_hdr_rec_type;
2464: l_asset_deprn_rec FA_API_TYPES.asset_deprn_rec_type;
2465: resv_err exception;
2466: BEGIN
2467: l_asset_hdr_rec.asset_id := p_asset_id;
2460: p_period_counter IN NUMBER default null,
2461: p_mrc_sob_type_code IN VARCHAR2
2462: ) RETURN NUMBER is
2463: l_asset_hdr_rec FA_API_TYPES.asset_hdr_rec_type;
2464: l_asset_deprn_rec FA_API_TYPES.asset_deprn_rec_type;
2465: resv_err exception;
2466: BEGIN
2467: l_asset_hdr_rec.asset_id := p_asset_id;
2468: l_asset_hdr_rec.book_type_code := p_book;