DBA Data[Home] [Help]

PACKAGE: APPS.FA_CHK_BOOKSTS_PKG

Source


1 PACKAGE FA_CHK_BOOKSTS_PKG AUTHID CURRENT_USER as
2 /* $Header: FAXCKBKS.pls 120.5 2009/12/01 09:22:21 pmadas ship $ */
3 
4 --
5 -- savepoint indicator, sets TRUE if savepoint has been created
6 --
7   savepoint_set  BOOLEAN := FALSE;
8 
9 
10 /* ---------------------------------------------------------------------
11  |   Name
12  |        faxcbsx
13  |
14  |   Description
15  |
16  |        Check book status user exit entry function.
17  |        Calls faxcbs to check the status of the book and returns TRUE
18  |        if depreciation submission is allowed.
19  |
20  |
21  |   Parameters
22  |        X_book  - book_type_code for which status is checked
23  |
24  |   Returns
25  |        TRUE if successful, FALSE otherwise
26  |
27  |   Notes
28  |
29  |   History
30  |        03-Feb-1997           LSON              Created
31  |
32  + -------------------------------------------------------------------- */
33 
34 FUNCTION faxcbsx(X_book        IN    VARCHAR2,
35 		 X_init_message_flag VARCHAR2 DEFAULT 'NO',
36                  X_close_period IN   NUMBER DEFAULT 1, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
37         return BOOLEAN;
38 
39 /* ---------------------------------------------------------------------
40  |   Name
41  |        faxcrb
42  |
43  |   Description
44  |        This function Checks the Reporting Books for a Primary Book.
45  |        This function has been created to check the depreciation status
46  |        and the current on all the associated reporting books of a MRC
47  |        enabled Book. If depreciation has errored on a reporting book
48  |        or has not yet been run on all the reporting books, we will
49  |        false and prevent the transaction.
50  |
51  |   Parameters
52  |        X_book  - book_type_code
53  |        X_txn_type  - type of transaction performed on Primary Book
54  |
55  |   Returns
56  |        TRUE if successful, FALSE otherwise
57  |
58  |   Notes
59  |
60  |   History
61  |        02-Dec-1997      SNARAYAN       Created
62  |        11-Aug-2001      BRIDGWAY       Added asset_id and close_period
63  |
64  + -------------------------------------------------------------------- */
65 
66 FUNCTION faxcrb(X_book         IN  VARCHAR2,
67                 X_trx_type     IN VARCHAR2,
68                 X_asset_id     IN NUMBER,
69                 X_close_period IN NUMBER, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
70              return BOOLEAN;
71 
72 /* ---------------------------------------------------------------------
73  |   Name
74  |        faxcbs
75  |
76  |   Description
77  |
78  |      Check the status of any processes on the book or its
79  |        associated CORP book or TAX books
80  |      Calls faxcps to check to see if any processes running on
81  |        the book is pending,inactive,or running. If so, txn is
82  |        not allowed.
83  |      Calls faxptb if Corp book and txn type is TRANSFER or RECLASS
84  |        and checks all associated TAX book status.
85  |      Calls faxgcb if TAX book and checks its associated CORP book
86  |        to see if any processes running on the corp books is MASS
87  |        transfer or Mass additions post. If so, txn not allowed
88  |
89  |
90  |   Parameters
91  |        X_book  - book_type_code for which status is checked
92  |        X_submit - TRUE, if request is for depreciation
93  |        X_start - TRUE if mass trx should be resubmitted.
94  |        X_asset_id - 0 for mass trx, other for individual txns
95  |        X_trx_type - transaction type code of transaction
96  |        X_result - TRUE if txn allowed, FALSE otherwise
97  |
98  |   Returns
99  |        TRUE if successful, FALSE otherwise
100  |
101  |   Notes
102  |
103  |   History
104  |        03-Feb-1997      LSON           Created
105  |        11-Aug-2001      BRIDGWAY       Added close_period
106  |
107  + -------------------------------------------------------------------- */
108 
109 FUNCTION faxcbs(X_book         IN    VARCHAR2,
110                 X_submit       IN    BOOLEAN,
111                 X_start        IN    BOOLEAN,
112                 X_asset_id     IN    NUMBER,
113                 X_trx_type     IN    VARCHAR2,
114                 X_txn_status   IN OUT NOCOPY   BOOLEAN,
115                 X_close_period IN    NUMBER DEFAULT 1, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
116         return BOOLEAN;
117 
118 /* ---------------------------------------------------------------------
119  |   Name
120  |        faxcps
121  |
122  |   Description
123  |
124  |        Check processes status.
125  |        Calls faxcms to check the status of any process
126  |        running on the book.
127  |
128  |   Parameters
129  |        X_book  - book for transaction status is checked
130  |        X_submit  - TRUE, if request for depreciation
131  |                    FALSE, otherwise
132  |        X_start - TRUE, if trx should be resubmitted
133  |        X_asset_id - 0 for mass_trx, other for individual transactions
134  |        X_txn_status - TRUE, if txns is allowed.
135  |
136  |   Returns
137  |        TRUE if successful, FALSE otherwise
138  |
139  |   Notes
140  |
141  |   History
142  |        03-Feb-1997      LSON           Created
143  |        11-Aug-2001      BRIDGWAY       Added close_period
144  |
145  + -------------------------------------------------------------------- */
146 
147 
148 FUNCTION faxcps(X_book         IN    VARCHAR2,
149                 X_submit       IN    BOOLEAN,
150                 X_start        IN    BOOLEAN,
151                 X_asset_id     IN    NUMBER,
152                 X_trx_type     IN    VARCHAR2,
153                 X_txn_status   IN OUT NOCOPY   BOOLEAN,
154                 X_close_period IN    NUMBER, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
155              return BOOLEAN;
156 
157 
158 /* ---------------------------------------------------------------------
159  |   Name
160  |        faxcds
161  |
162  |   Description
163  |        Checks Depreciation status.
164  |        Gets DEPRN_STATUS and DEPRN_REQUEST_ID from FA_BOOK_CONTROLS.
165  |        If deprn is running,inactive,or pending, trx is not approved.
166  |        If requested process is depreciation, it is allowed even though
167  |        last deprn errored out. A mass process is only allowed for deprn status
168  |        complete.
169  |
170  |   Parameters
171  |        X_book  - book for which txn status is checked
172  |        X_submit - true if submitting depreciation
173  |        X_asset_id -  asset for which txn approval is required
174  |        X_trx_type - transaction type being done for the asset
175  |        X_txn_status - TRUE if trx approved, FALSE otherwise
176  |
177  |   Returns
178  |        TRUE if successful, FALSE otherwise
179  |
180  |   Notes
181  |
182  |   History
183  |        05-NOV-1997           LSON              Created
184  |
185  + -------------------------------------------------------------------- */
186 
187 FUNCTION faxcds(X_book        IN  VARCHAR2,
188                 X_submit      IN  BOOLEAN,
189                 X_asset_id    IN  NUMBER,
190                 X_trx_type    IN  VARCHAR2,
191                 X_txn_status  IN OUT NOCOPY BOOLEAN, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
192          return BOOLEAN;
193 
194 
195 
196 /* ---------------------------------------------------------------------
197  |   Name
198  |        faxcms
199  |
200  |   Description
201  |        Checks the existance and status of any mass transactions running
202  |        against a book. If there are no uncompleted transactions, it will
203  |        return TRUE - meaning txns are allowed on this book. Otherwise
204  |        it displays message and passes the request_id back to the calling function.
205  |
206  |   Parameters
207  |        X_book  - book for which txn status is checked
208  |        X_request_id  - request_id to be returned to when that request
209  |                        is non-complete
210  |
211  |   Returns
212  |        TRUE if successful, FALSE otherwise
213  |
214  |   Notes
215  |
216  |   History
217  |        03-Feb-1997           LSON              Created
218  |
219  + -------------------------------------------------------------------- */
220 
221 FUNCTION faxcms(X_book         IN    VARCHAR2,
222                 X_request_id   OUT NOCOPY   NUMBER, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
223              return BOOLEAN;
224 
225 /* ---------------------------------------------------------------------
226  |   Name
227  |        faxcca
228  |
229  |   Description
230  |        Checks the existance and status of any Create Accounting
231  |        process running against a book. If there are no such requests,
232  |        it will return TRUE - meaning txns are allowed on this book. Otherwise
233  |        it displays message and passes the request_id back to the calling function.
234  |
235  |   Parameters
236  |        X_book  - book for which txn status is checked
237  |        X_request_id  - request_id to be returned to when that request
238  |                        is non-complete
239  |
240  |   Returns
241  |        TRUE if successful, FALSE otherwise
242  |
243  |   Notes
244  |
245  |   History
246  |        14-Aug-2006           BRIDGWAY          Created
247  |
248  + -------------------------------------------------------------------- */
249 
250 
251 FUNCTION faxcca(X_book         IN    VARCHAR2,
252                 X_request_id   OUT NOCOPY   NUMBER,
253 		p_log_level_rec IN  FA_API_TYPES.log_level_rec_type default
254 null)
255          return BOOLEAN;
256 
257 
258 /* ---------------------------------------------------------------------
259  |   Name
260  |        faxwcr
261  |
262  |   Description
263  |        This function waits for concurrent request, caculates a concurrent
264  |        request re-start time and issues request to run it at that time.
265  |
266  |   Parameters
267  |        X_request_id  - request-id of the failed submission
268  |
269  |   Returns
270  |        TRUE if successful, FALSE otherwise
271  |
272  |   Notes
273  |        Funtion currently disabled, will return TRUE always
274  |
275  |   History
276  |        03-Feb-1997           LSON              Created
277  |
278  + -------------------------------------------------------------------- */
279 
280 FUNCTION faxwcr(X_request_id    IN  NUMBER, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
281              return BOOLEAN;
282 
283 
284 /* ---------------------------------------------------------------------
285  |   Name
286  |        faxptb
287  |
288  |   Description
289  |
290  |      Checks the status of any processes on the TAX books.
291  |        For each Tax book of the associated CORP book
292  |        it calls faxcps to check its status.
293  |        If any one of them has process of running,pending,inactive
294  |        all the lock will be rolled back and txn is disallowed.
295  |
296  |   Parameters
297  |        X_book  - book_type_code for which status is checked
298  |        X_start - TRUE if mass trx should be resubmitted.
299  |        X_asset_id - 0 for mass trx, other for individual txns
300  |        X_trx_type - transaction type code of transaction
301  |        X_txn_status - TRUE if txn allowed, FALSE otherwise
302  |
303  |   Returns
304  |        TRUE if successful, FALSE otherwise
305  |
306  |   Notes
307  |
308  |   History
309  |        03-Feb-1997           LSON              Created
310  |
311  + -------------------------------------------------------------------- */
312 
313 
314 FUNCTION faxptb(X_book       IN     VARCHAR2,
315                 X_start      IN     BOOLEAN,
316                 X_asset_id   IN     NUMBER,
317                 X_trx_type   IN     VARCHAR2,
318                 X_txn_status     IN OUT NOCOPY    BOOLEAN, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
319         return BOOLEAN;
320 
321 
322 
323 /* ---------------------------------------------------------------------
324  |   Name
325  |        faxgcb
326  |
327  |   Description
328  |
329  |        Get associated corporate book for tax book passed in.
330  |        Calls faxcms to check to see if any mass processes running
331  |        on the corp book is mass transfer or mass additions post.
332  |        If so, disallow txns.
333  |
334  |   Parameters
335  |        X_book  - book_type_code for TAX book
336  |        X_txn_status - TRUE, if txns is allowed.
337  |
338  |   Returns
339  |        TRUE if successful, FALSE otherwise
340  |
341  |   Notes
342  |
343  |   History
344  |        03-Feb-1997           LSON              Created
345  |
346  + -------------------------------------------------------------------- */
347 
348 FUNCTION faxgcb(X_book         IN    VARCHAR2,
349                 X_txn_status       IN OUT NOCOPY   BOOLEAN, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
350 
351              return BOOLEAN;
352 
353 
354 
355 /* ---------------------------------------------------------------------
356  |   Name
357  |        faxlck
358  |
359  |   Description
360  |        This function locks fa_book_control row for a book passed in
361  |
362  |   Parameters
363  |        X_book  - book_type_code to lock
364  |                  If null, it will rollback to savepoint
365  |        X_txn_status  - TRUE if lock obtained
366  |
367  |   Returns
368  |        TRUE if successful, FALSE otherwise
369  |
370  |   Notes
371  |
372  |   History
373  |        03-Feb-1997           LSON              Created
374  |
375  + -------------------------------------------------------------------- */
376 
377 FUNCTION faxlck(X_book        IN  VARCHAR2,
378                 X_txn_status  IN OUT NOCOPY BOOLEAN,
379                 X_asset_id    IN NUMBER,
380                 X_trx_type    IN VARCHAR2, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
381              return BOOLEAN;
382 
383 
384 /* ---------------------------------------------------------------------
385  |   Name
386  |        faxsav
387  |
388  |   Description
389  |        This function create or rollback to a savepoint
390  |
391  |   Parameters
392  |        X_action  - R for rollback to a savepoint
393  |                    S for set savepoint
394  |                    C for clear savepoint indicator
395  |
396  |        X_txn_status  - TRUE if savepoint obtained
397  |
398  |   Returns
399  |        TRUE if successful, FALSE otherwise
400  |
401  |   Notes
402  |        savepoint_set is global variable indicating whether or not savepoint is set
403  |
404  |   History
405  |        03-Feb-1997           LSON              Created
406  |
407  + -------------------------------------------------------------------- */
408 
409 FUNCTION faxsav(X_action     IN  VARCHAR2,
410                 X_txn_status     IN OUT NOCOPY BOOLEAN, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
411      return BOOLEAN;
412 
413 /* ---------------------------------------------------------------------
414  |   Name
415  |        faxcdr
416  |
417  |   Description
418  |        This function checks if depreciation has been run for the
419  |        current open period for the book passed as parameter
420  |
421  |   Parameters
422  |        X_book     - book_type_code to check if depreciation has run
423  |        X_asset_id - asset_id (0 for mass requests)
424  |   Returns
425  |        TRUE if depreciation not run, FALSE otherwise
426  |
427  |   Notes
428  |
429  |   History
430  |        05-Nov-1998           SNARAYAN     Created
431  |        07-Aug-2001           BRIDGWAY     added asset_id param and
432  |
433  + -------------------------------------------------------------------- */
434 
435 FUNCTION faxcdr(
436                 X_book          IN      VARCHAR2,
437                 X_asset_id      IN      NUMBER DEFAULT 0, p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type)
438      return BOOLEAN;
439 
440 -- Bug 9032587: Wrapper procedure to call faxcdr
441 /* ---------------------------------------------------------------------
442  |   Name
443  |        faxcdr_proc
444  |
445  |   Description
446  |        This procedure is used as a wrapper program for calling
447  |        function faxcdr.
448  |
449  |   Notes
450  |
451  |   History
452  |
453  + -------------------------------------------------------------------- */
454 
455 PROCEDURE faxcdr_proc(
456                 X_book          IN      VARCHAR2,
457                 X_asset_id      IN      NUMBER DEFAULT 0,
458                 X_return_value  OUT     nocopy integer);
459 
460 -- End Bug 9032587
461 
462 END FA_CHK_BOOKSTS_PKG;