DBA Data[Home] [Help]

PACKAGE: APPS.AP_ETAX_SERVICES_PKG

Source


1 PACKAGE AP_ETAX_SERVICES_PKG AS
2 /* $Header: apetxsrs.pls 120.10.12010000.2 2008/12/16 07:14:25 hchaudha ship $ */
3 
4   -- Define structure to pass tax hold codes to release
5   TYPE Rel_Hold_Codes_Type IS TABLE OF ap_holds_all.hold_lookup_code%TYPE INDEX BY BINARY_INTEGER;
6 
7 /*=============================================================================
8  |  FUNCTION - Calculate()
9  |
10  |  DESCRIPTION
11  |      Public function that will call the calculate_tax service for
12  |      calculation and recalculation.
13  |      This API assumes the calling code controls the commit cycle.
14  |      This function returns TRUE if the call to the service is successful.
15  |      Otherwise, FALSE.
16  |
17  |  PARAMETERS
18  |      P_Invoice_Id - invoice id
19  |      P_Line_Number - This parameter will be used to allow this API to
20  |                      calculate tax only for the line specified in this
21  |                      parameter.  Additionally, this parameter will be used
22  |                      to determine the PREPAY line created for prepayment
23  |                      unapplications.
24  |      P_Calling_Mode - calling mode.  Identifies which service to call
25  |      P_All_Error_Messages - Should API return 1 error message or allow
26  |                             calling point to get them from message stack
27  |      P_error_code - Error code to be returned
28  |      P_calling_sequence -  Calling sequence
29  |
30  |  MODIFICATION HISTORY
31  |    DATE          Author         Action
32  |    07-OCT-2003   SYIDNER        Created
33  |
34  *============================================================================*/
35   FUNCTION Calculate(
36              P_Invoice_id              IN NUMBER,
37              P_Line_Number             IN NUMBER,
38              P_Calling_Mode            IN VARCHAR2,
39              P_All_Error_Messages      IN VARCHAR2,
40              P_Error_Code              OUT NOCOPY VARCHAR2,
41              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
42 
43 /*=============================================================================
44  |  FUNCTION - Calculate_Import()
45  |
46  |  DESCRIPTION
47  |      Public function that will call the calculate_tax service for
48  |      calculation and recalculation from the import program.
49  |      This new calling mode is required to avoid the repopulation of the eTax
50  |      global temp tables
51  |      This API assumes the calling code controls the commit cycle.
52  |      This function returns TRUE if the call to the service is successful.
53  |      Otherwise, FALSE.
54  |
55  |  PARAMETERS
56  |      P_Invoice_Id - invoice id
57  |      P_Calling_Mode - calling mode.  Identifies which service to call
58  |      P_Interface_Invoice_Id - Interface invoice id
59  |      P_All_Error_Messages - Should API return 1 error message or allow
60  |                             calling point to get them from message stack
61  |      P_error_code - Error code to be returned
62  |      P_calling_sequence -  Calling sequence
63  |
64  |  MODIFICATION HISTORY
65  |    DATE          Author         Action
66  |    14-JAN-2004   SYIDNER        Created
67  |
68  *============================================================================*/
69   FUNCTION Calculate_Import(
70              P_Invoice_Id              IN NUMBER,
71              P_Calling_Mode            IN VARCHAR2,
72              P_Interface_Invoice_Id    IN NUMBER,
73              P_All_Error_Messages      IN VARCHAR2,
74              P_Error_Code              OUT NOCOPY VARCHAR2,
75              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
76 
77 /*=============================================================================
78  |  FUNCTION - Distribute()
79  |
80  |  DESCRIPTION
81  |      Public function that will call the determine_recovery service for
82  |      distribution and redistribution.
83  |      This API assumes the calling code controls the commit cycle.
84  |      This function returns TRUE if the call to the service is successful.
85  |      Otherwise, FALSE.
86  |
87  |  PARAMETERS
88  |      P_Invoice_Id - invoice id
89  |      P_Line_Number - This parameter will be used to allow this API to
90  |                      distribute tax only for the line specified in this
91  |                      parameter.
92  |      P_Calling_Mode - calling mode.  Identifies which service to call
93  |      P_All_Error_Messages - Should API return 1 error message or allow
94  |                             calling point to get them from message stack
95  |      P_error_code - Error code to be returned
96  |      P_calling_sequence -  Calling sequence
97  |
98  |  MODIFICATION HISTORY
99  |    DATE          Author         Action
100  |    07-OCT-2003   SYIDNER        Created
101  |
102  *============================================================================*/
103   FUNCTION Distribute(
104              P_Invoice_id              IN NUMBER,
105              P_Line_Number             IN NUMBER,
106              P_Calling_Mode            IN VARCHAR2,
107              P_All_Error_Messages      IN VARCHAR2,
108              P_Error_Code              OUT NOCOPY VARCHAR2,
109              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
110 
111 /*=============================================================================
112  |  FUNCTION - Distribute_Import()
113  |
114  |  DESCRIPTION
115  |      Public function that will call the determine_recovery service for
116  |      distribution during the import.  This API will called only in the case
117  |      TAX-ONLY lines exist in the invoice.
118  |      This API assumes the calling code controls the commit cycle.
119  |      This function returns TRUE if the call to the service is successful.
120  |      Otherwise, FALSE.
121  |
122  |  PARAMETERS
123  |      P_Invoice_Id - invoice id
124  |      P_Calling_Mode - calling mode.  Identifies which service to call
125  |      P_All_Error_Messages - Should API return 1 error message or allow
126  |                             calling point to get them from message stack
127  |      P_error_code - Error code to be returned
128  |      P_calling_sequence -  Calling sequence
129  |
130  |  MODIFICATION HISTORY
131  |    DATE          Author         Action
132  |    20-JAN-2004   SYIDNER        Created
133  |
134  *============================================================================*/
135   FUNCTION Distribute_Import(
136              P_Invoice_id              IN NUMBER,
137              P_Calling_Mode            IN VARCHAR2,
138              P_All_Error_Messages      IN VARCHAR2,
139              P_Error_Code              OUT NOCOPY VARCHAR2,
140              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
141 
142 /*=============================================================================
143  |  FUNCTION - Import_Interface()
144  |
145  |  DESCRIPTION
146  |      Public function that will call the import_document_with_tax service for
147  |      distribution and redistribution.
148  |      This API assumes the calling code controls the commit cycle.
149  |      This function returns TRUE if the call to the service is successful.
150  |      Otherwise, FALSE.
151  |
152  |  PARAMETERS
153  |      P_Invoice_Id - invoice id
154  |      P_Calling_Mode - calling mode.  Identifies which service to call
155  |      P_Interface_Invoice_Id - Interface invoice id
156  |      P_All_Error_Messages - Should API return 1 error message or allow
157  |                             calling point to get them from message stack
158  |      P_error_code - Error code to be returned
159  |      P_calling_sequence -  Calling sequence
160  |
161  |  MODIFICATION HISTORY
162  |    DATE          Author         Action
163  |    07-OCT-2003   SYIDNER        Created
164  |
165  *============================================================================*/
166   FUNCTION Import_Interface(
167              P_Invoice_id              IN NUMBER,
168              P_Calling_Mode            IN VARCHAR2,
169              P_Interface_Invoice_Id    IN NUMBER,
170              P_All_Error_Messages      IN VARCHAR2,
171              P_Error_Code              OUT NOCOPY VARCHAR2,
172              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
173 
174 /*=============================================================================
175  |  FUNCTION - Reverse_Invoice()
176  |
177  |  DESCRIPTION
178  |      Public function that will call the reverse_document_distribution
179  |      service for quick credit (full reversal.)
180  |      This API assumes the calling code controls the commit cycle.
181  |      This function returns TRUE if the call to the service is successful.
182  |      Otherwise, FALSE.
183  |
184  |  PARAMETERS
185  |      P_Invoice_Id - invoice id
186  |      P_Calling_Mode - calling mode.  Identifies which service to call
187  |      P_All_Error_Messages - Should API return 1 error message or allow
188  |                             calling point to get them from message stack
189  |      P_error_code - Error code to be returned
190  |      P_calling_sequence -  Calling sequence
191  |
192  |  MODIFICATION HISTORY
193  |    DATE          Author         Action
194  |    07-OCT-2003   SYIDNER        Created
195  |
196  *============================================================================*/
197   FUNCTION Reverse_Invoice(
198              P_Invoice_id              IN NUMBER,
199              P_Calling_Mode            IN VARCHAR2,
200              P_All_Error_Messages      IN VARCHAR2,
201              P_Error_Code              OUT NOCOPY VARCHAR2,
202              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
203 
204 /*=============================================================================
205  |  FUNCTION - Override_Tax()
206  |
207  |  DESCRIPTION
208  |      Public function that will call the override_tax service.
209  |      This API assumes the calling code controls the commit cycle.
210  |      This function returns TRUE if the call to the service is successful.
211  |      Otherwise, FALSE.
212  |
213  |  PARAMETERS
214  |      P_Invoice_Id         - invoice id
215  |      P_Calling_Mode       - calling mode.  Identifies which service to call
216  |      P_Override_Status    - override_status parameter returned by the eTax
217  |                             UI (Tax lines and summary lines window).
218  |      P_Event_id	     - Indicates a specific instance of the override event.
219  |                             Tax line windows will return an event_id when there
220  |                             are any user overrides.
221  |      P_All_Error_Messages - Should API return 1 error message or allow
222  |                             calling point to get them from message stack
223  |      P_error_code         - Error code to be returned
224  |      P_calling_sequence   -  Calling sequence
225  |
226  |  MODIFICATION HISTORY
227  |    DATE          Author         Action
228  |    07-OCT-2003   SYIDNER        Created
229  |
230  *============================================================================*/
231 
232   FUNCTION Override_Tax(
233              P_Invoice_id              IN NUMBER,
234              P_Calling_Mode            IN VARCHAR2,
235              P_Override_Status         IN VARCHAR2,
236              P_Event_Id		       IN NUMBER,
237              P_All_Error_Messages      IN VARCHAR2,
238              P_Error_Code              OUT NOCOPY VARCHAR2,
239              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
240 
241 /*=============================================================================
242  |  FUNCTION - Override_Recovery()
243  |
244  |  DESCRIPTION
245  |      Public function that will call the override_recovery service.
246  |      This API assumes the calling code controls the commit cycle.
247  |      This function returns TRUE if the call to the service is successful.
248  |      Otherwise, FALSE.
249  |
250  |  PARAMETERS
251  |      P_Invoice_Id - invoice id
252  |      P_Calling_Mode - calling mode.  Identifies which service to call
253  |      P_All_Error_Messages - Should API return 1 error message or allow
254  |                             calling point to get them from message stack
255  |      P_error_code - Error code to be returned
256  |      P_calling_sequence -  Calling sequence
257  |
258  |  MODIFICATION HISTORY
259  |    DATE          Author         Action
260  |    07-OCT-2003   SYIDNER        Created
261  |
262  *============================================================================*/
263   FUNCTION Override_Recovery(
264              P_Invoice_id              IN NUMBER,
265              P_Calling_Mode            IN VARCHAR2,
266              P_All_Error_Messages      IN VARCHAR2,
267              P_Error_Code              OUT NOCOPY VARCHAR2,
268              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
269 
270 --Bug7592845
271 /*=============================================================================
272  |  FUNCTION - Freeze_itm_Distributions()
273  |
274  |  DESCRIPTION
275  |      Public function that will call the freeze_tax_dists_for_items service.
276  |      This API assumes the calling code controls the commit cycle.
277  |      This function returns TRUE if the call to the service is successful.
278  |      Otherwise, FALSE.
279  |
280  |  PARAMETERS
281  |      P_Invoice_header_rec - invoice record
282  |      P_Calling_Mode - calling mode.  Identifies which service to call
283  |      P_Event_Class_Code - Event class code for the invoice type
284  |      P_All_Error_Messages - Should API return 1 error message or allow
285  |                             calling point to get them from message stack
286  |      P_error_code - Error code to be returned
287  |      P_calling_sequence -  Calling sequence
288  |
289  |  MODIFICATION HISTORY
290  |    DATE                  Author                             Action
291  |    11-DEC-2008   SCHITLAP/HCHAUDHA        Created
292  |
293  *============================================================================*/
294   FUNCTION Freeze_itm_Distributions(
295              P_Invoice_Header_Rec      IN ap_invoices_all%ROWTYPE,
296              P_Calling_Mode            IN VARCHAR2,
297              P_Event_Class_Code        IN VARCHAR2,
298              P_All_Error_Messages      IN VARCHAR2,
299              P_Error_Code              OUT NOCOPY VARCHAR2,
300              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
301 --Bug7592845
302 
303 /*=============================================================================
304  |  FUNCTION - Freeze_Distributions()
305  |
306  |  DESCRIPTION
307  |      Public function that will call the freeze_tax_distributions service.
308  |      This API assumes the calling code controls the commit cycle.
309  |      This function returns TRUE if the call to the service is successful.
310  |      Otherwise, FALSE.
311  |
312  |  PARAMETERS
313  |      P_Invoice_header_rec - invoice record
314  |      P_Calling_Mode - calling mode.  Identifies which service to call
315  |      P_Event_Class_Code - Event class code for the invoice type
316  |      P_All_Error_Messages - Should API return 1 error message or allow
317  |                             calling point to get them from message stack
318  |      P_error_code - Error code to be returned
319  |      P_calling_sequence -  Calling sequence
320  |
321  |  MODIFICATION HISTORY
322  |    DATE          Author         Action
323  |    07-OCT-2003   SYIDNER        Created
324  |
325  *============================================================================*/
326   /*FUNCTION Freeze_Distributions(
327              P_Invoice_Header_Rec      IN ap_invoices_all%ROWTYPE,
328              P_Calling_Mode            IN VARCHAR2,
329              P_Event_Class_Code        IN VARCHAR2,
330              P_All_Error_Messages      IN VARCHAR2,
331              P_Error_Code              OUT NOCOPY VARCHAR2,
332              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;*/
333 --Bug7592845
334 
335 /*=============================================================================
336  |  FUNCTION - Global_Document_Update()
337  |
338  |  DESCRIPTION
339  |      Public function that will call the global_document_update service to
340  |      inform eTax of a cancellation of an invoice, the freeze after the
344  |      This function returns TRUE if the call to the service is successful.
341  |      invoice is validated (meaning is ready to reporting), and the unfreeze
342  |      of an invoice because it has to be modified after it was validated.
343  |      This API assumes the calling code controls the commit cycle.
345  |      Otherwise, FALSE.
346  |
347  |  PARAMETERS
348  |      P_Invoice_Id - invoice id
349  |      P_Calling_Mode - calling mode.  Identifies which service to call
350  |      P_All_Error_Messages - Should API return 1 error message or allow
351  |                             calling point to get them from message stack
352  |      P_error_code - Error code to be returned
353  |      P_calling_sequence -  Calling sequence
354  |
355  |  MODIFICATION HISTORY
356  |    DATE          Author         Action
357  |    07-OCT-2003   SYIDNER        Created
358  |                                 Added p_line_number so that the same
359  |                                 routine can be used while discarding
360  |                                 an invoice line.
361  *============================================================================*/
362   FUNCTION Global_Document_Update(
363              P_Invoice_id              IN NUMBER,
364              P_Line_Number	       IN NUMBER DEFAULT NULL,
365              P_Calling_Mode            IN VARCHAR2,
366              P_All_Error_Messages      IN VARCHAR2,
367              P_Error_Code              OUT NOCOPY VARCHAR2,
368              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
369 
370 /*=============================================================================
371  |  FUNCTION - Release_Tax_Holds()
372  |
373  |  DESCRIPTION
374  |      Public function that will call the global_document_update service to
375  |      inform eTax the release of tax holds by the user.
376  |      This function returns TRUE if the call to the service is successful.
377  |      Otherwise, FALSE.
378  |
379  |  PARAMETERS
380  |      P_Invoice_Id - invoice id
381  |      P_Calling_Mode - calling mode.  Identifies which service to call
382  |      P_Tax_Hold_Code - Tax hold codes released in AP
383  |      P_All_Error_Messages - Should API return 1 error message or allow
384  |                             calling point to get them from message stack
385  |      P_error_code - Error code to be returned
386  |      P_calling_sequence -  Calling sequence
387  |
388  |  MODIFICATION HISTORY
389  |    DATE          Author         Action
390  |    05-NOV-2003   SYIDNER        Created
391  |
392  *============================================================================*/
393   FUNCTION Release_Tax_Holds(
394              P_Invoice_id              IN NUMBER,
395              P_Calling_Mode            IN VARCHAR2,
396              P_Tax_Hold_Code           IN Rel_Hold_Codes_Type,
397              P_All_Error_Messages      IN VARCHAR2,
398              P_Error_Code              OUT NOCOPY VARCHAR2,
399              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
400 
401 /*=============================================================================
402  |  FUNCTION - Mark_Tax_Lines_Deleted()
403  |
404  |  DESCRIPTION
405  |      Public function that will call the mark_tax_lines_deleted service.
406  |      This API assumes the calling code controls the commit cycle.
407  |      This function returns TRUE if the call to the service is successful.
408  |      Otherwise, FALSE.
409  |
410  |  PARAMETERS
411  |      P_Invoice_Id - invoice id
412  |      P_Calling_Mode - calling mode.  Identifies which service to call
413  |      P_Line_Number_To_Delete - Tax Line to delete
414  |      P_All_Error_Messages - Should API return 1 error message or allow
415  |                             calling point to get them from message stack
416  |      P_error_code - Error code to be returned
417  |      P_calling_sequence -  Calling sequence
418  |
419  |  MODIFICATION HISTORY
420  |    DATE          Author         Action
421  |    07-OCT-2003   SYIDNER        Created
422  |    05-NOV-2003   SYIDNER        Included new P_Line_Number_To_Delete
423  |                                 parameter
424  |
425  *============================================================================*/
426   FUNCTION Mark_Tax_Lines_Deleted(
427              P_Invoice_id              IN NUMBER,
428              P_Calling_Mode            IN VARCHAR2,
429              P_Line_Number_To_Delete   IN NUMBER,
430              P_All_Error_Messages      IN VARCHAR2,
431              P_Error_Code              OUT NOCOPY VARCHAR2,
432              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
433 
434 
435 /*=============================================================================
436  |  FUNCTION - Validate_Invoice()
437  |
438  |  DESCRIPTION
439  |      Public function that will call the validate_document_for_tax service.
440  |      This API assumes the calling code controls the commit cycle.
441  |      This function returns TRUE if the call to the service is successful.
442  |      Otherwise, FALSE.
443  |
444  |  PARAMETERS
445  |      P_Invoice_Id - invoice id
446  |      P_Calling_Mode - calling mode.  Identifies which service to call
447  |      P_All_Error_Messages - Should API return 1 error message or allow
448  |                             calling point to get them from message stack
449  |      P_error_code - Error code to be returned
450  |      P_calling_sequence -  Calling sequence
451  |
455  |
452  |  MODIFICATION HISTORY
453  |    DATE          Author         Action
454  |    07-OCT-2003   SYIDNER        Created
456  *============================================================================*/
457   FUNCTION Validate_Invoice(
458              P_Invoice_id              IN NUMBER,
459              P_Calling_Mode            IN VARCHAR2,
460              P_All_Error_Messages      IN VARCHAR2,
461              P_Error_Code              OUT NOCOPY VARCHAR2,
462              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
463 
464 /*=============================================================================
465  |  FUNCTION - Validate_Default_Import()
466  |
467  |  DESCRIPTION
468  |      Public function that will call the validate_and_default_tax_attr service.
469  |      This API assumes the calling code controls the commit cycle.
470  |      This function returns TRUE if the call to the service is successful.
471  |      Otherwise, FALSE.
472  |      This API will validate the taxable and tax lines to be imported regarding
473  |      tax.  The lines will be passed to this API using the pl/sql structures
474  |      defined in the import process.
475  |      The service validate_and_default_tax_attr will default any possible tax
476  |      value, and this API will modify the pl/sql structures with the defaulted
477  |      tax info.
478  |
479  |  PARAMETERS
480  |      p_invoice_rec - record defined in the import program for the invoice header
481  |      p_invoice_lines_tab - array with the taxable and tax lines
482  |      P_Calling_Mode - calling mode.  Identifies which service to call
483  |      P_All_Error_Messages - Should API return 1 error message or allow
484  |                             calling point to get them from message stack
485  |      p_invoice_status - returns N if the invoice should be rejected.
486  |      P_error_code - Error code to be returned
487  |      P_calling_sequence -  Calling sequence
488  |
489  |  MODIFICATION HISTORY
490  |    DATE          Author         Action
491  |    20-JAN-2004   SYIDNER        Created
492  |
493  *============================================================================*/
494   FUNCTION Validate_Default_Import(
495              P_Invoice_Rec             IN OUT NOCOPY
496                AP_IMPORT_INVOICES_PKG.r_invoice_info_rec,
497              p_invoice_lines_tab       IN OUT NOCOPY
498                AP_IMPORT_INVOICES_PKG.t_lines_table,
499              P_Calling_Mode            IN VARCHAR2,
500              P_All_Error_Messages      IN VARCHAR2,
501              p_invoice_status          OUT NOCOPY VARCHAR2,
502              P_Error_Code              OUT NOCOPY VARCHAR2,
503              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
504 
505 /*=============================================================================
506  |  FUNCTION - Populate_Headers_GT()
507  |
508  |  DESCRIPTION
509  |      This function will get additional information required to populate the
510  |      ZX_TRANSACTION_HEADERS_GT
511  |      This function returns TRUE if the insert to the temp table goes
512  |      through successfully.  Otherwise, FALSE.
513  |
514  |  PARAMETERS
515  |      P_Invoice_Header_Rec - record with invoice header information
516  |      P_Calling_Mode - calling mode. it is used to
517  |      P_eTax_Already_called_flag - Flag to know if this is the first time tax
518  |                                   has been called
519  |      P_Event_Class_Code - Evnet class code
520  |      P_Event_Type_Code - Event Class Code
521  |      P_error_code - Error code to be returned
522  |      P_calling_sequence -  Calling sequence
523  |
524  |  MODIFICATION HISTORY
525  |    DATE          Author         Action
526  |    07-OCT-2003   SYIDNER        Created
527  |
528  *============================================================================*/
529   FUNCTION Populate_Headers_GT(
530              P_Invoice_Header_Rec        IN ap_invoices_all%ROWTYPE,
531              P_Calling_Mode              IN VARCHAR2,
532              P_eTax_Already_called_flag  IN VARCHAR2,
533              P_Event_Class_Code          OUT NOCOPY VARCHAR2,
534              P_Event_Type_Code           OUT NOCOPY VARCHAR2,
535              P_Error_Code                OUT NOCOPY VARCHAR2,
536              P_Calling_Sequence          IN VARCHAR2) RETURN BOOLEAN;
537 
538 /*=============================================================================
539  |  FUNCTION - Populate_Header_Import_GT()
540  |
541  |  DESCRIPTION
542  |    This function will get additional information required to populate the
543  |    ZX_TRANSACTION_HEADERS_GT from the import array structure.
544  |    This function returns TRUE if the insert to the temp table goes
545  |    through successfully.  Otherwise, FALSE.
546  |
547  |  PARAMETERS
548  |    P_Invoice_Header_Rec - record with invoice header information
549  |    P_Calling_Mode - calling mode. it is used to
550  |    P_Event_Class_Code - Event class code
551  |    P_Event_Type_Code - Event type code
552  |    P_error_code - Error code to be returned
553  |    P_calling_sequence -  Calling sequence
554  |
555  |  MODIFICATION HISTORY
556  |    DATE          Author         Action
557  |    20-JAN-2004   SYIDNER        Created
558  |
559 *============================================================================*/
560   FUNCTION Populate_Header_Import_GT(
561              P_Invoice_Header_Rec        IN AP_IMPORT_INVOICES_PKG.r_invoice_info_rec,
562              P_Calling_Mode              IN VARCHAR2,
563              P_Event_Class_Code          OUT NOCOPY VARCHAR2,
567 
564              P_Event_Type_Code           OUT NOCOPY VARCHAR2,
565              P_Error_Code                OUT NOCOPY VARCHAR2,
566              P_Calling_Sequence          IN VARCHAR2) RETURN BOOLEAN;
568 /*=============================================================================
569  |  FUNCTION - Populate_Lines_GT()
570  |
571  |  DESCRIPTION
572  |      This function will get additional information required to populate the
573  |      ZX_TRANSACTION_LINES_GT
574  |      This function returns TRUE if the population of the temp table goes
575  |      through successfully.  Otherwise, FALSE.
576  |
577  |  PARAMETERS
578  |      P_Invoice_Header_Rec - record with invoice header information
579  |      P_Calling_Mode - calling mode. it is used to
580  |      P_Event_Class_Code - Event class code for document
581  |      P_Line_Number - prepay line number to be unapplied
582  |      P_error_code - Error code to be returned
583  |      P_calling_sequence -  Calling sequence
584  |
585  |  MODIFICATION HISTORY
586  |    DATE          Author         Action
587  |    09-OCT-2003   SYIDNER        Created
588  |
589  *============================================================================*/
590   FUNCTION Populate_Lines_GT(
591              P_Invoice_Header_Rec      IN ap_invoices_all%ROWTYPE,
592              P_Calling_Mode            IN VARCHAR2,
593              P_Event_Class_Code        IN VARCHAR2,
594              P_Line_Number             IN NUMBER DEFAULT NULL,
595              P_Error_Code              OUT NOCOPY VARCHAR2,
596              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
597 
598 /*=============================================================================
599  |  FUNCTION - Populate_Lines_Import_GT()
600  |
601  |  DESCRIPTION
602  |      This function will get additional information required to populate the
603  |      ZX_TRANSACTION_LINES_GT
604  |      This function returns TRUE if the population of the temp table goes
605  |      through successfully.  Otherwise, FALSE.
606  |
607  |  PARAMETERS
608  |      P_Invoice_Header_Rec - record with invoice header information
609  |      P_Invoice_Lines_Tab - List of trx and tax lines for the invoice
610  |        existing in the ap_invoice_lines_interface table
611  |      P_Calling_Mode - calling mode. it is used to
612  |      P_Event_Class_Code - Event class code for document
613  |      P_error_code - Error code to be returned
614  |      P_calling_sequence -  Calling sequence
615  |
616  |  MODIFICATION HISTORY
617  |    DATE          Author         Action
618  |    20-JAN-2004   SYIDNER        Created
619  |
620  *============================================================================*/
621   FUNCTION Populate_Lines_Import_GT(
622              P_Invoice_Header_Rec      IN AP_IMPORT_INVOICES_PKG.r_invoice_info_rec,
623              P_Inv_Line_List           IN AP_IMPORT_INVOICES_PKG.t_lines_table,
624              P_Calling_Mode            IN VARCHAR2,
625              P_Event_Class_Code        IN VARCHAR2,
626              P_Error_Code              OUT NOCOPY VARCHAR2,
627              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
628 
629 /*=============================================================================
630  |  FUNCTION - Populate_Tax_Lines_GT()
631  |
632  |  DESCRIPTION
633  |      This function will get additional information required to populate the
634  |      ZX_TRANSACTION_LINES_GT, and  ZX_IMPORT_TAX_LINES_GT.
635  |      There is no need to populate ZX_TRX_TAX_LINK_GT since any tax line
636  |      manually created is assume to be allocated to all the ITEM lines in the
637  |      invoice.
638  |      This function returns TRUE if the population of the temp table goes
639  |      through successfully.  Otherwise, FALSE.
640  |
641  |  PARAMETERS
642  |      P_Invoice_Header_Rec - record with invoice header information
643  |      P_Calling_Mode - calling mode. it is used to
644  |      P_Event_Class_Code - Event class code for document
645  |      P_Tax_only_Flag - Indicates if the invoice is tax only
646  |      P_Inv_Rcv_Matched - determine if the invoice has any line matched to a
647  |                          receipt
648  |      P_error_code - Error code to be returned
649  |      P_calling_sequence -  Calling sequence
650  |
651  |  MODIFICATION HISTORY
652  |    DATE          Author         Action
653  |    06-FEB-2004   SYIDNER        Created
654  |
655  *============================================================================*/
656   FUNCTION Populate_Tax_Lines_GT(
657              P_Invoice_Header_Rec      IN ap_invoices_all%ROWTYPE,
658              P_Calling_Mode            IN VARCHAR2,
659              P_Event_Class_Code        IN VARCHAR2,
660              P_Tax_Only_Flag           IN VARCHAR2,
661              P_Inv_Rcv_Matched         IN OUT NOCOPY VARCHAR2,
662              P_Error_Code              OUT NOCOPY VARCHAR2,
663              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
664 
665 /*=============================================================================
666  |  FUNCTION - Populate_Distributions_GT()
667  |
668  |  DESCRIPTION
669  |      This function will get additional information required to populate the
670  |      ZX_DISTRIBUTION_LINES_GT
671  |      This function returns TRUE if the population of the temp table goes
672  |      through successfully.  Otherwise, FALSE.
673  |
674  |  PARAMETERS
678  |      P_Event_Type_Code - Evnet type code
675  |      P_Invoice_Header_Rec - record with invoice header information
676  |      P_Calling_Mode - calling mode. it is used to
677  |      P_Event_Class_Code - Event class code for document
679  |      P_error_code - Error code to be returned
680  |      P_calling_sequence -  Calling sequence
681  |
682  |  MODIFICATION HISTORY
683  |    DATE          Author         Action
684  |    20-OCT-2003   SYIDNER        Created
685  |
686  *============================================================================*/
687   FUNCTION Populate_Distributions_GT(
688              P_Invoice_Header_Rec      IN ap_invoices_all%ROWTYPE,
689              P_Calling_Mode            IN VARCHAR2,
690              P_Event_Class_Code        IN VARCHAR2,
691              P_Event_Type_Code         IN VARCHAR2,
692              P_Error_Code              OUT NOCOPY VARCHAR2,
693              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
694 
695 
696 /*=============================================================================
697  |  FUNCTION - Update_AP()
698  |
699  |  DESCRIPTION
700  |      This function will handle the return of values from the eTax repository
701  |      This will be called from all the functions that call the etax services
702  |      in the case the call is successfull.
703  |
704  |  PARAMETERS
705  |      P_Invoice_header_rec - Invoice header info
706  |      P_Calling_Mode - calling mode.
707  |      P_All_Error_Messages - Should API return 1 error message or allow
708  |                             calling point to get them from message stack
709  |      P_error_code - Error code to be returned
710  |      P_calling_sequence -  Calling sequence
711  |
712  |  MODIFICATION HISTORY
713  |    DATE          Author         Action
714  |    20-OCT-2003   SYIDNER        Created
715  |
716  *============================================================================*/
717   FUNCTION Update_AP(
718              P_Invoice_header_rec      IN ap_invoices_all%ROWTYPE,
719              P_Calling_Mode            IN VARCHAR2,
720              P_All_Error_Messages      IN VARCHAR2,
721              P_Error_Code              OUT NOCOPY VARCHAR2,
722              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
723 
724 /*=============================================================================
725  |  FUNCTION - Calculate_Quote ()
726  |
727  |  DESCRIPTION
728  |      This function will return the tax amount and indicate if it is inclusive.
729  |      This will be called from the recurring invoices form. This is a special
730  |      case, as the invoices for which the tax is to be calculated are not yet
731  |      saved to the database and eBTax global temporary tables are populated
732  |      based on the parameters. A psuedo-line is inserted into the GTT and
733  |      removed after the tax amount is calculated.
734  |
735  |  PARAMETERS
736  |      P_Invoice_header_rec 	- Invoice header info
737  |      P_Invoice_Lines_Rec	- Invoice lines info
738  |      P_Calling_Mode 		- Calling mode. (CALCULATE_QUOTE)
742  |      P_calling_sequence 	- Calling sequence
739  |      P_All_Error_Messages 	- Should API return 1 error message or allow
740  |                                calling point to get them from message stack
741  |      P_error_code 		- Error code to be returned
743  |
744  |  MODIFICATION HISTORY
745  |    DATE          Author         Action
746  |    13-AUG-2003   Sanjay         Created
747  *============================================================================*/
748   FUNCTION CALCULATE_QUOTE(
749              P_Invoice_Header_Rec      	IN  ap_invoices_all%ROWTYPE,
750              P_Invoice_Lines_Rec	IN  ap_invoice_lines_all%ROWTYPE,
751              P_Calling_Mode            	IN  VARCHAR2,
752              P_Tax_Amount		OUT NOCOPY NUMBER,
753 	     P_Tax_Amt_Included		OUT NOCOPY VARCHAR2,
754              P_Error_Code              	OUT NOCOPY VARCHAR2,
755              P_Calling_Sequence         IN  VARCHAR2) RETURN BOOLEAN;
756 
757  -- Bug 5110693: Added the new function to generate tax for recouped prepay distributions.
758 
759 /*=============================================================================
760  |  FUNCTION - Generate_Recouped_Tax ()
761  |
762  |  DESCRIPTION
763  |      This function will generate tax distribitons for recouped prepay
764  |      distributions.
765  |
766  *============================================================================*/
767   FUNCTION Generate_Recouped_Tax(
768              P_Invoice_id              IN NUMBER,
769 	     P_Invoice_Line_Number     IN NUMBER,
770              P_Calling_Mode            IN VARCHAR2,
771              P_All_Error_Messages      IN VARCHAR2,
772              P_Error_Code              OUT NOCOPY VARCHAR2,
773              P_Calling_Sequence        IN VARCHAR2) RETURN BOOLEAN;
774 
775  -- Bug 5185023: Added the new function to delete preview tax distributions
776 
777 /*=============================================================================
778  |  FUNCTION - Delete_Tax_Distributions ()
779  |
780  |  DESCRIPTION
781  |      This function will delete tax distributions in the etax schema that
782  |      were generated for preview item distributions. This is called in the
783  |      invoice workbench prior to deleting preview distributions.
784  |
785  *============================================================================*/
786 
787   FUNCTION Delete_Tax_Distributions
788                         (p_invoice_id         IN  ap_invoice_distributions_all.invoice_id%Type,
789                          p_calling_mode       IN  VARCHAR2,
790                          p_all_error_messages IN  VARCHAR2,
791                          p_error_code         OUT NOCOPY VARCHAR2,
792                          p_calling_sequence   IN  VARCHAR2) RETURN BOOLEAN;
793 
794 /*=============================================================================
795  |  FUNCTION - Calculate_Tax_Receipt_Match ()
796  |
797  |  DESCRIPTION
798  |      This function will synch tax repository for tax matched to receipts.
799  |
800  *============================================================================*/
801 
802   FUNCTION Calculate_Tax_Receipt_Match(
803 			P_Invoice_Id              IN  NUMBER,
804 			P_Calling_Mode            IN  VARCHAR2,
805 			P_All_Error_Messages      IN  VARCHAR2,
806 			P_Error_Code              OUT NOCOPY VARCHAR2,
807 			P_Calling_Sequence        IN  VARCHAR2) RETURN BOOLEAN;
808 
809 
810 /*=============================================================================
811  |  FUNCTION - Bulk_Populate_Headers_GT ()
812  |
813  |  DESCRIPTION
814  |      This function will populate the invoice headers to the tax staging table
815  |      in bulk during invoice validation.
816  |
817  *============================================================================*/
818 
819   FUNCTION Bulk_Populate_Headers_GT
820 			(p_validation_request_id IN  NUMBER,
821 			 p_calling_mode		 IN  VARCHAR2,
822 	     	 p_error_code		 OUT NOCOPY VARCHAR2) RETURN BOOLEAN;
823 
824   ------
825   TYPE org_rec Is RECORD(
826          bill_to_location_id       hr_all_organization_units.location_id%type);
827 
828   TYPE org_tab IS TABLE OF org_rec
829   INDEX BY PLS_INTEGER;
830 
831   g_org_attributes      org_tab;
832   ------
833 
834   TYPE supplier_site_rec Is RECORD(
835          location_id     ap_supplier_sites_all.location_id%type,
836          fob_lookup_code ap_supplier_sites_all.fob_lookup_code%type);
837 
838   TYPE supplier_site_tab IS TABLE OF supplier_site_rec
839   INDEX BY PLS_INTEGER;
840 
841   g_site_attributes     supplier_site_tab;
842   ------
843 
844   TYPE fsp_rec Is RECORD(
845          inventory_organization_id financials_system_params_all.inventory_organization_id%type);
846 
847   TYPE fsp_tab IS TABLE OF fsp_rec
848   INDEX BY PLS_INTEGER;
849 
850   g_fsp_attributes      fsp_tab;
851 
852   ------
853 
854 
855   --Bugfix: 5565310
856   PROCEDURE get_po_tax_attributes
857                   (p_application_id               IN  NUMBER,
858 		           p_org_id                       IN  NUMBER,
859 		           p_entity_code                  IN  VARCHAR2,
860 		           p_event_class_code             IN  VARCHAR2,
861 		           p_trx_level_type               IN  VARCHAR2,
862 		           p_trx_id                       IN  NUMBER,
863 		           p_trx_line_id                  IN  NUMBER,
864 		           x_line_intended_use            OUT NOCOPY VARCHAR2,
865 		           x_product_type                 OUT NOCOPY VARCHAR2,
866 		           x_product_category             OUT NOCOPY VARCHAR2,
867 		           x_product_fisc_classification  OUT NOCOPY VARCHAR2,
868 		           x_user_defined_fisc_class      OUT NOCOPY VARCHAR2,
869 		           x_assessable_value             OUT NOCOPY NUMBER,
870 		           x_tax_classification_code      OUT NOCOPY VARCHAR2);
871 
872 
873 END AP_ETAX_SERVICES_PKG;