DBA Data[Home] [Help]

PACKAGE: APPS.PA_INTEGRATION

Source


1 PACKAGE pa_integration AUTHID CURRENT_USER AS
2 --$Header: PAXPINTS.pls 120.1 2005/08/08 10:51:04 sbharath noship $
3 
4 
5     /**global variables related to get_raw_cdl_pa_date() and get_raw_cdl_recvr_pa_date() caching **/
9     g_p_earliest_pa_period_name     pa_cost_distribution_lines_all.pa_period_name%TYPE;
6     g_prvdr_org_id                  pa_expenditure_items_all.org_id%TYPE;
7     g_p_earliest_pa_start_date      pa_cost_distribution_lines_all.pa_date%TYPE;
8     g_p_earliest_pa_end_date        pa_cost_distribution_lines_all.pa_date%TYPE;
10     g_prvdr_pa_start_date           pa_cost_distribution_lines_all.pa_date%TYPE;
11     g_prvdr_pa_end_date             pa_cost_distribution_lines_all.pa_date%TYPE;
12     g_prvdr_pa_period_name          pa_cost_distribution_lines_all.pa_period_name%TYPE;
13     g_prvdr_pa_date                 pa_cost_distribution_lines_all.pa_date%TYPE;
14 
15     g_recvr_org_id                  pa_expenditure_items_all.recvr_org_id%TYPE;
16     g_r_earliest_pa_start_date      pa_cost_distribution_lines_all.recvr_pa_date%TYPE;
17     g_r_earliest_pa_end_date        pa_cost_distribution_lines_all.recvr_pa_date%TYPE;
18     g_r_earliest_pa_period_name     pa_cost_distribution_lines_all.recvr_pa_period_name%TYPE;
19     g_recvr_pa_start_date           pa_cost_distribution_lines_all.recvr_pa_date%TYPE;
20     g_recvr_pa_end_date             pa_cost_distribution_lines_all.recvr_pa_date%TYPE;
21     g_recvr_pa_period_name          pa_cost_distribution_lines_all.recvr_pa_period_name%TYPE;
22     g_recvr_pa_date                 pa_cost_distribution_lines_all.recvr_pa_date%TYPE;
23 
24     /**global variables related to pa_date caching **/
25 
26 FUNCTION get_period_name return pa_cost_distribution_lines_all.pa_period_name%TYPE;/*2835063*/
27 
28 
29 /*----------------------------------------------------------------------------*/
30 -- Start of Comments
31 -- API Name      : pending_vi_adjustments_exists
32 -- Type          : Public
33 -- Pre-Reqs      : None
34 -- Function      : checks for any transfers/splits/recalc raw costs in
35 --                 Oracle Projects.  If adjustments exists in Orcale Projects
36 --                 It returns the appropriate message_name, else it returns 'N'.
37 --                 Since this function will be used in select statements, the
38 --                 purity level is WNDS and WNPS.
39 -- Parameters    :
40 -- IN              P_Invoice_id          IN   NUMBER     Required
41 --                          Invoice Identifier, Corresponds to column
42 --                          INVOICE_ID of AP_INVOICES_ALL Table
43 -- RETURNS       : Message_Name, if adjustments exists in Orcale Projects
44 --                 'N'           if no adjustments exists.
45 --
46 -- Version       : 1.0  Initial version
47 -- End of Comments
48 /*----------------------------------------------------------------------------*/
49 
50 FUNCTION pending_vi_adjustments_exists(p_invoice_id IN NUMBER)
51 RETURN varchar2;
52 pragma RESTRICT_REFERENCES (pending_vi_adjustments_exists,WNDS,WNPS);
53 
54 /*----------------------------------------------------------------------------*/
55 -- Start of Comments
56 -- API Name      : check_ap_invoices
57 -- Type          : Public
58 -- Pre-Reqs      : None
59 -- Function      : Calls Oracle Payables API(AP_PA_API_PKG.get_invoice_status).
60 --                 The AP API returns the message_name if adjustments on this
61 --		   invoice have to be prevented. The message_name's returned
62 --                 by this function are as follows.
63 --
64 --  	1) PA_INV_CANCELLED: If the invoice has already been cancelled.
65 --   	2) PA_INV_PREPAY: If the prepayment associated with this item has
66 --     	   been partially or fully paid.
67 --  	3) PA_INV_NOADJUST: If the invoice associated with this
68 --         item has been partially or fully paid and the payables options
69 --     	   setting does not allow you to adjust paid invoices.
70 --  	4) PA_INV_DISC_PRORATE: If the invoice associated with
71 --     	   this item has been partially or fully paid and there are discount
72 --     	   payment distributions associated with the invoice.
73 --  	5) PA_INV_PREPAY_AMOUNT: If a prepayment has been applied to the
74 --     	   supplier invoice associated with this item.
75 --  	6) PA_INV_CASH: If you are running cash basis accounting.
76 --  	7) PA_INV_SEL_PAYMENT: If the invoice associated with this
77 --     	   item has been selected for payment.
78 --  	   ELSE returns 'N'
79 -- Purity        : WNDS, WNPS.
80 -- Parameters    :
81 -- IN              P_Invoice_id          IN   NUMBER     Required
82 --                          Invoice Identifier, Corresponds to column
83 --                          INVOICE_ID of AP_INVOICES_ALL Table
84 --                 P_status_type         IN VARCHAR2     Required
85 --                          Valid values are 'ADJUSTMENTS' and 'TRANSFER'
86 --                          TRANSFER = Checks if invoice is selected for
87 --				       payment
88 --			    ADJUSTMENTS= Checks if invoice is selected for
89 --                                       payment + all other invoice statuses
90 --                                       that should prevent Orcale projects
91 --                                       from doing any kind of adjustments.
92 --
93 -- RETURNS         Message_Name, if adjustments are to be prevented for this
94 --  	    	                 Invoice.
95 --                 'N'           if adjustments are allowed for this invoice.
96 -- End of Comments
97 /*---------------------------------------------------------------------------*/
98 
99 
100 FUNCTION check_ap_invoices(p_invoice_id IN NUMBER,
101 			   p_status_type IN VARCHAR2) RETURN VARCHAR2;
102 pragma RESTRICT_REFERENCES(check_ap_invoices,WNDS,WNPS);
103 
104 /*----------------------------------------------------------------------------*/
105 -- Start of Comments
106 -- API Name      : init_ap_invoices
107 -- Type          : Public
108 -- Pre-Reqs      : None
109 -- Function      : Initializes package body global variable l_invoice_id,
110 --		   l_invoice_status and l_status_type.  This function is used by
114 /*----------------------------------------------------------------------------*/
111 --                  pro*c programs
112 --                 to improve performance.
113 -- Parameters    : None
115 
116 PROCEDURE init_ap_invoices;
117 /*----------------------------------------------------------------------------*/
118 -- Start of Comments
119 -- API Name      : ap_invoice_status
120 -- Type          : Public
121 -- Pre-Reqs      : None
122 -- Function      : The functionality of this function is exactly same as
123 -- 		   check_ap_invoices. It has some performance enhancements for
124 --		   batch and pro*c programs. Another difference is it returns
125 --                 'Y' instead of message_name.
126 -- Parameters    :
127 -- IN              P_Invoice_id          IN   NUMBER     Required
128 --                          Invoice Identifier, Corresponds to column
129 --                          INVOICE_ID of AP_INVOICES_ALL Table
130 --                 P_status_type         IN VARCHAR2     Required
131 --                          Valid values are 'ADJUSTMENTS' and 'TRANSFER'
132 --                          TRANSFER = Checks if invoice is selected for
133 --                                     payment
134 --                          ADJUSTMENTS= Checks if invoice is selected for
135 --                                       payment + all other invoice statuses
136 --                                       that should prevent Orcale projects
137 --                                       from doing any kind of adjustments.
138 /*----------------------------------------------------------------------------*/
139 FUNCTION ap_invoice_status(p_invoice_id IN NUMBER,
140 			   p_status_type IN VARCHAR2) RETURN VARCHAR2;
141 pragma RESTRICT_REFERENCES(ap_invoice_status,WNDS);
142 /*----------------------------------------------------------------------------*/
143 PROCEDURE refresh_pa_cache ( p_org_id   IN NUMBER ,
144                              p_expenditure_item_date  IN DATE ,
145                              p_accounting_date IN DATE,
146                              p_caller_flag     IN VARCHAR2
147                            );
148 pragma RESTRICT_REFERENCES(refresh_pa_cache ,WNDS) ;
149 /*----------------------------------------------------------------------------*/
150 -- Start of Comments
151 -- API Name      : get_raw_cdl_pa_date
152 -- Type          : Public
153 -- Pre-Reqs      : None
154 -- Function      : This function is used by PAVVIT ( transfer supplier Invoices)
155 --                 to Projects, process. Based on the expenditure item date and
156 --                 Accounting date, this function derives PA_DATE for the Raw
157 --                 CDLs to be populated.
158 -- Parameters    :
159 --                 P_Expenditure_Item_date   IN   DATE  Required
160 --                       Expenditure Item date
161 --                 P_Accounting_date  IN DATE  required.
162 --                       The GL Date on which the raw cost was posted from
163 --                       payables module to GL Module
164 --  Since this function will be used in Select the
165 --  Purity level will be WNDS, WNPS.
166 --- FUnction Created for Bug no : 1103257
167 /*----------------------------------------------------------------------------*/
168 FUNCTION   get_raw_cdl_pa_date ( p_expenditure_item_date  IN DATE,
169                                  p_accounting_date        IN DATE,
170                                  p_org_id                    NUMBER
171                                ) RETURN DATE;
172 pragma RESTRICT_REFERENCES(get_raw_cdl_pa_date,WNDS) ;         /** removed WNPS **/
173 /*----------------------------------------------------------------------------*/
174 FUNCTION   get_raw_cdl_recvr_pa_date ( p_expenditure_item_date  IN DATE,
175                                  p_accounting_date   IN DATE,
176                                  p_org_id               NUMBER
177                                ) RETURN DATE;
178 pragma RESTRICT_REFERENCES(get_raw_cdl_recvr_pa_date,WNDS) ;
179 /*----------------------------------------------------------------------------*/
180 -- Start of Comments
181 -- API Name      : get_burden_cdl_pa_date
182 -- Type          : Public
183 -- Pre-Reqs      : None
184 -- Function      : This function is used by FCODTBC ( Distribute burden cost )
185 --                 process. Based on the PA_DATE date for corresponding
186 --                 RAw CDL. This function will be called only if the raw cost
187 --                 type is Supplier invoices.
188 -- Parameters    :
189 --                 P_raw_cdl_pa_date   IN   DATE  Required
190 --                       PA_DATE for corresponding Raw CDL
191 -- Since this function will be used in Select the
192 -- Purity level will be WNDS, WNPS.
193 -- FUnction created for Bug No : 1103257
194 /*----------------------------------------------------------------------------*/
195 FUNCTION   get_burden_cdl_pa_date ( p_raw_cdl_date IN DATE )
196                     RETURN DATE;
197 pragma RESTRICT_REFERENCES(get_burden_cdl_pa_date,WNDS,WNPS);
198 /*----------------------------------------------------------------------------*/
199 PROCEDURE get_period_information ( p_expenditure_item_date IN pa_expenditure_items_all.expenditure_item_date%TYPE
200                                   ,p_prvdr_gl_date IN pa_cost_distribution_lines_all.gl_date%TYPE
201                                   ,p_line_type IN pa_cost_distribution_lines_all.line_type%TYPE
202                                   ,p_prvdr_org_id IN pa_expenditure_items_all.org_id%TYPE
203                                   ,p_recvr_org_id IN pa_expenditure_items_all.org_id%TYPE
204                                   ,p_prvdr_sob_id IN pa_implementations_all.set_of_books_id%TYPE
205                                   ,p_recvr_sob_id IN pa_implementations_all.set_of_books_id%TYPE
206                                   ,x_prvdr_pa_date OUT NOCOPY pa_cost_distribution_lines_all.pa_date%TYPE
207                                   ,x_prvdr_pa_period_name OUT NOCOPY pa_cost_distribution_lines_all.pa_period_name%TYPE
208                                   ,x_prvdr_gl_period_name OUT NOCOPY pa_cost_distribution_lines_all.gl_period_name%TYPE
209                                   ,x_recvr_pa_date OUT NOCOPY pa_cost_distribution_lines_all.recvr_pa_date%TYPE
210                                   ,x_recvr_pa_period_name OUT NOCOPY pa_cost_distribution_lines_all.recvr_pa_period_name%TYPE
211                                   ,x_recvr_gl_date OUT NOCOPY pa_cost_distribution_lines_all.recvr_gl_date%TYPE
212                                   ,x_recvr_gl_period_name OUT NOCOPY pa_cost_distribution_lines_all.recvr_gl_period_name%TYPE
213                                   ,x_return_status OUT NOCOPY NUMBER
214                                   ,x_error_code OUT NOCOPY VARCHAR2
215                                   ,x_error_stage OUT NOCOPY NUMBER
216                                  );
217 /*----------------------------------------------------------------------------*/
218 FUNCTION get_gl_period_name ( p_gl_date         IN pa_cost_distribution_lines_all.gl_date%TYPE
219                              ,p_set_of_books_id IN pa_implementations_all.set_of_books_id%TYPE
220                             ) RETURN pa_cost_distribution_lines_all.gl_period_name%TYPE;
221 /*----------------------------------------------------------------------------*/
222 END pa_integration;