[Home] [Help]
PACKAGE: APPS.JAI_PLSQL_CACHE_PKG
Source
1 PACKAGE JAI_PLSQL_CACHE_PKG AS
2 /* $Header: jai_plsql_cache.pls 120.3 2006/05/26 11:36:23 lgopalsa noship $ */
3
4 TYPE func_curr_details IS RECORD
5 ( --organization_id HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE, -- org id
6 ledger_id GL_LEDGERS.ledger_id%TYPE , -- SOB
7 currency_code GL_LEDGERS.currency_code%TYPE ,
8 chart_of_accounts_id GL_LEDGERS.chart_of_accounts_id%TYPE,
9 organization_code MTL_PARAMETERS.organization_code%TYPE,
10 legal_entity HR_ORGANIZATION_INFORMATION.org_information2%TYPE,
11 organization_name HR_ALL_ORGANIZATION_UNITS.name%TYPE,
12 -- Bug 5243532. Added by Lakshmi Gopalsami
13 minimum_acct_unit FND_CURRENCIES.minimum_accountable_unit%TYPE,
14 precision FND_CURRENCIES.precision%TYPE
15 );
16
17 TYPE func_curr_det_tab IS TABLE OF func_curr_details
18 INDEX BY BINARY_INTEGER;
19
20 g_get_func_curr func_curr_det_tab;
21
22 CURSOR get_inv_org
23 (cp_org_id IN HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE) is
24 SELECT set_of_books_id ledger_id ,
25 organization_code org_code,
26 legal_entity leg_ent,
27 organization_name org_name
28 FROM org_organization_definitions
29 WHERE organization_id = cp_org_id;
30
31
32 CURSOR get_OU
33 (cp_org_id in HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE) is
34 SELECT set_of_books_id ledger_id ,
35 NULL org_code, -- Bug 5243532.Included org_code
36 default_legal_context_id leg_ent,
37 name org_name
38 FROM hr_operating_units
39 WHERE organization_id = cp_org_id;
40
41
42 CURSOR get_func_curr
43 (cp_ledger_id IN GL_LEDGERS.ledger_id%TYPE) IS
44 SELECT currency_code curr_code,
45 chart_of_accounts_id coa
46 FROM gl_ledgers
47 WHERE ledger_id = cp_ledger_id;
48
49 /* Bug 5243532. Added by Lakshmi Gopalsami */
50 /* Currency precision details */
51 CURSOR get_curr_details (cp_curr IN fnd_currencies.currency_code%TYPE) is
52 SELECT minimum_accountable_unit minimum_acct_unit,
53 PRECISION
54 FROM fnd_currencies
55 WHERE currency_code = cp_curr;
56
57 /* Read from cache */
58 FUNCTION read_cache
59 (p_org_id in HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE )
60 RETURN func_curr_details;
61
62 /* Write from cache */
63 PROCEDURE write_cache
64 (p_org_id IN HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE,
65 p_func_curr_det IN func_curr_details
66 );
67
68 /* Read from db and write into cache */
69 FUNCTION read_from_db
70 (p_org_id IN HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE )
71 RETURN func_curr_details;
72
73 /* Function which performs reading from cache, if not found
74 read from db and write onto the cache and return the same
75 */
76
77 FUNCTION return_sob_curr
78 (p_org_id IN HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE)
79 RETURN func_curr_details;
80
81
82 END JAI_PLSQL_CACHE_PKG;