1 PACKAGE BODY FV_AP_PREPAY_PKG_PVT AS
2 /* $Header: FVAPPFRB.pls 120.3 2005/12/29 22:26:28 dsadhukh noship $ */
3
4
5
6
7 --==========================================================================
8 ---------------------------------------------------------------------------
9 -- Procedure Definitions
10 ---------------------------------------------------------------------------
11 --==========================================================================
12
13
14 --=========================================================================
15 -- ENCUMBRANCE_ENABLED: is a function that returns boolean. True if
16 -- encumbrance is enabled, false otherwise.
17 --=========================================================================
18
19 FUNCTION Encumbrance_Enabled RETURN BOOLEAN IS
20 BEGIN
21 RETURN(TRUE);
22 END Encumbrance_Enabled;
23
24
25
26 --=========================================================================
27 -- SETUP_GL_FUNDSCHK_PARAMS: Procedure that sets up parameters needed by
28 -- gl_fundschecker, such as retrieving the
29 -- packet_id, setting the appropriate mode and partial_reservation_flag
30 -- depending on whether it is for fundschecking or approval's funds
31 -- reservation.
32 --
33 -- Parameters:
34 --
35 -- p_packet_id: Packet_id variable to be populated by this procedure
36 --
37 -- p_mode: GL Fundschecking mode to be populated by this procedure
38 -- ('C' if for fundscheking, 'R' for approval's funds reservation)
39 --
40 -- p_partial_reserv_flag: GL Fundschecking partial reservation flag
41 -- to be populated by this procedure.
42 -- ('Y' for fundschecking, 'N' for approval's funds
43 -- reservation.)
44 --
45 -- p_called_by: Which Program this api is called by ('APPRVOAL'
46 -- or 'FUNDSCHKER')
47 --
48 -- p_calling_sequence: Debugging string to indicate path of module calls to be
49 -- printed out NOCOPY upon error.
50 --=========================================================================
51
52 PROCEDURE SetUp_GL_FundsChk_Params(p_packet_id IN OUT NOCOPY NUMBER,
53 p_mode IN OUT NOCOPY VARCHAR2,
54 p_partial_resv_flag IN OUT NOCOPY VARCHAR2,
55 p_called_by IN VARCHAR2,
56 p_calling_sequence IN VARCHAR2) IS
57 BEGIN
58
59 null;
60 END SetUp_GL_FundsChk_Params;
61
62
63
64 --=========================================================================
65 -- GET_GL_FUNDSCHK_PACKET_ID: Prcedure to retrieve the next packet_id to
66 -- be used for inserting records into
67 -- gl_bc_packets and for calling gl_fundschecker api.
68 --
69 -- Parameters;
70 --
71 -- p_packet_id: Packet_Id variable to be populated by this procedure
72 --
73 --=========================================================================
74
75 PROCEDURE Get_GL_FundsChk_Packet_Id(p_packet_id IN OUT NOCOPY NUMBER) IS
76 BEGIN
77 null;
78 END Get_GL_FundsChk_Packet_ID;
79
80
81
82 --============================================================================
83 -- FUNDS_CHECK: Procedure to perform fundschecking on a whole invoice if
84 -- p_dist_line_num is null or a particular invoice distribution
85 -- line if p_dist_line_num is provided.
86 --
87 -- Parameters:
88 --
89 -- p_invoice_id: Invoice_Id to perform funds_checking on
90 --
91 -- p_dist_line_num: Invoice Distribution Line Number if populated, tells
92 -- the api to fundscheck a particular invoice distribution
93 -- instead of all the distribution lines of the invoice
94 --
95 -- p_return_message_name: Message returned to the calling module of status of
96 -- of invoice
97 --
98 -- p_calling_sequence: Debugging string to indicate path of module calls to be
99 -- printed out NOCOPY upon error.
100 --============================================================================
101
102 PROCEDURE Funds_Check(p_invoice_id IN NUMBER,
103 p_dist_line_num IN NUMBER,
104 p_return_message_name IN OUT NOCOPY VARCHAR2,
105 p_calling_sequence IN VARCHAR2) IS
106
107 BEGIN
108 null;
109 END Funds_Check;
110
111
112 --============================================================================
113 -- FUNDS_RESERVE: Procedure to performs funds reservations.
114 --
115 -- Parameters:
116 --
117 -- p_invoice_id: Invoice Id
118 --
119 -- p_unique_packet_id_per: ('INVOICE' or 'DISTRIBUTION')
120 --
121 -- p_set_of_books_id: Set of books Id
122 --
123 -- p_base_currency_code: Base Currency Code
124 --
125 -- p_inv_enc_type_id: Financials Invoice Encumbrance Type Id
126 --
127 -- p_purch_enc_type_id: Financials Purchasing Encumbrance Type Id
128 --
129 -- p_conc_flag: ('Y' or 'N') indicating if procedure is to be called as a
130 -- concurrent program or userexit.
131 --
132 -- p_system_user: Approval Program User Id
133 --
134 -- p_ussgl_option:
135 --
136 -- p_holds: Holds Array
137 --
138 -- p_hold_count: Holds Count Array
139 --
140 -- p_release_count: Release Count Array
141 --
142 -- p_calling_sequence: Debugging string to indicate path of module calls to be
143 -- printed out NOCOPY upon error.
144 --============================================================================
145
146 PROCEDURE Funds_Reserve(p_invoice_id IN NUMBER,
147 p_unique_packet_id_per IN VARCHAR2,
148 p_set_of_books_id IN NUMBER,
149 p_base_currency_code IN VARCHAR2,
150 p_inv_enc_type_id IN NUMBER,
151 p_purch_enc_type_id IN NUMBER,
152 p_conc_flag IN VARCHAR2,
153 p_system_user IN NUMBER,
154 p_ussgl_option IN VARCHAR2,
155 p_holds IN OUT NOCOPY AP_APPROVAL_PKG.HOLDSARRAY,
156 p_hold_count IN OUT NOCOPY AP_APPROVAL_PKG.COUNTARRAY,
157 p_release_count IN OUT NOCOPY AP_APPROVAL_PKG.COUNTARRAY,
158 p_calling_sequence IN VARCHAR2) IS
159
160
161
162 BEGIN
163
164 null;
165 END Funds_Reserve;
166
167 --============================================================================
168 -- CLEAR_PACKET_ID_FROM_INVDISTS: Procedure that clears the packet_id from
169 -- the distributions with the given invoice_id
170 -- and given packet_id.
171 --============================================================================
172
173 PROCEDURE Clear_Packet_Id_From_InvDists(p_invoice_id IN NUMBER,
174 p_packet_id IN NUMBER,
175 p_calling_sequence IN VARCHAR2) IS
176 BEGIN
177 null;
178 END Clear_Packet_Id_From_InvDists;
179
180
181 --============================================================================
182 -- FUNDSCHECK_INIT: Procedure to retrieve system parameters to be used in
183 -- fundschecker.
184 --
185 -- Parameters:
186 --
187 -- p_chart_of_accounts_id: Variable for the procedure to populate with the
188 -- chart of accounts id
189 --
190 -- p_set_of_books_id: Variable for the procedure to populate with the
191 -- set of books id
192 --
193 -- p_auto_offsets_flag: Variable for the procedure to populate with the
194 -- automatic offsets flag.
195 --
196 -- p_flex_method: Variable for the procedure to populate with the
197 -- flexbuild method
198 --
199 -- p_xrate_gain_ccid: Variable for the procedure to populate with the
200 -- exchange rate variance gain ccid
201 --
202 -- p_xrate_loss_ccid: Variable for the procedure to populate with the
203 -- exchange rate variance loss ccid
204 --
205 -- p_base_currency_code: Variable for the procedure to populate with the
206 -- base currency code
207 --
208 -- p_inv_enc_type_id: Variable for the procedure to populate with the
209 -- invoice encumbrance type id
210 --
211 -- p_gl_user_id: Variable for the procedure to populate with the
212 -- profile option user_id to be used for the gl_fundschecker
213 --
214 -- p_calling_sequence: Debugging string to indicate path of module calls to be
215 -- printed out NOCOPY upon error.
216 --============================================================================
217
218 PROCEDURE FundsCheck_Init(p_chart_of_accounts_id IN OUT NOCOPY NUMBER,
219 p_set_of_books_id IN OUT NOCOPY NUMBER,
220 p_auto_offsets_flag IN OUT NOCOPY VARCHAR2,
221 p_flex_method IN OUT NOCOPY VARCHAR2,
222 p_xrate_gain_ccid IN OUT NOCOPY NUMBER,
223 p_xrate_loss_ccid IN OUT NOCOPY NUMBER,
224 p_base_currency_code IN OUT NOCOPY VARCHAR2,
225 p_inv_enc_type_id IN OUT NOCOPY NUMBER,
226 p_gl_user_id IN OUT NOCOPY NUMBER,
227 p_calling_sequence IN VARCHAR2) IS
228 BEGIN
229 null;
230 END FundsCheck_Init;
231
232
233 --============================================================================
234 -- SETUP_FLEXBUILD_PARAMS: Procedure to setup the flexbuild parameters
235 -- needed to flexbuild either or both exchange
236 -- rate gain/loss account ccids. It returns the qualifier name, segment
237 -- delimiter, segment number, number of segments, system level exchange
238 -- rate variance account segments and some flags and message if flexbuilding
239 -- cannot happen for exchange rate accounts.
240 --
241 -- Parameters:
242 --
243 -- p_chart_of_accounts_id: Chart of accounts id
244 --
245 -- p_flex_method: System Level Flexbuild method
246 --
247 -- p_flex_xrate_flag: BOOLEAN, whether to flexbuild the exchange rate
248 -- variance account (TRUE for flexbuild, FALSE otherwise).
249 --
250 -- p_xrate_gain_ccid: System level exchange rate variance gain ccid.
251 -- Only needed if p_flex_xrate_flag = TRUE
252 --
253 -- p_xrate_loss_ccid: System level excahgne rate variance loss ccid
254 -- Only needed if p_flex_xrate_flag = TRUE
255 --
256 -- p_flex_qualifier_name: Variable to be populated with the flexbuild
257 -- qualifier name by the procedure for flexbuilding
258 --
259 -- p_flex_segment_delimiter: Variable to be populated with the flexbuild
260 -- segment delimiter by the procedure for
261 -- flexbuilding
262 --
263 -- p_flex_segment_number: Variable to be populated with the flexbuild
264 -- segment number by the procedure for flexbuilding
265 --
266 -- p_num_of_segments: Variable to be populated with the flexbuild number
267 -- of segments by the procedure for flexbuilding
268 --
269 -- p_xrate_gain_segments: Variable to contain the exchange rate variance
270 -- gain account segments to be populated by the
271 -- procedure for flexbuilding
272 --
273 -- p_xrate_loss_segments: Variable to contain the exchange rate variance
274 -- loss account segments to be populated by the
275 -- procedure for flexbuilding
276 --
277 -- p_xrate_cant_flexbuild_flag: Boolean value to be set by the procedure if
278 -- for some reason the exchange rate variance
279 -- account cannot be flexbuilt.
280 --
281 -- p_cant_flexbuild_reason: Variable to contain the reason why the
282 -- liability account could not be flexbuilt
283 --
284 -- p_calling_sequence: Debugging string to indicate path of module calls to be
285 -- printed out NOCOPY upon error.
286 --============================================================================
287
288 PROCEDURE SetUp_Flexbuild_Params(p_chart_of_accounts_id IN NUMBER,
289 p_flex_method IN VARCHAR2,
290 p_flex_xrate_flag IN BOOLEAN,
291 p_xrate_gain_ccid IN NUMBER,
292 p_xrate_loss_ccid IN NUMBER,
293 p_flex_qualifier_name IN OUT NOCOPY VARCHAR2,
294 p_flex_segment_delimiter IN OUT NOCOPY VARCHAR2,
295 p_flex_segment_number IN OUT NOCOPY NUMBER,
296 p_num_of_segments IN OUT NOCOPY NUMBER,
297 p_xrate_gain_segments IN OUT NOCOPY FND_FLEX_EXT.SEGMENTARRAY,
298 p_xrate_loss_segments IN OUT NOCOPY FND_FLEX_EXT.SEGMENTARRAY,
299 p_xrate_cant_flexbuild_flag IN OUT NOCOPY BOOLEAN,
300 p_cant_flexbuild_reason IN OUT NOCOPY VARCHAR2,
301 p_calling_sequence IN VARCHAR2) IS
302 BEGIN
303 null;
304 END SetUp_Flexbuild_Params;
305
306
307 --============================================================================
308 -- BC_PACKETS_INSERT: Procedure that inserts accounting debits or credit
309 -- records into gl_bc_packets depending on whether the
310 -- invoice distribution was a reversal and whether the amount inserted is
311 -- positive or negative. Records need to be inserted into gl_bc_packets
312 -- before gl_fundschecker can be called.
313 --
314 -- Parameters:
315 --
316 -- p_packet_id: Packet Id
317 --
318 -- p_set_of_books_id: Set of Books Id
319 --
320 -- p_ccid: Code Combination Id
321 --
322 -- p_period_year: Period Year
323 --
324 -- p_period_num: Period Num
325 --
326 -- p_quarter_num: Quarter Num
327 --
328 -- p_gl_user: User Id
329 --
330 -- p_enc_type_id: Encumbrance Type Id
331 --
332 -- -------------------------------------------------+
333 -- | Journal Entry Reference Columns |
334 -- | (Not needed for funds checking) |
335 -- | |
336 -- | Expense Lines: |
337 -- | o p_ref1: Vendor Name |
338 -- | o p_ref2: Invoice ID |
339 -- | o p_ref3: Distribution Line Number |
340 -- | o p_ref4: Invoice Number |
341 -- | o p_ref5: Voucher Number |
342 -- | Encumbrance Lines and Reversals |
343 -- | o p_ref1: Vendor Name |
344 -- | o p_ref2: Invoice ID |
345 -- | o p_ref3: Distribution Line Number |
346 -- | o p_ref4: PO Number |
347 -- | o p_ref5: Invoice Number |
348 -- | Payment Lines |
349 -- | o p_ref1: Vendor Name |
350 -- | o p_ref2: Invoice ID |
351 -- | o p_ref3: Check ID |
352 -- | o p_ref4: Check Number |
353 -- | o p_ref5: Invoice Number |
354 -- +-------------------------------------------------
355 --
356 -- p_je_source: Je Source Name ('Payables')
357 --
358 -- p_je_category: Je Category Nmae ('Purchase Invoices')
359 --
360 -- p_actual_flag: Actual Flag ('E')
361 --
362 -- p_period_name: Period Name
363 --
364 -- p_base_currency_code: Base Currency Code
365 --
366 -- p_status_code: Status Code ('C' for fundschecking, 'P' for approval's
367 -- funds reservation)
368 --
369 -- p_ussgl_code: USSGL code profile option (Not needed for fundschecking)
370 --
371 -- p_base_amt: Base Amount
372 --
373 -- p_reversal_flag: Reversal Flag
374 --
375 -- p_calling_sequence: Debugging string to indicate path of module calls to
376 -- be printed out NOCOPY upon error.
377 --============================================================================
378
379 PROCEDURE BC_Packets_Insert(p_packet_id IN NUMBER,
380 p_set_of_books_id IN NUMBER,
381 p_ccid IN NUMBER,
382 p_period_year IN NUMBER,
383 p_period_num IN NUMBER,
384 p_quarter_num IN NUMBER,
385 p_gl_user IN NUMBER,
386 p_enc_type_id IN NUMBER,
387 p_ref1 IN VARCHAR2,
388 p_ref2 IN NUMBER,
389 p_ref3 IN NUMBER,
390 p_ref4 IN VARCHAR2,
391 p_ref5 IN VARCHAR2,
395 p_period_name IN VARCHAR2,
392 p_je_source IN VARCHAR2,
393 p_je_category IN VARCHAR2,
394 p_actual_flag IN VARCHAR2,
396 p_base_currency_code IN VARCHAR2,
397 p_status_code IN VARCHAR2,
398 p_ussgl_code IN VARCHAR2,
399 p_base_amt IN NUMBER,
400 p_reversal_flag IN VARCHAR2,
401 p_calling_sequence IN VARCHAR2) IS
402 BEGIN
403 null;
404 END BC_Packets_Insert;
405
406
407 /**==========================================================================
408 ENCUMBRANCE_LINES_INSERT : This Procedure inserts lines into ap_encumbrance
409 lines. The p_conc_flag determines whether to set the extended who columns
410 if called by a concurrent program
411 ==========================================================================**/
412
413 PROCEDURE Encumbrance_Lines_Insert (
414 p_invoice_distribution_id IN NUMBER,
415 p_encum_line_type IN VARCHAR2,
416 p_accounting_date IN DATE,
417 p_period_name IN VARCHAR2,
418 p_encum_type_id IN NUMBER,
419 p_code_combination_id IN NUMBER,
420 p_accounted_cr IN NUMBER,
421 p_accounted_dr IN NUMBER,
422 p_reversal_flag IN VARCHAR2,
423 p_user_id IN NUMBER,
424 p_conc_flag IN VARCHAR2,
425 p_calling_sequence IN VARCHAR2) IS
426
427 BEGIN
428 null;
429 END Encumbrance_Lines_Insert;
430
431
432 --============================================================================
433 -- CALC_IPV_ERV: Procedure to calculate invoice price variance, base invoice
434 -- price variance, exchange rate variance and to return the
435 -- the appropriate invoice price variance ccid and exchange rate variance ccid
436 -- depending on the po distribution destination type. If the destination
437 -- type is EXPENSE, both the ipv_ccid and erv_ccid equals the po distribution
438 -- expense ccid. If the destination type is INVENDTORY, the ipv_ccid equals
439 -- the po distribution variance account ccid, while the erv_ccid depends on
440 -- whether it is a gain or loss to be assigned to the system level exchange
441 -- rate variance gain/loss ccid and also if automatic offsets is on,
442 -- to determine if the system gain/loss account gets overlaid with the
443 -- dist_ccid depending on the flex method.
444 --
445 -- Parameters:
446 --
447 -- p_auto_offset_flag: Boolean to indicated whether automatic offsets is
448 -- enabled or not (TRUE for enabled, FALSE otherwise)
449 --
450 -- p_xrate_cant_flexbuild_flag: Boolean to indicate whether the procedure
451 -- has problems setting up parameters to
452 -- flexbuild the exchange rate variacne account
453 --
454 -- p_chart_of_account_id: Chart of Accounts Id
455 --
456 -- p_xrate_gain_segments: Exchange Rate Variance Gain Account Segments
457 --
458 -- p_xrate_loss_segments: Exchange Rate Variance Loss Account Segments
459 --
460 -- p_sys_xrate_gain_ccid: System level Exchange Rate Variance Gain Ccid
461 --
462 -- p_sys_xrate_loss_ccid: System level Exchange Rate Variance Loss Ccid
463 --
464 -- p_dist_ccid: Invoice Distribution Line Ccid
465 --
466 -- p_expense_ccid: PO Distribution Expense Ccid
467 --
468 -- p_variance_ccid: PO Distribution Variance Ccid
469 --
470 -- p_segment_number: Flexbuild Segment Number
471 --
472 -- p_flex_method: Flexbuild Method
473 --
474 -- p_flex_qualifier_name: Flexbuild Qualifier Name
475 --
476 -- p_flex_segment_delimiter: Flexbuild Segment Delimiter
477 --
478 -- p_po_rate: PO Rate
479 --
480 -- p_po_price: PO Price
481 --
482 -- p_inv_rate: Invoice Rate
483 --
484 -- p_inv_price: Invoice Price
485 --
486 -- p_inv_qty: Invoice Quantity
487 --
488 -- p_inv_currency_code: Invoice Currency Code
489 --
490 -- p_base_currency_code: Base Currency Code
491 --
492 -- p_destination_type: PO Distribution Destination Type
493 --
494 -- p_ipv: Variable to contain the invoice price variance calculated by the
495 -- procedure.
496 --
497 -- p_bipv: Variable to contain the base invoice price variance calculated
498 -- by the procedure.
499 --
500 -- p_price_var_ccid: Variable to contain the invoice price variance ccid
501 -- that is determined by the po distribution destination
502 -- type.
503 -- p_erv: Variable to contain the exchange rate variacne calculated by the
504 -- procedure.
505 --
506 -- p_erv_ccid: Variable to contains the exchange rate variance ccid that
507 -- is determined by the po distribution destination type and
508 -- if automatic offsets is on or not.
509 --
510 -- p_calling_sequence: Debugging string to indicate path of module calls to
511 -- be printed out NOCOPY upon error.
512 --============================================================================
513
514 PROCEDURE Calc_IPV_ERV(p_auto_offsets_flag IN VARCHAR2,
515 p_xrate_cant_flexbuild_flag IN BOOLEAN,
516 p_chart_of_accounts_id IN NUMBER,
517 p_xrate_gain_segments IN FND_FLEX_EXT.SEGMENTARRAY,
518 p_xrate_loss_segments IN FND_FLEX_EXT.SEGMENTARRAY,
519 p_sys_xrate_gain_ccid IN NUMBER,
520 p_sys_xrate_loss_ccid IN NUMBER,
524 p_segment_number IN NUMBER,
521 p_dist_ccid IN NUMBER,
522 p_expense_ccid IN NUMBER,
523 p_variance_ccid IN NUMBER,
525 p_flex_method IN VARCHAR2,
526 p_flex_qualifier_name IN VARCHAR2,
527 p_flex_segment_delimiter IN VARCHAR2,
528 p_po_rate IN NUMBER,
529 p_po_price IN NUMBER,
530 p_inv_rate IN NUMBER,
531 p_rtxn_rate IN NUMBER,
532 p_rtxn_uom IN VARCHAR2,
533 p_rtxn_item_id IN NUMBER,
534 p_po_uom IN VARCHAR2,
535 p_match_option IN VARCHAR2,
536 p_inv_price IN NUMBER,
537 p_inv_qty IN NUMBER,
538 p_dist_amount IN NUMBER,
539 p_base_dist_amount IN NUMBER,
540 p_inv_currency_code IN VARCHAR2,
541 p_base_currency_code IN VARCHAR2,
542 p_destination_type IN VARCHAR2,
543 p_ipv IN OUT NOCOPY NUMBER,
544 p_bipv IN OUT NOCOPY NUMBER,
545 p_price_var_ccid IN OUT NOCOPY NUMBER,
546 p_erv IN OUT NOCOPY NUMBER,
547 p_erv_ccid IN OUT NOCOPY NUMBER,
548 p_calling_sequence IN VARCHAR2) IS
549 BEGIN
550 null;
551 END Calc_IPV_ERV;
552
553
554 Procedure Calc_Tax_IPV_ERV(p_auto_offsets_flag IN VARCHAR2,
555 p_xrate_cant_flexbuild_flag IN BOOLEAN,
556 p_chart_of_accounts_id IN NUMBER,
557 p_xrate_gain_segments IN FND_FLEX_EXT.SEGMENTARRAY,
558 p_xrate_loss_segments IN FND_FLEX_EXT.SEGMENTARRAY,
559 p_sys_xrate_gain_ccid IN NUMBER,
560 p_sys_xrate_loss_ccid IN NUMBER,
561 p_flex_segment_number IN NUMBER,
562 p_flex_method IN VARCHAR2,
563 p_flex_qualifier_name IN VARCHAR2,
564 p_flex_segment_delimiter IN VARCHAR2,
565 p_tax_dist_id IN NUMBER,
566 p_po_dist_id IN NUMBER,
567 p_dist_ccid IN NUMBER,
568 p_sum_qty_invoiced IN NUMBER,
569 p_sum_allocated_amount IN NUMBER,
570 p_po_expense_ccid IN NUMBER,
571 p_price_variance_ccid IN NUMBER,
572 p_po_price IN NUMBER,
573 p_rtxn_rate IN NUMBER,
574 p_rtxn_uom IN VARCHAR2,
575 p_rtxn_item_id IN NUMBER,
576 p_po_uom IN VARCHAR2,
577 p_match_option IN VARCHAR2,
578 p_po_rate IN NUMBER,
579 p_inv_rate IN NUMBER,
580 p_destination_type IN VARCHAR2,
581 p_po_tax_rate IN NUMBER,
582 p_po_recov_rate IN NUMBER,
583 p_invoice_currency_code IN VARCHAR2,
584 p_base_currency_code IN VARCHAR2,
585 p_tax_ipv_ccid IN OUT NOCOPY NUMBER,
586 p_tax_erv_ccid IN OUT NOCOPY NUMBER,
587 p_tax_ipv IN OUT NOCOPY NUMBER,
588 p_tax_bipv IN OUT NOCOPY NUMBER,
589 p_tax_erv IN OUT NOCOPY NUMBER,
590 p_calling_sequence IN VARCHAR2,
591 p_tax_id IN NUMBER,
592 p_codeorgroup IN NUMBER,
593 p_vendor_id IN NUMBER,
594 p_vendor_site_id IN NUMBER) IS
595
596
597 BEGIN
598 null;
599 END Calc_Tax_IPV_ERV;
600
601 --============================================================================
602 -- CALC_QV: Procedure to calculate the quantity variance and base quantity
603 -- variance and also return the invoice distribution line number
604 -- that the quantity variances should be applied to.
605 --
606 -- Parameters:
607 --
608 -- p_invoice_id: Invoice Id
609 --
610 -- p_po_dist_id: Po Distribution Id that the invoice is matched to
611 --
612 -- p_inv_currency_code: Invoice Currency Code
613 --
614 -- p_base_currency_code: Base Currency Code
615 --
616 -- p_po_price: Po Price
617 --
618 -- p_po_qty: Po Quantity
619 --
620 -- p_qv: Variable to contain the quantity variance of the invoice to be
621 -- calculated by the procedure
622 --
623 -- p_bqv: Variable to contain the base quantity variance of the invoice to
624 -- be calculated by the procedure
625 --
626 -- p_update_line_num: Variable to contain the distribution line number
627 -- of the invoice that the qv should be applied to
628 --
629 -- p_calling_sequence: Debugging string to indicate path of module calls to be
630 -- printed out NOCOPY upon error.
631 --============================================================================
632
633 PROCEDURE Calc_QV(p_invoice_id IN NUMBER,
634 p_po_dist_id IN NUMBER,
635 p_inv_currency_code IN VARCHAR2,
636 p_base_currency_code IN VARCHAR2,
637 p_po_price IN NUMBER,
638 p_po_qty IN NUMBER,
639 p_match_option IN VARCHAR2,
640 p_rtxn_uom IN VARCHAR2,
641 p_po_uom IN VARCHAR2,
645 p_update_line_num IN OUT NOCOPY NUMBER,
642 p_item_id IN NUMBER,
643 p_qv IN OUT NOCOPY NUMBER,
644 p_bqv IN OUT NOCOPY NUMBER,
646 p_calling_sequence IN VARCHAR2) IS
647
648 BEGIN
649 null;
650 END Calc_QV;
651
652
653 --============================================================================
654 -- PROCESS_FUNDSCHK_FAILURE_CODE: Procedure to process the gl_fundschecker
655 -- failure code. It updates all the
656 -- unapproved invoice distributions associated for a invoice if
657 -- p_dist_line_num is null or a particular invoice distribution line if
658 -- p_dist_line_num is provided with the given packet_id. It then retrieves
659 -- the gl_fundschecker failure result code and determines which message to
660 -- return to let the user know why fundschecking failed.
661 --
662 -- Parameters:
663 --
664 -- p_invoice_id: Invoice Id
665 --
666 -- p_dist_line_num: Dist Line Number (if null, updates the whole invoice
667 -- with the packet_id, otherwise only updates this
668 -- invoice distribution line)
669 --
670 -- p_packet_id: Packet Id
671 --
672 -- p_return_message_name: Variable to contain the return message name
673 -- of why fundschecking failed to be populated by
674 -- the procedure.
675 --
676 -- p_calling_sequence: Debugging string to indicate path of module calls to be
677 -- printed out NOCOPY upon error.
678 --============================================================================
679
680 PROCEDURE Process_Fundschk_Failure_Code(p_invoice_id IN NUMBER,
681 p_dist_line_num IN NUMBER,
682 p_packet_id IN NUMBER,
683 p_return_message_name IN OUT NOCOPY VARCHAR2,
684 p_calling_sequence IN VARCHAR2) IS
685 BEGIN
686 null;
687 END Process_Fundschk_Failure_Code;
688
689
690 --============================================================================
691 -- UPDATE_INVDISTS_WTH_PACKETID: Procedure to update all the upapproved dist
692 -- in an invoice if p_dist_line_num is null
693 -- or a particular invoice distribution line,
694 -- if p_dist_line_num is provided.
695 --
696 -- Parameters:
697 --
698 -- p_invoice_id: Invoice Id
699 --
700 -- p_dist_line_num: Dist Line Number (if null, updates the whole invoice
701 -- with the packet_id, otherwise only updates this
702 -- invoice distribution line)
703 --
704 -- p_packet_id: Packet Id
705 --
706 --============================================================================
707
708 PROCEDURE Update_InvDists_Wth_PacketId(p_invoice_id IN NUMBER,
709 p_dist_line_num IN NUMBER,
710 p_packet_id IN NUMBER) IS
711 BEGIN
712 null;
713 END Update_InvDists_Wth_PacketId;
714
715
716 --============================================================================
717 -- GET_GL_FUNDSCHK_RESULT_CODE: Procedure to retrieve the GL_Fundschecker
718 -- result code after the GL_Fundschecker has
719 -- been run.
720 --
721 -- Parameters:
722 --
723 -- p_packet_id: Packet Id
724 --
725 -- p_fc_result_code: Variable to contain the gl_fundschecker result code
726 --
727 --============================================================================
728
729 PROCEDURE Get_GL_FundsChk_Result_Code(p_packet_id IN NUMBER,
730 p_fc_result_code IN OUT NOCOPY VARCHAR2) IS
731 BEGIN
732 null;
733 END Get_GL_FundsChk_Result_Code;
734
735
736 --============================================================================
737 -- UPDATE_INVDIST_WTH_ENCUM_FLAG: Procedure that sets the encumbrance_flag
738 -- to the given encumbrance_flag for the
739 -- given invoice_id with the given packet_id.
740 --============================================================================
741
742 PROCEDURE Update_InvDist_Wth_Encum_Flag(p_invoice_id IN NUMBER,
743 p_packet_id IN NUMBER,
744 p_encum_flag IN VARCHAR2,
745 p_calling_sequence IN VARCHAR2) IS
746 BEGIN
747
748 null;
749 END Update_InvDist_Wth_Encum_Flag;
750
751
752 --============================================================================
753 -- PROCESS_FUNDSRESV_FAIL_CODE: Procedure to process the gl_fundschecker
754 -- failure code. It tretrieves the
755 -- gl_fundschecker result code and determines whether insufficient funds
756 -- or cant funds check exists and retunrs those values.
757 --
758 -- Parameters:
759 --
760 -- p_invoice_id: Invoice Id
761 --
762 -- p_packet_id: Packet Id
763 --
764 -- p_insuff_funds_exists: Variable to be set if insufficent funds exists.
765 --
766 -- p_cant_fundschk_exists: Variable to be set if insufficent funds exists.
767 --
768 -- p_calling_sequence: Debugging string to indicate path of module calls to be
769 -- printed out NOCOPY upon error.
770 --============================================================================
771 PROCEDURE Process_FundsResv_Fail_Code(p_invoice_id IN NUMBER,
772 p_packet_id IN NUMBER,
773 p_insuff_funds_exists IN OUT NOCOPY VARCHAR2,
774 p_cant_fundsck_exists IN OUT NOCOPY VARCHAR2,
775 p_calling_sequence IN VARCHAR2) IS
776 BEGIN
777
778 null;
779 END Process_FundsResv_Fail_Code;
780
781 -- Short-named procedure for logging
782
783 PROCEDURE Log(msg IN VARCHAR2,
784 loc IN VARCHAR2) IS
785 BEGIN
786
787 null;
788 --AP_LOGGING_PKG.AP_Log(msg, loc);
789 END Log;
790
791 END FV_AP_PREPAY_PKG_PVT;