DBA Data[Home] [Help]

PACKAGE: APPS.AP_PAYMENT_UTIL_PKG

Source


1 PACKAGE AP_PAYMENT_UTIL_PKG AUTHID CURRENT_USER AS
2 /* $Header: appayuts.pls 120.14 2010/07/07 20:48:00 bgoyal ship $ */
3 
4 /*===========================================================================
5  |  FUNCTION    - get_le_name
6  |  DESCRIPTION - Utility to get Legal Entity Name for transactions which
7  |                store legal_entity_id
8  *==========================================================================*/
9 FUNCTION get_le_name(p_legal_entity_id   IN NUMBER)
10 RETURN  VARCHAR2;
11 
12 /*===========================================================================
13  |  FUNCTION     - get_ou_name
14  |  DESCRIPTION  - Utility to get the Operating Unit name for a given org_id
15  |                 This API should be replaced by
16  |                 fnd_access_control_util.get_org_name(AI.org_id)
17  *==========================================================================*/
18 FUNCTION get_ou_name(p_org_id   IN NUMBER)
19 RETURN  VARCHAR2 ;
20 
21 
22 /*===========================================================================
23  |  PROCEDURE    - Get_iby_payer_defaults
24  |  DESCRIPTION  - Defaults the following IBY defaults(org_id is NULL)
25  |                 1. Document Rejection Level
26  |                 2. Payment Rejection Level
27  |                 3. Whether to Stop Procees for Review After Proposed
28  |                    payments creation
29  *==========================================================================*/
30 PROCEDURE get_iby_payer_defaults(
31                 p_doc_rejection_level_code      OUT NOCOPY VARCHAR2,
32                 p_payment_rejection_level_code  OUT NOCOPY VARCHAR2,
33                 p_payments_review_settings      OUT NOCOPY VARCHAR2);
34 
35 
36 /*===========================================================================
37  |  FUNCTION    - get_pi_count
38  |  DESCRIPTION - This is the number of payment instructions created for all
39  |                payments belonging to the PPR.  This appears only after at
40  |                least one exists.
41  |
42  *==========================================================================*/
43 FUNCTION get_pi_count(p_psr_id    IN  NUMBER)
44 RETURN NUMBER;
45 
46 
47 /*===========================================================================
48  |  FUNCTION    - get_selected_ps_count
49  |  DESCRIPTION - Gets the count of selected scheduled payments for the
50  |                Payment Batch(Pay Run)
51  |
52  *==========================================================================*/
53 FUNCTION get_selected_ps_count(p_checkrun_id   IN  NUMBER,
54                                p_psr_id        IN  NUMBER)
55 RETURN NUMBER;
56 
57 /*===========================================================================
58  |  FUNCTION    - get_unsel_ps_count
59  |  DESCRIPTION - Gets the count of un-selected scheduled payments for the
60  |                Payment Batch(Pay Run)
61  |
62  *==========================================================================*/
63 FUNCTION Get_unsel_ps_Count(p_checkrun_id   IN  NUMBER)
64 RETURN NUMBER;
65 
66 
67 
68 /*=============================================================================
69  |  FUNCTION    - Get_Rejected_ps_Count
70  |  DESCRIPTION - This is the total count of scheduled payments that Oracle
71  |                Payments(IBY) has rejected.
72  |
73  *============================================================================*/
74 FUNCTION get_rejected_ps_count(p_psr_id     IN  NUMBER)
75 RETURN NUMBER;
76 
77 /*===========================================================================
78  |  FUNCTION    - get_unsel_reason_count
79  |  DESCRIPTION - This is the count of payment schedules that met the criteria
80  |                but were not selected  for a particular dont_pay_reason_code
81  |
82  *==========================================================================*/
83 FUNCTION Get_unsel_reason_Count(
84              p_checkrun_id      IN           NUMBER,
85              p_dont_pay_code    IN           VARCHAR2
86             ) RETURN NUMBER;
87 
88 
89 /*===========================================================================
90  |  FUNCTION    - get_ps_ur_count
91  |  DESCRIPTION - Gets the count of scheduled payments for the missing User
92  |                exchange rates for a combination of  payment currency
93  |                and the ledger currency(Invoices associated with one OU
94  |                have one ledger currency associated with them)
95  |
96  *==========================================================================*/
97 FUNCTION get_ps_ur_count(
98                p_checkrun_id                   IN  NUMBER,
99                p_ledger_currency_code          IN VARCHAR2,
100                p_payment_currency_code         IN VARCHAR2)
101 RETURN NUMBER;
102 
103 /*=============================================================================
104  |  FUNCTION    - Get_missing_rates_ps_count
105  |  DESCRIPTION - This is the total count of selected scheduled payments that
106  |                have missing exchange rates
107  |
108  *============================================================================*/
109 FUNCTION Get_missing_rates_ps_Count(
110                   p_checkrun_id                   IN  NUMBER)
111 RETURN NUMBER;
112 
113 /*=============================================================================
114  |  FUNCTION     - Get_interest_due
115  |  DESCRIPTION  - This is the Total Interest due for the Selected Payment
116  |                 Schedule wrt the Payment Date on the Pay Run. The Interest
117  |                 Due is calculated during the AutoSelect/Recalculation.
118  |
119  *============================================================================*/
120  FUNCTION Get_Interest_due(
121                 p_checkrun_id                  IN NUMBER,
122                 p_invoice_id                   IN NUMBER,
123                 p_payment_num                  IN NUMBER
124                 )
125 RETURN NUMBER;
126 
127 /*===========================================================================
128  |  FUNCTION    - Get_interest_paid
129  |  DESCRIPTION - This is the total interest that has been paid for the Invoice
130  |                Used in PsDetailsPG
131  |
132  *==========================================================================*/
133 FUNCTION get_interest_paid(p_invoice_id            IN NUMBER)
134 RETURN NUMBER;
135 
136 
137 /*===========================================================================
138  |  FUNCTION     - Get_interest_inv
139  |  DESCRIPTION  - This is the Interest Invoice planned for the Selected
140  |                Scheduled Payment.
141  |                Used in PsDetailsPG
142  |
143  *==========================================================================*/
144  FUNCTION Get_Interest_inv(
145                 p_checkrun_id                  IN NUMBER,
146                 p_invoice_id                   IN NUMBER,
147                 p_payment_num                  IN NUMBER
148                 )
149 RETURN VARCHAR2;
150 
151 /*=============================================================================
152  |  FUNCTION    - Get_gain_loss_amt
153  |  DESCRIPTION - This function would calculate the estimated gain loss for the
154  |                Payment Schedule.
155  |                PsDetailsPG : Nice to have
156  |
157  *============================================================================*/
158  FUNCTION Get_gain_loss_amount
159  RETURN NUMBER;
160 
161 
162 
163 
164 /*===========================================================================
165  |  FUNCTION     - Get_interest_rate
166  |  DESCRIPTION  - This is the interest rate use to create planned interest
167  |                 invoices. The rate is calculated wrt the payment date.
168  |
169  *==========================================================================*/
170 FUNCTION Get_interest_rate(p_check_date      IN  DATE) RETURN NUMBER;
171 
172 
173 
174 /*=============================================================================
175  |  FUNCTION    - get_payment_status_flag
176  |  DESCRIPTION - This function returns the status w.r.t payments that have been
177  |                created in IBY for this Payment Process Request(Checkrun_id)
178  |                IBY will provide an API to get the value of this flag
179  |
180  *============================================================================*/
181 FUNCTION get_payment_status_flag(p_psr_id      IN         NUMBER)
182 RETURN VARCHAR2;
183 
184 /*=============================================================================
185  |  FUNCTION    - get_psr_status
186  |  DESCRIPTION - This function returns the status w.r.t payments that have been
187  |               created in IBY for this Payment Process Request(Checkrun_id)
188  |
189  *============================================================================*/
190 FUNCTION get_psr_status(p_psr_id      IN         NUMBER,
191                         p_psr_status  IN         VARCHAR2)
192 RETURN VARCHAR2;
193 
194 
195 /*===========================================================================
196  |  FUNCTION    - get_destination_function
197  |  DESCRIPTION - The destination function is attached to the Payment Process
198  |                request Link on the PsrSearch Page. The Payment Process
199  |                Name Link navigates the user to Selected Payment Schedules
200  |                Page if the request is not yet submitted to IBY and status
201  |                is 'REVIEW' or 'MISSING RATES'. If the request has been
202  |                submitted to IBY, the link navigates the user to
203  |                IBY_FD_REQUESTS_DET Page uless the status is INSERTED' or
204  |                'SUBMITTED'
205  |
206  |
207  *==========================================================================*/
208 FUNCTION get_destination_function(p_checkrun_id      IN      NUMBER,
209                                   p_status_code      IN      VARCHAR2)
210 RETURN VARCHAR2 ;
211 
212 
213 /*=============================================================================
214  |  FUNCTION - Action_Switcher
215  |  DESCRIPTION - The function is attached to the ActionSwitcher
216  |  TakeActionEnabled    -- takeaction_enabled.gif(ActionFunction)
217  |  TakeActionDisabled   -- No Icon (No Action)
218  |  WarningIndEvenActive -- warningind_even_active.gif (This case can happens
219  |                          when say a Concurrent Program is Terminated).
220  |  ActionInProgress     -- inprogressind_status.gif (No Action)
221  |
222  *============================================================================*/
223 FUNCTION Action_Switcher(p_checkrun_id         IN NUMBER,
224                          p_psr_id              IN NUMBER,
225                          p_status_code         IN VARCHAR2,
226                          p_checkrun_request_id IN NUMBER,
227                          p_psr_request_id      IN NUMBER
228                          )
229 RETURN VARCHAR2;
230 
231 /*=============================================================================
232  |  FUNCTION - Get_Action_Function
233  |  DESCRIPTION - The Action function is attached to the Start Action Icon
234  |                The Icon navigates the user to Selected Payment Schedules
235  |                Page if the request is not yet submitted to IBY and status
236  |                is 'REVIEW' or 'MISSING RATES'. If the request has been
237  |                submitted to IBY, the link navigates the user to the
238  |                following pages
239  |
240  |                IBY Statuses                  Destinations
241  |                ----------------------------  -----------------------
242  |                INFORMATION_REQUIRED          IBY_FD_ASSIGN_COMPLETE
243  |                PENDING_REVIEW_DOC_VAL_ERRORS IBY_FD_DOCS_VALIDATE
244  |                PENDING_REVIEW_PMT_VAL_ERRORS IBY_FD_PAYMENT_VALIDATE
245  |                PENDING_REVIEW                IBY_FD_PAYMENT_REVIEW
246  |
247  *============================================================================*/
248 FUNCTION get_action_function(p_checkrun_id      IN      NUMBER,
249                              p_status_code      IN      VARCHAR2)
250 RETURN VARCHAR2;
251 
252 
253 
254  /*===========================================================================
255  |  FUNCTION     - get_psr_snapshot_count
256  |  DESCRIPTION  - This function is designed for the Payables Payment Manager
257  |                 Home Page . The function returns the total count of Payment
258  |                 Process Requests with a particular Status or a combination
259  |                 of Payment Process Request Statuses that map to a particular
260  |                 snapshot code
261  |
262  |   SNAPSHOT CODE           STATUS
263  |   -------------           ------------------------------------------------
264  |   NEED_ACTION_BY_ME       AP:
265  |                             'REVIEW', 'MISSING RATES'
266  |                            IBY:
267  |                              'INFORMATION_REQUIRED'
268  |                              'PENDING_REVIEW_DOC_VAL_ERRORS',
269  |                              'PENDING_REVIEW_PMT_VAL_ERRORS',
270  |                              'PENDING_REVIEW'
271  |
272  |   PROCESSING              AP:
273  |                             'UNSTARTED', 'SELECTING', 'CANCELING',
274  |                             'CALCULATING', 'SELECTED'
275  |                           IBY:
276  |                             'INSERTED', 'SUBMITTED',
277  |                             'ASSIGNMENT_COMPLETE','DOCUMENTS_VALIDATED',
278  |                             'RETRY_DOCUMENT_VALIDATION',
279  |                             'RETRY_PAYMENT_CREATION'
280  |
281  |   USER_TERMINATED         AP:
282  |                             'CANCELED' , 'CANCELLED NO PAYMENTS'
283  |                           IBY:
284  |                             'TERMINATED'
285  |
286  |   PROGRAM_ERRORS          IBY:
287  |                             'PENDING_REVIEW_DOC_VAL_ERRORS'
288  |                             'PENDING_REVIEW_PMT_VAL_ERRORS'
289  |
290  |   COMPLETED               IBY:
291  |                           'PAYMENTS_CREATED'
292  |
293  |   TOTAL                   COUNT(*) IN AP
294  |
295  *==========================================================================*/
296 FUNCTION get_psr_snapshot_count(p_snapshot_code      IN       VARCHAR2)
297 RETURN NUMBER;
301  |  DESCRIPTION - This method locks the newly added Payment Schedules
298 
299 /*=============================================================================
300  |  FUNCTION    - Update Payment Schedules
302  |
303  |
304  *============================================================================*/
305 FUNCTION Update_payment_schedules(
306                   p_checkrun_id                   IN  NUMBER)
307 RETURN VARCHAR2;
308 
309 /*=============================================================================
310  |  FUNCTION    - Validates Psr
311  |  DESCRIPTION - This method is a wrapper on IBY's  API
312  |                IBY_FD_USER_API_PUB.Validate_Method_and_Profile(ibyfduas.pls)
313  |
314  *============================================================================*/
315 FUNCTION Validate_Psr(
316                   p_checkrun_id                   IN  NUMBER)
317 RETURN VARCHAR2;
318 
319 /*=============================================================================
320  |  FUNCTION    - Validates Payment Template
321  |  DESCRIPTION - This method is a wrapper on IBY's  API
322  |                IBY_FD_USER_API_PUB.Validate_Method_and_Profile(ibyfduas.pls)
323  |
324  *============================================================================*/
325 FUNCTION Validate_payment_template(
326                   p_template_id                   IN  NUMBER)
327 RETURN VARCHAR2;
328 
329 
330 /*=============================================================================
331  |  FUNCTION    - Get Request Status
332  |  DESCRIPTION - This method is a wrapper on FND API  API
333  |                FND_CONCURRENT.Get_Request_status
334  |
335  *============================================================================*/
336 FUNCTION Get_request_status(p_checkrun_id   IN  NUMBER,
337                             p_psr_id        IN  NUMBER)
338 RETURN VARCHAR2;
339 
340 
341 /*=============================================================================
342  |  FUNCTION    - Is Federal Installed
343  |  DESCRIPTION - This method is a wrapper on FV_INSTALL.Enabled(org_id)
344  |                API
345  |
346  *============================================================================*/
347 FUNCTION Is_Federal_Installed(p_org_id      IN  NUMBER)
348 RETURN VARCHAR2;
349 
350 /*=============================================================================
351  |  FUNCTION    -  Check_PPR_MOAC_Access                                      |
352  |  DESCRIPTION - This method will check if User can take action on PPR or not |
353  |                Logic is to check the each Org against the current user Org  |
354  |                access. If any of the org is not listed under User's Security|
355  |                set by FND; Function will return 'N' else 'Y'                |
356  |                                                                             |
357  |                Get Distinct Org Id for Invoices selected in PPR --> Count1  |
358  |                Check no of Org_Id accessible against the security context   |
359  |                set in session. If Count mismatches Return 'N' else 'Y'      |
360  *============================================================================*/
361 FUNCTION Check_PPR_MOAC_Access(p_checkrun_id IN  NUMBER)
362 RETURN VARCHAR2;
363 
364 /* Added for bug#9835337 Start */
365 FUNCTION Check_PPR_PMT_MOAC_Access(p_instruction_id IN  NUMBER)
366 RETURN VARCHAR2;
367 /* Added for bug#9835337 End */
368 
369 END AP_PAYMENT_UTIL_PKG;