DBA Data[Home] [Help]

PACKAGE: APPS.FUN_TRX_PVT

Source


1 PACKAGE FUN_TRX_PVT AS
2 /* $Header: funtrxvalpvts.pls 120.12.12010000.2 2008/08/06 07:48:58 makansal ship $ */
3 
4 
5    TYPE batch_rec_type IS RECORD (
6       batch_id               NUMBER (15),
7       batch_number           VARCHAR2 (15),
8       initiator_id           NUMBER (15),
9       from_le_id             NUMBER (15),
10       from_ledger_id         NUMBER (15),
11       control_total          NUMBER,
12       currency_code          VARCHAR2 (15),
13       exchange_rate_type     VARCHAR2 (30),
14       status                 VARCHAR2 (15),
15       description            VARCHAR2 (240),
16       trx_type_id            NUMBER (15),
17       trx_type_code          VARCHAR2 (15),
18       gl_date                DATE,
19       batch_date             DATE,
20       reject_allowed         VARCHAR2 (1),
21       from_recurring_batch   NUMBER (15),
22       automatic_proration_flag VARCHAR2(1)
23    );
24 
25    TYPE trx_rec_type IS RECORD (
26       trx_id                  NUMBER (15),
27       initiator_id            NUMBER (15),
28       recipient_id            NUMBER (15),
29       to_le_id                NUMBER (15),
30       to_ledger_id            NUMBER (15),
31       batch_id                NUMBER (15),
32       status                  VARCHAR2 (15),
33       init_amount_cr          NUMBER,
34       init_amount_dr          NUMBER,
35       reci_amount_cr          NUMBER,
36       reci_amount_dr          NUMBER,
37       ar_invoice_number       VARCHAR2 (50),
38       invoicing_rule          VARCHAR2 (1),
39       approver_id             NUMBER (15),
40       approval_date           DATE,
41       original_trx_id         NUMBER (15),
42       reversed_trx_id         NUMBER (15),
43       from_recurring_trx_id   NUMBER (15),
44       initiator_instance      VARCHAR2 (1),
45       recipient_instance      VARCHAR2 (1),
46       automatic_proration_flag VARCHAR2(1),
47       trx_number              VARCHAR2(15)
48    );
49 
50    TYPE line_rec_type IS RECORD (
51       line_id          NUMBER (15),
52       trx_id           NUMBER (15),
53       line_number      NUMBER (15),
54       line_type        VARCHAR2 (1),
55       init_amount_cr   NUMBER,
56       init_amount_dr   NUMBER,
57       reci_amount_cr   NUMBER,
58       reci_amount_dr   NUMBER
59    );
60 
61    TYPE init_dist_rec_type IS RECORD (
62       batch_dist_id   NUMBER (15),
63       line_number     NUMBER (15),
64       batch_id        NUMBER (15),
65       ccid            NUMBER (15),
66       amount_cr       NUMBER,
67       amount_dr       NUMBER,
68       description     VARCHAR2(240)
69    );
70 
71    TYPE dist_line_rec_type IS RECORD (
72       dist_id         NUMBER (15),
73       dist_number     NUMBER (15),
74       trx_id          NUMBER (15),
75       line_id         NUMBER (15),
76       party_id        NUMBER,
77       party_type      VARCHAR2 (1),
78       dist_type       VARCHAR2 (1),
79       batch_dist_id   NUMBER (15),
80       amount_cr       NUMBER,
81       amount_dr       NUMBER,
82       ccid            NUMBER (15),
83       trx_number      VARCHAR2(15)
84    );
85 
86    -- Index-By-Table definitions
87    TYPE batch_tbl_type IS TABLE OF batch_rec_type
88       INDEX BY BINARY_INTEGER;
89 
90    TYPE trx_tbl_type IS TABLE OF trx_rec_type
91       INDEX BY BINARY_INTEGER;
92 
93    TYPE line_tbl_type IS TABLE OF line_rec_type
94       INDEX BY BINARY_INTEGER;
95 
96    TYPE init_dist_tbl_type IS TABLE OF init_dist_rec_type
97       INDEX BY BINARY_INTEGER;
98 
99    TYPE dist_line_tbl_type IS TABLE OF dist_line_rec_type
100       INDEX BY BINARY_INTEGER;
101 
102    TYPE number_type IS TABLE OF NUMBER
103       INDEX BY BINARY_INTEGER;
104 
105         /*-- Nested-Table definitions
106         TYPE Batch_Tbl_Type IS TABLE OF Batch_Rec_Type;
107         TYPE Trx_Tbl_Type IS TABLE OF Trx_Rec_Type;
108         TYPE Line_Tbl_Type IS TABLE OF Line_Rec_Type;
109         TYPE Init_Dist_Tbl_Type IS TABLE OF Init_Dist_Rec_Type;
110         TYPE Dist_Line_Tbl_Type IS TABLE OF Dist_Line_Rec_Type;
111         TYPE NUMBER_Type IS TABLE OF NUMBER;
112         */
113 -- Start of comments
114 --      API name : Init_Batch_Validate
115 --      Type : Private
116 --      Function : This procedure should only be called from the initiator UI,
117 --                 Web ADI and initiator workflow, and it would perform the
118 --                 validations on a specific batch.  Depending
119 --                 upon the validation level given, it would perform either
120 --                 the minimal validation for saving the record into the
121 --                 database, or it would perform full validations for the
122 --                 record to be sent out to the recipient.  Full validations
123 --                 should be called for all stages on or after the the
124 --                 transaction has been sent out.
125 --                 Minimal validations would be performed if
126 --                 p_validation_level = 50, and full validations
127 --                 would be performed if p_validation_level =
128 --                 FND_API.G_VALID_LEVEL_FULL (100).
129 --                 The default of this procedure is to perform
130 --                 full validations.
131 --                 It is the responsibility of the calling program to commit
132 --                 the record after performing the validations.  This API is
133 --                 not responsible to perform any commit.
134 --      Pre-reqs : None.
135 --      Parameters :
136 --      IN      :       p_api_version   IN NUMBER Required
137 --                      p_init_msg_list IN VARCHAR2     Optional
138 --                              Default = FND_API.G_FALSE
139 --                      p_validation_level IN NUMBER Optional
140 --                              Default = FND_API.G_VALID_LEVEL_FULL
141 --                      p_insert IN VARCHAR2 Required
142 --                      p_batch_rec IN OUT NOCOPY BATCH_REC_TYPE Required
143 --                      p_trx_tbl IN OUT NOCOPY TRX_TBL_TYPE Required
144 --                      p_init_dist_tbl IN OUT NOCOPY INIT_DIST_TBL_TYPE Required
145 --                      p_dist_lines_tbl IN OUT NOCOPY DIST_LINE_TBL_TYPE Required
146 --      OUT     :       x_return_status OUT     VARCHAR2(1)
147 --                      x_msg_count     OUT     NUMBER
148 --                      x_msg_data      OUT     VARCHAR2(2000)
149 --
150 --      Version :       Current version 1.0
151 --                      Initial version 1.0
152 --
153 --      Notes   :       None
154 --
155 -- End of comments
156    PROCEDURE init_batch_validate (
157       p_api_version        IN              NUMBER,
158       p_init_msg_list      IN              VARCHAR2 default null,
159       p_validation_level   IN              NUMBER default null,
160       x_return_status      OUT NOCOPY      VARCHAR2,
161       x_msg_count          OUT NOCOPY      NUMBER,
162       x_msg_data           OUT NOCOPY      VARCHAR2,
163       p_insert             IN              VARCHAR2 default null,
164       p_batch_rec          IN OUT NOCOPY   batch_rec_type,
165       p_trx_tbl            IN OUT NOCOPY   trx_tbl_type,
166       p_init_dist_tbl      IN OUT NOCOPY   init_dist_tbl_type,
167       p_dist_lines_tbl     IN OUT NOCOPY   dist_line_tbl_type
168    );
169 
170 -- Start of comments
171 --      API name : Init_Trx_Validate
172 --      Type : Private
173 --      Function : This procedure should only be called from the initiator UI,
174 --                 Web ADI and initiator workflow, and it would perform the
175 --                 validations on a specific transaction.  Depending
176 --                 upon the validation level given, it would perform either
177 --                 the minimal validation for saving the record into the
178 --                 database, or it would perform full validations for the
179 --                 record to be sent out to the recipient.  Full validations
180 --                 should be called for all stages on or after the the
181 --                 transaction has been sent out.
182 --                 Minimal validations would be performed if
183 --                 p_validation_level = 50, and full validations
184 --                 would be performed if p_validation_level =
185 --                 FND_API.G_VALID_LEVEL_FULL (100).
186 --                 The default of this procedure is to perform
187 --                 full validations.
188 --                 It is the responsibility of the calling program to commit
189 --                 the record after performing the validations.  This API is
190 --                 not responsible to perform any commit.
191 --      Pre-reqs : None.
192 --      Parameters :
193 --      IN      :       p_api_version   IN NUMBER Required
194 --                      p_init_msg_list IN VARCHAR2     Optional
195 --                              Default = FND_API.G_FALSE
196 --                      p_validation_level IN NUMBER Optional
197 --                              Default = FND_API.G_VALID_LEVEL_FULL
198 --                      p_trx_rec IN OUT NOCOPY TRX_REC_TYPE Required
199 --                      p_dist_lines_tbl IN OUT NOCOPY DIST_LINE_TBL_TYPE Required
200 --      OUT     :       x_return_status OUT     VARCHAR2(1)
201 --                      x_msg_count     OUT     NUMBER
202 --                      x_msg_data      OUT     VARCHAR2(2000)
203 --
204 --      Version :       Current version 1.0
205 --                      Initial version 1.0
206 --
207 --      Notes   :       None
208 --
209 -- End of comments
210    PROCEDURE init_trx_validate (
211       p_api_version        IN              NUMBER,
212       p_init_msg_list      IN              VARCHAR2 default null,
213       p_validation_level   IN              NUMBER default null ,
214       x_return_status      OUT NOCOPY      VARCHAR2,
215       x_msg_count          OUT NOCOPY      NUMBER,
216       x_msg_data           OUT NOCOPY      VARCHAR2,
217       p_trx_rec            IN OUT NOCOPY   trx_rec_type,
218       p_dist_lines_tbl     IN OUT NOCOPY   dist_line_tbl_type,
219       p_currency_code      IN              VARCHAR2,
220       p_gl_date            IN              DATE,
221       p_trx_date           IN              DATE
222    );
223 
224 -- Start of comments
225 --      API name : Init_Dist_Validate
226 --      Type : Private
227 --      Function : This procedure should only be called from the initiator UI,
228 --                 Web ADI and initiator workflow, and it would perform the
229 --                 validations on a specific distribution line.  Depending
230 --                 upon the validation level given, it would perform either
231 --                 the minimal validation for saving the record into the
232 --                 database, or it would perform full validations for the
233 --                 record to be sent out to the recipient.  Full validations
234 --                 should be called for all stages on or after the the
235 --                 transaction has been sent out.
236 --                 Minimal validations would be performed if
237 --                 p_validation_level = 50, and full validations
238 --                 would be performed if p_validation_level =
239 --                 FND_API.G_VALID_LEVEL_FULL (100).
240 --                 The default of this procedure is to perform
241 --                 full validations.
242 --                 It is the responsibility of the calling program to commit
243 --                 the record after performing the validations.  This API is
244 --                 not responsible to perform any commit.
245 --      Pre-reqs : None.
246 --      Parameters :
247 --      IN      :       p_api_version   IN NUMBER Required
248 --                      p_init_msg_list IN VARCHAR2     Optional
249 --                              Default = FND_API.G_FALSE
250 --                      p_validation_level IN NUMBER Optional
251 --                              Default = FND_API.G_VALID_LEVEL_FULL
252 --                      p_init_dist_rec IN OUT NOCOPY INIT_DIST_REC_TYPE Required
253 --      OUT     :       x_return_status OUT     VARCHAR2(1)
254 --                      x_msg_count     OUT     NUMBER
255 --                      x_msg_data      OUT     VARCHAR2(2000)
256 --
257 --      Version :       Current version 1.0
258 --                      Initial version 1.0
259 --
260 --      Notes   :       None
261 --
262 -- End of comments
263    PROCEDURE init_dist_validate (
264       p_api_version        IN              NUMBER,
265       p_init_msg_list      IN              VARCHAR2 default null,
266       p_validation_level   IN              NUMBER default null,
267       p_le_id          IN              NUMBER,
268       p_ledger_id          IN              NUMBER,
269       x_return_status      OUT NOCOPY      VARCHAR2,
270       x_msg_count          OUT NOCOPY      NUMBER,
271       x_msg_data           OUT NOCOPY      VARCHAR2,
272       p_init_dist_rec      IN OUT NOCOPY   init_dist_rec_type
273    );
274 
275 -- Start of comments
276 --      API name : Init_IC_Dist_Validate
277 --      Type : Private
278 --      Function : This procedure should only be called from the initiator UI,
279 --                 Web ADI and initiator workflow, and it would perform the
280 --                 validations on a specific distribution entry.  Depending
281 --                 upon the validation level given, it would perform either
282 --                 the minimal validation for saving the record into the
283 --                 database, or it would perform full validations for the
284 --                 record to be sent out to the recipient.  Full validations
285 --                 should be called for all stages on or after the the
286 --                 transaction has been sent out.
287 --                 Minimal validations would be performed if
288 --                 p_validation_level = 50, and full validations
289 --                 would be performed if p_validation_level =
290 --                 FND_API.G_VALID_LEVEL_FULL (100).
291 --                 The default of this procedure is to perform
292 --                 full validations.
293 --                 It is the responsibility of the calling program to commit
294 --                 the record after performing the validations.  This API is
295 --                 not responsible to perform any commit.
296 --      Pre-reqs : None.
297 --      Parameters :
298 --      IN      :       p_api_version   IN NUMBER Required
299 --                      p_init_msg_list IN VARCHAR2     Optional
300 --                              Default = FND_API.G_FALSE
301 --                      p_validation_level IN NUMBER Optional
302 --                              Default = FND_API.G_VALID_LEVEL_FULL
303 --                      p_dist_line_rec_type  IN OUT NOCOPY
304 --                              DIST_LINE_REC_TYPE Required
305 --      OUT     :       x_return_status OUT     VARCHAR2(1)
306 --                      x_msg_count     OUT     NUMBER
307 --                      x_msg_data      OUT     VARCHAR2(2000)
308 --
309 --      Version :       Current version 1.0
310 --                      Initial version 1.0
311 --
312 --      Notes   :       None
313 --
314 -- End of comments
315    PROCEDURE init_ic_dist_validate (
316       p_api_version        IN              NUMBER,
317       p_init_msg_list      IN              VARCHAR2 default null,
318       p_validation_level   IN              NUMBER default null,
319       p_le_id              IN              NUMBER,
320       p_ledger_id          IN              NUMBER,
321       x_return_status      OUT NOCOPY      VARCHAR2,
322       x_msg_count          OUT NOCOPY      NUMBER,
323       x_msg_data           OUT NOCOPY      VARCHAR2,
324       p_dist_line_rec      IN OUT NOCOPY   dist_line_rec_type
325    );
326 
327 -- Start of comments
328 --      API name : Init_Generate_Distributions
329 --      Type : Public
330 --      Function : This procedure would perform the proration of the
331 --                 Initiator distribution lines.
332 --                 This procedure should only be called from the initiator UI or
333 --                 Web ADI only after Init_Batch_Validate procedure is called
334 --                 in full validation mode and the data has been committed to
335 --                 the database.
336 --      Pre-reqs : Init_Batch_Validate is called in full validation mode.
337 --      Parameters :
341 --                      p_validation_level IN NUMBER Optional
338 --      IN      :       p_api_version   IN NUMBER Required
339 --                      p_init_msg_list IN VARCHAR2     Optional
340 --                              Default = FND_API.G_FALSE
342 --                              Default = FND_API.G_VALID_LEVEL_FULL
343 --                      p_dist_line_rec_type  IN OUT NOCOPY
344 --                              DIST_LINE_REC_TYPE Required
345 --      OUT     :       x_return_status OUT     VARCHAR2(1)
346 --                      x_msg_count     OUT     NUMBER
347 --                      x_msg_data      OUT     VARCHAR2(2000)
348 --
349 --      Version :       Current version 1.0
350 --                      Initial version 1.0
351 --
352 --      Notes   :       None
353 --
354 -- End of comments
355    PROCEDURE Init_Generate_Distributions (
356       p_api_version      IN              NUMBER,
357       p_init_msg_list    IN              VARCHAR2 default null,
358       x_return_status    OUT NOCOPY      VARCHAR2,
359       x_msg_count        OUT NOCOPY      NUMBER,
360       x_msg_data         OUT NOCOPY      VARCHAR2,
361       p_batch_rec        IN OUT NOCOPY   batch_rec_type,
362       p_trx_tbl          IN OUT NOCOPY   trx_tbl_type,
363       p_init_dist_tbl    IN OUT NOCOPY   init_dist_tbl_type,
364       p_dist_lines_tbl   IN OUT NOCOPY   dist_line_tbl_type
365    );
366 
367    PROCEDURE Init_Generate_Distributions (
368       p_api_version      IN              NUMBER,
369       p_init_msg_list    IN              VARCHAR2 default null,
370       x_return_status    OUT NOCOPY      VARCHAR2,
371       x_msg_count        OUT NOCOPY      NUMBER,
372       x_msg_data         OUT NOCOPY      VARCHAR2,
373       p_batch_id           IN              NUMBER
374    );
375    /*
376 -- Start of comments
377 --      API name        : Set_Return_Status
378 --      Type    : Private
379 --      Function        : This function returns the correct status given the
380 --                        status to be updated and the original status.  There are
381 --                        totally 3 possible return statuses:
382 --                        FND_API.G_RET_STS_SUCCESS, FND_API.G_RET_STS_ERROR,
383 --                        and FND_API.G_RET_STS_UNEXP_ERROR .  If the status to
384 --                        be updated to is more severe than
385 --                        the original status, then it would update the original
386 --                        status to new status.  If not, the original status would
387 --                        remain unchanged.
388 --      Pre-reqs        : None.
389 --      Parameters      :
390 --      IN      :       p_new_status IN VARCHAR2(1)     Required
391 --      OUT     :       x_orig_status   IN OUT  VARCHAR2(1)
392 --
393 --      Version :       Current version 1.0
394 --                      Initial version         1.0
395 --
396 --      Notes   :       None
397 --
398 -- End of comments
399    PROCEDURE set_return_status (
400       x_orig_status   IN OUT NOCOPY   VARCHAR2,
401       p_new_status    IN              VARCHAR2
402    );
403 
404 -- Start of comments
405 --      API name        : Is_Party_Valid
406 --      Type    : Private
407 --      Function        : This function checks if the intercompany
408 --                        party is valid.  This procedure should only be called
409 --                        in the INITIATOR_VALIDATE and RECIPIENT_VALIDATE call.
410 --                        This procedure assumes the message list has been initialized.
411 --      Pre-reqs        : None.
412 --      Parameters      :
413 --      IN      :       p_party_id IN NUMBER Required
414 --                      p_le_id IN NUMBER Required
415 --                      p_ledger_id IN NUMBER Required
416 --                      p_instance IN VARCHAR2 Required
417 --                      p_local IN VARCHAR2 Required
418 --                      p_type IN VARCHAR2 Required
419 --      OUT     :       x_return_status OUT     VARCHAR2(1)
420 
421    --
422 --      Version :       Current version 1.0
423 --                      Initial version         1.0
424 --
425 --      Notes   :       None
426 --
427 -- End of comments
428    PROCEDURE is_party_valid (
429       x_return_status   OUT NOCOPY      VARCHAR2,
430       p_party_id        IN              NUMBER,
431       p_le_id           IN              NUMBER,
432       p_ledger_id       IN              NUMBER,
433       p_instance        IN              VARCHAR2,
434       p_local           IN              VARCHAR2,
435       p_type            IN              VARCHAR2,
436       p_batch_date        IN              DATE
437    );
438 
439 -- Start of comments
440 --      API name        : Is_Init_Trx_Amt_Valid
441 --      Type    : Private
442 --      Function        : This function checks whether the initiator transaction amounts are valid.
443 --                        This procedure should only be called by the Initiator_Validate call.
444 --                        This procedure assumes the message list has been initialized.
445 --      Pre-reqs        : None.
446 --      Parameters      :
447 --      IN      :       p_trx_amount_cr IN NUMBER Required
448 --                      p_trx_amount_dr IN NUMBER Required
449 --                      p_dist_amount_cr IN NUMBER Required
450 --                      p_dist_amount_dr IN NUMBER Required
451 --                      p_currency_code IN VARCHAR2 Required
455 --      Version :       Current version 1.0
452 --                      p_trx_date IN DATE
453 --      OUT     :       x_return_status OUT     VARCHAR2(1)
454 --
456 --                      Initial version         1.0
457 --
458 --      Notes   :       None
459 --
460 -- End of comments
461    PROCEDURE is_init_trx_amt_valid (
462       x_return_status    OUT NOCOPY      VARCHAR2,
463       p_trx_amount_cr    IN              NUMBER,
464       p_trx_amount_dr    IN              NUMBER,
465       p_dist_amount_cr   IN              NUMBER,
466       p_dist_amount_dr   IN              NUMBER,
467       p_currency_code    IN              VARCHAR2,
468       p_trx_date         IN              DATE
469    );
470 
471 -- Start of comments
472 --      API name        : Is_Batch_Num_Unique
473 --      Type    : Private
474 --      Function        : This function checks if there are any batches with the same
475 --                        batch number and initiator id exist in the table.
476 --                        This procedure should only be called in the INITIATOR_VALIDATE and
477 --                        RECIPIENT_VALIDATE call.
478 --                        This procedure assumes the message list has been initialized.
479 --      Pre-reqs        : None.
480 --      Parameters      :
481 --      IN      :       p_batch_number  IN      NUMBER Required
482 --                      P_initiator_id  IN NUMBER    Required
483 --      OUT     :       x_return_status OUT     VARCHAR2
484 --
485 --      Version :       Current version 1.0
486 --                      Initial version         1.0
487 --
488 --      Notes   :       None
489 --
490 -- End of comments
491    PROCEDURE is_batch_num_unique (
492       x_return_status   OUT NOCOPY      VARCHAR2,
493       p_batch_number    IN              VARCHAR2,
494       p_initiator_id    IN              NUMBER
495    );
496 */
497 -- Start of comments
498 --      API name        : Is_AR_Valid
499 --      Type    : Private
500 --      Function        : This function checks whether AR is valid or not in the initiator side.
501 --                        This procedure can be called by the Initiator_Validate call and initiator workflow.
502 --                        Please keep in mind that this function does not check whether AR period is open or not
503 --      Pre-reqs        : None.
504 --      Parameters      :
505 --      IN      :       p_initiator_id IN NUMBER Required
506 --                      p_invoicing_rule IN VARCHAR2 Required
507 --                      p_recipient_id IN NUMBER Required
508 --                      p_to_le_id IN NUMBER Required
509 --                      p_trx_date IN DATE Required
510 --      OUT     :       x_return_status OUT     VARCHAR2
511 --
512 --      Version :       Current version 1.0
513 --                      Initial version         1.0
514 --
515 --      Notes   :       None
516 --
517 -- End of comments
518    PROCEDURE is_ar_valid (
519       x_return_status    OUT NOCOPY      VARCHAR2,
520       p_initiator_id     IN              NUMBER,
521       p_invoicing_rule   IN              VARCHAR2,
522       p_recipient_id     IN              NUMBER,
523       p_to_le_id         IN              NUMBER,
524       p_trx_date         IN              DATE
525    );
526 /*
527 -- Start of comments
528 --      API name        : Is_Reci_Not_Duplicated
529 --      Type    : Private
530 --      Function        : This function ensures that there are no
531 --                        duplicate recipients in the batch.  This
532 --                        procedure should only be called in the Initiator_Validate call.
533 --                        This procedure assumes the message list has been initialized.
534 --      Pre-reqs        : None.
535 --      Parameters      :
536 --      IN      : p_initiator_id IN NUMBER Required
537 --                p_trx_tbl     IN TRX_TAB_TYPE Required
538 --      OUT     : x_return_status       OUT     VARCHAR2
539 --
540 --      Version : Current version       1.0
541 --                Initial version       1.0
542 --
543 --      Notes   : None
544 --
545 -- End of comments
546    PROCEDURE is_reci_not_duplicated (
547       x_return_status   OUT NOCOPY      VARCHAR2,
548       p_initiator_id    IN              NUMBER,
549       p_trx_tbl         IN OUT NOCOPY   trx_tbl_type
550    );
551 
552 -- Start of comments
553 --      API name        : Is_Trx_Type_Valid
554 --      Type    : Private
555 --      Function        : This function checks whether the batch type
556 --                        entered is valid or not.  This
557 --                        procedure should only be called in
558 --                        Initiator_Validate and Recipient_Validate calls.
559 --                        This procedure assumes the message list has
560 --                        been initialized.  Initiator workflow
561 --                        should perform its own validations for
562 --                        checking whether the AR memo lines
563 --                        and AR transaction types associated with the
564 --                        batch type is valid, as this function
565 --                        only checks whether the batch type exists and valid.
566 --      Pre-reqs        : None.
567 --      Parameters      :
568 --      IN      :       p_trx_type_id IN NUMBER Required
569 --      OUT     :       x_return_status OUT     VARCHAR2
570 --
574 --      Notes   :       None
571 --      Version :       Current version 1.0
572 --                      Initial version         1.0
573 --
575 --
576 -- End of comments
577    PROCEDURE is_trx_type_valid (
578       x_return_status   OUT NOCOPY      VARCHAR2,
579       p_trx_type_id     IN              NUMBER
580    );
581 
582 -- Start of comments
583 --      API name        : Is_Init_GL_Date_Valid
584 --      Type    : Private
585 --      Function        : This function validates the GL date entered with the
586 --                        initiator setup.  This function does not validate
587 --                        the GL date with GL period, as the assumption here is that
588 --                        GL period must be open if IC period is open.
589 --                        This procedure should only be called by the Initiator_Validate call.
590 --                        This procedure assumes the message list has been initialized.
591 --      Pre-reqs        : None.
592 --      Parameters      :
593 --      IN      :       p_from_le_id IN NUMBER Required
594 --              :       p_gl_date              IN DATE   Required
595 --      OUT     :       x_return_status OUT     VARCHAR2(1)
596 --
597 --      Version :       Current version 1.0
598 --                      Initial version         1.0
599 --
600 --      Notes   :       None
601 --
602 -- End of comments
603    PROCEDURE is_init_gl_date_valid (
604       x_return_status   OUT NOCOPY      VARCHAR2,
605       p_from_le_id      IN              NUMBER,
606       p_gl_date         IN              DATE
607    );
608 
609 -- Start of comments
610 --      API name        : Is_Curr_Fld_Valid
611 --      Type    : Private
612 --      Function        : This function checks whether user has entered a valid currency code.
613 --                        This  procedure should only be called in Initiator_Validate and
614 --                        Recipient_Validate calls.
615 --                        This procedure assumes the message list has been initialized.
616 --      Pre-reqs        : None.
617 --      Parameters      :
618 --      IN      :       p_curr_code     IN VARCHAR2 Required
619 --                      p_trx_date      IN DATE Required
620 --      OUT     :       x_return_status OUT VARCHAR2
621 --
622 --      Version :       Current version 1.0
623 --                      Initial version         1.0
624 --
625 --      Notes   :       None
626 --
627 -- End of comments
628    PROCEDURE is_curr_fld_valid (
629       x_return_status   OUT NOCOPY      VARCHAR2,
630       p_curr_code       IN              VARCHAR2,
631       p_ledger_id       IN              NUMBER,
632       p_trx_date        IN              DATE
633    );
634 */
635 -- Start of comments
636 --      API name        : Create_Reverse_Batch
637 --      Type    : Private
638 --      Function        : This procedure creates a new batch for reversal of the
639 --                        original batch.
640 --      Pre-reqs        : None.
641 --      Parameters      :
642 --      IN      :       p_curr_code     IN VARCHAR2 Required
643 --                      p_trx_date      IN DATE Required
644 --      OUT     :       x_return_status OUT VARCHAR2
645 --
646 --      Version :       Current version 1.0
647 --                      Initial version         1.0
648 --
649 --      Notes   :       None
650 --
651 -- End of comments
652    PROCEDURE create_reverse_batch (
653       p_api_version             IN              NUMBER,
654       p_init_msg_list           IN              VARCHAR2 default null,
655       p_commit                  IN              VARCHAR2 default null,
656       p_validation_level        IN              NUMBER default null,
657       p_batch_id                IN              NUMBER,
658       p_reversed_batch_number   IN              VARCHAR2,
659       p_reversal_method         IN              VARCHAR2,
660       -- 'SWITCH' OR 'SIGN'
661       p_reversed_batch_date     IN              DATE,
662       p_reversed_gl_date        IN              DATE,
663       p_reversed_description    IN              VARCHAR2,
664       x_return_status           OUT NOCOPY      VARCHAR2,
665       x_reversed_batch_id       IN OUT NOCOPY   NUMBER
666    );
667 
668    PROCEDURE create_reverse_trx (
669       p_api_version             IN              NUMBER,
670       p_init_msg_list           IN              VARCHAR2 default null,
671       p_commit                  IN              VARCHAR2 default null,
672       p_validation_level        IN              NUMBER default null,
673       p_trx_tbl_id              IN              number_type,
674       p_reversed_batch_number   IN              VARCHAR2,
675       p_reversal_method         IN              VARCHAR2,
676       -- 'SWITCH' OR 'SIGN'
677       p_reversed_batch_date     IN              DATE,
678       p_reversed_gl_date        IN              DATE,
679       p_reversed_description    IN              VARCHAR2,
680       x_return_status           OUT NOCOPY      VARCHAR2,
681       x_reversed_batch_id       IN OUT NOCOPY   NUMBER
682    );
683 
684 -- Start of comments
685 --      API name        : Update_Trx_Status
686 --      Type    : Private
687 --      Function        : This procedure would update the
688 --                        status of the transaction as given.  Depending upon the
689 --                        validation level given, it would perform either no
693 --                        called only if the calling program is an intercompany
690 --                        validations before updating the record into the database,
691 --                        or it would perform full validations for the record before
692 --                        the status can be updated.  The no validations should only be
694 --                        procedure and is sure that the status can be updated as given.
695 --                        No validations would be performed if
696 --                        p_validation_level = FND_API.G_VALID_LEVEL_NONE, and
697 --                        full validations would be performed if
698 --                       p_validation_level = FND_API.G_VALID_LEVEL_FULL.
699 --                       The default of this procedure is to perform
700 --                       the full validations.
701 --                       Currently, p_api_version is not used and is not validated,
702 --                       but we would put this in the api  as this is a standard IN parameter.
703 --                       It is the responsibility of the calling program to commit the
704 --                       record after performing the validations.  This API is not responsible to
705 --                       perform any commit.
706 --      Pre-reqs        : None.
707 --      Parameters      :
708 --      IN      :       p_api_version                   IN NUMBER Required
709 --                      p_init_msg_list IN VARCHAR2     Optional
710 --                              Default = FND_API.G_FALSE
711 --                      p_commit                IN VARCHAR2 Optional
712 --                              Default = FND_API.G_FALSE
713 --                      p_validation_level      IN NUMBER Optional
714 --                              Default = FND_API.G_VALID_LEVEL_FULL
715 --                      p_trx_tbl_id                IN number_type Required
716 --                      p_update_status_to      IN VARCHAR(20) Required
717 --
718 --      OUT     :       x_return_status OUT     VARCHAR2(1)
719 --                      x_msg_count     OUT     NUMBER
720 --                      x_msg_data      OUT     VARCHAR2(2000)
721 --
722 --      Version :       Current version 1.0
723 --                      Initial version         1.0
724 --
725 --      Notes   :       None
726 --
727 -- End of comments
728    PROCEDURE update_trx_status (
729       p_api_version        IN              NUMBER,
730       p_init_msg_list      IN              VARCHAR2 default null,
731       p_commit             IN              VARCHAR2 default null,
732       p_validation_level   IN              NUMBER default null,
733       x_return_status      OUT NOCOPY      VARCHAR2,
734       x_msg_count          OUT NOCOPY      NUMBER,
735       x_msg_data           OUT NOCOPY      VARCHAR2,
736       p_trx_id             IN              NUMBER,
737       p_update_status_to   IN              VARCHAR2
738    );
739 /*
740 -- Start of comments
741 --        API name : Is_Batch_Balance
742 --        Type: Private
743 --        Function: This procedure checks to see if the
744 --                  total(intercompany_distributions_amounts) = total(dist_amounts)
745 --         Pre-reqs: None.
746 --         Parameters:
747 --         IN       :  p_init_dist_tbl IN OUT NOCOPY INIT_DIST_TBL_TYPE
748 --                     p_dist_lines_tbl IN OUT NOCOPY DIST_LINE_TBL_TYPE
749 --         OUT      :  x_return_status OUT VARCHAR2(1)
750 --
751 --         Version  :  Current version 1.0
752 --                     Initial version 1.0
753 --
754 --         Notes    :  None
755 --
756 -- End of comments
757    PROCEDURE is_batch_balance (
758       x_return_status    OUT NOCOPY      VARCHAR2,
759       p_init_dist_tbl    IN OUT NOCOPY   init_dist_tbl_type,
760       p_dist_lines_tbl   IN OUT NOCOPY   dist_line_tbl_type
761    );
762 */
763 -- Start of comments
764 --        API name : Recipient_Validate
765 --        Type: Private
766 --        Function: This procedure should only be called from the recipient
767 --                  UI, and recipient workflow, and it would perform the validations
768 --                  on a specific transaction batch.  Depending upon the validation
769 --                  level given, it would perform either the minimal validation for
770 --                  saving the record into the database when receiving the message
771 --                  in XML Gateway, or it would perform full validations for
772 --                  the record to be transferred to AP or GL Minimal validations
773 --                  would be performed if p_validation_level = 50, and full validations
774 --                  would be performed if p_validation_level = FND_API.G_VALID_LEVEL_FULL (100).
775 --                  The default of this procedure is to perform the full validations.
776 --                  Currently, p_api_version is not used and is not validated, but we
777 --                  would put this in the api as this is a standard IN parameter.
778 --                  It is the responsibility of the calling program to commit the
779 --                  record after performing the validations.  This API is not
780 --                  responsible to perform any commit.
781 --         Pre-reqs: None.
782 --         Parameters:
783 --         IN       :  p_api_version   IN NUMBER Required
784 --                     p_init_msg_list IN VARCHAR2 Optional
785 --                             Default = FND_API.G_FALSE
786 --                     p_validation_level IN NUMBER  Optional
787 --                             Default = FND_API.G_VALID_LEVEL_FULL
788 --                     p_batch_rec IN OUT NOCOPY BATCH_REC_TYPE Required
789 --                     p_trx_rec IN OUT NOCOPY TRX_REC_TYPE Required
790 --                     p_dist_lines_tbl IN OUT NOCOPY DIST_LINE_TBL_TYPE Required
791 --
792 --         OUT      :  x_return_status OUT VARCHAR2
793 --                     x_msg_count OUT NUMBER
794 --                     x_msg_data OUT VARCHAR2
795 --
796 --         Version  :  Current version 1.0
797 --                     Initial version 1.0
798 --
799 --         Notes    :  None
800 --
801 -- End of comments
802    PROCEDURE recipient_validate (
803       p_api_version        IN              NUMBER,
804       p_init_msg_list      IN              VARCHAR2 default null,
805       p_validation_level   IN              NUMBER default null,
806       x_return_status      OUT NOCOPY      VARCHAR2,
807       x_msg_count          OUT NOCOPY      NUMBER,
808       x_msg_data           OUT NOCOPY      VARCHAR2,
809       p_batch_rec          IN OUT NOCOPY   batch_rec_type,
810       p_trx_rec            IN OUT NOCOPY   trx_rec_type,
811       p_dist_lines_tbl     IN OUT NOCOPY   dist_line_tbl_type
812    );
813 
814 -- Start of comments
815 --        API name : Ini_Recipient_Validate
816 --        Type: Private
817 --        Function: This procedure should only be called from the initiator
818 --                  UI, and it would perform the validations
819 --                  on a specific transaction batch.  Depending upon the validation
820 --                  level given, it would perform either the minimal validation for
821 --                  saving the record into the database when receiving the message
822 --                  in XML Gateway, or it would perform full validations for
823 --                  the record to be transferred to AP or GL Minimal validations
824 --                  would be performed if p_validation_level = 50, and full validations
825 --                  would be performed if p_validation_level = FND_API.G_VALID_LEVEL_FULL (100).
826 --                  The default of this procedure is to perform the full validations.
827 --                  Currently, p_api_version is not used and is not validated, but we
828 --                  would put this in the api as this is a standard IN parameter.
829 --                  It is the responsibility of the calling program to commit the
830 --                  record after performing the validations.  This API is not
831 --                  responsible to perform any commit.
832 --         Pre-reqs: None.
833 --         Parameters:
834 --         IN       :  p_api_version   IN NUMBER Required
835 --                     p_init_msg_list IN VARCHAR2 Optional
836 --                             Default = FND_API.G_FALSE
837 --                     p_validation_level IN NUMBER  Optional
838 --                             Default = FND_API.G_VALID_LEVEL_FULL
839 --                     p_batch_rec IN OUT NOCOPY BATCH_REC_TYPE Required
840 --                     p_trx_rec IN OUT NOCOPY TRX_REC_TYPE Required
841 --                     p_dist_lines_tbl IN OUT NOCOPY DIST_LINE_TBL_TYPE Required
842 --
843 --         OUT      :  x_return_status OUT VARCHAR2
844 --                     x_msg_count OUT NUMBER
845 --                     x_msg_data OUT VARCHAR2
846 --
847 --         Version  :  Current version 1.0
848 --                     Initial version 1.0
849 --
850 --         Notes    :  None
851 --
852 -- End of comments
853    PROCEDURE ini_recipient_validate (
854       p_api_version        IN              NUMBER,
855       p_init_msg_list      IN              VARCHAR2 default null,
856       p_validation_level   IN              NUMBER default null,
857       x_return_status      OUT NOCOPY      VARCHAR2,
858       x_msg_count          OUT NOCOPY      NUMBER,
859       x_msg_data           OUT NOCOPY      VARCHAR2,
860       p_batch_rec          IN OUT NOCOPY   batch_rec_type,
861       p_trx_rec            IN OUT NOCOPY   trx_rec_type,
862       p_dist_lines_tbl     IN OUT NOCOPY   dist_line_tbl_type
863    );
864 
865 -- Start of comments
866 --      API name        : Is_AP_Valid
867 --      Type    : Private
868 --      Function        : This function checks whether AP is valid or
869 --                        not in the Recipient side.
870 --                        This procedure can be called by the Recipient_Validate
871 --                        call and recipient workflow.  Please keep in mind that
872 --                        this function does not check whether AP period is open
873 --                        or not when using this function.
874 --      Pre-reqs        : None.
875 --      Parameters      :
876 --      IN      :       p_initiator_id   IN NUMBER Required
877 --                      p_invoicing_rule  IN VARCHAR2 Required
878 --                      p_recipient_id  IN NUMBER Required
879 --                      p_to_le_id      IN NUMBER Required
880 --                      p_trx_date      IN NUMBER Required
881 --      OUT     :       x_return_status OUT     VARCHAR2(1)
882 --
883 --      Version :       Current version 1.0
884 --                      Initial version         1.0
885 --
886 --      Notes   :       None
887 --
888 -- End of comments
889    PROCEDURE is_ap_valid (
890       x_return_status    OUT NOCOPY      VARCHAR2,
891       p_initiator_id     IN              NUMBER,
892       p_invoicing_rule   IN              VARCHAR2,
893       p_recipient_id     IN              NUMBER,
894       p_to_le_id         IN              NUMBER,
895       p_trx_date         IN              DATE
896    );
897 
898 -- Start of comments
899 --      API name        : Is_Payable_Acct_Valid
900 --      Type    : Private
901 --      Function        : This procedure can be called by the Recipient_Validate
902 --                        call and recipient workflow.  It checks whether the
903 --                        payable account is valid for the recipient.
904 --
905 --      Pre-reqs        : None.
906 --      Parameters      :
907 --      IN      :       p_ccid   IN NUMBER Required
908 --      OUT     :       x_return_status OUT     VARCHAR2(1)
909 --
910 --      Version :       Current version 1.0
911 --                      Initial version         1.0
912 --
913 --      Notes   :       None
914 --
915 -- End of comments
916    PROCEDURE is_payable_acct_valid (
917       x_return_status   OUT NOCOPY      VARCHAR2,
918       p_ccid            IN              NUMBER
919    );
920 
921 -- Start of comments
922 --      API name        : Debug
923 --      Type    : Private
924 --      Function        : This is a helper procedure that checks if  the debug level defined and put a debug message in
925 --                        varchar2 into the stack.  Since these are debug messages, they would not be put into FND_MESSAGES
926 --                    for translation.  This procedure assumes the message list has been initialized.
927 --      Pre-reqs        : None.
928 --      Parameters      :
929 --      IN      :       p_message               IN      VARCHAR2        Required
930 --              p_message_level IN      NUMBER
931 --      Version :       Current version 1.0
935 --
932 --                      Initial version         1.0
933 --
934 --      Notes   :       None
936 -- End of comments
937    PROCEDURE DEBUG (p_message IN VARCHAR2);
938 
939 -- Start of comments
940 --        API name : Is_AR_Transfer_Valid
941 --        Type: Private
942 --        Function: This procedure should only be called from the initiator workflow
943 --                  to perform validations during the transaction import to AR.
944 --                  This procedure would perform the following validations:
945 --                  1. Check AR transaction type and memo line.
946 --                  2. Check customer information
947 --                  3. Check Operating unit
948 --                  4. Check AR period
949 --         Pre-reqs: None.
950 --         Parameters:
951 --         IN       :  p_api_version   IN NUMBER Required
952 --                     p_init_msg_list IN VARCHAR2 Optional
953 --                             Default = FND_API.G_FALSE
954 --                     p_validation_level IN NUMBER  Optional
955 --                             Default = FND_API.G_VALID_LEVEL_FULL
956 --                     p_batch_id IN NUMBER
957 --                     p_trx_id IN NUMBER
958 --
959 --         OUT      :  x_return_status OUT VARCHAR2
960 --                     x_msg_count OUT NUMBER
961 --                     x_msg_data OUT VARCHAR2
962 --
963 --         Version  :  Current version 1.0
964 --                     Initial version 1.0
965 --
966 --         Notes    :  None
967 --
968 -- End of comments
969    PROCEDURE ar_transfer_validate (
970       p_api_version        IN              NUMBER,
971       p_init_msg_list      IN              VARCHAR2 default null,
972       p_validation_level   IN              NUMBER default null,
973       x_return_status      OUT NOCOPY      VARCHAR2,
974       x_msg_count          OUT NOCOPY      NUMBER,
975       x_msg_data           OUT NOCOPY      VARCHAR2,
976       p_batch_id           IN              NUMBER,
977       p_trx_id             IN              NUMBER
978    );
979 
980 
981 -- Start of comments
982 --        API name : cancel_notifications
983 --        Type: Private
984 --        Function: This procedure is called to cancel open notifications
985 --                  -called from the Outbound Search page
986 --                   when a batch is deleted (p_batch_id is passed)
987 --                  -Or it will be called from the Outbound Create page when a
988 --                   transaction is deleted (p_batch_id and p_trx_id is passed)
989 --         Pre-reqs: None.
990 --         Parameters:
991 --         IN       :
992 --                     p_init_msg_list IN VARCHAR2 Optional
993 --                             Default = FND_API.G_FALSE
994 --                     p_batch_id IN NUMBER
995 --                     p_trx_id IN NUMBER
996 --
997 --         OUT      :  x_return_status OUT VARCHAR2
998 --                     x_msg_count OUT NUMBER
999 --                     x_msg_data OUT VARCHAR2
1000 --
1001 --
1002 --         Notes    :  None
1003 --
1004 -- End of comments
1005 PROCEDURE cancel_notifications (p_batch_id        IN NUMBER,
1006                               p_trx_id          IN NUMBER,
1007                               p_init_msg_list   IN VARCHAR2 ,
1008                               x_return_status   OUT NOCOPY VARCHAR2,
1009                               x_msg_count       OUT NOCOPY NUMBER,
1010                               x_msg_data        OUT NOCOPY VARCHAR2);
1011 
1012 
1013 -- Start of comments
1014 --        API name : check_invoice_reqd_flag
1015 --        Type: Private
1016 --        Function: This procedure is called to determine if invoice
1017 --                  -is required for a transaction.
1018 --         Pre-reqs: None.
1019 --         Parameters:
1020 --         IN       :
1021 --                     p_init_party_id IN  NUMBER
1022 --                     p_init_le_id         IN NUMBER,
1023 --                     p_reci_party_id      IN NUMBER,
1024 --                     p_reci_le_id         IN NUMBER,
1025 --                     p_ttyp_invoice_flag  IN VARCHAR2,
1026 --
1027 --         OUT      :  x_invoice_required VARCHAR2
1028 --                     x_return_status    VARCHAR2
1029 --
1030 --
1031 --         Notes    :  None
1032 --
1033 -- End of comments
1034 PROCEDURE check_invoice_reqd_flag(p_init_party_id      IN  NUMBER,
1035                                   p_init_le_id         IN NUMBER,
1036                                   p_reci_party_id      IN NUMBER,
1037                                   p_reci_le_id         IN NUMBER,
1038                                   p_ttyp_invoice_flag  IN VARCHAR2,
1039                                   x_invoice_required   OUT NOCOPY VARCHAR2,
1040                                   x_return_status      OUT NOCOPY VARCHAR2);
1041 
1042 -- Start of comments
1043 --        API name : validate_org_assignment
1044 --        Type: Private
1045 --        Function: This procedure is called to check whether the oranization assignment is
1046 --                  defined with all the options check for at least one user or not.
1047 --                  Set an error message if there is no such organization assignment
1048 --         Pre-reqs: None.
1049 --         Parameters:
1050 --         IN       :
1051 --                     p_party_id IN NUMBER
1052 --
1053 --         OUT      :  x_return_status OUT VARCHAR2
1054 --
1055 --
1056 --         Notes    :  None
1057 --
1058 -- End of comments
1059 /*
1060 PROCEDURE validate_org_assignment
1061 (       x_return_status OUT NOCOPY VARCHAR2  ,
1062         p_party_id  IN      NUMBER
1063 );
1064 */
1065 END FUN_TRX_PVT;