DBA Data[Home] [Help]

PACKAGE: APPS.GL_LEDGERS_PKG

Source


1 PACKAGE GL_LEDGERS_PKG AUTHID CURRENT_USER AS
2    /* $Header: glistlds.pls 120.41 2011/06/01 16:40:32 skotakar ship $ */
3 
4 -- **********************************************************************
5 
6    --
7    -- Procedure
8    --   complete_config
9    -- Purpose
10    --   Called from OA FWK ledger configuration page to submit concurrent program
11    -- History
12    --   June 26, 2003    Alan Wen   Copied from temporary pkg gl_ledger_pkg1
13    -- Arguments
14    --   X_CONFIG_ID configuration ID
15    -- Example
16    --
17    -- Notes
18    --
19 
20    FUNCTION complete_config(x_config_id NUMBER)
21       RETURN VARCHAR2;
22    --
23    -- Procedure
24    --   insert_row
25    -- Purpose
26    --   Called from OA FWK ledger page to create ledger
27    -- History
28    --   June 26, 2003    Alan Wen   Copied from temporary pkg gl_ledger_pkg1
29    --   July 09, 2003    Alan Wen   Applied OA FWKstandard for handling PL/SQL errors
30    --
31    -- Arguments
32    --
33    -- Example
34    --
35    -- Notes
36    --   This procedure overload the update_row in this package.
37    --   After the Ledger Form is remvoed, the other one will be removed
38 
39 
40    PROCEDURE insert_row(
41       p_api_version                    IN              NUMBER := 1.0,
42       p_init_msg_list                  IN              VARCHAR2
43             := fnd_api.g_false,
44       p_commit                         IN              VARCHAR2
45             := fnd_api.g_false,
46       p_validate_only                  IN              VARCHAR2
47             := fnd_api.g_true,
48       p_record_version_number          IN              NUMBER := NULL,
49       x_return_status                  OUT NOCOPY      VARCHAR2,
50       x_msg_count                      OUT NOCOPY      NUMBER,
51       x_msg_data                       OUT NOCOPY      VARCHAR2,
52       x_rowid                          IN OUT NOCOPY   VARCHAR2,
53       x_ledger_id                                      NUMBER,
54       x_name                                           VARCHAR2,
55       x_short_name                                     VARCHAR2,
56       x_chart_of_accounts_id                           NUMBER,
57       x_currency_code                                  VARCHAR2,
58       x_period_set_name                                VARCHAR2,
59       x_accounted_period_type                          VARCHAR2,
60       x_first_ledger_period_name                       VARCHAR2,
61       x_ret_earn_code_combination_id                   NUMBER,
62       x_suspense_allowed_flag                          VARCHAR2,
63       x_suspense_ccid                                  NUMBER,
64       x_allow_intercompany_post_flag                   VARCHAR2,
65       x_enable_avgbal_flag                             VARCHAR2,
66       x_enable_budgetary_control_f                     VARCHAR2,
67       x_require_budget_journals_flag                   VARCHAR2,
68       x_enable_je_approval_flag                        VARCHAR2,
69       x_enable_automatic_tax_flag                      VARCHAR2,
70       x_consolidation_ledger_flag                      VARCHAR2,
71       x_translate_eod_flag                             VARCHAR2,
72       x_translate_qatd_flag                            VARCHAR2,
73       x_translate_yatd_flag                            VARCHAR2,
74       x_automatically_created_flag                     VARCHAR2,
75       x_track_rounding_imbalance_f                     VARCHAR2,
76 --      x_mrc_ledger_type_code                           VARCHAR2,
77       x_le_ledger_type_code                            VARCHAR2,
78       x_bal_seg_value_option_code                      VARCHAR2,
79       x_mgt_seg_value_option_code                      VARCHAR2,
80       x_last_update_date                               DATE,
81       x_last_updated_by                                NUMBER,
82       x_creation_date                                  DATE,
83       x_created_by                                     NUMBER,
84       x_last_update_login                              NUMBER,
85       x_description                                    VARCHAR2,
86       x_future_enterable_periods_lmt                   NUMBER,
87       x_latest_opened_period_name                      VARCHAR2,
88       x_latest_encumbrance_year                        NUMBER,
89       x_cum_trans_ccid                                 NUMBER,
90       x_res_encumb_ccid                                NUMBER,
91       x_net_income_ccid                                NUMBER,
92       x_balancing_segment                              VARCHAR2,
93       x_rounding_ccid                                  NUMBER,
94       x_transaction_calendar_id                        NUMBER,
95       x_daily_translation_rate_type                    VARCHAR2,
96       x_period_average_rate_type                       VARCHAR2,
97       x_period_end_rate_type                           VARCHAR2,
98       x_context                                        VARCHAR2,
99       x_attribute1                                     VARCHAR2,
100       x_attribute2                                     VARCHAR2,
101       x_attribute3                                     VARCHAR2,
102       x_attribute4                                     VARCHAR2,
103       x_attribute5                                     VARCHAR2,
104       x_attribute6                                     VARCHAR2,
105       x_attribute7                                     VARCHAR2,
106       x_attribute8                                     VARCHAR2,
107       x_attribute9                                     VARCHAR2,
108       x_attribute10                                    VARCHAR2,
109       x_attribute11                                    VARCHAR2,
110       x_attribute12                                    VARCHAR2,
111       x_attribute13                                    VARCHAR2,
112       x_attribute14                                    VARCHAR2,
113       x_attribute15                                    VARCHAR2,
114       x_set_manual_flag                                VARCHAR2,
115       --x_child_ledger_access_code          VARCHAR2,
116       x_ledger_category_code                           VARCHAR2,
117       x_configuration_id                               NUMBER,
118       x_sla_accounting_method_code                     VARCHAR2,
119       x_sla_accounting_method_type                     VARCHAR2,
120       x_sla_description_language                       VARCHAR2,
121       x_sla_entered_cur_bal_sus_ccid                   NUMBER,
122       x_sla_bal_by_ledger_curr_flag                    VARCHAR2,
123       x_sla_ledger_cur_bal_sus_ccid                    NUMBER,
124       x_alc_ledger_type_code                           VARCHAR2,
125       x_criteria_set_id                                NUMBER,
126       x_enable_secondary_track_flag                    VARCHAR2 DEFAULT 'N',
127       x_enable_reval_ss_track_flag                     VARCHAR2 DEFAULT 'N',
128       x_enable_reconciliation_flag                     VARCHAR2 DEFAULT 'N',
129       x_sla_ledger_cash_basis_flag                     VARCHAR2 DEFAULT 'N',
130       x_create_je_flag                                 VARCHAR2 DEFAULT 'Y',
131       x_commitment_budget_flag                         VARCHAR2 DEFAULT NULL,
132       x_net_closing_bal_flag                           VARCHAR2 DEFAULT 'N',
133       x_auto_jrnl_rev_flag                             VARCHAR2 DEFAULT 'N');
134 
135 -- *********************************************************************
136 
137    --
138    -- Procedure
139    --   update_row
140    -- Purpose
141    --   Called from OA FWK ledger page to update ledger definition
142    -- History
143    --   June 26, 2003    Alan Wen   Copied from temporary pkg gl_ledger_pkg1
144    --   July 09, 2003    Alan Wen   Applied OA FWKstandard for handling PL/SQL errors
145    --
146    -- Arguments
147    --
148    -- Example
149    --
150    -- Notes
151    --   This procedure overload the update_row in this package.
152    --   After the Ledger Form is remvoed, the other one will be removed
153 
154    PROCEDURE update_row(
155       p_api_version                    IN              NUMBER := 1.0,
156       p_init_msg_list                  IN              VARCHAR2
157             := fnd_api.g_false,
158       p_commit                         IN              VARCHAR2
159             := fnd_api.g_false,
160       p_validate_only                  IN              VARCHAR2
161             := fnd_api.g_true,
162       p_record_version_number          IN              NUMBER := NULL,
163       x_return_status                  OUT NOCOPY      VARCHAR2,
164       x_msg_count                      OUT NOCOPY      NUMBER,
165       x_msg_data                       OUT NOCOPY      VARCHAR2,
166       x_rowid                                          VARCHAR2,
167       x_ledger_id                                      NUMBER,
168       x_name                                           VARCHAR2,
169       x_short_name                                     VARCHAR2,
170       x_chart_of_accounts_id                           NUMBER,
171       x_currency_code                                  VARCHAR2,
172       x_period_set_name                                VARCHAR2,
173       x_accounted_period_type                          VARCHAR2,
174       x_first_ledger_period_name                       VARCHAR2,
175       x_ret_earn_code_combination_id                   NUMBER,
176       x_suspense_allowed_flag                          VARCHAR2,
177       x_suspense_ccid                                  NUMBER,
178       x_allow_intercompany_post_flag                   VARCHAR2,
179       x_enable_avgbal_flag                             VARCHAR2,
180       x_enable_budgetary_control_f                     VARCHAR2,
181       x_require_budget_journals_flag                   VARCHAR2,
182       x_enable_je_approval_flag                        VARCHAR2,
183       x_enable_automatic_tax_flag                      VARCHAR2,
184       x_consolidation_ledger_flag                      VARCHAR2,
185       x_translate_eod_flag                             VARCHAR2,
186       x_translate_qatd_flag                            VARCHAR2,
187       x_translate_yatd_flag                            VARCHAR2,
188       x_automatically_created_flag                     VARCHAR2,
189       x_track_rounding_imbalance_f                     VARCHAR2,
190 --      x_mrc_ledger_type_code                           VARCHAR2,
191       x_le_ledger_type_code                            VARCHAR2,
192       x_bal_seg_value_option_code                      VARCHAR2,
193       --      x_bal_seg_column_name               VARCHAR2,
194       --      x_bal_seg_value_set_id              NUMBER,
195       x_mgt_seg_value_option_code                      VARCHAR2,
196       --      x_mgt_seg_column_name               VARCHAR2,
197       --      x_mgt_seg_value_set_id              NUMBER,
198       x_implicit_access_set_id                         NUMBER,
199       x_last_update_date                               DATE,
200       x_last_updated_by                                NUMBER,
201       x_last_update_login                              NUMBER,
202       x_description                                    VARCHAR2,
203       x_future_enterable_periods_lmt                   NUMBER,
204       x_latest_opened_period_name                      VARCHAR2,
205       x_latest_encumbrance_year                        NUMBER,
206       x_cum_trans_ccid                                 NUMBER,
207       x_res_encumb_ccid                                NUMBER,
208       x_net_income_ccid                                NUMBER,
209       x_balancing_segment                              VARCHAR2,
210       x_rounding_ccid                                  NUMBER,
211       x_transaction_calendar_id                        NUMBER,
212       x_daily_translation_rate_type                    VARCHAR2,
213       x_period_average_rate_type                       VARCHAR2,
214       x_period_end_rate_type                           VARCHAR2,
215       x_context                                        VARCHAR2,
216       x_attribute1                                     VARCHAR2,
217       x_attribute2                                     VARCHAR2,
218       x_attribute3                                     VARCHAR2,
219       x_attribute4                                     VARCHAR2,
220       x_attribute5                                     VARCHAR2,
221       x_attribute6                                     VARCHAR2,
222       x_attribute7                                     VARCHAR2,
223       x_attribute8                                     VARCHAR2,
224       x_attribute9                                     VARCHAR2,
225       x_attribute10                                    VARCHAR2,
226       x_attribute11                                    VARCHAR2,
227       x_attribute12                                    VARCHAR2,
228       x_attribute13                                    VARCHAR2,
229       x_attribute14                                    VARCHAR2,
230       x_attribute15                                    VARCHAR2,
231       x_set_manual_flag                                VARCHAR2,
232       --x_child_ledger_access_code          VARCHAR2,
233       x_ledger_category_code                           VARCHAR2,
234       x_configuration_id                               NUMBER,
235       x_sla_accounting_method_code                     VARCHAR2,
236       x_sla_accounting_method_type                     VARCHAR2,
237       x_sla_description_language                       VARCHAR2,
238       x_sla_entered_cur_bal_sus_ccid                   NUMBER,
239       x_sla_bal_by_ledger_curr_flag                    VARCHAR2,
240       x_sla_ledger_cur_bal_sus_ccid                    NUMBER,
241       x_alc_ledger_type_code                           VARCHAR2,
242       x_criteria_set_id                                NUMBER,
243       x_enable_secondary_track_flag                    VARCHAR2 DEFAULT 'N',
244       x_enable_reval_ss_track_flag                     VARCHAR2 DEFAULT 'N',
245       x_enable_reconciliation_flag                     VARCHAR2 DEFAULT 'N',
246       x_sla_ledger_cash_basis_flag                     VARCHAR2 DEFAULT 'N',
247       x_create_je_flag                                 VARCHAR2 DEFAULT 'Y',
248       x_commitment_budget_flag                         VARCHAR2 DEFAULT NULL,
249       x_net_closing_bal_flag                           VARCHAR2 DEFAULT 'N',
250       x_auto_jrnl_rev_flag                             VARCHAR2 DEFAULT 'N');
251    --
252    -- Procedure
253    --   check_unique_name
254    -- Purpose
255    --   Ensure new ledger name is unique among ledgers, ledger sets, and
256    --   access sets.
257    -- History
258    --   02/08/01    O Monnier      Created
259    -- Arguments
260    --   x_rowid    The ID of the row to be checked
261    --   x_name     The category name to be checked
262    -- Example
263    --   GL_LEDGERS_PKG.check_unique_name( '12345', 'LEDGER 1' );
264    -- Notes
265    --
266    PROCEDURE check_unique_name(x_rowid VARCHAR2, x_name VARCHAR2);
267    --
268    -- Procedure
269    --   check_unique_short_name
270    -- Purpose
271    --   Ensure new ledger short name is unique among ledgers and ledger sets.
272    -- History
273    --   02/08/01    O Monnier      Created
274    -- Arguments
275    --   x_rowid          The ID of the row to be checked
276    --   x_short_name     The short name to be checked
277    -- Example
278    --   GL_LEDGERS_PKG.check_unique_short_name( '12345', 'LEDGER 1' );
279    -- Notes
280    --
281    PROCEDURE check_unique_short_name(x_rowid VARCHAR2, x_short_name VARCHAR2);
282    --
283    -- Procedure
284    --   get_unique_id
285    -- Purpose
286    --   Gets a new sequence unique id for a new ledger.
287    -- History
288    --   02/08/01    O Monnier      Created from old sets of books package.
289    -- Arguments
290    --   none
291    -- Example
292    --   :ledger.ledger_id := GL_LEDGERS_PKG.get_unique_id;
293    -- Notes
294    --
295    FUNCTION get_unique_id
296       RETURN NUMBER;
297    --
298    -- Procedure
299    --   is_coa_frozen
300    -- Purpose
301    --   Test if the Chart of Accounts selected is frozen.
302    -- History
303    --   02/08/01    O Monnier      Created
304    -- Arguments
305    --   X_Chart_Of_Accounts_Id          Key Flexfield Structure Num
306    -- Example
307    --   test := GL_LEDGERS_PKG.is_coa_frozen ( 101 );
308    -- Notes
309    --
313    -- Procedure
310    FUNCTION is_coa_frozen(x_chart_of_accounts_id NUMBER)
311       RETURN BOOLEAN;
312    --
314    --   get_bal_mgt_seg_info
315    -- Purpose
316    --   Gets the balancing segment column name, value set id,
317    --   the management segment column name, and value set id for the Chart of Accounts.
318    -- History
319    --   02/08/01    O Monnier      Created
320    -- Arguments
321    --   X_Bal_Seg_Column_Name           Retrieve the balancing segment column name
322    --   X_Bal_Seg_Value_Set_Id          Retrieve the balancing segment value set id
323    --   X_Mgt_Seg_Column_Name           Retrieve the balancing segment column name
324    --   X_Mgt_Seg_Value_Set_Id          Retrieve the balancing segment value set id
325    --   X_Chart_Of_Accounts_Id          Key Flexfield Structure Num
326    -- Example
327    --   GL_LEDGERS_PKG.get_bal_seg_info(X_Bal_Seg_Column_Name,
328    --                                   X_Bal_Seg_Value_Set_Id,
329    --                                   X_Mgt_Seg_Column_Name,
330    --                                   X_Mgt_Seg_Value_Set_Id,
331    --                                   1);
332    -- Notes
333    --
334    PROCEDURE get_bal_mgt_seg_info(
335       x_bal_seg_column_name    OUT NOCOPY   VARCHAR2,
336       x_bal_seg_value_set_id   OUT NOCOPY   NUMBER,
337       x_mgt_seg_column_name    OUT NOCOPY   VARCHAR2,
338       x_mgt_seg_value_set_id   OUT NOCOPY   NUMBER,
339       x_chart_of_accounts_id                NUMBER);
340 
341 -- *********************************************************************
342 -- The following procedures are necessary to handle the base view form.
343 
344    PROCEDURE insert_row(
345       x_rowid                          IN OUT NOCOPY   VARCHAR2,
346       x_ledger_id                                      NUMBER,
347       x_name                                           VARCHAR2,
348       x_short_name                                     VARCHAR2,
349       x_chart_of_accounts_id                           NUMBER,
350       x_chart_of_accounts_name                         VARCHAR2,
351       x_currency_code                                  VARCHAR2,
352       x_period_set_name                                VARCHAR2,
353       x_user_period_type                               VARCHAR2,
354       x_accounted_period_type                          VARCHAR2,
355       x_first_ledger_period_name                       VARCHAR2,
356       x_ret_earn_code_combination_id                   NUMBER,
357       x_suspense_allowed_flag                          VARCHAR2,
358       x_suspense_ccid                                  NUMBER,
359       x_allow_intercompany_post_flag                   VARCHAR2,
360       x_enable_avgbal_flag                             VARCHAR2,
361       x_enable_budgetary_control_f                     VARCHAR2,
362       x_require_budget_journals_flag                   VARCHAR2,
363       x_enable_je_approval_flag                        VARCHAR2,
364       x_enable_automatic_tax_flag                      VARCHAR2,
365       x_consolidation_ledger_flag                      VARCHAR2,
366       x_translate_eod_flag                             VARCHAR2,
367       x_translate_qatd_flag                            VARCHAR2,
368       x_translate_yatd_flag                            VARCHAR2,
369       x_automatically_created_flag                     VARCHAR2,
370       x_track_rounding_imbalance_f                     VARCHAR2,
371       x_alc_ledger_type_code                           VARCHAR2,
372       x_le_ledger_type_code                            VARCHAR2,
373       x_bal_seg_value_option_code                      VARCHAR2,
374       x_bal_seg_column_name                            VARCHAR2,
375       x_bal_seg_value_set_id                           NUMBER,
376       x_mgt_seg_value_option_code                      VARCHAR2,
377       x_mgt_seg_column_name                            VARCHAR2,
378       x_mgt_seg_value_set_id                           NUMBER,
379       x_last_update_date                               DATE,
380       x_last_updated_by                                NUMBER,
381       x_creation_date                                  DATE,
382       x_created_by                                     NUMBER,
383       x_last_update_login                              NUMBER,
384       x_description                                    VARCHAR2,
385       x_future_enterable_periods_lmt                   NUMBER,
386       x_latest_opened_period_name                      VARCHAR2,
387       x_latest_encumbrance_year                        NUMBER,
388       x_cum_trans_ccid                                 NUMBER,
389       x_res_encumb_ccid                                NUMBER,
390       x_net_income_ccid                                NUMBER,
391       x_balancing_segment                              VARCHAR2,
392       x_rounding_ccid                                  NUMBER,
393       x_transaction_calendar_id                        NUMBER,
394       x_transaction_calendar_name                      VARCHAR2,
395       x_daily_translation_rate_type                    VARCHAR2,
396       x_daily_user_translation_type                    VARCHAR2,
397       x_period_average_rate_type                       VARCHAR2,
398       x_period_avg_user_rate_type                      VARCHAR2,
399       x_period_end_rate_type                           VARCHAR2,
400       x_period_end_user_rate_type                      VARCHAR2,
401       x_context                                        VARCHAR2,
402       x_attribute1                                     VARCHAR2,
403       x_attribute2                                     VARCHAR2,
407       x_attribute6                                     VARCHAR2,
404       x_attribute3                                     VARCHAR2,
405       x_attribute4                                     VARCHAR2,
406       x_attribute5                                     VARCHAR2,
408       x_attribute7                                     VARCHAR2,
409       x_attribute8                                     VARCHAR2,
410       x_attribute9                                     VARCHAR2,
411       x_attribute10                                    VARCHAR2,
412       x_attribute11                                    VARCHAR2,
413       x_attribute12                                    VARCHAR2,
414       x_attribute13                                    VARCHAR2,
415       x_attribute14                                    VARCHAR2,
416       x_attribute15                                    VARCHAR2,
417       x_set_manual_flag                                VARCHAR2);
418 
419    PROCEDURE lock_row(
420       x_rowid                          VARCHAR2,
421       x_ledger_id                      NUMBER,
422       x_name                           VARCHAR2,
423       x_short_name                     VARCHAR2,
424       x_chart_of_accounts_id           NUMBER,
425       x_chart_of_accounts_name         VARCHAR2,
426       x_currency_code                  VARCHAR2,
427       x_period_set_name                VARCHAR2,
428       x_user_period_type               VARCHAR2,
429       x_accounted_period_type          VARCHAR2,
430       x_first_ledger_period_name       VARCHAR2,
431       x_ret_earn_code_combination_id   NUMBER,
432       x_suspense_allowed_flag          VARCHAR2,
433       x_suspense_ccid                  NUMBER,
434       x_allow_intercompany_post_flag   VARCHAR2,
435       x_enable_avgbal_flag             VARCHAR2,
436       x_enable_budgetary_control_f     VARCHAR2,
437       x_require_budget_journals_flag   VARCHAR2,
438       x_enable_je_approval_flag        VARCHAR2,
439       x_enable_automatic_tax_flag      VARCHAR2,
440       x_consolidation_ledger_flag      VARCHAR2,
441       x_translate_eod_flag             VARCHAR2,
442       x_translate_qatd_flag            VARCHAR2,
443       x_translate_yatd_flag            VARCHAR2,
444       x_automatically_created_flag     VARCHAR2,
445       x_track_rounding_imbalance_f     VARCHAR2,
446       x_alc_ledger_type_code           VARCHAR2,
447       x_le_ledger_type_code            VARCHAR2,
448       x_bal_seg_value_option_code      VARCHAR2,
449       x_bal_seg_column_name            VARCHAR2,
450       x_bal_seg_value_set_id           NUMBER,
451       x_mgt_seg_value_option_code      VARCHAR2,
452       x_mgt_seg_column_name            VARCHAR2,
453       x_mgt_seg_value_set_id           NUMBER,
454       x_description                    VARCHAR2,
455       x_future_enterable_periods_lmt   NUMBER,
456       x_latest_opened_period_name      VARCHAR2,
457       x_latest_encumbrance_year        NUMBER,
458       x_cum_trans_ccid                 NUMBER,
459       x_res_encumb_ccid                NUMBER,
460       x_net_income_ccid                NUMBER,
461       x_balancing_segment              VARCHAR2,
462       x_rounding_ccid                  NUMBER,
463       x_transaction_calendar_id        NUMBER,
464       x_transaction_calendar_name      VARCHAR2,
465       x_daily_translation_rate_type    VARCHAR2,
466       x_daily_user_translation_type    VARCHAR2,
467       x_period_average_rate_type       VARCHAR2,
468       x_period_avg_user_rate_type      VARCHAR2,
469       x_period_end_rate_type           VARCHAR2,
470       x_period_end_user_rate_type      VARCHAR2,
471       x_context                        VARCHAR2,
472       x_attribute1                     VARCHAR2,
473       x_attribute2                     VARCHAR2,
474       x_attribute3                     VARCHAR2,
475       x_attribute4                     VARCHAR2,
476       x_attribute5                     VARCHAR2,
477       x_attribute6                     VARCHAR2,
478       x_attribute7                     VARCHAR2,
479       x_attribute8                     VARCHAR2,
480       x_attribute9                     VARCHAR2,
481       x_attribute10                    VARCHAR2,
482       x_attribute11                    VARCHAR2,
483       x_attribute12                    VARCHAR2,
484       x_attribute13                    VARCHAR2,
485       x_attribute14                    VARCHAR2,
486       x_attribute15                    VARCHAR2);
487 
488    PROCEDURE update_row(
489       x_rowid                          VARCHAR2,
490       x_ledger_id                      NUMBER,
491       x_name                           VARCHAR2,
492       x_short_name                     VARCHAR2,
493       x_chart_of_accounts_id           NUMBER,
494       x_chart_of_accounts_name         VARCHAR2,
495       x_currency_code                  VARCHAR2,
496       x_period_set_name                VARCHAR2,
497       x_user_period_type               VARCHAR2,
498       x_accounted_period_type          VARCHAR2,
499       x_first_ledger_period_name       VARCHAR2,
500       x_ret_earn_code_combination_id   NUMBER,
501       x_suspense_allowed_flag          VARCHAR2,
502       x_suspense_ccid                  NUMBER,
503       x_allow_intercompany_post_flag   VARCHAR2,
504       x_enable_avgbal_flag             VARCHAR2,
505       x_enable_budgetary_control_f     VARCHAR2,
506       x_require_budget_journals_flag   VARCHAR2,
507       x_enable_je_approval_flag        VARCHAR2,
508       x_enable_automatic_tax_flag      VARCHAR2,
509       x_consolidation_ledger_flag      VARCHAR2,
513       x_automatically_created_flag     VARCHAR2,
510       x_translate_eod_flag             VARCHAR2,
511       x_translate_qatd_flag            VARCHAR2,
512       x_translate_yatd_flag            VARCHAR2,
514       x_track_rounding_imbalance_f     VARCHAR2,
515       x_alc_ledger_type_code           VARCHAR2,
516       x_le_ledger_type_code            VARCHAR2,
517       x_bal_seg_value_option_code      VARCHAR2,
518       x_bal_seg_column_name            VARCHAR2,
519       x_bal_seg_value_set_id           NUMBER,
520       x_mgt_seg_value_option_code      VARCHAR2,
521       x_mgt_seg_column_name            VARCHAR2,
522       x_mgt_seg_value_set_id           NUMBER,
523       x_implicit_access_set_id         NUMBER,
524       x_last_update_date               DATE,
525       x_last_updated_by                NUMBER,
526       x_last_update_login              NUMBER,
527       x_description                    VARCHAR2,
528       x_future_enterable_periods_lmt   NUMBER,
529       x_latest_opened_period_name      VARCHAR2,
530       x_latest_encumbrance_year        NUMBER,
531       x_cum_trans_ccid                 NUMBER,
532       x_res_encumb_ccid                NUMBER,
533       x_net_income_ccid                NUMBER,
534       x_balancing_segment              VARCHAR2,
535       x_rounding_ccid                  NUMBER,
536       x_transaction_calendar_id        NUMBER,
537       x_transaction_calendar_name      VARCHAR2,
538       x_daily_translation_rate_type    VARCHAR2,
539       x_daily_user_translation_type    VARCHAR2,
540       x_period_average_rate_type       VARCHAR2,
541       x_period_avg_user_rate_type      VARCHAR2,
542       x_period_end_rate_type           VARCHAR2,
543       x_period_end_user_rate_type      VARCHAR2,
544       x_context                        VARCHAR2,
545       x_attribute1                     VARCHAR2,
546       x_attribute2                     VARCHAR2,
547       x_attribute3                     VARCHAR2,
548       x_attribute4                     VARCHAR2,
549       x_attribute5                     VARCHAR2,
550       x_attribute6                     VARCHAR2,
551       x_attribute7                     VARCHAR2,
552       x_attribute8                     VARCHAR2,
553       x_attribute9                     VARCHAR2,
554       x_attribute10                    VARCHAR2,
555       x_attribute11                    VARCHAR2,
556       x_attribute12                    VARCHAR2,
557       x_attribute13                    VARCHAR2,
558       x_attribute14                    VARCHAR2,
559       x_attribute15                    VARCHAR2,
560       x_set_manual_flag                VARCHAR2);
561 
562 -- *********************************************************************
563 
564    --
565    -- Procedure
566    --   select_row
567    -- Purpose
568    --   select a row
569    -- History
570    --   02/08/01    O Monnier      Created from old sets of books package.
571    -- Arguments
572    --   recinfo    record information
573    -- Example
574    --   select_row(recinfo);
575    -- Notes
576    --
577    PROCEDURE select_row(recinfo IN OUT NOCOPY gl_ledgers%ROWTYPE);
578    --
579    -- Procedure
580    --   select_column
581    -- Purpose
582    --   get ledger_name from a row for populating non-database fields
583    --
584    -- History
585    --   02/08/01    O Monnier      Created from old sets of books package.
586    -- Arguments
587    --   ledger_id          ledger id
588    --   name               ledger name
589    -- Example
590    --   select_column(:block.ledger_id,:block.ledger_name);
591    -- Notes
592    --
593    PROCEDURE select_columns(x_ledger_id NUMBER, x_name IN OUT NOCOPY VARCHAR2);
594    -- Procedure
595    --  update_gl_system_usages
596    -- Purpose
597    --  update the average_balances_flag to 'Y' if average balance processing
598    --  is enabled for at least one ledger.
599    -- History
600    --  02/08/01    O Monnier      Created from old sets of books package.
601    -- Arguments
602    --  cons_lgr_flag      Consolidation Ledger Flag
603    PROCEDURE update_gl_system_usages(cons_lgr_flag VARCHAR2);
604    -- Procedure
605    --  insert_gl_net_income_accounts
606    -- Purpose
607    --  insert into gl_net_income_accounts table
608    -- History
609    --  02/08/01    O Monnier      Created from old sets of books package.
610    -- Arguments
611    --
612    PROCEDURE insert_gl_net_income_accounts(
613       x_ledger_id                NUMBER,
614       x_balancing_segment        VARCHAR2,
615       x_net_income_ccid          NUMBER,
616       x_creation_date            DATE,
617       x_created_by               NUMBER,
618       x_last_update_date         DATE,
619       x_last_updated_by          NUMBER,
620       x_last_update_login        NUMBER,
621       x_request_id               NUMBER,
622       x_program_application_id   NUMBER,
623       x_program_id               NUMBER,
624       x_program_update_date      DATE);
625    -- Procedure
626    --  led_update_other_tables
627    -- Purpose
628    --  update the other tables related to the ledger.
629    -- History
630    --  02/08/01    O Monnier      Created from old sets of books package.
631    -- Arguments
632    --
633    PROCEDURE led_update_other_tables(
634       x_ledger_id          NUMBER,
635       x_last_update_date   DATE,
639    --  Check_Avg_Translation
636       x_last_updated_by    NUMBER,
637       x_suspense_ccid      NUMBER);
638    -- Procedure
640    -- Purpose
641    --  check the translation status for average balances.
642    -- History
643    --  02/08/01    O Monnier      Created from old sets of books package.
644    -- Arguments
645    --
646    FUNCTION check_avg_translation(x_ledger_id NUMBER)
647       RETURN BOOLEAN;
648    -- Procedure
649    --  enable_manual_je_approval
650    -- Purpose
651    --  Update the journal_approval_flag to 'Y' for 'Manual' source.
652    -- History
653    --  02/08/01    O Monnier      Created from old sets of books package.
654    -- Arguments
655    --  none
656    PROCEDURE enable_manual_je_approval;
657 
658 -- *********************************************************************
659 -- The following 3 procedures are necessary to handle the Ledger Sets form.
660 -- Will be removed after the form is removed.
661 
662    PROCEDURE insert_set(
663       x_rowid                   IN OUT NOCOPY   VARCHAR2,
664       x_access_set_id           IN OUT NOCOPY   NUMBER,
665       x_ledger_id                               NUMBER,
666       x_name                                    VARCHAR2,
667       x_short_name                              VARCHAR2,
668       x_chart_of_accounts_id                    NUMBER,
669       x_period_set_name                         VARCHAR2,
670       x_accounted_period_type                   VARCHAR2,
671       x_default_ledger_id                       NUMBER,
672       x_last_update_date                        DATE,
673       x_last_updated_by                         NUMBER,
674       x_creation_date                           DATE,
675       x_created_by                              NUMBER,
676       x_last_update_login                       NUMBER,
677       x_description                             VARCHAR2,
678       x_context                                 VARCHAR2,
679       x_attribute1                              VARCHAR2,
680       x_attribute2                              VARCHAR2,
681       x_attribute3                              VARCHAR2,
682       x_attribute4                              VARCHAR2,
683       x_attribute5                              VARCHAR2,
684       x_attribute6                              VARCHAR2,
685       x_attribute7                              VARCHAR2,
686       x_attribute8                              VARCHAR2,
687       x_attribute9                              VARCHAR2,
688       x_attribute10                             VARCHAR2,
689       x_attribute11                             VARCHAR2,
690       x_attribute12                             VARCHAR2,
691       x_attribute13                             VARCHAR2,
692       x_attribute14                             VARCHAR2,
693       x_attribute15                             VARCHAR2);
694 
695    PROCEDURE lock_set(
696       x_rowid                   VARCHAR2,
697       x_ledger_id               NUMBER,
698       x_name                    VARCHAR2,
699       x_short_name              VARCHAR2,
700       x_chart_of_accounts_id    NUMBER,
701       x_period_set_name         VARCHAR2,
702       x_accounted_period_type   VARCHAR2,
703       x_description             VARCHAR2,
704       x_context                 VARCHAR2,
705       x_attribute1              VARCHAR2,
706       x_attribute2              VARCHAR2,
707       x_attribute3              VARCHAR2,
708       x_attribute4              VARCHAR2,
709       x_attribute5              VARCHAR2,
710       x_attribute6              VARCHAR2,
711       x_attribute7              VARCHAR2,
712       x_attribute8              VARCHAR2,
713       x_attribute9              VARCHAR2,
714       x_attribute10             VARCHAR2,
715       x_attribute11             VARCHAR2,
716       x_attribute12             VARCHAR2,
717       x_attribute13             VARCHAR2,
718       x_attribute14             VARCHAR2,
719       x_attribute15             VARCHAR2);
720 
721    PROCEDURE update_set(
722       x_rowid                   VARCHAR2,
723       x_access_set_id           NUMBER,
724       x_ledger_id               NUMBER,
725       x_name                    VARCHAR2,
726       x_short_name              VARCHAR2,
727       x_chart_of_accounts_id    NUMBER,
728       x_period_set_name         VARCHAR2,
729       x_accounted_period_type   VARCHAR2,
730       x_default_ledger_id       NUMBER,
731       x_last_update_date        DATE,
732       x_last_updated_by         NUMBER,
733       x_last_update_login       NUMBER,
734       x_description             VARCHAR2,
735       x_context                 VARCHAR2,
736       x_attribute1              VARCHAR2,
737       x_attribute2              VARCHAR2,
738       x_attribute3              VARCHAR2,
739       x_attribute4              VARCHAR2,
740       x_attribute5              VARCHAR2,
741       x_attribute6              VARCHAR2,
742       x_attribute7              VARCHAR2,
743       x_attribute8              VARCHAR2,
744       x_attribute9              VARCHAR2,
745       x_attribute10             VARCHAR2,
746       x_attribute11             VARCHAR2,
747       x_attribute12             VARCHAR2,
748       x_attribute13             VARCHAR2,
749       x_attribute14             VARCHAR2,
750       x_attribute15             VARCHAR2);
751 
752 -- *********************************************************************
753 -- The following procedures are necessary to handle the default ledger
754 -- for a ledger set.
755 
759 
756    FUNCTION maintain_def_ledger_assign(
757       x_ledger_set_id     NUMBER,
758       x_default_ledger_id NUMBER) RETURN BOOLEAN;
760 -- *********************************************************************
761 -- Procedure
762 --  Get_CCID
763 -- Purpose
764 --  Create or retrieve the code combination given the concatenated segments.
765 --  Called by iSpeed API.
766 -- History
767 --  11-MAY-04  C Ma       Copied from 11i.
768 -- Arguments
769 --
770 PROCEDURE Get_CCID(Y_Chart_Of_Accounts_Id    NUMBER,
771                    Y_Concat_Segments         VARCHAR2,
772                    Y_Account_Code            VARCHAR2,
773                    Y_Average_Balances_Flag   VARCHAR2,
774                    Y_User_Id                 NUMBER,
775                    Y_Resp_Id                 NUMBER,
776                    Y_Resp_Appl_Id            NUMBER,
777                    Y_CCID                OUT NOCOPY NUMBER
778                    );
779 
780 -- *********************************************************************
781 -- The following 2 procedures are for the Ledger Set iSetup API.
782 
783    PROCEDURE insert_set(
784       x_ledger_id               NUMBER,
785       x_name                    VARCHAR2,
786       x_short_name              VARCHAR2,
787       x_chart_of_accounts_id    NUMBER,
788       x_period_set_name         VARCHAR2,
789       x_accounted_period_type   VARCHAR2,
790       x_default_ledger_id       NUMBER,
791       x_date                    DATE,
792       x_user_id                 NUMBER,
793       x_login_id                NUMBER,
794       x_description             VARCHAR2,
795       x_context                 VARCHAR2,
796       x_attribute1              VARCHAR2,
797       x_attribute2              VARCHAR2,
798       x_attribute3              VARCHAR2,
799       x_attribute4              VARCHAR2,
800       x_attribute5              VARCHAR2,
801       x_attribute6              VARCHAR2,
802       x_attribute7              VARCHAR2,
803       x_attribute8              VARCHAR2,
804       x_attribute9              VARCHAR2,
805       x_attribute10             VARCHAR2,
806       x_attribute11             VARCHAR2,
807       x_attribute12             VARCHAR2,
808       x_attribute13             VARCHAR2,
809       x_attribute14             VARCHAR2,
810       x_attribute15             VARCHAR2);
811 
812    PROCEDURE update_set(
813       x_ledger_id               NUMBER,
814       x_name                    VARCHAR2,
815       x_short_name              VARCHAR2,
816       x_chart_of_accounts_id    NUMBER,
817       x_period_set_name         VARCHAR2,
818       x_accounted_period_type   VARCHAR2,
819       x_default_ledger_id       NUMBER,
820       x_date                    DATE,
821       x_user_id                 NUMBER,
822       x_login_id                NUMBER,
823       x_description             VARCHAR2,
824       x_context                 VARCHAR2,
825       x_attribute1              VARCHAR2,
826       x_attribute2              VARCHAR2,
827       x_attribute3              VARCHAR2,
828       x_attribute4              VARCHAR2,
829       x_attribute5              VARCHAR2,
830       x_attribute6              VARCHAR2,
831       x_attribute7              VARCHAR2,
832       x_attribute8              VARCHAR2,
833       x_attribute9              VARCHAR2,
834       x_attribute10             VARCHAR2,
835       x_attribute11             VARCHAR2,
836       x_attribute12             VARCHAR2,
837       x_attribute13             VARCHAR2,
838       x_attribute14             VARCHAR2,
839       x_attribute15             VARCHAR2);
840 
841  -- *********************************************************************
842    --
843    -- Procedure
844    --   remove_lgr_bsv_for_le
845    -- Purpose
846    --   remove ledger bsv if a le with bsv has been deleted.
847    -- History
848    --   01/13/06        Jen Wu        Created
849    -- Arguments
850    --   x_le_id         legal entity id
851    -- Example
852    --   GL_LEDGERS_PKG.remove_lgr_bsv_for_le(1);
853    -- Notes
854    --
855 
856    PROCEDURE remove_lgr_bsv_for_le(x_le_id NUMBER);
857  -- *********************************************************************
858    --
859    -- Procedure
860    --   process_le_bsv_assign
861    -- Purpose
862    --   Propogate the legal entity BSV assignments to ledgers.
863    -- History
864    --   21/01/05    C Ma              Created
865    -- Arguments
866    --   x_le_id         legal entity id
867    -- Example
868    --   GL_LEDGERS_PKG.process_le_bsv_assign(1, 1, '01','I',null,null);
869    -- Notes
870    --
871    PROCEDURE process_le_bsv_assign(x_le_id NUMBER,
872                                    x_value_set_id NUMBER,
873                                    x_bsv_value VARCHAR2,
874                                    x_operation VARCHAR2,
875                                    x_start_date DATE DEFAULT null,
876                                    x_end_date DATE   DEFAULT null);
877 
878 -- *********************************************************************
879    --
880    -- Procedure
881    --   get_bsv_desc
882    -- Purpose
883    --   Get the segment value description.
884    -- History
885    --   04/06/05    C Ma              Created
886    -- Arguments
887    --   x_flex_value_set_id
888    --   x_bal_seg_value
889    -- Example
893    FUNCTION get_bsv_desc( x_object_type         VARCHAR2,
890    --   GL_LEDGERS_PKG.get_bsv_desc(1002472, '01');
891    -- Notes
892    --
894                           x_object_id           NUMBER,
895                           x_bal_seg_value       VARCHAR2)
896    RETURN VARCHAR2;
897 
898 -- *********************************************************************
899    --
900    -- Procedure
901    --   check_calendar_gap
902    -- Purpose
903    --   Check whether there is a gap in the calendar periods. This is copied
904    --   over from check_for_gap procedure in gl_period_statuses_pkg. This one
905    --   is only called from the Accounting Setup Manager in OA.
906    -- History
907    --   04/28/05    C Ma              Created
908    -- Arguments
909    --   x_period_set_name
910    --   x_period_type
911    -- Example
912    --   GL_LEDGERS_PKG.check_calendar_gap('Accounting', 'Month',
913    --                           x_gap_flag, x_start_date, x_end_date);
914    -- Notes
915    --
916   PROCEDURE check_calendar_gap (
917         x_period_set_name       IN              VARCHAR2,
918         x_period_type           IN              VARCHAR2,
919         x_gap_flag              OUT NOCOPY      VARCHAR2,
920         x_start_date            OUT NOCOPY      DATE,
921         x_end_date              OUT NOCOPY      DATE);
922 
923 -- *********************************************************************
924    --
925    -- Procedure
926    --   check_duplicate_ledger
927    -- Purpose
928    --   Check whether there is a gap in the calendar periods. This is copied
929    --   over from check_for_gap procedure in gl_period_statuses_pkg. This one
930    --   is only called from the Accounting Setup Manager in OA.
931    -- History
932    --   04/28/05    C Ma              Created
933    -- Arguments
934    --   x_period_set_name
935    --   x_period_type
936    -- Example
937    --   GL_LEDGERS_PKG.check_duplicate_ledger('Accounting', 1,
938    --                           x_dupl_flag);
939    -- Notes
940    --
941   PROCEDURE check_duplicate_ledger (
942         x_object_name           IN              VARCHAR2,
943         x_object_id             IN              NUMBER,
944         x_dupl_flag             OUT NOCOPY      VARCHAR2);
945 
946   PROCEDURE check_dupl_ldg_shortname(
947         x_ledger_short_name     IN              VARCHAR2,
948         x_ledger_id             IN              NUMBER,
949         x_dupl_flag             OUT NOCOPY      VARCHAR2);
950 
951   PROCEDURE check_dupl_tgr_name (
952         x_target_ledger_name    IN              VARCHAR2,
953         x_relationship_id       IN              NUMBER,
954         x_ledger_id             IN              NUMBER,
955         x_dupl_flag             OUT NOCOPY      VARCHAR2);
956 
957   PROCEDURE check_dupl_tgr_shortname(
958         x_ledger_short_name     IN              VARCHAR2,
959         x_relationship_id       IN              NUMBER,
960         x_ledger_id             IN              NUMBER,
961         x_dupl_flag             OUT NOCOPY      VARCHAR2);
962 
963   PROCEDURE set_status_complete(x_object_type   VARCHAR2,
964                                 x_object_id IN NUMBER);
965 
966 
967   PROCEDURE check_translation_performed(x_ledger_id IN          NUMBER,
968                                 x_run_flag      OUT NOCOPY      VARCHAR2);
969 
970   PROCEDURE check_calendar_35max_days(x_ledger_id IN            NUMBER,
971                                 x_35day_flag OUT NOCOPY VARCHAR2);
972 
973   PROCEDURE check_desc_flex_setup(x_desc_flex_name IN VARCHAR2,
974                                 x_setup_flag OUT NOCOPY VARCHAR2);
975   PROCEDURE remove_ou_setup(x_config_id IN NUMBER);
976 -- *********************************************************************
977 
978   FUNCTION get_short_name ( x_primary_ledger_short_name VARCHAR2,
979 			  x_suffix_length number)
980 						RETURN VARCHAR2;
981 -- *********************************************************************
982 END gl_ledgers_pkg;