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