DBA Data[Home] [Help]

PACKAGE: APPS.PO_REQAPPROVAL_INIT1

Source


1 PACKAGE po_reqapproval_init1 AS
2 /* $Header: POXWPA1S.pls 120.13.12010000.4 2008/11/03 09:34:00 rojain ship $ */
3 
4  /*=======================================================================+
5  | FILENAME
6  |   POXWPA1S.pls
7  |
8  | DESCRIPTION
9  |   PL/SQL spec for package:  PO_REQAPPROVAL_INIT1
10  |
11  | NOTES
12  | MODIFIED    	Ben Chihaoui (06/10/97)
13  | MODIFIED    	davidng (05/24/02)
14  |       	Changed parameter PrintFlag to default to 'N' instead of NULL
15  *=====================================================================*/
16 
17 
18 -- Start_WF_Process
19 --  Generates the itemkey, sets up the Item Attributes,
20 --  then starts the workflow process.
21 --
22 /* RETROACTIVE FPI Change.
23  * Added 2 new parameters MassUpdateReleases and RetroactivePriceChange.
24  * MassUpdateReleases is Y when approval is initiated from the Form and
25  * the user wants to update all the releases against the blanket with
26  * the retroactive price change. RetroactivePriceChange is Y when the
27  * releases are updated with the retroactive price change.
28 */
29 PROCEDURE Start_WF_Process ( ItemType          VARCHAR2,
30                              ItemKey                VARCHAR2,
31                              WorkflowProcess        VARCHAR2,
32                              ActionOriginatedFrom   VARCHAR2,
33                              DocumentID             NUMBER,
34                              DocumentNumber         VARCHAR2,
35                              PreparerID             NUMBER,
36                              DocumentTypeCode       VARCHAR2,
37                              DocumentSubtype        VARCHAR2,
38                              SubmitterAction        VARCHAR2,
39                              forwardToID            NUMBER,
40                              forwardFromID          NUMBER,
41                              DefaultApprovalPathID  NUMBER,
42                              Note                   VARCHAR2,
43                              PrintFlag              VARCHAR2 default 'N',
44 							 FaxFlag		    VARCHAR2 default 'N',
45 							 FAXNumber		    VARCHAR2 default NULL,
46 							 EmailFlag              VARCHAR2 default 'N',
47                              EmailAddress           VARCHAR2 default NULL,
48                              CreateSourcingRule     VARCHAR2 default NULL,
49                              ReleaseGenMethod       VARCHAR2 default NULL,
50                              UpdateSourcingRule     VARCHAR2 default NULL,
51                              MassUpdateReleases     VARCHAR2 default 'N', -- Retroactive FPI
52                              RetroactivePriceChange VARCHAR2 default 'N', -- Retroactive FPI
53                              OrgAssignChange        VARCHAR2 default 'N', -- GA FPI
54                              CommunicatePriceChange VARCHAR2 default NULL, -- <FPJ Retroactive> -- bug4176111
55                              p_Background_Flag      VARCHAR2 default 'N', -- <DropShip FPJ>
56                              p_Initiator            VARCHAR2 default NULL,
57                              p_xml_flag             VARCHAR2 default NULL, -- Bug 5218538,
58 							/* Bug6708182 FPDS-NG ER. */
59 							/* Bug 6708182 Start */
60 							 FpdsngFlag			VARCHAR2 default 'N',
61                p_source_type_code VARCHAR2 DEFAULT null
62 							/* Bug 6708182 End */
63                            );
64 
65 
66 -- set_multiorg_context
67 --   Get the org_id and set the context for Mult-org
68 --
69 PROCEDURE get_multiorg_context(document_type varchar2, document_id number,
70                                x_orgid IN OUT NOCOPY number);
71 
72 
73 -- Record variable ReqHdr_rec
74 --   Public record variable used to hold the Requisition_header columns
75 -- Bug#3147435
76 -- Added contractor_requisition_flag and contractor_status to ReqHdrRecord
77    TYPE ReqHdrRecord IS RECORD(
78                                REQUISITION_HEADER_ID NUMBER,
79                                DESCRIPTION           VARCHAR2(240),
80                                AUTHORIZATION_STATUS  VARCHAR2(25),
81                                TYPE_LOOKUP_CODE      VARCHAR2(25),
82                                PREPARER_ID           NUMBER,
83                                SEGMENT1              VARCHAR2(20),
84                                CLOSED_CODE           VARCHAR2(25),
85                                EMERGENCY_PO_NUM      VARCHAR2(25),
86                                CONTRACTOR_REQUISITION_FLAG VARCHAR2(1),
87                                CONTRACTOR_STATUS     VARCHAR2(25),
88                                NOTE_TO_AUTHORIZER    VARCHAR2(4000));
89 
90    ReqHdr_rec ReqHdrRecord;
91 
92 -- Record variable ReqLine_rec
93 --   Public record variable used to hold the Requisition_line columns.
94 
95    TYPE ReqLineRecord IS RECORD(
96                                LINE_NUM               NUMBER,
97                                ITEM_DESCRIPTION       VARCHAR2(240),
98                                UNIT_MEAS_LOOKUP_CODE  VARCHAR2(25),
99                                UNIT_PRICE             NUMBER,
100                                QUANTITY               NUMBER,
101                                NEED_BY_DATE           DATE,
102                                TO_PERSON_ID           NUMBER,
103                                DELIVER_TO_LOCATION_ID NUMBER,
104 
105    /** PO UTF8 Column Expansion Project 9/23/2002 tpoon **/
106    /** Expanded deliver_to_location from 20 to 60 **/
107 --                               DELIVER_TO_LOCATION    VARCHAR2(20),
108                                DELIVER_TO_LOCATION    VARCHAR2(60),
109 
110                                REQUESTOR_FULL_NAME    VARCHAR2(240));
111 
112    ReqLine_rec ReqLineRecord;
113 
114 -- Cursor GetRecHdr_csr
115 --   Public cursor used to get the Requisition_header columns.
116 
117    CURSOR GetRecHdr_csr(p_requisition_header_id NUMBER) RETURN ReqHdrRecord;
118 
119 --
120 PROCEDURE get_user_name( p_employee_id IN number, x_username OUT NOCOPY varchar2,
121                          x_user_display_name OUT NOCOPY varchar2);
122 
123 --
124 PROCEDURE get_employee_id( p_username IN varchar2, x_employee_id OUT NOCOPY number);
125 
126 --
127 
128 -- SetStartupValues
129 --
130 --
131 -- IN
132 --   itemtype --   itemkey --   actid  --   funcmode
133 -- OUT
134 --   Resultout
135 --    - Activity Performed   - Activity was completed without any errors.
136 --
137 procedure Set_Startup_Values(	itemtype	in varchar2,
138 				itemkey  	in varchar2,
139 				actid		in number,
140 				funcmode	in varchar2,
141 				resultout	out NOCOPY varchar2	);
142 --
143 -- Get_ReqAttributes
144 --   Get the requisition attributes. We get the header info and up to 5
145 --   requisition lines.
146 --
147 -- IN
148 --   itemtype  --   itemkey  --   actid   --   funcmode
149 -- OUT
150 --   Resultout
151 --    - Activity Performed   - Activity was completed without any errors.
152 --
153 procedure Get_Req_Attributes(	itemtype	in varchar2,
154 				itemkey  	in varchar2,
155 				actid		in number,
156 				funcmode	in varchar2,
157 				resultout	out NOCOPY varchar2	);
158 --
159 -- Set_req_stat_preapproved
160 -- Added for WR4
161 -- IN
162 --   itemtype  --   itemkey  --   actid   --   funcmode
163 -- OUT
164 --   Resultout
165 --    - Activity Performed   - Activity was completed without any errors.
166 --
167 procedure Set_doc_stat_preapproved(     itemtype        in varchar2,
168                                       itemkey         in varchar2,
169                                       actid           in number,
170                                       funcmode        in varchar2,
171                                       resultout       out NOCOPY varchar2    );
172 
173 --
174 -- Set_req_stat_inprocess
175 -- Set the requisition status to IN-PROCESS. That way, the users can not bring
176 -- the Requisition up in the entry form and make modifications while it's in
177 -- in the workflow process.
178 --
179 -- IN
180 --   itemtype  --   itemkey  --   actid   --   funcmode
181 -- OUT
182 --   Resultout
183 --    - Activity Performed   - Activity was completed without any errors.
184 --
185 procedure Set_doc_stat_inprocess(     itemtype        in varchar2,
186                                       itemkey         in varchar2,
187                                       actid           in number,
188                                       funcmode        in varchar2,
189                                       resultout       out NOCOPY varchar2    );
190 
191 -- set_doc_to_originalstat
192 --  Sets the doc back to it's original status if No Approver was found
193 --  or doc failed STATE VERIFICATION or COMPLETENESS check before APPROVE,
194 --  REJECT or FORWARD.
195 
196 --
197 -- IN
198 --   itemtype  --   itemkey  --   actid   --   funcmode
199 -- OUT
200 --   Resultout
201 --    - Activity Performed   - Activity was completed without any errors.
202 --
203 procedure set_doc_to_originalstat(     itemtype        in varchar2,
204                                       itemkey         in varchar2,
205                                       actid           in number,
206                                       funcmode        in varchar2,
207                                       resultout       out NOCOPY varchar2    );
208 
209 -- Register_doc_submitted
210 -- IN
211 --   itemtype  --   itemkey  --   actid   --   funcmode
212 -- OUT
213 --   Resultout
214 --    - Activity Performed   - Activity was completed without any errors.
215 --
216 procedure Register_doc_submitted(     itemtype        in varchar2,
217                                       itemkey         in varchar2,
218                                       actid           in number,
219                                       funcmode        in varchar2,
220                                       resultout       out NOCOPY varchar2    );
221 
222 --
223 -- Can_Owner_Approve
224 --   Can the owner of a requisition approve it
225 -- IN
226 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
227 --   itemkey   - A string generated from the application object's primary key.
228 --   actid     - The notification process activity(instance id).
229 --   funcmode  - Run/Cancel
230 -- OUT
231 --   Resultout
232 --     Y - Owner can approve requisition
233 --     N - Owner can NOT approve requisition
234 --
235 procedure Can_Owner_Approve(   itemtype        in varchar2,
236                                 itemkey         in varchar2,
237                                 actid           in number,
238                                 funcmode        in varchar2,
239                                 resultout       out NOCOPY varchar2    );
240 --
241 -- Is_doc_preapproved
242 --   Is the document status pre-approved
243 -- IN
244 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
245 --   itemkey   - A string generated from the application object's primary key.
246 --   actid     - The notification process activity(instance id).
247 --   funcmode  - Run/Cancel
248 -- OUT
249 --   Resultout
250 --     Y -
251 --     N -
252 --
253 procedure Is_doc_preapproved(   itemtype        in varchar2,
254                                 itemkey         in varchar2,
255                                 actid           in number,
256                                 funcmode        in varchar2,
257                                 resultout       out NOCOPY varchar2    );
258 --
259 
260 --
261 -- Ins_actionhist_submit
262 --   When submitting the document into the workflow, we need to insert
263 --   action SUBMIT into PO_ACTION_HISTORY
264 -- IN
265 --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
266 --   itemkey   - A string generated from the application object's primary key.
267 --   actid     - The notification process activity(instance id).
268 --   funcmode  - Run/Cancel
269 -- OUT
270 --   Resultout
271 --     ACTIVITY_PERFORMED
272 --
273 procedure Ins_actionhist_submit(   itemtype        in varchar2,
274                                 itemkey         in varchar2,
275                                 actid           in number,
276                                 funcmode        in varchar2,
277                                 resultout       out NOCOPY varchar2    );
278 --
279 
280 --
281 -- Set_End_VerifyDoc_Failed
282 --  Sets the value of the transition to FAILED_VERIFICATION to match the
283 --  transition value for the VERIFY_REQUISITION Process
284 --
285 -- IN
286 --   itemtype  --   itemkey  --   actid   --   funcmode
287 -- OUT
288 --   Resultout
289 --    - Activity Performed   - Activity was completed without any errors.
290 --
291 procedure Set_End_VerifyDoc_Failed(   itemtype        in varchar2,
292                                       itemkey         in varchar2,
293                                       actid           in number,
294                                       funcmode        in varchar2,
295                                       resultout       out NOCOPY varchar2    );
296 
297 --
298 -- Set_End_VerifyDoc_Passed
299 --  Sets the value of the transition to PASSED_VERIFICATION to match the
300 --  transition value for the VERIFY_REQUISITION Process
301 --
302 -- IN
303 --   itemtype  --   itemkey  --   actid   --   funcmode
304 -- OUT
305 --   Resultout
306 --    -
307 --
308 procedure Set_End_VerifyDoc_Passed(   itemtype        in varchar2,
309                                       itemkey         in varchar2,
310                                       actid           in number,
311                                       funcmode        in varchar2,
312                                       resultout       out NOCOPY varchar2    );
313 
314 --
315 -- Set_End_Valid_Action
316 --  Sets the value of the transition to VALID_ACTION to match the
320 -- IN
317 --  transition value for the APPROVE_REQUISITION, APPROVE_PO,
318 --  APPROVE_AND_FORWARD_REQUISITION and APPROVE_AND_FORWARD_PO Processes.
319 --
321 --   itemtype  --   itemkey  --   actid   --   funcmode
322 -- OUT
323 --   Resultout
324 --    - VALID_ACTION
325 --
326 procedure Set_End_Valid_Action(   itemtype        in varchar2,
327                                       itemkey         in varchar2,
328                                       actid           in number,
329                                       funcmode        in varchar2,
330                                       resultout       out NOCOPY varchar2    );
331 
332 --
333 -- Set_End_Invalid_Action
334 --  Sets the value of the transition to VALID_ACTION to match the
335 --  transition value for the APPROVE_REQUISITION, APPROVE_PO,
336 --  APPROVE_AND_FORWARD_REQUISITION and APPROVE_AND_FORWARD_PO Processes.
337 --
338 -- IN
339 --   itemtype  --   itemkey  --   actid   --   funcmode
340 -- OUT
341 --   Resultout
342 --    - VALID_ACTION
343 --
344 procedure Set_End_Invalid_Action(   itemtype        in varchar2,
345                                       itemkey         in varchar2,
346                                       actid           in number,
347                                       funcmode        in varchar2,
348                                       resultout       out NOCOPY varchar2    );
349 
350 --
351 --
352 -- Encumb_on_doc_unreserved
353 -- IN
354 --   itemtype  --   itemkey  --   actid   --   funcmode
355 -- OUT
356 --   Resultout
357 --    - Y/N
358 --   If Encumbrance is ON and Document is NOT reserved, then return Y.
359 
360 procedure Encumb_on_doc_unreserved(   itemtype        in varchar2,
361                                       itemkey         in varchar2,
362                                       actid           in number,
363                                       funcmode        in varchar2,
364                                       resultout       out NOCOPY varchar2    );
365 
366 
367 --
368 --
369 -- RESERVE_AT_COMPLETION_CHECK
370 -- IN
371 --   itemtype  --   itemkey  --   actid   --   funcmode
372 -- OUT
373 --   Resultout
374 --    - Y/N
375 --   If the reserve at completion flag is checked, then return Y.
376 
377 procedure RESERVE_AT_COMPLETION_CHECK(   itemtype        in varchar2,
378                                          itemkey         in varchar2,
379                                          actid           in number,
380                                          funcmode        in varchar2,
381                                          resultout       out NOCOPY varchar2    );
382 --
383 
384 --
385 --
386 -- Is_Interface_ReqImport
387 -- IN
388 --   itemtype  --   itemkey  --   actid   --   funcmode
389 -- OUT
390 --   Resultout
391 --    - Y/N
392 --   If requisition being generated from the requisiton import program
393 
394 procedure Is_Interface_ReqImport(   itemtype        in varchar2,
395                                       itemkey         in varchar2,
396                                       actid           in number,
397                                       funcmode        in varchar2,
398                                       resultout       out NOCOPY varchar2    ) ;
399 
400 --
401 -- Remove_reminder_notif
402 -- IN
403 --   itemtype  --   itemkey  --   actid   --   funcmode
404 -- OUT
405 --   Resultout
406 --
407 --   Remove the reminder notifications since this doc is now approved.
408 
409 procedure Remove_reminder_notif(   itemtype        in varchar2,
410                                       itemkey         in varchar2,
411                                       actid           in number,
412                                       funcmode        in varchar2,
413                                       resultout       out NOCOPY varchar2    ) ;
414 
415 -- Print_Doc_Yes_No
416 -- IN
417 --   itemtype  --   itemkey  --   actid   --   funcmode
418 -- OUT
419 --   Resultout
420 --
421 --   Does user want to print the document?
422 
423 procedure Print_Doc_Yes_No(   itemtype        in varchar2,
424                               itemkey         in varchar2,
425                               actid           in number,
426                               funcmode        in varchar2,
427                               resultout       out NOCOPY varchar2    ) ;
428 
429 
430 -- Fax_Doc_Yes_No
431 -- IN
432 --   itemtype  --   itemkey  --   actid   --   funcmode
433 -- OUT
434 --   Resultout
435 --
436 --   Does user want to fax the document?
437 
438 procedure Fax_Doc_Yes_No(     itemtype        in varchar2,
439                               itemkey         in varchar2,
440                               actid           in number,
441                               funcmode        in varchar2,
442                               resultout       out NOCOPY varchar2    ) ;
443 
444 
445 
446 -- Send_WS_Notif_Yes_No
447 -- IN
448 --   itemtype  --   itemkey  --   actid   --   funcmode
449 -- OUT
450 --   Resultout
451 --
452 --   Does user want to send the notification ?
453 
454 procedure Send_WS_Notif_Yes_No(     itemtype        in varchar2,
455                               itemkey         in varchar2,
459 
456                               actid           in number,
457                               funcmode        in varchar2,
458                               resultout       out NOCOPY varchar2    ) ;
460 
461 -- Send_WS_Fyi_Notif_Yes_No
462 -- IN
463 --   itemtype  --   itemkey  --   actid   --   funcmode
464 -- OUT
465 --   Resultout
466 --
467 --   Does user want to send the FYI notification ?
468 
469 procedure Send_WS_Fyi_Notif_Yes_No(     itemtype        in varchar2,
470                               itemkey         in varchar2,
471                               actid           in number,
472                               funcmode        in varchar2,
473                               resultout       out NOCOPY varchar2    ) ;
474 
475 
476 -- Send_WS_Ack_Notif_Yes_No
477 -- IN
478 --   itemtype  --   itemkey  --   actid   --   funcmode
479 -- OUT
480 --   Resultout
481 --
482 --   Does user want to send the acknowledgement notification ?
483 
484 procedure Send_WS_Ack_Notif_Yes_No(     itemtype        in varchar2,
485                               itemkey         in varchar2,
486                               actid           in number,
487                               funcmode        in varchar2,
488                               resultout       out NOCOPY varchar2    ) ;
489 
490 
491 -- locate_notifier
492 -- IN
493 -- document_number, document_type
494 -- OUT
495 -- fnd_user (resultout)
496 -- What is the web supplier defined for this particular user (if any)?
497 
498 procedure locate_notifier		(document_id	in	varchar2,
499 					document_type  	in 	varchar2,
500 				 resultout	in out NOCOPY  varchar2);
501 
502 
503 /*******************************************************************
504   < Added this procedure as part of Bug #: 2810150 >
505 
506   PROCEDURE NAME: get_user_list_with_resp
507 
508   DESCRIPTION   :
509   For the given document_id ( ie. po_header_id ), this procedure
510   tries to find out the correct users that need to be sent the
511   notifications.
512 
513   Referenced by : Workflow procedures
514   parameters    :
515    Input:
516     document_id - the document id
517     document_type - Document type
518     p_notify_only_flag -
519         The values can be 'Y' or 'N'
520         'Y' means: The procedure will return all the users that are supplier users related to the document.
521         Returns the role containing all the users in the "x_resultout" variable
522 
523         'N' means: we want users that need to be sent FYI and also the users with resp.
524             x_resultout: will have the role for the users that need to be sent the FYI
525             x_role_with_resp: will have the role for users having the fucntion "POS_ACK_ORDER" assigned to
526             them.
527 
528    Output:
529     x_resultout - Role for the users that need to be sent FYI
530     x_role_with_resp - Role for the users who have the ability to acknowledge.
531 
532   CHANGE History: Created      27-Feb-2003    jpasala
533 *******************************************************************/
534 
535 procedure locate_notifier       (p_document_id    in      varchar2,
536                                  p_document_type   in     varchar2,
537                                  p_notify_only_flag   in     varchar2,
538                                  x_resultout      in out NOCOPY  varchar2,
539                                  x_role_with_resp in out NOCOPY VARCHAR2) ;
540 -- Email_Doc_Yes_No
541 -- IN
542 --   itemtype  --   itemkey  --   actid   --   funcmode
543 -- OUT
544 --   Resultout
545 --
546 --   Does user want to email the document?
547 
548 procedure Email_Doc_Yes_No(     itemtype        in varchar2,
549                               itemkey         in varchar2,
550                               actid           in number,
551                               funcmode        in varchar2,
552                               resultout       out NOCOPY varchar2    ) ;
553 
554 
555 -- Print_Document
556 -- IN
557 --   itemtype  --   itemkey  --   actid   --   funcmode
558 -- OUT
559 --   Resultout
560 --
561 --   Print Document.
562 
563 procedure Print_Document(   itemtype        in varchar2,
564                             itemkey         in varchar2,
565                             actid           in number,
566                             funcmode        in varchar2,
567                             resultout       out NOCOPY varchar2    ) ;
568 
569 
570 
571 -- Fax_Document
572 -- IN
573 --   itemtype  --   itemkey  --   actid   --   funcmode
574 -- OUT
575 --   Resultout
576 --
577 --   Fax Document.
578 
579 procedure Fax_Document(     itemtype        in varchar2,
580                             itemkey         in varchar2,
581                             actid           in number,
582                             funcmode        in varchar2,
583                             resultout       out NOCOPY varchar2    ) ;
584 
585 
586 
587 -- Is_document_Approved
588 -- IN
589 --   itemtype  --   itemkey  --   actid   --   funcmode
590 -- OUT
591 --   Resultout
592 --
593 --   Is the document already approved. This may be the case if the document
597 procedure Is_document_Approved(   itemtype        in varchar2,
594 --   was PRE-APPROVED before it goes through the reserve action. The RESERVE
595 --   would then approve the doc after it reserved the funds.
596 
598                             itemkey         in varchar2,
599                             actid           in number,
600                             funcmode        in varchar2,
601                             resultout       out NOCOPY varchar2    ) ;
602 
603 -- Get_Workflow_Approval_Mode
604 -- IN
605 --   itemtype  --   itemkey  --   actid   --   funcmode
606 -- OUT
607 --   Resultout
608 --      On-line
609 --      Background
610 
611 procedure Get_Workflow_Approval_Mode(   itemtype        in varchar2,
612                             itemkey         in varchar2,
613                             actid           in number,
614                             funcmode        in varchar2,
615                             resultout       out NOCOPY varchar2    ) ;
616 
617 -- Get_Create_PO_Mode
618 -- IN
619 --   itemtype  --   itemkey  --   actid   --   funcmode
620 -- OUT
621 --   Resultout
622 --      Activity Performed
623 
624 procedure Get_Create_PO_Mode(   itemtype        in varchar2,
625                             itemkey         in varchar2,
626                             actid           in number,
627                             funcmode        in varchar2,
628                             resultout       out NOCOPY varchar2    ) ;
629 
630 -- Dummy
631 -- IN
632 --   itemtype  --   itemkey  --   actid   --   funcmode
633 -- OUT
634 --   Resultout
635 --      Activity Performed
636 -- Dummy procedure that does nothing (NOOP). Used to set the
637 -- cost above the backgound engine threshold. This causes the
638 -- workflow to execute in the background.
639 procedure Dummy(   itemtype        in varchar2,
640                             itemkey         in varchar2,
641                             actid           in number,
642                             funcmode        in varchar2,
643                             resultout       out NOCOPY varchar2    ) ;
644 
645 -- Is product source code POR ?
646 -- Determines if the requisition is created
647 -- through web requisition
648 procedure is_apps_source_POR(itemtype in varchar2,
649                          itemkey         in varchar2,
650                          actid           in number,
651                          funcmode        in varchar2,
652                          resultout       out NOCOPY varchar2);
653 
654 -- Bug#3147435
655 -- Is contractor status PENDING?
656 -- Determines if the requisition has contractor_status PENDING at header level
657 procedure is_contractor_status_pending(itemtype in varchar2,
658                                        itemkey         in varchar2,
659                                        actid           in number,
660                                        funcmode        in varchar2,
661                                        resultout       out NOCOPY varchar2);
662 
663 -- Is_Submitter_Last_Approver
664 -- IN
665 --   itemtype  --   itemkey  --   actid   --   funcmode
666 -- OUT
667 --   Resultout
668 --
669 -- Bug 823167 kbenjami
670 --
671 -- Is the Submitter the last Approver?
672 -- Checks to see if submitter is also the current
673 -- approver of the doc.
674 -- Prevents two notifications from being sent to the
675 -- same person.
676 --
677 procedure Is_Submitter_Last_Approver(itemtype 	in varchar2,
678                             itemkey         in varchar2,
679                             actid           in number,
680                             funcmode        in varchar2,
681                             resultout       out NOCOPY varchar2    ) ;
682 
683 -- This function finds out the document type, subtype and number and
684 -- concatenates them together for PLSQL_ERROR_DOC.  This is need because
685 -- the document info attribute may be rolled back when error occurs.
686 
687 function get_error_doc(itemtype in varchar2,
688                        itemkey  in varchar2) return varchar2;
689 
690 -- This function finds out preparer user name.  This is need because
691 -- the document info attribute may be rolled back when error occurs.
692 
693 function get_preparer_user_name(itemtype in varchar2,
694                                 itemkey  in varchar2) return varchar2;
695 
696 -- This procedure send the 'PLSQL_ERROR_OCCURS' notification to the
697 -- preparer when PL/SQL error occurs during approval workflow
698 
699 procedure send_error_notif(itemtype    in varchar2,
700                            itemkey     in varchar2,
701                            username    in varchar2,
702                            doc         in varchar2,
703                            msg         in varchar2,
704                            loc         in varchar2,
705 			   document_id in number default NULL); /* Bug 6827401 Added document_id with default value as NULL*/
706 
707 /* Bug# 1739194: kagarwal
708 ** Desc: Added new procedure to check the document manager error.
709 */
710 procedure Is_Document_Manager_Error_1_2(itemtype in varchar2,
711                                 itemkey         in varchar2,
712                                 actid           in number,
713                                 funcmode        in varchar2,
717    in the profile */
714                                 resultout       out NOCOPY varchar2);
715 
716 /* bug 1759631 - procedure to check if there is any second email address
718 
719 procedure PROFILE_VALUE_CHECK(itemtype        in varchar2,
720                               itemkey         in varchar2,
721                               actid           in number,
722                               funcmode        in varchar2,
723                               resultout       out NOCOPY varchar2 ) ;
724 
725 procedure Check_Error_Count(itemtype in varchar2,
726                                 itemkey         in varchar2,
727                                 actid           in number,
728                                 funcmode        in varchar2,
729                                 resultout       out NOCOPY varchar2);
730 procedure Initialise_Error(itemtype in varchar2,
731                                 itemkey         in varchar2,
732                                 actid           in number,
733                                 funcmode        in varchar2,
734 			   resultout       out NOCOPY varchar2);
735 
736 procedure  acceptance_required   ( itemtype        in  varchar2,
737                               	   itemkey         in  varchar2,
738 	                           actid           in number,
739                                    funcmode        in  varchar2,
740                                    result          out NOCOPY varchar2    );
741 --
742 
743 procedure  Register_acceptance   ( itemtype        in  varchar2,
744                               	   itemkey         in  varchar2,
745 	                           actid           in number,
746                                    funcmode        in  varchar2,
747                                    result          out NOCOPY varchar2    );
748 --
749 
750 procedure  Register_rejection   (  itemtype        in  varchar2,
751                               	   itemkey         in  varchar2,
752 	                           actid           in number,
753                                    funcmode        in  varchar2,
754                                    result          out NOCOPY varchar2    );
755 
756 procedure Create_SR_ASL_Yes_No( itemtype        in varchar2,
757                                 itemkey         in varchar2,
758                                 actid           in number,
759                                 funcmode        in varchar2,
760                                 resultout       out NOCOPY varchar2    );
761 
762 /* Bug#2353153: kagarwal
763 ** Added new PROCEDURE set_doc_mgr_context as a global procedure as this
764 ** is being used by wf apis present in different packages.
765 */
766 
767 PROCEDURE Set_doc_mgr_context (itemtype VARCHAR2,
768                                itemkey VARCHAR2);
769 
770 /* FPI RETROACTIVE PRICING CHANGE START */
771 /*******************************************************************
772   PROCEDURE NAME: MassUpdate_Releases_Yes_No
773 
774   DESCRIPTION   : This is the API which determines whether the approval;
775 		  process should also update the releases against the
776 		  blanket that is getting approved has to be updated
777 		  with the new price change. Get the value of
778 		  the parameter massupdatereleases from start_Wf_process.
779 		  If this value is Y and if it is a blanket agreeement
780 		  then we need to mass update the releases with the new
781 		  price.
782   Referenced by :
783   parameters    : Usual workflow attributes.
784 
785   CHANGE History: Created      30-Sep-2002    pparthas
786 *******************************************************************/
787 
788 procedure MassUpdate_Releases_Yes_No( itemtype        in varchar2,
789                                      itemkey         in varchar2,
790                                      actid           in number,
791                                      funcmode        in varchar2,
792                                      resultout       out NOCOPY varchar2    );
793 
794 /*******************************************************************
795   PROCEDURE NAME: MassUpdate_Releases_Workflow
796 
797   DESCRIPTION   : This is the API that is called from PO Approval
798 		  Workflow if the massupdate checkbox in the
799 		  Approval  Window is set to Yes.
800   Referenced by :
801   parameters    : Usual workflow attributes.
802 
803   CHANGE History: Created      30-Sep-2002    pparthas
804 *******************************************************************/
805 procedure MassUpdate_Releases_Workflow( itemtype        in varchar2,
806                                      itemkey         in varchar2,
807                                      actid           in number,
808                                      funcmode        in varchar2,
809 				     resultout       out NOCOPY varchar2 ) ;
810 
811 
812 /*******************************************************************
813   PROCEDURE NAME: Send_Supplier_Comm_Yes_No
814 
815   DESCRIPTION   : This is the API which determines whether supplier
816 		  Communication has to be sent when the document is
817 		  is approved. There is a new Change Order Workflow
818 		  attribute which can be set to Y if we need to
819 		  send supplier when the release is updated with
820 		  the new price after the Mass update release program is
821 		  run. If it is yes, then this procedure will return
822 		  Yes.
823   Referenced by :
824   parameters    : Usual workflow attributes.
828 procedure Send_Supplier_Comm_Yes_No( itemtype        in varchar2,
825 
826   CHANGE History: Created      30-Sep-2002    pparthas
827 *******************************************************************/
829                                      itemkey         in varchar2,
830                                      actid           in number,
831                                      funcmode        in varchar2,
832                                      resultout       out NOCOPY varchar2    );
833 
834 /* RETROACTIVE FPI END */
835 
836 
837 -- <FPJ Retroactive START>
838 /**
839 * Public Procedure: Retro_Invoice_Release_WF
840 * Requires:
841 *   IN PARAMETERS:
842 *     Usual workflow attributes.
843 * Modifies: PO_DISTRIBUTIONS_ALL.invoice_adjustment_flag
844 * Effects:  This procedure updates invoice adjustment flag, and calls Costing
845 *           and Inventory APIs.
846 */
847 procedure Retro_Invoice_Release_WF( itemtype        in varchar2,
848                                     itemkey         in varchar2,
849                                     actid           in number,
850                                     funcmode        in varchar2,
851                                     resultout       out NOCOPY varchar2    );
852 
853 procedure should_notify_cat_admin(p_item_type        in varchar2,
854 	                          p_item_key         in varchar2,
855 	                          p_act_id           in number,
856 	                          p_func_mode        in varchar2,
857 	                          x_result_out       out NOCOPY varchar2    );
858 
859 -- <FPJ Retroactive END>
860 
861 -- <Bug 5059002 Begin>
862 
863 /**
864 * Public Procedure: set_is_supplier_context_y
865 * Requires:
866 *   IN PARAMETERS:
867 *     Usual workflow attributes.
868 * Modifies: Sets the workflow attribute IS_SUPPLIER_CONTEXT to Y
869 */
870 
871 -- Commenting this procedure. May not be required after context Setting Fix.
872 /* procedure set_is_supplier_context_y(p_item_type        in varchar2,
873 	                          p_item_key         in varchar2,
874 	                          p_act_id           in number,
875 	                          p_func_mode        in varchar2,
876 	                          x_result_out       out NOCOPY varchar2); */
877 
878 /**
879 * Public Procedure: set_is_supplier_context_n
880 * Requires:
881 *   IN PARAMETERS:
882 *     Usual workflow attributes.
883 * Modifies: Sets the workflow attribute IS_SUPPLIER_CONTEXT to N
884 */
885 /* procedure set_is_supplier_context_n(p_item_type        in varchar2,
886 	                          p_item_key         in varchar2,
887 	                          p_act_id           in number,
888 	                          p_func_mode        in varchar2,
889 	                          x_result_out       out NOCOPY varchar2); */
890 -- <Bug 5059002 End>
891 
892 -- HTML Orders R12
893 -- function to construct the PO view/update Page URL's
894 Function get_po_url (p_po_header_id IN NUMBER,
895 	             p_doc_subtype  IN VARCHAR2,
896                      p_mode         IN VARCHAR2)
897 RETURN VARCHAR2;
898 
899 FUNCTION get_wf_role_for_users(p_list_of_users in varchar2, p_num_users in number) return varchar2;
900 
901 -- <Bug 5228261 Begin>
902 procedure GetReqAttributes(p_requisition_header_id in NUMBER,
903                              itemtype        in varchar2,
904                              itemkey         in varchar2);
905 -- <Bug 5228261 End>
906 
907 -- <Bug 4950854 Begin>
908 procedure update_print_count( p_doc_id in NUMBER,
909                               p_doc_type IN VARCHAR2 );
910 -- <Bug 4950854 End>
911 
912 -- <BUG 5691965 START>
913 /**
914 ** Public Procedure: Update_Action_History_TimeOut
915 ** Requires:
916 **   IN PARAMETERS:
917 **     Usual workflow attributes.
918 ** Modifies: Action History
919 ** Effects:  Actoin History is updated with No Action if the approval
920 **           notification is TimedOut.
921 */
922 
923 PROCEDURE Update_Action_History_TimeOut (itemtype     IN    VARCHAR2,
924                                          itemkey      IN    VARCHAR2,
925                                          actid        IN    NUMBER,
926                                          funcmode     IN    VARCHAR2,
927                                          resultout   OUT   NOCOPY VARCHAR2);
928 
929 -- <BUG 5691965 END>
930 
931 -- <Bug 6144768 Begin>
932 -- When Supplier responds from iSP then the responder should show
933 -- as supplier and also supplier acknowledgement notifications
934 -- should be available in the To-Do Notification full list.
935 
936 /**
937 * Public Procedure: set_is_supplier_context_y
938 * Requires:
939 *   IN PARAMETERS:
940 *     Usual workflow attributes.
941 * Modifies: Sets the workflow attribute IS_SUPPLIER_CONTEXT to Y
942 */
943 procedure set_is_supplier_context_y(p_item_type        in varchar2,
944 	                            p_item_key         in varchar2,
945 	                            p_act_id           in number,
946 	                            p_func_mode        in varchar2,
947                                     x_result_out       out NOCOPY varchar2);
948 
949 /**
950 * Public Procedure: set_is_supplier_context_n
951 * Requires:
952 *   IN PARAMETERS:
953 *     Usual workflow attributes.
954 * Modifies: Sets the workflow attribute IS_SUPPLIER_CONTEXT to N
955 */
956 procedure set_is_supplier_context_n(p_item_type        in varchar2,
957 	                            p_item_key         in varchar2,
958 	                            p_act_id           in number,
959 	                            p_func_mode        in varchar2,
960 	                            x_result_out       out NOCOPY varchar2);
961 -- <Bug 6144768 End>
962 
963 end  PO_REQAPPROVAL_INIT1;