187:
188:
189:
190: BEGIN
191: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
192: itemkey,
193: 'ORG_ID');
194:
195: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
191: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
192: itemkey,
193: 'ORG_ID');
194:
195: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
196: itemkey,
197: 'INVOICE_ID');
198:
199: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
195: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
196: itemkey,
197: 'INVOICE_ID');
198:
199: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
200: itemkey,
201: 'HOLD_ID');
202: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
203: itemkey,
198:
199: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
200: itemkey,
201: 'HOLD_ID');
202: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
203: itemkey,
204: 'ITERATION');
205:
206: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
202: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
203: itemkey,
204: 'ITERATION');
205:
206: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
207: itemkey,
208: 'NOTF_ITERATION');
209:
210: l_debug_info := l_api_name || ': get variables from workflow' ||
242: update ap_holds_all
243: set wf_status = 'TERMINATED'
244: where hold_id = l_hold_id ;
245: -- added for bug 8671976
246: resultout := wf_engine.eng_completed||':'||'N';
247: ELSE -- have approver
248: WF_DIRECTORY.GetRoleName('PER',
249: l_next_approver.person_id,l_role,
250: l_role_display);
251: WF_DIRECTORY.GetUserName('PER',
252: l_next_approver.person_id,
253: l_name,
254: l_display_name);
255: WF_ENGINE.SetItemAttrText(itemtype,
256: itemkey,
257: 'INTERNAL_REP_ROLE',
258: l_role);
259:
256: itemkey,
257: 'INTERNAL_REP_ROLE',
258: l_role);
259:
260: WF_ENGINE.SetItemAttrText(itemtype,
261: itemkey,
262: 'ORIG_SYSTEM',
263: 'PER');
264:
261: itemkey,
262: 'ORIG_SYSTEM',
263: 'PER');
264:
265: WF_ENGINE.SetItemAttrText(itemtype,
266: itemkey,
267: 'INTERNAL_REP_DISPLAY_NAME',
268: l_display_name);
269:
266: itemkey,
267: 'INTERNAL_REP_DISPLAY_NAME',
268: l_display_name);
269:
270: WF_ENGINE.SetItemAttrNumber(itemtype,
271: itemkey,
272: 'INTERNAL_REP_PERSON_ID',
273: l_next_approver.person_id);
274: --Now set the environment
292: l_hist_rec.NOTIFICATION_ORDER := l_notf_iteration;
293:
294: insert_history_table(p_hist_rec => l_hist_rec);
295:
296: resultout := wf_engine.eng_completed||':'||'Y';
297: END IF;
298:
299: EXCEPTION
300:
317: l_num number;
318: l_debug_info VARCHAR2(2000);
319: l_api_name CONSTANT VARCHAR2(200) := 'is_negotiable_flow';
320: BEGIN
321: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
322: itemkey,
323: 'ORG_ID');
324:
325: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
321: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
322: itemkey,
323: 'ORG_ID');
324:
325: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
326: itemkey,
327: 'INVOICE_ID');
328:
329: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
325: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
326: itemkey,
327: 'INVOICE_ID');
328:
329: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
330: itemkey,
331: 'HOLD_ID');
332: l_debug_info := 'Before select';
333: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
349: and ail.po_line_location_id = h.line_location_id
350: and h.status_flag = 'S'
351: and h.hold_lookup_code in ('PRICE', 'QTY ORD', 'QTY REC', 'AMT ORD', 'AMT REC')));
352: IF l_num > 0 THEN
353: resultout := wf_engine.eng_completed||':'||'Y';
354: WF_ENGINE.SetItemAttrText(itemtype,
355: itemkey,
356: 'NOTF_CONTEXT',
357: 'HOLDNEGOTIABLE');
350: and h.status_flag = 'S'
351: and h.hold_lookup_code in ('PRICE', 'QTY ORD', 'QTY REC', 'AMT ORD', 'AMT REC')));
352: IF l_num > 0 THEN
353: resultout := wf_engine.eng_completed||':'||'Y';
354: WF_ENGINE.SetItemAttrText(itemtype,
355: itemkey,
356: 'NOTF_CONTEXT',
357: 'HOLDNEGOTIABLE');
358: ELSE
355: itemkey,
356: 'NOTF_CONTEXT',
357: 'HOLDNEGOTIABLE');
358: ELSE
359: WF_ENGINE.SetItemAttrText(itemtype,
360: itemkey,
361: 'NOTF_CONTEXT',
362: 'HOLDNONNEGOTIABLE');
363: resultout := wf_engine.eng_completed||':'||'N';
359: WF_ENGINE.SetItemAttrText(itemtype,
360: itemkey,
361: 'NOTF_CONTEXT',
362: 'HOLDNONNEGOTIABLE');
363: resultout := wf_engine.eng_completed||':'||'N';
364: END IF;
365: l_debug_info := 'After select, reultout : ' || resultout;
366: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
367: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
394: l_notf_iteration NUMBER;
395: -- bug 8940578
396: l_comments VARCHAR2(240);
397: BEGIN
398: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
399: itemkey,
400: 'ORG_ID');
401:
402: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
398: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
399: itemkey,
400: 'ORG_ID');
401:
402: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
403: itemkey,
404: 'INVOICE_ID');
405:
406: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
402: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
403: itemkey,
404: 'INVOICE_ID');
405:
406: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
407: itemkey,
408: 'HOLD_ID');
409:
410: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
406: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
407: itemkey,
408: 'HOLD_ID');
409:
410: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
411: itemkey,
412: 'INTERNAL_REP_PERSON_ID');
413:
414: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
410: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
411: itemkey,
412: 'INTERNAL_REP_PERSON_ID');
413:
414: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
415: itemkey,
416: 'ITERATION');
417:
418: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
414: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
415: itemkey,
416: 'ITERATION');
417:
418: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
419: itemkey,
420: 'NOTF_ITERATION');
421: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
422: 'INTERNAL_REP_DISPLAY_NAME');
417:
418: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
419: itemkey,
420: 'NOTF_ITERATION');
421: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
422: 'INTERNAL_REP_DISPLAY_NAME');
423: -- bug 8940578
424: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
425: itemkey,
420: 'NOTF_ITERATION');
421: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
422: 'INTERNAL_REP_DISPLAY_NAME');
423: -- bug 8940578
424: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
425: itemkey,
426: 'WF_NOTE');
427: -- bug 8940578
428:
468: approverPersonIdIn => l_approver_id,
469: approverUserIdIn => NULL,
470: transactionTypeIn => 'APHLD');
471:
472: resultout := wf_engine.eng_completed||':'||'Y';
473: EXCEPTION
474:
475: WHEN OTHERS
476: THEN
494: l_iteration NUMBER;
495: l_notf_iteration NUMBER;
496: l_comments VARCHAR2(240); --Bug9069200
497: BEGIN
498: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
499: itemkey,
500: 'ORG_ID');
501:
502: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
498: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
499: itemkey,
500: 'ORG_ID');
501:
502: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
503: itemkey,
504: 'INVOICE_ID');
505:
506: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
502: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
503: itemkey,
504: 'INVOICE_ID');
505:
506: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
507: itemkey,
508: 'HOLD_ID');
509:
510: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
506: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
507: itemkey,
508: 'HOLD_ID');
509:
510: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
511: itemkey,
512: 'INTERNAL_REP_PERSON_ID');
513:
514: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
510: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
511: itemkey,
512: 'INTERNAL_REP_PERSON_ID');
513:
514: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
515: itemkey,
516: 'ITERATION');
517:
518: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
514: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
515: itemkey,
516: 'ITERATION');
517:
518: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
519: itemkey,
520: 'NOTF_ITERATION');
521:
522: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
518: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
519: itemkey,
520: 'NOTF_ITERATION');
521:
522: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
523: 'INTERNAL_REP_DISPLAY_NAME');
524:
525: --Bug9069200
526: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
522: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
523: 'INTERNAL_REP_DISPLAY_NAME');
524:
525: --Bug9069200
526: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
527: itemkey,'WF_NOTE');
528: --Now set the environment
529: MO_GLOBAL.INIT ('SQLAP');
530: MO_GLOBAL.set_policy_context('S',l_org_id);
575: UPDATE ap_holds_all
576: SET wf_status = 'RELEASED'
577: WHERE hold_id = l_hold_id;
578:
579: resultout := wf_engine.eng_completed||':'||'Y';
580: EXCEPTION
581:
582: WHEN OTHERS
583: THEN
603: -- bug 8940578
604: l_comments VARCHAR2(240);
605:
606: BEGIN
607: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
608: itemkey,
609: 'ORG_ID');
610:
611: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
607: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
608: itemkey,
609: 'ORG_ID');
610:
611: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
612: itemkey,
613: 'INVOICE_ID');
614:
615: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
611: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
612: itemkey,
613: 'INVOICE_ID');
614:
615: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
616: itemkey,
617: 'HOLD_ID');
618:
619: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
615: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
616: itemkey,
617: 'HOLD_ID');
618:
619: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
620: itemkey,
621: 'INTERNAL_REP_PERSON_ID');
622:
623: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
619: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
620: itemkey,
621: 'INTERNAL_REP_PERSON_ID');
622:
623: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
624: itemkey,
625: 'ITERATION');
626:
627: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
623: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
624: itemkey,
625: 'ITERATION');
626:
627: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
628: itemkey,
629: 'NOTF_ITERATION');
630:
631: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
627: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
628: itemkey,
629: 'NOTF_ITERATION');
630:
631: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
632: 'INTERNAL_REP_DISPLAY_NAME');
633: -- bug 8940578
634: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
635: itemkey,
630:
631: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
632: 'INTERNAL_REP_DISPLAY_NAME');
633: -- bug 8940578
634: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
635: itemkey,
636: 'WF_NOTE');
637: -- bug 8940578
638:
676: approverPersonIdIn => l_approver_id,
677: approverUserIdIn => NULL,
678: transactionTypeIn => 'APHLD');
679:
680: resultout := wf_engine.eng_completed||':'||'Y';
681: EXCEPTION
682:
683: WHEN OTHERS
684: THEN
702: l_iteration NUMBER;
703: l_notf_iteration NUMBER;
704: l_comments VARCHAR2(240); --Bug9069200
705: BEGIN
706: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
707: itemkey,
708: 'ORG_ID');
709:
710: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
706: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
707: itemkey,
708: 'ORG_ID');
709:
710: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
711: itemkey,
712: 'INVOICE_ID');
713:
714: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
710: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
711: itemkey,
712: 'INVOICE_ID');
713:
714: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
715: itemkey,
716: 'HOLD_ID');
717:
718: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
714: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
715: itemkey,
716: 'HOLD_ID');
717:
718: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
719: itemkey,
720: 'INTERNAL_REP_PERSON_ID');
721:
722: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
718: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
719: itemkey,
720: 'INTERNAL_REP_PERSON_ID');
721:
722: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
723: itemkey,
724: 'ITERATION');
725:
726: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
722: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
723: itemkey,
724: 'ITERATION');
725:
726: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
727: itemkey,
728: 'NOTF_ITERATION');
729:
730: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
726: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
727: itemkey,
728: 'NOTF_ITERATION');
729:
730: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
731: 'INTERNAL_REP_DISPLAY_NAME');
732:
733: --Bug9069200
734: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
730: l_display_name := WF_ENGINE.getItemAttrText(itemtype, itemkey,
731: 'INTERNAL_REP_DISPLAY_NAME');
732:
733: --Bug9069200
734: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
735: itemkey,'WF_NOTE');
736: --Now set the environment
737: MO_GLOBAL.INIT ('SQLAP');
738: MO_GLOBAL.set_policy_context('S',l_org_id);
784: UPDATE ap_holds_all
785: SET wf_status = 'RELEASED'
786: WHERE hold_id = l_hold_id;
787:
788: resultout := wf_engine.eng_completed||':'||'Y';
789: EXCEPTION
790:
791: WHEN OTHERS
792: THEN
801: funcmode IN VARCHAR2,
802: resultout OUT NOCOPY VARCHAR2 ) IS
803: l_notf_receipient_type VARCHAR2(50);
804: BEGIN
805: l_notf_receipient_type := WF_ENGINE.getItemAttrText(itemtype, itemkey,
806: 'NOTF_RECEIPIENT_TYPE');
807: IF l_notf_receipient_type = 'INTERNAL' THEN
808: resultout := wf_engine.eng_completed||':'||'Y';
809: ELSE
804: BEGIN
805: l_notf_receipient_type := WF_ENGINE.getItemAttrText(itemtype, itemkey,
806: 'NOTF_RECEIPIENT_TYPE');
807: IF l_notf_receipient_type = 'INTERNAL' THEN
808: resultout := wf_engine.eng_completed||':'||'Y';
809: ELSE
810: resultout := wf_engine.eng_completed||':'||'N';
811: END IF;
812: EXCEPTION
806: 'NOTF_RECEIPIENT_TYPE');
807: IF l_notf_receipient_type = 'INTERNAL' THEN
808: resultout := wf_engine.eng_completed||':'||'Y';
809: ELSE
810: resultout := wf_engine.eng_completed||':'||'N';
811: END IF;
812: EXCEPTION
813:
814: WHEN OTHERS
823: funcmode IN VARCHAR2,
824: resultout OUT NOCOPY VARCHAR2 ) IS
825:
826: BEGIN
827: resultout := wf_engine.eng_completed||':'||'Y';
828: EXCEPTION
829:
830: WHEN OTHERS
831: THEN
856: l_curr_calling_sequence VARCHAR2(2000);
857:
858:
859: BEGIN
860: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
861: itemkey,
862: 'ORG_ID');
863:
864: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
860: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
861: itemkey,
862: 'ORG_ID');
863:
864: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
865: itemkey,
866: 'INVOICE_ID');
867:
868: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
864: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
865: itemkey,
866: 'INVOICE_ID');
867:
868: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
869: itemkey,
870: 'HOLD_ID');
871:
872: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
868: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
869: itemkey,
870: 'HOLD_ID');
871:
872: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
873: itemkey,
874: 'SUPPLIER_PERSON_ID');
875: l_internal_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
876: itemkey,
871:
872: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
873: itemkey,
874: 'SUPPLIER_PERSON_ID');
875: l_internal_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
876: itemkey,
877: 'INTERNAL_REP_PERSON_ID');
878: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
879: itemkey,
874: 'SUPPLIER_PERSON_ID');
875: l_internal_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
876: itemkey,
877: 'INTERNAL_REP_PERSON_ID');
878: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
879: itemkey,
880: 'SUPPLIER_DISPLAY_NAME');
881: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
882: itemkey,
877: 'INTERNAL_REP_PERSON_ID');
878: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
879: itemkey,
880: 'SUPPLIER_DISPLAY_NAME');
881: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
882: itemkey,
883: 'PARENT_KEY');
884:
885: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
881: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
882: itemkey,
883: 'PARENT_KEY');
884:
885: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
886: itemkey,
887: 'ITERATION');
888:
889: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
885: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
886: itemkey,
887: 'ITERATION');
888:
889: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
890: itemkey,
891: 'NOTF_ITERATION');
892:
893: --Now set the environment
944: approverPersonIdIn => l_internal_approver_id,
945: approverUserIdIn => NULL,
946: transactionTypeIn => 'APHLD');
947:
948: l_debug_info := 'Before wf_engine.CompleteActivity';
949: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
950: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
951: l_api_name,l_debug_info);
952: END IF;
949: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
950: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
951: l_api_name,l_debug_info);
952: END IF;
953: wf_engine.CompleteActivity(
954: itemType => 'APINVHDN',
955: itemKey => l_parentkey,
956: activity => 'HOLD_MAIN:WAITNEGOTIABLE',
957: result => 'NULL');
959: UPDATE ap_holds_all
960: SET wf_status = 'RELEASED'
961: WHERE hold_id = l_hold_id;
962:
963: resultout := wf_engine.eng_completed||':'||'Y';
964: EXCEPTION
965:
966: WHEN OTHERS
967: THEN
976: funcmode IN VARCHAR2,
977: resultout OUT NOCOPY VARCHAR2 ) IS
978:
979: BEGIN
980: resultout := wf_engine.eng_completed||':'||'Y';
981: EXCEPTION
982:
983: WHEN OTHERS
984: THEN
1031:
1032:
1033:
1034: BEGIN
1035: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1036: itemkey,
1037: 'ORG_ID');
1038:
1039: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1035: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1036: itemkey,
1037: 'ORG_ID');
1038:
1039: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1040: itemkey,
1041: 'INVOICE_ID');
1042:
1043: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1039: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1040: itemkey,
1041: 'INVOICE_ID');
1042:
1043: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1044: itemkey,
1045: 'HOLD_ID');
1046:
1047: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1043: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1044: itemkey,
1045: 'HOLD_ID');
1046:
1047: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1048: itemkey,
1049: 'SUPPLIER_PERSON_ID');
1050: l_internal_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1051: itemkey,
1046:
1047: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1048: itemkey,
1049: 'SUPPLIER_PERSON_ID');
1050: l_internal_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1051: itemkey,
1052: 'INTERNAL_REP_PERSON_ID');
1053: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
1054: itemkey,
1049: 'SUPPLIER_PERSON_ID');
1050: l_internal_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1051: itemkey,
1052: 'INTERNAL_REP_PERSON_ID');
1053: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
1054: itemkey,
1055: 'SUPPLIER_DISPLAY_NAME');
1056: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
1057: itemkey,
1052: 'INTERNAL_REP_PERSON_ID');
1053: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
1054: itemkey,
1055: 'SUPPLIER_DISPLAY_NAME');
1056: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
1057: itemkey,
1058: 'PARENT_KEY');
1059:
1060: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1056: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
1057: itemkey,
1058: 'PARENT_KEY');
1059:
1060: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1061: itemkey,
1062: 'ITERATION');
1063:
1064: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1060: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1061: itemkey,
1062: 'ITERATION');
1063:
1064: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1065: itemkey,
1066: 'NOTF_ITERATION');
1067:
1068: --Now set the environment
1132: approverPersonIdIn => l_internal_approver_id,
1133: approverUserIdIn => NULL,
1134: transactionTypeIn => 'APHLD');
1135:
1136: l_debug_info := 'Before wf_engine.CompleteActivity';
1137: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1138: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
1139: l_api_name,l_debug_info);
1140: END IF;
1137: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1138: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
1139: l_api_name,l_debug_info);
1140: END IF;
1141: wf_engine.CompleteActivity(
1142: itemType => 'APINVHDN',
1143: itemKey => l_parentkey,
1144: activity => 'HOLD_MAIN:WAITNEGOTIABLE',
1145: result => 'NULL');
1143: itemKey => l_parentkey,
1144: activity => 'HOLD_MAIN:WAITNEGOTIABLE',
1145: result => 'NULL');
1146:
1147: resultout := wf_engine.eng_completed||':'||'Y';
1148: EXCEPTION
1149:
1150: WHEN OTHERS
1151: THEN
1173: l_success BOOLEAN;
1174: l_error_code VARCHAR2(4000);
1175: l_curr_calling_sequence VARCHAR2(2000);
1176: BEGIN
1177: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1178: itemkey,
1179: 'ORG_ID');
1180:
1181: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1177: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1178: itemkey,
1179: 'ORG_ID');
1180:
1181: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1182: itemkey,
1183: 'INVOICE_ID');
1184:
1185: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1181: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1182: itemkey,
1183: 'INVOICE_ID');
1184:
1185: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1186: itemkey,
1187: 'HOLD_ID');
1188:
1189: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1185: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1186: itemkey,
1187: 'HOLD_ID');
1188:
1189: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1190: itemkey,
1191: 'INTERNAL_REP_PERSON_ID');
1192: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
1193: itemkey,
1188:
1189: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1190: itemkey,
1191: 'INTERNAL_REP_PERSON_ID');
1192: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
1193: itemkey,
1194: 'INTERNAL_REP_DISPLAY_NAME');
1195: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
1196: itemkey,
1191: 'INTERNAL_REP_PERSON_ID');
1192: l_display_name := WF_ENGINE.GETITEMATTRText(itemtype,
1193: itemkey,
1194: 'INTERNAL_REP_DISPLAY_NAME');
1195: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
1196: itemkey,
1197: 'PARENT_KEY');
1198:
1199: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1195: l_parentkey := WF_ENGINE.GETITEMATTRText(itemtype,
1196: itemkey,
1197: 'PARENT_KEY');
1198:
1199: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1200: itemkey,
1201: 'ITERATION');
1202:
1203: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1199: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1200: itemkey,
1201: 'ITERATION');
1202:
1203: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1204: itemkey,
1205: 'NOTF_ITERATION');
1206:
1207:
1259: approverPersonIdIn => l_approver_id,
1260: approverUserIdIn => NULL,
1261: transactionTypeIn => 'APHLD');
1262:
1263: l_debug_info := 'Before wf_engine.CompleteActivity';
1264: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1265: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
1266: l_api_name,l_debug_info);
1267: END IF;
1264: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1265: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
1266: l_api_name,l_debug_info);
1267: END IF;
1268: wf_engine.CompleteActivity(
1269: itemType => 'APINVHDN',
1270: itemKey => l_parentkey,
1271: activity => 'HOLD_MAIN:WAITNEGOTIABLE',
1272: result => 'NULL');
1275: UPDATE ap_holds_all
1276: SET wf_status = 'RELEASED'
1277: WHERE hold_id = l_hold_id;
1278:
1279: resultout := wf_engine.eng_completed||':'||'Y';
1280: EXCEPTION
1281:
1282: WHEN OTHERS
1283: THEN
1327: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
1328: l_api_name,l_debug_info);
1329: END IF;
1330:
1331: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1332: itemkey,
1333: 'ORG_ID');
1334:
1335: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1331: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1332: itemkey,
1333: 'ORG_ID');
1334:
1335: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1336: itemkey,
1337: 'INVOICE_ID');
1338:
1339: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1335: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1336: itemkey,
1337: 'INVOICE_ID');
1338:
1339: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1340: itemkey,
1341: 'ITERATION');
1342:
1343: l_debug_info := 'get invoice amount';
1446: SET WFApproval_Status = 'NOT REQUIRED'
1447: WHERE Invoice_Id = l_invoice_id
1448: AND WFApproval_Status = 'INITIATED';
1449:
1450: resultout := wf_engine.eng_completed||':'||'N';
1451:
1452: --we do not care if there are anymore
1453: --productions
1454: EXIT;
1521: SET WFApproval_Status = 'REJECTED'
1522: WHERE Invoice_Id = l_invoice_id
1523: AND WFApproval_Status = 'INITIATED';
1524:
1525: resultout := wf_engine.eng_completed||':'||'N';
1526: END IF; --required and rejected
1527:
1528: ELSE --there were no production results
1529:
1531: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
1532: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
1533: l_api_name,l_debug_info);
1534: END IF;
1535: resultout := wf_engine.eng_completed||':'||'Y';
1536:
1537: END IF;
1538:
1539: resultout := nvl(resultout, wf_engine.eng_completed||':'||'Y');
1535: resultout := wf_engine.eng_completed||':'||'Y';
1536:
1537: END IF;
1538:
1539: resultout := nvl(resultout, wf_engine.eng_completed||':'||'Y');
1540:
1541: EXCEPTION
1542: WHEN OTHERS
1543: THEN
1588: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
1589: l_api_name,l_debug_info);
1590: END IF;
1591:
1592: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1593: itemkey,
1594: 'ORG_ID');
1595:
1596: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1592: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1593: itemkey,
1594: 'ORG_ID');
1595:
1596: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1597: itemkey,
1598: 'INVOICE_ID');
1599:
1600: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1596: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
1597: itemkey,
1598: 'INVOICE_ID');
1599:
1600: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
1601: itemkey,
1602: 'ITERATION');
1603:
1604: --check AME if any production rules should prevent approval
1749: G_CURRENT_RUNTIME_LEVEL) THEN
1750: FND_LOG.STRING(G_LEVEL_STATEMENT,
1751: G_MODULE_NAME||l_api_name,l_debug_info);
1752: END IF;
1753: resultout := wf_engine.eng_completed||':'||'Y';
1754: ELSE
1755: l_debug_info := 'No More Lines require approval in this invoice';
1756: IF (G_LEVEL_STATEMENT >=
1757: G_CURRENT_RUNTIME_LEVEL) THEN
1757: G_CURRENT_RUNTIME_LEVEL) THEN
1758: FND_LOG.STRING(G_LEVEL_STATEMENT,
1759: G_MODULE_NAME||l_api_name,l_debug_info);
1760: END IF;
1761: resultout := wf_engine.eng_completed||':'||'N';
1762: END IF;
1763: */
1764: resultout := wf_engine.eng_completed||':'||'Y';
1765:
1760: END IF;
1761: resultout := wf_engine.eng_completed||':'||'N';
1762: END IF;
1763: */
1764: resultout := wf_engine.eng_completed||':'||'Y';
1765:
1766: EXCEPTION
1767:
1768: WHEN OTHERS
1810: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
1811: l_api_name,l_debug_info);
1812: END IF;
1813:
1814: l_invoice_id := WF_ENGINE.GETITEMATTRNumber
1815: (itemtype,
1816: itemkey,
1817: 'INVOICE_ID');
1818: l_iteration := WF_ENGINE.GETITEMATTRNumber
1814: l_invoice_id := WF_ENGINE.GETITEMATTRNumber
1815: (itemtype,
1816: itemkey,
1817: 'INVOICE_ID');
1818: l_iteration := WF_ENGINE.GETITEMATTRNumber
1819: (itemtype,
1820: itemkey,
1821: 'ITERATION');
1822: l_org_id := WF_ENGINE.GETITEMATTRNumber
1818: l_iteration := WF_ENGINE.GETITEMATTRNumber
1819: (itemtype,
1820: itemkey,
1821: 'ITERATION');
1822: l_org_id := WF_ENGINE.GETITEMATTRNumber
1823: (itemtype,
1824: itemkey,
1825: 'ORG_ID');
1826: l_debug_info := l_api_name ||
1975: -- bug 13919019 start
1976: -- These values have to be cleared of before starting as the residue values will cause issue
1977: -- in case of approver groups which has more than one approver and
1978: -- the notification is escalated in the previous level
1979: WF_ENGINE.SetItemAttrText(itemtype,
1980: itemkey,
1981: 'ESCALATED',
1982: null);
1983: WF_ENGINE.SetItemAttrText(itemtype,
1979: WF_ENGINE.SetItemAttrText(itemtype,
1980: itemkey,
1981: 'ESCALATED',
1982: null);
1983: WF_ENGINE.SetItemAttrText(itemtype,
1984: itemkey,
1985: 'FORWARD_ROLE',
1986: null);
1987: WF_ENGINE.SetItemAttrText(itemtype,
1983: WF_ENGINE.SetItemAttrText(itemtype,
1984: itemkey,
1985: 'FORWARD_ROLE',
1986: null);
1987: WF_ENGINE.SetItemAttrText(itemtype,
1988: itemkey,
1989: 'ESC_ROLE_NAME',
1990: null);
1991:
1988: itemkey,
1989: 'ESC_ROLE_NAME',
1990: null);
1991:
1992: WF_ENGINE.SetItemAttrText(itemtype,
1993: itemkey,
1994: 'ESC_ROLE_ACTUAL',
1995: null);
1996:
2170: -- bug 13919019 start
2171: -- These values have to be cleared of before starting as the residue values will cause issue
2172: -- in case of approver groups which has more than one approver and
2173: -- the notification is escalated in the previous level
2174: WF_ENGINE.SetItemAttrText(itemtype,
2175: itemkey,
2176: 'ESCALATED',
2177: null);
2178: WF_ENGINE.SetItemAttrText(itemtype,
2174: WF_ENGINE.SetItemAttrText(itemtype,
2175: itemkey,
2176: 'ESCALATED',
2177: null);
2178: WF_ENGINE.SetItemAttrText(itemtype,
2179: itemkey,
2180: 'FORWARD_ROLE',
2181: null);
2182: WF_ENGINE.SetItemAttrText(itemtype,
2178: WF_ENGINE.SetItemAttrText(itemtype,
2179: itemkey,
2180: 'FORWARD_ROLE',
2181: null);
2182: WF_ENGINE.SetItemAttrText(itemtype,
2183: itemkey,
2184: 'ESC_ROLE_NAME',
2185: null);
2186:
2183: itemkey,
2184: 'ESC_ROLE_NAME',
2185: null);
2186:
2187: WF_ENGINE.SetItemAttrText(itemtype,
2188: itemkey,
2189: 'ESC_ROLE_ACTUAL',
2190: null);
2191:
2303: END IF; -- end if for IF nvl(l_next_approver.item_class,
2304: -- 'line item') <> ame_util.headerItemClassName
2305: END LOOP; --nextApprovers table
2306: END IF; --complete
2307: resultout := wf_engine.eng_completed;
2308: EXCEPTION
2309: WHEN OTHERS THEN
2310: WF_CORE.CONTEXT('APINVAPR','get_approvers',itemtype,
2311: itemkey, to_char(actid), funcmode);
2357: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2358: l_api_name,l_debug_info);
2359: END IF;
2360:
2361: l_invoice_id := WF_ENGINE.GETITEMATTRNumber
2362: (itemtype,
2363: itemkey,
2364: 'INVOICE_ID');
2365: l_iteration := WF_ENGINE.GETITEMATTRNumber
2361: l_invoice_id := WF_ENGINE.GETITEMATTRNumber
2362: (itemtype,
2363: itemkey,
2364: 'INVOICE_ID');
2365: l_iteration := WF_ENGINE.GETITEMATTRNumber
2366: (itemtype,
2367: itemkey,
2368: 'ITERATION');
2369:
2443:
2444: END LOOP;
2445:
2446: IF l_pend <> 0 THEN
2447: resultout := wf_engine.eng_completed||':'||'MORE';
2448: ELSE
2449: l_debug_info := 'Into the No Pending Case';
2450: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
2451: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2521: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2522: l_api_name,l_debug_info);
2523: END IF;
2524:
2525: resultout := wf_engine.eng_completed||':'||'FINISH';
2526:
2527: ELSIF l_sent >0 THEN
2528:
2529: l_debug_info := 'Set the Result to Finish';
2530: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
2531: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2532: l_api_name,l_debug_info);
2533: END IF;
2534: resultout := wf_engine.eng_completed||':'||'WAIT';
2535:
2536: ELSIF l_sent = 0 AND l_comp >0 THEN
2537:
2538: l_debug_info := l_api_name ||': all complete but none sent';
2579: WHERE Invoice_Id = l_invoice_id;
2580:
2581:
2582:
2583: resultout := wf_engine.eng_completed||':'||'FINISH';
2584: END IF; -- sent/complete checks
2585: END IF;
2586:
2587: EXCEPTION
2648: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2649: l_api_name,l_debug_info);
2650: END IF;
2651:
2652: l_invoice_id := WF_ENGINE.GETITEMATTRNumber
2653: (itemtype,
2654: itemkey,
2655: 'INVOICE_ID');
2656: l_org_id := WF_ENGINE.GETITEMATTRNumber
2652: l_invoice_id := WF_ENGINE.GETITEMATTRNumber
2653: (itemtype,
2654: itemkey,
2655: 'INVOICE_ID');
2656: l_org_id := WF_ENGINE.GETITEMATTRNumber
2657: (itemtype,
2658: itemkey,
2659: 'ORG_ID');
2660:
2781: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2782: l_api_name,l_debug_info);
2783: END IF;
2784:
2785: WF_ENGINE.createProcess('APINVAPR',
2786: l_notification_key,
2787: 'APPROVAL_INVOICE_LINES');
2788:
2789: l_debug_info := 'After: Create The Lines Sub Process';
2802: l_orig_system_id,
2803: Notif_Process_Rec.role_name,
2804: l_approver_name);
2805:
2806: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2807: l_notification_key,
2808: 'ORG_ID',
2809: l_org_id);
2810: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2806: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2807: l_notification_key,
2808: 'ORG_ID',
2809: l_org_id);
2810: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2811: l_notification_key,
2812: 'INVOICE_ID',
2813: l_invoice_id);
2814: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2810: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2811: l_notification_key,
2812: 'INVOICE_ID',
2813: l_invoice_id);
2814: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2815: l_notification_key,
2816: 'INVOICE_ITERATION',
2817: l_invoice_iteration);
2818: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2814: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2815: l_notification_key,
2816: 'INVOICE_ITERATION',
2817: l_invoice_iteration);
2818: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2819: l_notification_key,
2820: 'NOTF_ITERATION',
2821: l_notification_iteration);
2822: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2818: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2819: l_notification_key,
2820: 'NOTF_ITERATION',
2821: l_notification_iteration);
2822: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2823: l_notification_key,
2824: 'APPROVER_ID',
2825: l_orig_system_id);
2826: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2822: WF_ENGINE.SetItemAttrNumber('APINVAPR',
2823: l_notification_key,
2824: 'APPROVER_ID',
2825: l_orig_system_id);
2826: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2827: l_notification_key,
2828: 'ROLE_NAME',
2829: Notif_Process_Rec.role_name);
2830: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2826: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2827: l_notification_key,
2828: 'ROLE_NAME',
2829: Notif_Process_Rec.role_name);
2830: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2831: l_notification_key,
2832: 'APPROVER_NAME',
2833: l_approver_name);
2834: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2830: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2831: l_notification_key,
2832: 'APPROVER_NAME',
2833: l_approver_name);
2834: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2835: l_notification_key,
2836: 'INVOICE_SUPPLIER_NAME',
2837: l_invoice_supplier_name);
2838: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2834: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2835: l_notification_key,
2836: 'INVOICE_SUPPLIER_NAME',
2837: l_invoice_supplier_name);
2838: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2839: l_notification_key,
2840: 'INVOICE_SUPPLIER_SITE',
2841: l_invoice_supplier_site);
2842: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2838: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2839: l_notification_key,
2840: 'INVOICE_SUPPLIER_SITE',
2841: l_invoice_supplier_site);
2842: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2843: l_notification_key,
2844: 'INVOICE_NUMBER',
2845: l_invoice_number);
2846: WF_ENGINE.SETITEMATTRDATE('APINVAPR',
2842: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2843: l_notification_key,
2844: 'INVOICE_NUMBER',
2845: l_invoice_number);
2846: WF_ENGINE.SETITEMATTRDATE('APINVAPR',
2847: l_notification_key,
2848: 'INVOICE_DATE',
2849: l_invoice_date);
2850: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2846: WF_ENGINE.SETITEMATTRDATE('APINVAPR',
2847: l_notification_key,
2848: 'INVOICE_DATE',
2849: l_invoice_date);
2850: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2851: l_notification_key,
2852: 'INVOICE_DESCRIPTION',
2853: l_invoice_description);
2854: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2850: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2851: l_notification_key,
2852: 'INVOICE_DESCRIPTION',
2853: l_invoice_description);
2854: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2855: l_notification_key,
2856: 'NOTIFICATION_KEY',
2857: l_notification_key);
2858: WF_ENGINE.SETITEMATTRNUMBER
2854: WF_ENGINE.SETITEMATTRTEXT('APINVAPR',
2855: l_notification_key,
2856: 'NOTIFICATION_KEY',
2857: l_notification_key);
2858: WF_ENGINE.SETITEMATTRNUMBER
2859: (
2860: itemtype => 'APINVAPR',
2861: itemkey => l_notification_key,
2862: aname => 'INVOICE_TOTAL',
2861: itemkey => l_notification_key,
2862: aname => 'INVOICE_TOTAL',
2863: avalue => l_invoice_total
2864: );
2865: WF_ENGINE.SETITEMATTRTEXT
2866: (
2867: itemtype => 'APINVAPR',
2868: itemkey => l_notification_key,
2869: aname => 'INVOICE_CURRENCY_CODE',
2880: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2881: l_api_name,l_debug_info);
2882: END IF;
2883:
2884: WF_ENGINE.setItemParent('APINVAPR',
2885: l_notification_key,
2886: 'APINVAPR',
2887: itemKey,
2888: null);
2892: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2893: l_api_name,l_debug_info);
2894: END IF;
2895:
2896: wf_engine.startProcess('APINVAPR', l_notification_key);
2897:
2898: l_debug_info := 'Update the ap_apinv_approvers notification status';
2899: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
2900: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2908: END IF;
2909:
2910: END LOOP;
2911:
2912: resultout := wf_engine.eng_completed||':'||'Y';
2913:
2914: EXCEPTION
2915:
2916: WHEN OTHERS
2929: funcmode IN VARCHAR2,
2930: resultout OUT NOCOPY VARCHAR2 ) IS
2931:
2932: BEGIN
2933: resultout := wf_engine.eng_completed||':'||'Y';
2934: EXCEPTION
2935:
2936: WHEN OTHERS
2937: THEN
2974: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
2975: l_api_name,l_debug_info);
2976: END IF;
2977:
2978: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
2979: itemkey,
2980: 'INVOICE_ID');
2981:
2982: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
2978: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
2979: itemkey,
2980: 'INVOICE_ID');
2981:
2982: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
2983: itemkey,
2984: 'WF_NOTE');
2985:
2986: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
2982: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
2983: itemkey,
2984: 'WF_NOTE');
2985:
2986: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
2987: itemkey,
2988: 'ORG_ID');
2989:
2990: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
2986: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
2987: itemkey,
2988: 'ORG_ID');
2989:
2990: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
2991: itemkey,
2992: 'INVOICE_TOTAL');
2993:
2994: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
2990: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
2991: itemkey,
2992: 'INVOICE_TOTAL');
2993:
2994: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
2995: itemkey,
2996: 'APPROVER_NAME');
2997:
2998: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
2994: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
2995: itemkey,
2996: 'APPROVER_NAME');
2997:
2998: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
2999: itemkey,
3000: 'ESC_ROLE_NAME');
3001:
3002: l_document_approver := WF_ENGINE.GetItemAttrText(itemtype,
2998: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
2999: itemkey,
3000: 'ESC_ROLE_NAME');
3001:
3002: l_document_approver := WF_ENGINE.GetItemAttrText(itemtype,
3003: itemkey,
3004: 'DOCUMENT_APPROVER');
3005:
3006: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3002: l_document_approver := WF_ENGINE.GetItemAttrText(itemtype,
3003: itemkey,
3004: 'DOCUMENT_APPROVER');
3005:
3006: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3007: itemkey,
3008: 'APPROVER_ID');
3009:
3010: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3006: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3007: itemkey,
3008: 'APPROVER_ID');
3009:
3010: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3011: itemkey,
3012: 'ESCALATED');
3013:
3014: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3010: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3011: itemkey,
3012: 'ESCALATED');
3013:
3014: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3015: itemkey,
3016: 'ESC_APPROVER_NAME');
3017:
3018: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3014: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3015: itemkey,
3016: 'ESC_APPROVER_NAME');
3017:
3018: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3019: itemkey,
3020: 'ESC_APPROVER_ID');
3021:
3022: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3018: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3019: itemkey,
3020: 'ESC_APPROVER_ID');
3021:
3022: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3023: itemkey,
3024: 'ITERATION');
3025:
3026:
3089: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3090: l_api_name,l_debug_info);
3091: END IF;
3092:
3093: resultout := wf_engine.eng_completed||':'||'Y';
3094: EXCEPTION
3095: WHEN OTHERS
3096: THEN
3097: WF_CORE.CONTEXT('APINVAPR','process_doc_rejection',itemtype,
3138: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3139: l_api_name,l_debug_info);
3140: END IF;
3141:
3142: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
3143: itemkey,
3144: 'INVOICE_ID');
3145:
3146: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3142: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
3143: itemkey,
3144: 'INVOICE_ID');
3145:
3146: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3147: itemkey,
3148: 'WF_NOTE');
3149:
3150: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3146: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3147: itemkey,
3148: 'WF_NOTE');
3149:
3150: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3151: itemkey,
3152: 'ORG_ID');
3153:
3154: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
3150: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3151: itemkey,
3152: 'ORG_ID');
3153:
3154: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
3155: itemkey,
3156: 'INVOICE_TOTAL');
3157:
3158: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3154: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
3155: itemkey,
3156: 'INVOICE_TOTAL');
3157:
3158: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3159: itemkey,
3160: 'APPROVER_NAME');
3161:
3162: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3158: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3159: itemkey,
3160: 'APPROVER_NAME');
3161:
3162: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3163: itemkey,
3164: 'ESC_ROLE_NAME');
3165:
3166: l_document_approver := WF_ENGINE.GetItemAttrText(itemtype,
3162: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3163: itemkey,
3164: 'ESC_ROLE_NAME');
3165:
3166: l_document_approver := WF_ENGINE.GetItemAttrText(itemtype,
3167: itemkey,
3168: 'DOCUMENT_APPROVER');
3169:
3170: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3166: l_document_approver := WF_ENGINE.GetItemAttrText(itemtype,
3167: itemkey,
3168: 'DOCUMENT_APPROVER');
3169:
3170: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3171: itemkey,
3172: 'APPROVER_ID');
3173:
3174: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3170: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3171: itemkey,
3172: 'APPROVER_ID');
3173:
3174: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3175: itemkey,
3176: 'ESCALATED');
3177:
3178: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3174: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3175: itemkey,
3176: 'ESCALATED');
3177:
3178: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3179: itemkey,
3180: 'ESC_APPROVER_NAME');
3181:
3182: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3178: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3179: itemkey,
3180: 'ESC_APPROVER_NAME');
3181:
3182: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3183: itemkey,
3184: 'ESC_APPROVER_ID');
3185:
3186: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3182: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3183: itemkey,
3184: 'ESC_APPROVER_ID');
3185:
3186: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3187: itemkey,
3188: 'ITERATION');
3189:
3190: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3186: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3187: itemkey,
3188: 'ITERATION');
3189:
3190: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3191: itemkey,
3192: 'NOTF_ITERATION');
3193: -- added for the delegation enhancement
3194: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
3190: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3191: itemkey,
3192: 'NOTF_ITERATION');
3193: -- added for the delegation enhancement
3194: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
3195: itemkey,
3196: 'ROLE_ACTUAL');
3197: l_esc_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
3198: itemkey,
3193: -- added for the delegation enhancement
3194: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
3195: itemkey,
3196: 'ROLE_ACTUAL');
3197: l_esc_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
3198: itemkey,
3199: 'ESC_ROLE_ACTUAL');
3200: -- added for the delegation enhancement
3201: l_user_id := nvl(to_number(fnd_profile.value('USER_ID')),-1);
3255:
3256: -- Set WF_NOTE to null
3257: -- 01/24/2007
3258:
3259: WF_ENGINE.SetItemAttrText('APINVAPR',
3260: itemkey,
3261: 'WF_NOTE',
3262: null);
3263: -- added for the delegation enhancement
3261: 'WF_NOTE',
3262: null);
3263: -- added for the delegation enhancement
3264:
3265: WF_ENGINE.SetItemAttrText(itemtype,
3266: itemkey,
3267: 'FORWARD_ROLE',
3268: null);
3269: -- added for the delegation enhancement
3276: l_api_name,l_debug_info);
3277: END IF;
3278:
3279:
3280: resultout := wf_engine.eng_completed||':'||'Y';
3281: EXCEPTION
3282: WHEN OTHERS
3283: THEN
3284: WF_CORE.CONTEXT('APINVAPR','process_doc_approval',itemtype,
3338: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3339: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3340: l_api_name,l_debug_info);
3341: END IF;
3342: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
3343: itemkey,
3344: 'INVOICE_ID');
3345:
3346: --commented for bug 13566970
3343: itemkey,
3344: 'INVOICE_ID');
3345:
3346: --commented for bug 13566970
3347: /* l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3348: itemkey,
3349: 'ITERATION'); */
3350: -- added for bug 13566970
3351: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3347: /* l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3348: itemkey,
3349: 'ITERATION'); */
3350: -- added for bug 13566970
3351: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3352: itemkey,
3353: 'INVOICE_ITERATION');
3354: --end of bug 13566970
3355:
3352: itemkey,
3353: 'INVOICE_ITERATION');
3354: --end of bug 13566970
3355:
3356: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3357: itemkey,
3358: 'WF_NOTE');
3359:
3360: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3356: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3357: itemkey,
3358: 'WF_NOTE');
3359:
3360: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3361: itemkey,
3362: 'ORG_ID');
3363:
3364: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3360: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3361: itemkey,
3362: 'ORG_ID');
3363:
3364: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3365: itemkey,
3366: 'APPROVER_NAME');
3367:
3368: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3364: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3365: itemkey,
3366: 'APPROVER_NAME');
3367:
3368: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3369: itemkey,
3370: 'ESC_ROLE_NAME');
3371:
3372: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3368: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3369: itemkey,
3370: 'ESC_ROLE_NAME');
3371:
3372: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3373: itemkey,
3374: 'ROLE_NAME');
3375:
3376: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3372: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3373: itemkey,
3374: 'ROLE_NAME');
3375:
3376: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3377: itemkey,
3378: 'APPROVER_ID');
3379:
3380: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3376: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3377: itemkey,
3378: 'APPROVER_ID');
3379:
3380: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3381: itemkey,
3382: 'ESCALATED');
3383: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3384: itemkey,
3379:
3380: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3381: itemkey,
3382: 'ESCALATED');
3383: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3384: itemkey,
3385: 'ESC_APPROVER_NAME');
3386:
3387: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3383: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3384: itemkey,
3385: 'ESC_APPROVER_NAME');
3386:
3387: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3388: itemkey,
3389: 'ESC_APPROVER_ID');
3390:
3391: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3387: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3388: itemkey,
3389: 'ESC_APPROVER_ID');
3390:
3391: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3392: itemkey,
3393: 'NOTF_ITERATION');
3394:
3395: l_user_id := nvl(to_number(fnd_profile.value('USER_ID')),-1);
3499: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3500: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3501: l_api_name,l_debug_info);
3502: END IF;
3503: wf_engine.CompleteActivity(
3504: itemType => 'APINVAPR',
3505: itemKey => l_invoice_key,
3506: activity => 'APPROVAL_MAIN:BLOCK',
3507: result => 'NULL');
3510: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3511: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3512: l_api_name,l_debug_info);
3513: END IF;
3514: resultout := wf_engine.eng_completed||':'||'Y';
3515: EXCEPTION
3516:
3517: WHEN OTHERS
3518: THEN
3572: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3573: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3574: l_api_name,l_debug_info);
3575: END IF;
3576: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
3577: itemkey,
3578: 'INVOICE_ID');
3579:
3580: --commented for bug 13566970
3577: itemkey,
3578: 'INVOICE_ID');
3579:
3580: --commented for bug 13566970
3581: /* l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3582: itemkey,
3583: 'ITERATION'); */
3584: --added for bug 13566970
3585: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3581: /* l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3582: itemkey,
3583: 'ITERATION'); */
3584: --added for bug 13566970
3585: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3586: itemkey,
3587: 'INVOICE_ITERATION');
3588: --end of bug 13566970
3589:
3586: itemkey,
3587: 'INVOICE_ITERATION');
3588: --end of bug 13566970
3589:
3590: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3591: itemkey,
3592: 'NOTF_ITERATION');
3593:
3594: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3590: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3591: itemkey,
3592: 'NOTF_ITERATION');
3593:
3594: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3595: itemkey,
3596: 'WF_NOTE');
3597:
3598: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3594: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3595: itemkey,
3596: 'WF_NOTE');
3597:
3598: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3599: itemkey,
3600: 'ORG_ID');
3601:
3602: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3598: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3599: itemkey,
3600: 'ORG_ID');
3601:
3602: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3603: itemkey,
3604: 'APPROVER_NAME');
3605:
3606: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3602: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3603: itemkey,
3604: 'APPROVER_NAME');
3605:
3606: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3607: itemkey,
3608: 'ESC_ROLE_NAME');
3609:
3610: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3606: l_esc_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3607: itemkey,
3608: 'ESC_ROLE_NAME');
3609:
3610: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3611: itemkey,
3612: 'ROLE_NAME');
3613:
3614: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3610: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3611: itemkey,
3612: 'ROLE_NAME');
3613:
3614: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3615: itemkey,
3616: 'APPROVER_ID');
3617:
3618: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3614: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3615: itemkey,
3616: 'APPROVER_ID');
3617:
3618: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3619: itemkey,
3620: 'ESCALATED');
3621: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3622: itemkey,
3617:
3618: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
3619: itemkey,
3620: 'ESCALATED');
3621: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3622: itemkey,
3623: 'ESC_APPROVER_NAME');
3624:
3625: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3621: l_esc_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3622: itemkey,
3623: 'ESC_APPROVER_NAME');
3624:
3625: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3626: itemkey,
3627: 'ESC_APPROVER_ID');
3628: /*-- added for the delegation enhancement
3629: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
3625: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3626: itemkey,
3627: 'ESC_APPROVER_ID');
3628: /*-- added for the delegation enhancement
3629: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
3630: itemkey,
3631: 'ROLE_ACTUAL');
3632: l_esc_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
3633: itemkey,
3628: /*-- added for the delegation enhancement
3629: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
3630: itemkey,
3631: 'ROLE_ACTUAL');
3632: l_esc_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
3633: itemkey,
3634: 'ESC_ROLE_ACTUAL');
3635: -- added for the delegation enhancement
3636:
3755: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3756: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3757: l_api_name,l_debug_info);
3758: END IF;
3759: wf_engine.CompleteActivity(
3760: itemType => 'APINVAPR',
3761: itemKey => l_invoice_key,
3762: activity => 'APPROVAL_MAIN:BLOCK',
3763: result => 'NULL');
3766: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3767: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3768: l_api_name,l_debug_info);
3769: END IF;
3770: resultout := wf_engine.eng_completed||':'||'Y';
3771: EXCEPTION
3772:
3773: WHEN OTHERS
3774: THEN
3783: funcmode IN VARCHAR2,
3784: resultout OUT NOCOPY VARCHAR2 ) IS
3785:
3786: BEGIN
3787: resultout := wf_engine.eng_completed||':'||'Y';
3788: EXCEPTION
3789:
3790: WHEN OTHERS
3791: THEN
3800: funcmode IN VARCHAR2,
3801: resultout OUT NOCOPY VARCHAR2 ) IS
3802:
3803: BEGIN
3804: resultout := wf_engine.eng_completed||':'||'Y';
3805: EXCEPTION
3806:
3807: WHEN OTHERS
3808: THEN
3821: funcmode IN VARCHAR2,
3822: resultout OUT NOCOPY VARCHAR2 ) IS
3823:
3824: BEGIN
3825: resultout := wf_engine.eng_completed||':'||'Y';
3826: EXCEPTION
3827:
3828: WHEN OTHERS
3829: THEN
3837: funcmode IN VARCHAR2,
3838: resultout OUT NOCOPY VARCHAR2 ) IS
3839:
3840: BEGIN
3841: resultout := wf_engine.eng_completed||':'||'Y';
3842: EXCEPTION
3843:
3844: WHEN OTHERS
3845: THEN
3891: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3892: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
3893: l_api_name,l_debug_info);
3894: END IF;
3895: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
3896: itemkey,
3897: 'INVOICE_ID');
3898:
3899: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3895: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
3896: itemkey,
3897: 'INVOICE_ID');
3898:
3899: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3900: itemkey,
3901: 'ITERATION');
3902:
3903: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
3899: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
3900: itemkey,
3901: 'ITERATION');
3902:
3903: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
3904: itemkey,
3905: 'PARENT_KEY');
3906:
3907: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3903: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
3904: itemkey,
3905: 'PARENT_KEY');
3906:
3907: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3908: itemkey,
3909: 'WF_NOTE');
3910:
3911: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3907: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
3908: itemkey,
3909: 'WF_NOTE');
3910:
3911: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3912: itemkey,
3913: 'ORG_ID');
3914:
3915: MO_GLOBAL.INIT ('SQLAP');
3915: MO_GLOBAL.INIT ('SQLAP');
3916: MO_GLOBAL.set_policy_context('S',l_org_id);
3917:
3918:
3919: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3920: itemkey,
3921: 'INTERNAL_REP_DISPLAY_NAME');
3922:
3923: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3919: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
3920: itemkey,
3921: 'INTERNAL_REP_DISPLAY_NAME');
3922:
3923: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3924: itemkey,
3925: 'INTERNAL_REP_ROLE');
3926:
3927: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3923: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
3924: itemkey,
3925: 'INTERNAL_REP_ROLE');
3926:
3927: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3928: itemkey,
3929: 'INTERNAL_REP_PERSON_ID');
3930:
3931:
3928: itemkey,
3929: 'INTERNAL_REP_PERSON_ID');
3930:
3931:
3932: l_supplier_name := WF_ENGINE.GetItemAttrText(itemtype,
3933: itemkey,
3934: 'SUPPLIER_DISPLAY_NAME');
3935:
3936: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
3932: l_supplier_name := WF_ENGINE.GetItemAttrText(itemtype,
3933: itemkey,
3934: 'SUPPLIER_DISPLAY_NAME');
3935:
3936: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
3937: itemkey,
3938: 'SUPPLIER_ROLE');
3939:
3940: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3936: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
3937: itemkey,
3938: 'SUPPLIER_ROLE');
3939:
3940: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3941: itemkey,
3942: 'SUPPLIER_PERSON_ID');
3943:
3944: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3940: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
3941: itemkey,
3942: 'SUPPLIER_PERSON_ID');
3943:
3944: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
3945: itemkey,
3946: 'NOTF_ITERATION');
3947:
3948:
4002: ,'CREDIT MEMO REQUEST') THEN
4003: recreate_pay_scheds(l_invoice_id,l_curr_calling_sequence);
4004: END IF;
4005:
4006: wf_engine.CompleteActivity(
4007: itemType => 'APINVAPR',
4008: itemKey => l_parent_key,
4009: activity => 'APPROVAL_INVOICE:DOCUMENT_APPROVAL_REQUEST',
4010: result => 'APPROVED');
4014: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
4015: l_api_name,l_debug_info);
4016: END IF;
4017:
4018: resultout := wf_engine.eng_completed||':'||'Y';
4019: EXCEPTION
4020:
4021: WHEN OTHERS
4022: THEN
4066: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
4067: l_api_name,l_debug_info);
4068: END IF;
4069: l_curr_calling_sequence := 'AP_WORKFLOW_PKG.aprvl_process_accept_int';
4070: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
4071: itemkey,
4072: 'INVOICE_ID');
4073:
4074: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
4070: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
4071: itemkey,
4072: 'INVOICE_ID');
4073:
4074: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
4075: itemkey,
4076: 'ITERATION');
4077:
4078: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
4074: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
4075: itemkey,
4076: 'ITERATION');
4077:
4078: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
4079: itemkey,
4080: 'PARENT_KEY');
4081:
4082: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
4078: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
4079: itemkey,
4080: 'PARENT_KEY');
4081:
4082: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
4083: itemkey,
4084: 'WF_NOTE');
4085:
4086: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4082: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
4083: itemkey,
4084: 'WF_NOTE');
4085:
4086: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4087: itemkey,
4088: 'ORG_ID');
4089:
4090: MO_GLOBAL.INIT ('SQLAP');
4090: MO_GLOBAL.INIT ('SQLAP');
4091: MO_GLOBAL.set_policy_context('S',l_org_id);
4092:
4093:
4094: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
4095: itemkey,
4096: 'INTERNAL_REP_DISPLAY_NAME');
4097:
4098: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
4094: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
4095: itemkey,
4096: 'INTERNAL_REP_DISPLAY_NAME');
4097:
4098: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
4099: itemkey,
4100: 'INTERNAL_REP_ROLE');
4101:
4102: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4098: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
4099: itemkey,
4100: 'INTERNAL_REP_ROLE');
4101:
4102: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4103: itemkey,
4104: 'INTERNAL_REP_PERSON_ID');
4105:
4106:
4103: itemkey,
4104: 'INTERNAL_REP_PERSON_ID');
4105:
4106:
4107: l_supplier_name := WF_ENGINE.GetItemAttrText(itemtype,
4108: itemkey,
4109: 'SUPPLIER_DISPLAY_NAME');
4110:
4111: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
4107: l_supplier_name := WF_ENGINE.GetItemAttrText(itemtype,
4108: itemkey,
4109: 'SUPPLIER_DISPLAY_NAME');
4110:
4111: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
4112: itemkey,
4113: 'SUPPLIER_ROLE');
4114:
4115: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4111: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
4112: itemkey,
4113: 'SUPPLIER_ROLE');
4114:
4115: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4116: itemkey,
4117: 'SUPPLIER_PERSON_ID');
4118:
4119: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
4115: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4116: itemkey,
4117: 'SUPPLIER_PERSON_ID');
4118:
4119: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
4120: itemkey,
4121: 'NOTF_ITERATION');
4122:
4123:
4160: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
4161: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
4162: l_api_name,l_debug_info);
4163: END IF;
4164: wf_engine.CompleteActivity(
4165: itemType => 'APINVAPR',
4166: itemKey => l_parent_key,
4167: activity => 'APPROVAL_INVOICE:DOCUMENT_APPROVAL_REQUEST',
4168: result => 'APPROVED');
4166: itemKey => l_parent_key,
4167: activity => 'APPROVAL_INVOICE:DOCUMENT_APPROVAL_REQUEST',
4168: result => 'APPROVED');
4169:
4170: resultout := wf_engine.eng_completed||':'||'Y';
4171: EXCEPTION
4172:
4173: WHEN OTHERS
4174: THEN
4248: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
4249: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
4250: l_api_name,l_debug_info);
4251: END IF;
4252: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
4253: itemkey,
4254: 'INVOICE_ID');
4255:
4256: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
4252: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
4253: itemkey,
4254: 'INVOICE_ID');
4255:
4256: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
4257: itemkey,
4258: 'ITERATION');
4259:
4260: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
4256: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
4257: itemkey,
4258: 'ITERATION');
4259:
4260: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
4261: itemkey,
4262: 'PARENT_KEY');
4263:
4264: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
4260: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
4261: itemkey,
4262: 'PARENT_KEY');
4263:
4264: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
4265: itemkey,
4266: 'WF_NOTE');
4267:
4268: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4264: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
4265: itemkey,
4266: 'WF_NOTE');
4267:
4268: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4269: itemkey,
4270: 'ORG_ID');
4271:
4272: MO_GLOBAL.INIT ('SQLAP');
4272: MO_GLOBAL.INIT ('SQLAP');
4273: MO_GLOBAL.set_policy_context('S',l_org_id);
4274:
4275:
4276: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
4277: itemkey,
4278: 'INTERNAL_REP_DISPLAY_NAME');
4279:
4280: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
4276: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype,
4277: itemkey,
4278: 'INTERNAL_REP_DISPLAY_NAME');
4279:
4280: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
4281: itemkey,
4282: 'INTERNAL_REP_ROLE');
4283:
4284: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4280: l_role_name := WF_ENGINE.GetItemAttrText(itemtype,
4281: itemkey,
4282: 'INTERNAL_REP_ROLE');
4283:
4284: l_approver_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4285: itemkey,
4286: 'INTERNAL_REP_PERSON_ID');
4287:
4288:
4285: itemkey,
4286: 'INTERNAL_REP_PERSON_ID');
4287:
4288:
4289: l_supplier_name := WF_ENGINE.GetItemAttrText(itemtype,
4290: itemkey,
4291: 'INTERNAL_REP_DISPLAY_NAME');
4292:
4293: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
4289: l_supplier_name := WF_ENGINE.GetItemAttrText(itemtype,
4290: itemkey,
4291: 'INTERNAL_REP_DISPLAY_NAME');
4292:
4293: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
4294: itemkey,
4295: 'INTERNAL_REP_ROLE');
4296:
4297: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4293: l_supplier_role := WF_ENGINE.GetItemAttrText(itemtype,
4294: itemkey,
4295: 'INTERNAL_REP_ROLE');
4296:
4297: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4298: itemkey,
4299: 'INTERNAL_REP_PERSON_ID');
4300:
4301: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
4297: l_supplier_person_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4298: itemkey,
4299: 'INTERNAL_REP_PERSON_ID');
4300:
4301: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
4302: itemkey,
4303: 'NOTF_ITERATION');
4304:
4305:
4377: l_pay_curr_invoice_amount,
4378: l_token,
4379: null);
4380:
4381: wf_engine.CompleteActivity(
4382: itemType => 'APINVAPR',
4383: itemKey => l_parent_key,
4384: activity => 'APPROVAL_INVOICE:DOCUMENT_APPROVAL_REQUEST',
4385: result => 'REJECTED');
4390: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
4391: l_api_name,l_debug_info);
4392: END IF;
4393:
4394: resultout := wf_engine.eng_completed||':'||'Y';
4395: EXCEPTION
4396:
4397: WHEN OTHERS
4398: THEN
4468: l_total,
4469: l_hold_instr;
4470: CLOSE csr_ap_hold_neg_details;
4471:
4472: wf_engine.createProcess('APINVHNE', l_new_child_itemkey, 'HOLD_NEGOTIATION');
4473: WF_ENGINE.setItemParent('APINVHNE', l_new_child_itemkey,
4474: 'APINVHDN', parentkey, null);
4475: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4476: l_new_child_itemkey,
4469: l_hold_instr;
4470: CLOSE csr_ap_hold_neg_details;
4471:
4472: wf_engine.createProcess('APINVHNE', l_new_child_itemkey, 'HOLD_NEGOTIATION');
4473: WF_ENGINE.setItemParent('APINVHNE', l_new_child_itemkey,
4474: 'APINVHDN', parentkey, null);
4475: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4476: l_new_child_itemkey,
4477: 'HOLD_ID',
4471:
4472: wf_engine.createProcess('APINVHNE', l_new_child_itemkey, 'HOLD_NEGOTIATION');
4473: WF_ENGINE.setItemParent('APINVHNE', l_new_child_itemkey,
4474: 'APINVHDN', parentkey, null);
4475: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4476: l_new_child_itemkey,
4477: 'HOLD_ID',
4478: p_hold_id);
4479: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4475: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4476: l_new_child_itemkey,
4477: 'HOLD_ID',
4478: p_hold_id);
4479: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4480: l_new_child_itemkey,
4481: 'INVOICE_ID',
4482: l_invoice_id);
4483: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4479: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4480: l_new_child_itemkey,
4481: 'INVOICE_ID',
4482: l_invoice_id);
4483: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4484: l_new_child_itemkey,
4485: 'ORG_ID',
4486: l_org_id);
4487: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4483: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4484: l_new_child_itemkey,
4485: 'ORG_ID',
4486: l_org_id);
4487: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4488: l_new_child_itemkey,
4489: 'INVOICE_TOTAL',
4490: l_total);
4491: WF_ENGINE.SetItemAttrText('APINVHNE',
4487: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4488: l_new_child_itemkey,
4489: 'INVOICE_TOTAL',
4490: l_total);
4491: WF_ENGINE.SetItemAttrText('APINVHNE',
4492: l_new_child_itemkey,
4493: 'HOLD_INSTRUCTION',
4494: l_hold_instr);
4495: WF_ENGINE.SetItemAttrText('APINVHNE',
4491: WF_ENGINE.SetItemAttrText('APINVHNE',
4492: l_new_child_itemkey,
4493: 'HOLD_INSTRUCTION',
4494: l_hold_instr);
4495: WF_ENGINE.SetItemAttrText('APINVHNE',
4496: l_new_child_itemkey,
4497: 'INVOICE_SUPPLIER_NAME',
4498: l_vendor_name);
4499: WF_ENGINE.SetItemAttrText('APINVHNE',
4495: WF_ENGINE.SetItemAttrText('APINVHNE',
4496: l_new_child_itemkey,
4497: 'INVOICE_SUPPLIER_NAME',
4498: l_vendor_name);
4499: WF_ENGINE.SetItemAttrText('APINVHNE',
4500: l_new_child_itemkey,
4501: 'INVOICE_NUMBER',
4502: l_invoice_num);
4503: WF_ENGINE.SetItemAttrDate('APINVHNE',
4499: WF_ENGINE.SetItemAttrText('APINVHNE',
4500: l_new_child_itemkey,
4501: 'INVOICE_NUMBER',
4502: l_invoice_num);
4503: WF_ENGINE.SetItemAttrDate('APINVHNE',
4504: l_new_child_itemkey,
4505: 'INVOICE_DATE',
4506: l_invoice_date);
4507: WF_ENGINE.SetItemAttrText('APINVHNE',
4503: WF_ENGINE.SetItemAttrDate('APINVHNE',
4504: l_new_child_itemkey,
4505: 'INVOICE_DATE',
4506: l_invoice_date);
4507: WF_ENGINE.SetItemAttrText('APINVHNE',
4508: l_new_child_itemkey,
4509: 'INVOICE_DESCRIPTION',
4510: l_invoice_description);
4511: WF_ENGINE.SetItemAttrText('APINVHNE',
4507: WF_ENGINE.SetItemAttrText('APINVHNE',
4508: l_new_child_itemkey,
4509: 'INVOICE_DESCRIPTION',
4510: l_invoice_description);
4511: WF_ENGINE.SetItemAttrText('APINVHNE',
4512: l_new_child_itemkey,
4513: 'PARENT_KEY',
4514: parentkey);
4515: WF_ENGINE.SetItemAttrText('APINVHNE',
4511: WF_ENGINE.SetItemAttrText('APINVHNE',
4512: l_new_child_itemkey,
4513: 'PARENT_KEY',
4514: parentkey);
4515: WF_ENGINE.SetItemAttrText('APINVHNE',
4516: l_new_child_itemkey,
4517: 'HOLD_TYPE',
4518: WF_ENGINE.GETITEMATTRText('APINVHDN',
4519: parentkey,
4514: parentkey);
4515: WF_ENGINE.SetItemAttrText('APINVHNE',
4516: l_new_child_itemkey,
4517: 'HOLD_TYPE',
4518: WF_ENGINE.GETITEMATTRText('APINVHDN',
4519: parentkey,
4520: 'HOLD_TYPE'));
4521: -- Bug 9509841
4522: WF_ENGINE.SetItemAttrText( 'APINVHNE',
4518: WF_ENGINE.GETITEMATTRText('APINVHDN',
4519: parentkey,
4520: 'HOLD_TYPE'));
4521: -- Bug 9509841
4522: WF_ENGINE.SetItemAttrText( 'APINVHNE',
4523: l_new_child_itemkey,
4524: 'NOTIFICATION_KEY',
4525: l_new_child_itemkey );
4526:
4536: WF_DIRECTORY.GetUserName('FND_USR',
4537: l_ext_user_id,
4538: l_name,
4539: l_display_name);
4540: WF_ENGINE.SetItemAttrText('APINVHNE',
4541: l_new_child_itemkey,
4542: 'SUPPLIER_ROLE',
4543: l_role);
4544: WF_ENGINE.SetItemAttrText('APINVHNE',
4540: WF_ENGINE.SetItemAttrText('APINVHNE',
4541: l_new_child_itemkey,
4542: 'SUPPLIER_ROLE',
4543: l_role);
4544: WF_ENGINE.SetItemAttrText('APINVHNE',
4545: l_new_child_itemkey,
4546: 'SUPPLIER_DISPLAY_NAME',
4547: l_display_name);
4548: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4544: WF_ENGINE.SetItemAttrText('APINVHNE',
4545: l_new_child_itemkey,
4546: 'SUPPLIER_DISPLAY_NAME',
4547: l_display_name);
4548: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4549: l_new_child_itemkey,
4550: 'SUPPLIER_PERSON_ID',
4551: l_ext_user_id);
4552:
4549: l_new_child_itemkey,
4550: 'SUPPLIER_PERSON_ID',
4551: l_ext_user_id);
4552:
4553: WF_ENGINE.SetItemAttrText('APINVHNE',
4554: l_new_child_itemkey,
4555: 'NOTF_RECEIPIENT_TYPE',
4556: 'EXTERNAL');
4557: WF_ENGINE.SetItemAttrText('APINVHNE',
4553: WF_ENGINE.SetItemAttrText('APINVHNE',
4554: l_new_child_itemkey,
4555: 'NOTF_RECEIPIENT_TYPE',
4556: 'EXTERNAL');
4557: WF_ENGINE.SetItemAttrText('APINVHNE',
4558: l_new_child_itemkey,
4559: 'INTERNAL_REP_DISPLAY_NAME',
4560: WF_ENGINE.GETITEMATTRText('APINVHDN',
4561: parentkey,
4556: 'EXTERNAL');
4557: WF_ENGINE.SetItemAttrText('APINVHNE',
4558: l_new_child_itemkey,
4559: 'INTERNAL_REP_DISPLAY_NAME',
4560: WF_ENGINE.GETITEMATTRText('APINVHDN',
4561: parentkey,
4562: 'INTERNAL_REP_DISPLAY_NAME'));
4563: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4564: l_new_child_itemkey,
4559: 'INTERNAL_REP_DISPLAY_NAME',
4560: WF_ENGINE.GETITEMATTRText('APINVHDN',
4561: parentkey,
4562: 'INTERNAL_REP_DISPLAY_NAME'));
4563: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4564: l_new_child_itemkey,
4565: 'INTERNAL_REP_PERSON_ID',
4566: WF_ENGINE.GETITEMATTRNumber('APINVHDN',
4567: parentkey,
4562: 'INTERNAL_REP_DISPLAY_NAME'));
4563: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4564: l_new_child_itemkey,
4565: 'INTERNAL_REP_PERSON_ID',
4566: WF_ENGINE.GETITEMATTRNumber('APINVHDN',
4567: parentkey,
4568: 'INTERNAL_REP_PERSON_ID'));
4569: WF_ENGINE.SetItemAttrText('APINVHNE',
4570: l_new_child_itemkey,
4565: 'INTERNAL_REP_PERSON_ID',
4566: WF_ENGINE.GETITEMATTRNumber('APINVHDN',
4567: parentkey,
4568: 'INTERNAL_REP_PERSON_ID'));
4569: WF_ENGINE.SetItemAttrText('APINVHNE',
4570: l_new_child_itemkey,
4571: 'ORIG_SYSTEM',
4572: WF_ENGINE.GETITEMATTRText('APINVHDN',
4573: parentkey,
4568: 'INTERNAL_REP_PERSON_ID'));
4569: WF_ENGINE.SetItemAttrText('APINVHNE',
4570: l_new_child_itemkey,
4571: 'ORIG_SYSTEM',
4572: WF_ENGINE.GETITEMATTRText('APINVHDN',
4573: parentkey,
4574: 'ORIG_SYSTEM'));
4575: WF_ENGINE.SetItemAttrText('APINVHNE',
4576: l_new_child_itemkey,
4571: 'ORIG_SYSTEM',
4572: WF_ENGINE.GETITEMATTRText('APINVHDN',
4573: parentkey,
4574: 'ORIG_SYSTEM'));
4575: WF_ENGINE.SetItemAttrText('APINVHNE',
4576: l_new_child_itemkey,
4577: 'INTERNAL_REP_ROLE',
4578: WF_ENGINE.GETITEMATTRText('APINVHDN',
4579: parentkey,
4574: 'ORIG_SYSTEM'));
4575: WF_ENGINE.SetItemAttrText('APINVHNE',
4576: l_new_child_itemkey,
4577: 'INTERNAL_REP_ROLE',
4578: WF_ENGINE.GETITEMATTRText('APINVHDN',
4579: parentkey,
4580: 'INTERNAL_REP_ROLE'));
4581: ELSIF int_ext_indicator = 'E' THEN
4582:
4579: parentkey,
4580: 'INTERNAL_REP_ROLE'));
4581: ELSIF int_ext_indicator = 'E' THEN
4582:
4583: l_role := WF_ENGINE.GETITEMATTRText('APINVHDN',
4584: parentkey,
4585: 'INTERNAL_REP_ROLE');
4586: WF_ENGINE.SetItemAttrText('APINVHNE',
4587: l_new_child_itemkey,
4582:
4583: l_role := WF_ENGINE.GETITEMATTRText('APINVHDN',
4584: parentkey,
4585: 'INTERNAL_REP_ROLE');
4586: WF_ENGINE.SetItemAttrText('APINVHNE',
4587: l_new_child_itemkey,
4588: 'INTERNAL_REP_ROLE',
4589: l_role);
4590: WF_ENGINE.SetItemAttrText('APINVHNE',
4586: WF_ENGINE.SetItemAttrText('APINVHNE',
4587: l_new_child_itemkey,
4588: 'INTERNAL_REP_ROLE',
4589: l_role);
4590: WF_ENGINE.SetItemAttrText('APINVHNE',
4591: l_new_child_itemkey,
4592: 'DISP_NOT_RECEIVER',
4593: l_role);
4594: l_display_name := WF_ENGINE.GETITEMATTRText('APINVHDN',
4590: WF_ENGINE.SetItemAttrText('APINVHNE',
4591: l_new_child_itemkey,
4592: 'DISP_NOT_RECEIVER',
4593: l_role);
4594: l_display_name := WF_ENGINE.GETITEMATTRText('APINVHDN',
4595: parentkey,
4596: 'INTERNAL_REP_DISPLAY_NAME');
4597: WF_ENGINE.SetItemAttrText('APINVHNE',
4598: l_new_child_itemkey,
4593: l_role);
4594: l_display_name := WF_ENGINE.GETITEMATTRText('APINVHDN',
4595: parentkey,
4596: 'INTERNAL_REP_DISPLAY_NAME');
4597: WF_ENGINE.SetItemAttrText('APINVHNE',
4598: l_new_child_itemkey,
4599: 'INTERNAL_REP_DISPLAY_NAME',
4600: l_display_name);
4601: l_person_id := WF_ENGINE.GETITEMATTRNumber('APINVHDN',
4597: WF_ENGINE.SetItemAttrText('APINVHNE',
4598: l_new_child_itemkey,
4599: 'INTERNAL_REP_DISPLAY_NAME',
4600: l_display_name);
4601: l_person_id := WF_ENGINE.GETITEMATTRNumber('APINVHDN',
4602: parentkey,
4603: 'INTERNAL_REP_PERSON_ID');
4604: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4605: l_new_child_itemkey,
4600: l_display_name);
4601: l_person_id := WF_ENGINE.GETITEMATTRNumber('APINVHDN',
4602: parentkey,
4603: 'INTERNAL_REP_PERSON_ID');
4604: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4605: l_new_child_itemkey,
4606: 'INTERNAL_REP_PERSON_ID',
4607: l_person_id);
4608: WF_ENGINE.SetItemAttrText('APINVHNE',
4604: WF_ENGINE.SetItemAttrNumber('APINVHNE',
4605: l_new_child_itemkey,
4606: 'INTERNAL_REP_PERSON_ID',
4607: l_person_id);
4608: WF_ENGINE.SetItemAttrText('APINVHNE',
4609: l_new_child_itemkey,
4610: 'NOTF_RECEIPIENT_TYPE',
4611: 'INTERNAL');
4612: WF_ENGINE.SetItemAttrText('APINVHNE',
4608: WF_ENGINE.SetItemAttrText('APINVHNE',
4609: l_new_child_itemkey,
4610: 'NOTF_RECEIPIENT_TYPE',
4611: 'INTERNAL');
4612: WF_ENGINE.SetItemAttrText('APINVHNE',
4613: l_new_child_itemkey,
4614: 'ORIG_SYSTEM',
4615: WF_ENGINE.GETITEMATTRText('APINVHDN',
4616: parentkey,
4611: 'INTERNAL');
4612: WF_ENGINE.SetItemAttrText('APINVHNE',
4613: l_new_child_itemkey,
4614: 'ORIG_SYSTEM',
4615: WF_ENGINE.GETITEMATTRText('APINVHDN',
4616: parentkey,
4617: 'ORIG_SYSTEM'));
4618: WF_ENGINE.SetItemAttrText('APINVHNE',
4619: l_new_child_itemkey,
4614: 'ORIG_SYSTEM',
4615: WF_ENGINE.GETITEMATTRText('APINVHDN',
4616: parentkey,
4617: 'ORIG_SYSTEM'));
4618: WF_ENGINE.SetItemAttrText('APINVHNE',
4619: l_new_child_itemkey,
4620: 'SUPPLIER_DISPLAY_NAME',
4621: WF_ENGINE.GETITEMATTRText('APINVHNE',
4622: childkey,
4617: 'ORIG_SYSTEM'));
4618: WF_ENGINE.SetItemAttrText('APINVHNE',
4619: l_new_child_itemkey,
4620: 'SUPPLIER_DISPLAY_NAME',
4621: WF_ENGINE.GETITEMATTRText('APINVHNE',
4622: childkey,
4623: 'SUPPLIER_DISPLAY_NAME'));
4624:
4625: END IF;
4622: childkey,
4623: 'SUPPLIER_DISPLAY_NAME'));
4624:
4625: END IF;
4626: WF_ENGINE.startProcess('APINVHNE', l_new_child_itemkey);
4627: MO_GLOBAL.INIT ('SQLAP');
4628: MO_GLOBAL.set_policy_context('S',l_org_id);
4629:
4630: -- Complete the previous negotiation process if any.
4629:
4630: -- Complete the previous negotiation process if any.
4631:
4632: IF childkey IS NOT NULL THEN
4633: l_notf_receipient_type := WF_ENGINE.GetItemAttrText('APINVHNE',
4634: childkey,
4635: 'NOTF_RECEIPIENT_TYPE');
4636: IF l_notf_receipient_type = 'INTERNAL' THEN
4637:
4634: childkey,
4635: 'NOTF_RECEIPIENT_TYPE');
4636: IF l_notf_receipient_type = 'INTERNAL' THEN
4637:
4638: wf_engine.CompleteActivity(
4639: itemType => 'APINVHNE',
4640: itemKey => childkey,
4641: activity => 'HOLD_NEGOTIATION:WAITINTERNAL',
4642: result => 'NULL');
4640: itemKey => childkey,
4641: activity => 'HOLD_NEGOTIATION:WAITINTERNAL',
4642: result => 'NULL');
4643: ELSE
4644: wf_engine.CompleteActivity(
4645: itemType => 'APINVHNE',
4646: itemKey => childkey,
4647: activity => 'HOLD_NEGOTIATION:WAITEXTERNAL',
4648: result => 'NULL');
4734:
4735: CLOSE csr_ap_hold_details;
4736:
4737:
4738: wf_engine.createProcess('APINVHDN', l_itemkey, 'HOLD_MAIN');
4739: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4740: l_itemkey,
4741: 'INVOICE_ID',
4742: l_invoice_id);
4735: CLOSE csr_ap_hold_details;
4736:
4737:
4738: wf_engine.createProcess('APINVHDN', l_itemkey, 'HOLD_MAIN');
4739: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4740: l_itemkey,
4741: 'INVOICE_ID',
4742: l_invoice_id);
4743: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4739: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4740: l_itemkey,
4741: 'INVOICE_ID',
4742: l_invoice_id);
4743: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4744: l_itemkey,
4745: 'HOLD_ID',
4746: p_hold_id);
4747: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4743: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4744: l_itemkey,
4745: 'HOLD_ID',
4746: p_hold_id);
4747: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4748: l_itemkey,
4749: 'ORG_ID',
4750: l_org_id);
4751: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4747: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4748: l_itemkey,
4749: 'ORG_ID',
4750: l_org_id);
4751: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4752: l_itemkey,
4753: 'INVOICE_TOTAL',
4754: l_total);
4755: WF_ENGINE.SetItemAttrText('APINVHDN',
4751: WF_ENGINE.SetItemAttrNumber('APINVHDN',
4752: l_itemkey,
4753: 'INVOICE_TOTAL',
4754: l_total);
4755: WF_ENGINE.SetItemAttrText('APINVHDN',
4756: l_itemkey,
4757: 'HOLD_INSTRUCTION',
4758: l_hold_instr);
4759: WF_ENGINE.SetItemAttrText('APINVHDN',
4755: WF_ENGINE.SetItemAttrText('APINVHDN',
4756: l_itemkey,
4757: 'HOLD_INSTRUCTION',
4758: l_hold_instr);
4759: WF_ENGINE.SetItemAttrText('APINVHDN',
4760: l_itemkey,
4761: 'INVOICE_SUPPLIER_NAME',
4762: l_vendor_name);
4763: WF_ENGINE.SetItemAttrText('APINVHDN',
4759: WF_ENGINE.SetItemAttrText('APINVHDN',
4760: l_itemkey,
4761: 'INVOICE_SUPPLIER_NAME',
4762: l_vendor_name);
4763: WF_ENGINE.SetItemAttrText('APINVHDN',
4764: l_itemkey,
4765: 'INVOICE_NUMBER',
4766: l_invoice_num);
4767: WF_ENGINE.SetItemAttrDate('APINVHDN',
4763: WF_ENGINE.SetItemAttrText('APINVHDN',
4764: l_itemkey,
4765: 'INVOICE_NUMBER',
4766: l_invoice_num);
4767: WF_ENGINE.SetItemAttrDate('APINVHDN',
4768: l_itemkey,
4769: 'INVOICE_DATE',
4770: l_invoice_date);
4771: WF_ENGINE.SetItemAttrText('APINVHDN',
4767: WF_ENGINE.SetItemAttrDate('APINVHDN',
4768: l_itemkey,
4769: 'INVOICE_DATE',
4770: l_invoice_date);
4771: WF_ENGINE.SetItemAttrText('APINVHDN',
4772: l_itemkey,
4773: 'INVOICE_DESCRIPTION',
4774: l_invoice_description);
4775: WF_ENGINE.SetItemAttrText('APINVHDN',
4771: WF_ENGINE.SetItemAttrText('APINVHDN',
4772: l_itemkey,
4773: 'INVOICE_DESCRIPTION',
4774: l_invoice_description);
4775: WF_ENGINE.SetItemAttrText('APINVHDN',
4776: l_itemkey,
4777: 'HOLD_TYPE',
4778: l_hold_type);
4779: WF_ENGINE.SetItemAttrText('APINVHDN',
4775: WF_ENGINE.SetItemAttrText('APINVHDN',
4776: l_itemkey,
4777: 'HOLD_TYPE',
4778: l_hold_type);
4779: WF_ENGINE.SetItemAttrText('APINVHDN',
4780: l_itemkey,
4781: 'PARENT_KEY',
4782: l_itemkey);
4783:
4784: UPDATE ap_holds_all
4785: SET wf_status = 'STARTED'
4786: WHERE hold_id = p_hold_id;
4787:
4788: WF_ENGINE.startProcess('APINVHDN', l_itemkey);
4789:
4790:
4791:
4792: EXCEPTION
4859: select '&'
4860: into l_ampersand
4861: from dual
4862: where 1 like 1 escape '&';
4863: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
4864: itemkey,
4865: 'ITERATION');
4866:
4867: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
4863: l_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
4864: itemkey,
4865: 'ITERATION');
4866:
4867: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
4868: itemkey,
4869: 'NOTF_ITERATION');
4870:
4871: /*
4887: );
4888:
4889:
4890:
4891: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
4892: itemkey,
4893: 'ORG_ID');
4894:
4895: l_invoice_id := substr(itemkey, 1, instr(itemkey,'_')-1);
4900: MO_GLOBAL.set_policy_context('S',l_org_id);
4901:
4902: --IF l_complete = ame_util.booleanTrue THEN /*no approver on the list*/
4903: IF l_next_approvers.count < 1 THEN
4904: resultout := wf_engine.eng_completed||':'||'FINISH';
4905:
4906: --check for prior approvers
4907: SELECT count(*)
4908: INTO l_count
4926: 'NOT REQUIRED')
4927: WHERE invoice_id = l_invoice_id
4928: AND wfapproval_status <> 'MANUALLY APPROVED';
4929: END IF;
4930: l_inv_match_type := WF_ENGINE.GetItemAttrText('APINVAPR',
4931: itemkey,
4932: 'INV_MATCH_TYPE');
4933: IF l_inv_match_type = 'UNMATCHED' THEN
4934: UPDATE AP_INVOICE_LINES_ALL
4996: l_next_approver.ORIG_SYSTEM_ID,
4997: l_name,
4998: l_display_name);
4999:
5000: WF_ENGINE.SetItemAttrText(itemtype,
5001: itemkey,
5002: 'APPROVER_NAME',
5003: l_display_name);
5004:
5001: itemkey,
5002: 'APPROVER_NAME',
5003: l_display_name);
5004:
5005: WF_ENGINE.SetItemAttrNumber(itemtype,
5006: itemkey,
5007: 'APPROVER_ID',
5008: l_next_approver.ORIG_SYSTEM_ID); /****
5009: POTENTIAL BUG ************/
5007: 'APPROVER_ID',
5008: l_next_approver.ORIG_SYSTEM_ID); /****
5009: POTENTIAL BUG ************/
5010:
5011: WF_ENGINE.SetItemAttrText(itemtype,
5012: itemkey,
5013: 'DOCUMENT_APPROVER',
5014: l_role);
5015:
5012: itemkey,
5013: 'DOCUMENT_APPROVER',
5014: l_role);
5015:
5016: WF_ENGINE.SetItemAttrText(itemtype,
5017: itemkey,
5018: 'ORIG_SYSTEM',
5019: l_next_approver.ORIG_SYSTEM);
5020:
5017: itemkey,
5018: 'ORIG_SYSTEM',
5019: l_next_approver.ORIG_SYSTEM);
5020:
5021: WF_ENGINE.SetItemAttrNumber(itemtype,
5022: itemkey,
5023: 'NOTF_ITERATION',
5024: nvl(l_notf_iteration,0) + 1);
5025:
5026: -- bug 8450681
5027: -- These values have to be cleared of before starting as the residue values will cause issue
5028: -- in case of approver groups which has more than one approver and
5029: -- the notification is escalated in the previous level
5030: WF_ENGINE.SetItemAttrText(itemtype,
5031: itemkey,
5032: 'ESCALATED',
5033: null);
5034: WF_ENGINE.SetItemAttrText(itemtype,
5030: WF_ENGINE.SetItemAttrText(itemtype,
5031: itemkey,
5032: 'ESCALATED',
5033: null);
5034: WF_ENGINE.SetItemAttrText(itemtype,
5035: itemkey,
5036: 'FORWARD_ROLE',
5037: null);
5038: WF_ENGINE.SetItemAttrText(itemtype,
5034: WF_ENGINE.SetItemAttrText(itemtype,
5035: itemkey,
5036: 'FORWARD_ROLE',
5037: null);
5038: WF_ENGINE.SetItemAttrText(itemtype,
5039: itemkey,
5040: 'ROLE_ACTUAL',
5041: null);
5042:
5039: itemkey,
5040: 'ROLE_ACTUAL',
5041: null);
5042:
5043: WF_ENGINE.SetItemAttrText(itemtype,
5044: itemkey,
5045: 'ESC_ROLE_ACTUAL',
5046: null);
5047:
5047:
5048:
5049: -- bug 8450681
5050: /*
5051: WF_ENGINE.SETITEMATTRTEXT
5052: (
5053: itemtype => itemtype,
5054: itemkey => itemkey,
5055: aname => 'INVOICE_ATTACHMENTS',
5075: l_hist_rec.ORG_ID := l_org_id;
5076: l_hist_rec.AMOUNT_APPROVED := 0;
5077:
5078: insert_history_table(p_hist_rec => l_hist_rec);
5079: resultout := wf_engine.eng_completed||':'||'MORE';
5080:
5081: END IF;
5082:
5083: ELSE /* For IF l_count_rejects = 0, so there are rejections */
5091: UPDATE ap_invoices_all
5092: SET wfapproval_status = 'NEEDS WFREAPPROVAL'
5093: WHERE invoice_id = l_invoice_id;
5094:
5095: resultout := wf_engine.eng_completed||':'||'FINISH';
5096: END IF;
5097: EXCEPTION
5098:
5099: WHEN OTHERS
5144: l_api_name,l_debug_info);
5145: END IF;
5146:
5147: --Get the current approver info
5148: l_approver_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5149: itemkey,
5150: 'APPROVER_ID');
5151:
5152: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5148: l_approver_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5149: itemkey,
5150: 'APPROVER_ID');
5151:
5152: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5153: itemkey,
5154: 'INVOICE_ID');
5155:
5156: l_invoice_total := WF_ENGINE.GetItemAttrNumber(itemtype,
5152: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5153: itemkey,
5154: 'INVOICE_ID');
5155:
5156: l_invoice_total := WF_ENGINE.GetItemAttrNumber(itemtype,
5157: itemkey,
5158: 'INVOICE_TOTAL');
5159:
5160: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
5156: l_invoice_total := WF_ENGINE.GetItemAttrNumber(itemtype,
5157: itemkey,
5158: 'INVOICE_TOTAL');
5159:
5160: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
5161: itemkey,
5162: 'ITERATION');
5163:
5164: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
5160: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
5161: itemkey,
5162: 'ITERATION');
5163:
5164: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
5165: itemkey,
5166: 'NOTF_ITERATION');
5167:
5168: l_org_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5164: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
5165: itemkey,
5166: 'NOTF_ITERATION');
5167:
5168: l_org_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5169: itemkey,
5170: 'ORG_ID');
5171:
5172: l_role := WF_ENGINE.GetItemAttrText(itemtype,
5168: l_org_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5169: itemkey,
5170: 'ORG_ID');
5171:
5172: l_role := WF_ENGINE.GetItemAttrText(itemtype,
5173: itemkey,
5174: 'DOCUMENT_APPROVER');
5175:
5176:
5245: itemSourcesOut => l_source);
5246: -- bug 8450681 ends
5247:
5248: --Set WF attributes
5249: WF_ENGINE.SetItemAttrText(itemtype,
5250: itemkey,
5251: 'ESC_APPROVER_NAME',
5252: l_esc_approver_name);
5253:
5250: itemkey,
5251: 'ESC_APPROVER_NAME',
5252: l_esc_approver_name);
5253:
5254: WF_ENGINE.SetItemAttrNumber(itemtype,
5255: itemkey,
5256: 'ESC_APPROVER_ID',
5257: l_esc_approver_id);
5258:
5255: itemkey,
5256: 'ESC_APPROVER_ID',
5257: l_esc_approver_id);
5258:
5259: WF_ENGINE.SetItemAttrText(itemtype,
5260: itemkey,
5261: 'ESC_ROLE_NAME',
5262: l_esc_role);
5263: -- bug 8450681 begins
5260: itemkey,
5261: 'ESC_ROLE_NAME',
5262: l_esc_role);
5263: -- bug 8450681 begins
5264: WF_ENGINE.SetItemAttrText(itemtype,
5265: itemkey,
5266: 'ESC_ROLE_ACTUAL',
5267: l_esc_role);
5268: -- bug 8450681 ends
5265: itemkey,
5266: 'ESC_ROLE_ACTUAL',
5267: l_esc_role);
5268: -- bug 8450681 ends
5269: WF_ENGINE.SetItemAttrText(itemtype,
5270: itemkey,
5271: 'ESCALATED',
5272: 'Y');
5273: l_hist_rec.HISTORY_TYPE := 'DOCUMENTAPPROVAL';
5359: END IF;
5360:
5361:
5362: --Get the current approver info
5363: l_approver_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5364: itemkey,
5365: 'APPROVER_ID');
5366:
5367: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5363: l_approver_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5364: itemkey,
5365: 'APPROVER_ID');
5366:
5367: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5368: itemkey,
5369: 'INVOICE_ID');
5370:
5371: --commented for bug 13566970
5368: itemkey,
5369: 'INVOICE_ID');
5370:
5371: --commented for bug 13566970
5372: /* l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
5373: itemkey,
5374: 'ITERATION'); */
5375: --added for bug 13566970
5376: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
5372: /* l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
5373: itemkey,
5374: 'ITERATION'); */
5375: --added for bug 13566970
5376: l_iteration := WF_ENGINE.GetItemAttrNumber(itemtype,
5377: itemkey,
5378: 'INVOICE_ITERATION');
5379: --end og bug 13566970
5380:
5377: itemkey,
5378: 'INVOICE_ITERATION');
5379: --end og bug 13566970
5380:
5381: l_org_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5382: itemkey,
5383: 'ORG_ID');
5384:
5385: l_role := WF_ENGINE.GetItemAttrText(itemtype,
5381: l_org_id := WF_ENGINE.GetItemAttrNumber(itemtype,
5382: itemkey,
5383: 'ORG_ID');
5384:
5385: l_role := WF_ENGINE.GetItemAttrText(itemtype,
5386: itemkey,
5387: 'ROLE_NAME');
5388:
5389: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
5385: l_role := WF_ENGINE.GetItemAttrText(itemtype,
5386: itemkey,
5387: 'ROLE_NAME');
5388:
5389: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber(itemtype,
5390: itemkey,
5391: 'NOTF_ITERATION');
5392:
5393: --Now set the environment
5504: itemSourcesOut => l_source);
5505: -- bug 13919019 ends
5506:
5507: --Set WF attributes
5508: WF_ENGINE.SetItemAttrText(itemtype,
5509: itemkey,
5510: 'ESC_APPROVER_NAME',
5511: l_esc_approver_name);
5512:
5509: itemkey,
5510: 'ESC_APPROVER_NAME',
5511: l_esc_approver_name);
5512:
5513: WF_ENGINE.SetItemAttrNumber(itemtype,
5514: itemkey,
5515: 'ESC_APPROVER_ID',
5516: l_esc_approver_id);
5517:
5514: itemkey,
5515: 'ESC_APPROVER_ID',
5516: l_esc_approver_id);
5517:
5518: WF_ENGINE.SetItemAttrText(itemtype,
5519: itemkey,
5520: 'ESC_ROLE_NAME',
5521: l_esc_role);
5522:
5520: 'ESC_ROLE_NAME',
5521: l_esc_role);
5522:
5523: -- bug 13919019 begins
5524: WF_ENGINE.SetItemAttrText(itemtype,
5525: itemkey,
5526: 'ESC_ROLE_ACTUAL',
5527: l_esc_role);
5528: -- bug 13919019 ends
5526: 'ESC_ROLE_ACTUAL',
5527: l_esc_role);
5528: -- bug 13919019 ends
5529:
5530: WF_ENGINE.SetItemAttrText(itemtype,
5531: itemkey,
5532: 'ESCALATED',
5533: 'Y');
5534:
5577: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
5578: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
5579: l_api_name,l_debug_info);
5580: END IF;
5581: wf_engine.CompleteActivity(
5582: itemType => 'APINVAPR',
5583: itemKey => l_invoice_key,
5584: activity => 'APPROVAL_MAIN:BLOCK',
5585: result => 'NULL');
5675: CLOSE csr_ap_aprvl_neg_details;
5676:
5677: l_ext_user_id := p_ext_user_id;
5678:
5679: wf_engine.createProcess('APINVNEG', l_new_child_itemkey,
5680: 'APPROVAL_NEGOTIATION');
5681: WF_ENGINE.setItemParent('APINVNEG', l_new_child_itemkey,
5682: 'APINVAPR', parentkey, null);
5683: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5677: l_ext_user_id := p_ext_user_id;
5678:
5679: wf_engine.createProcess('APINVNEG', l_new_child_itemkey,
5680: 'APPROVAL_NEGOTIATION');
5681: WF_ENGINE.setItemParent('APINVNEG', l_new_child_itemkey,
5682: 'APINVAPR', parentkey, null);
5683: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5684: l_new_child_itemkey,
5685: 'INVOICE_ID',
5679: wf_engine.createProcess('APINVNEG', l_new_child_itemkey,
5680: 'APPROVAL_NEGOTIATION');
5681: WF_ENGINE.setItemParent('APINVNEG', l_new_child_itemkey,
5682: 'APINVAPR', parentkey, null);
5683: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5684: l_new_child_itemkey,
5685: 'INVOICE_ID',
5686: l_invoice_id);
5687: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5683: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5684: l_new_child_itemkey,
5685: 'INVOICE_ID',
5686: l_invoice_id);
5687: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5688: l_new_child_itemkey,
5689: 'ORG_ID',
5690: l_org_id);
5691: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5687: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5688: l_new_child_itemkey,
5689: 'ORG_ID',
5690: l_org_id);
5691: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5692: l_new_child_itemkey,
5693: 'INVOICE_TOTAL',
5694: nvl(p_invoice_amount,l_total));
5695: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5691: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5692: l_new_child_itemkey,
5693: 'INVOICE_TOTAL',
5694: nvl(p_invoice_amount,l_total));
5695: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5696: parentkey,
5697: 'INVOICE_TOTAL',
5698: nvl(p_invoice_amount,l_total));
5699: WF_ENGINE.SetItemAttrText('APINVNEG',
5695: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5696: parentkey,
5697: 'INVOICE_TOTAL',
5698: nvl(p_invoice_amount,l_total));
5699: WF_ENGINE.SetItemAttrText('APINVNEG',
5700: l_new_child_itemkey,
5701: 'INVOICE_SUPPLIER_NAME',
5702: l_vendor_name);
5703: WF_ENGINE.SetItemAttrText('APINVNEG',
5699: WF_ENGINE.SetItemAttrText('APINVNEG',
5700: l_new_child_itemkey,
5701: 'INVOICE_SUPPLIER_NAME',
5702: l_vendor_name);
5703: WF_ENGINE.SetItemAttrText('APINVNEG',
5704: l_new_child_itemkey,
5705: 'INVOICE_NUMBER',
5706: l_invoice_num);
5707: WF_ENGINE.SetItemAttrDate('APINVNEG',
5703: WF_ENGINE.SetItemAttrText('APINVNEG',
5704: l_new_child_itemkey,
5705: 'INVOICE_NUMBER',
5706: l_invoice_num);
5707: WF_ENGINE.SetItemAttrDate('APINVNEG',
5708: l_new_child_itemkey,
5709: 'INVOICE_DATE',
5710: l_invoice_date);
5711: WF_ENGINE.SetItemAttrText('APINVNEG',
5707: WF_ENGINE.SetItemAttrDate('APINVNEG',
5708: l_new_child_itemkey,
5709: 'INVOICE_DATE',
5710: l_invoice_date);
5711: WF_ENGINE.SetItemAttrText('APINVNEG',
5712: l_new_child_itemkey,
5713: 'INVOICE_DESCRIPTION',
5714: l_invoice_description);
5715: WF_ENGINE.SetItemAttrText('APINVNEG',
5711: WF_ENGINE.SetItemAttrText('APINVNEG',
5712: l_new_child_itemkey,
5713: 'INVOICE_DESCRIPTION',
5714: l_invoice_description);
5715: WF_ENGINE.SetItemAttrText('APINVNEG',
5716: l_new_child_itemkey,
5717: 'PARENT_KEY',
5718: parentkey);
5719: WF_ENGINE.SetItemAttrText('APINVNEG',
5715: WF_ENGINE.SetItemAttrText('APINVNEG',
5716: l_new_child_itemkey,
5717: 'PARENT_KEY',
5718: parentkey);
5719: WF_ENGINE.SetItemAttrText('APINVNEG',
5720: l_new_child_itemkey,
5721: 'NOTIFICATION_KEY',
5722: l_new_child_itemkey);
5723:
5720: l_new_child_itemkey,
5721: 'NOTIFICATION_KEY',
5722: l_new_child_itemkey);
5723:
5724: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5725: l_new_child_itemkey,
5726: 'ITERATION',
5727: l_iteration);
5728: WF_ENGINE.SetItemAttrText('APINVNEG',
5724: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5725: l_new_child_itemkey,
5726: 'ITERATION',
5727: l_iteration);
5728: WF_ENGINE.SetItemAttrText('APINVNEG',
5729: l_new_child_itemkey,
5730: 'ORIG_SYSTEM',
5731: WF_ENGINE.GETITEMATTRText('APINVAPR',
5732: parentkey,
5727: l_iteration);
5728: WF_ENGINE.SetItemAttrText('APINVNEG',
5729: l_new_child_itemkey,
5730: 'ORIG_SYSTEM',
5731: WF_ENGINE.GETITEMATTRText('APINVAPR',
5732: parentkey,
5733: 'ORIG_SYSTEM'));
5734: /* Currently the sender is Internal and sending to External*/
5735: IF int_ext_indicator = 'I' and l_ext_user_id IS NOT NULL THEN
5740: WF_DIRECTORY.GetUserName('FND_USR',
5741: l_ext_user_id,
5742: l_name,
5743: l_display_name);
5744: WF_ENGINE.SetItemAttrText('APINVNEG',
5745: l_new_child_itemkey,
5746: 'SUPPLIER_ROLE',
5747: l_role);
5748: WF_ENGINE.SetItemAttrText('APINVNEG',
5744: WF_ENGINE.SetItemAttrText('APINVNEG',
5745: l_new_child_itemkey,
5746: 'SUPPLIER_ROLE',
5747: l_role);
5748: WF_ENGINE.SetItemAttrText('APINVNEG',
5749: l_new_child_itemkey,
5750: 'SUPPLIER_DISPLAY_NAME',
5751: l_display_name);
5752: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5748: WF_ENGINE.SetItemAttrText('APINVNEG',
5749: l_new_child_itemkey,
5750: 'SUPPLIER_DISPLAY_NAME',
5751: l_display_name);
5752: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5753: l_new_child_itemkey,
5754: 'SUPPLIER_PERSON_ID',
5755: l_ext_user_id);
5756:
5753: l_new_child_itemkey,
5754: 'SUPPLIER_PERSON_ID',
5755: l_ext_user_id);
5756:
5757: WF_ENGINE.SetItemAttrText('APINVNEG',
5758: l_new_child_itemkey,
5759: 'NOTF_RECEIPIENT_TYPE',
5760: 'EXTERNAL');
5761: WF_ENGINE.SetItemAttrText('APINVNEG',
5757: WF_ENGINE.SetItemAttrText('APINVNEG',
5758: l_new_child_itemkey,
5759: 'NOTF_RECEIPIENT_TYPE',
5760: 'EXTERNAL');
5761: WF_ENGINE.SetItemAttrText('APINVNEG',
5762: l_new_child_itemkey,
5763: 'INTERNAL_REP_DISPLAY_NAME',
5764: WF_ENGINE.GETITEMATTRText('APINVAPR',
5765: parentkey,
5760: 'EXTERNAL');
5761: WF_ENGINE.SetItemAttrText('APINVNEG',
5762: l_new_child_itemkey,
5763: 'INTERNAL_REP_DISPLAY_NAME',
5764: WF_ENGINE.GETITEMATTRText('APINVAPR',
5765: parentkey,
5766: 'APPROVER_NAME'));
5767: WF_ENGINE.SetItemAttrText('APINVNEG',
5768: l_new_child_itemkey,
5763: 'INTERNAL_REP_DISPLAY_NAME',
5764: WF_ENGINE.GETITEMATTRText('APINVAPR',
5765: parentkey,
5766: 'APPROVER_NAME'));
5767: WF_ENGINE.SetItemAttrText('APINVNEG',
5768: l_new_child_itemkey,
5769: 'INTERNAL_REP_ROLE',
5770: WF_ENGINE.GETITEMATTRText('APINVAPR',
5771: parentkey,
5766: 'APPROVER_NAME'));
5767: WF_ENGINE.SetItemAttrText('APINVNEG',
5768: l_new_child_itemkey,
5769: 'INTERNAL_REP_ROLE',
5770: WF_ENGINE.GETITEMATTRText('APINVAPR',
5771: parentkey,
5772: 'DOCUMENT_APPROVER'));
5773:
5774: /* Currently the sender is external (supplier) and sending to
5774: /* Currently the sender is external (supplier) and sending to
5775: Internal Rep */
5776: ELSIF int_ext_indicator = 'E' THEN
5777:
5778: l_role := WF_ENGINE.GETITEMATTRText('APINVAPR',
5779: parentkey,
5780: 'DOCUMENT_APPROVER');
5781: WF_ENGINE.SetItemAttrText('APINVNEG',
5782: l_new_child_itemkey,
5777:
5778: l_role := WF_ENGINE.GETITEMATTRText('APINVAPR',
5779: parentkey,
5780: 'DOCUMENT_APPROVER');
5781: WF_ENGINE.SetItemAttrText('APINVNEG',
5782: l_new_child_itemkey,
5783: 'INTERNAL_REP_ROLE',
5784: l_role);
5785: WF_ENGINE.SetItemAttrText('APINVNEG',
5781: WF_ENGINE.SetItemAttrText('APINVNEG',
5782: l_new_child_itemkey,
5783: 'INTERNAL_REP_ROLE',
5784: l_role);
5785: WF_ENGINE.SetItemAttrText('APINVNEG',
5786: l_new_child_itemkey,
5787: 'DISP_NOT_RECEIVER',
5788: l_role);
5789: l_display_name := WF_ENGINE.GETITEMATTRText('APINVAPR',
5785: WF_ENGINE.SetItemAttrText('APINVNEG',
5786: l_new_child_itemkey,
5787: 'DISP_NOT_RECEIVER',
5788: l_role);
5789: l_display_name := WF_ENGINE.GETITEMATTRText('APINVAPR',
5790: parentkey,
5791: 'APPROVER_NAME');
5792: WF_ENGINE.SetItemAttrText('APINVNEG',
5793: l_new_child_itemkey,
5788: l_role);
5789: l_display_name := WF_ENGINE.GETITEMATTRText('APINVAPR',
5790: parentkey,
5791: 'APPROVER_NAME');
5792: WF_ENGINE.SetItemAttrText('APINVNEG',
5793: l_new_child_itemkey,
5794: 'INTERNAL_REP_DISPLAY_NAME',
5795: l_display_name);
5796: l_person_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
5792: WF_ENGINE.SetItemAttrText('APINVNEG',
5793: l_new_child_itemkey,
5794: 'INTERNAL_REP_DISPLAY_NAME',
5795: l_display_name);
5796: l_person_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
5797: parentkey,
5798: 'APPROVER_ID');
5799: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5800: l_new_child_itemkey,
5795: l_display_name);
5796: l_person_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
5797: parentkey,
5798: 'APPROVER_ID');
5799: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5800: l_new_child_itemkey,
5801: 'INTERNAL_REP_PERSON_ID',
5802: l_person_id);
5803: WF_ENGINE.SetItemAttrText('APINVNEG',
5799: WF_ENGINE.SetItemAttrNumber('APINVNEG',
5800: l_new_child_itemkey,
5801: 'INTERNAL_REP_PERSON_ID',
5802: l_person_id);
5803: WF_ENGINE.SetItemAttrText('APINVNEG',
5804: l_new_child_itemkey,
5805: 'NOTF_RECEIPIENT_TYPE',
5806: 'INTERNAL');
5807: WF_ENGINE.SetItemAttrText('APINVNEG',
5803: WF_ENGINE.SetItemAttrText('APINVNEG',
5804: l_new_child_itemkey,
5805: 'NOTF_RECEIPIENT_TYPE',
5806: 'INTERNAL');
5807: WF_ENGINE.SetItemAttrText('APINVNEG',
5808: l_new_child_itemkey,
5809: 'SUPPLIER_DISPLAY_NAME',
5810: WF_ENGINE.GETITEMATTRText('APINVNEG',
5811: childkey,
5806: 'INTERNAL');
5807: WF_ENGINE.SetItemAttrText('APINVNEG',
5808: l_new_child_itemkey,
5809: 'SUPPLIER_DISPLAY_NAME',
5810: WF_ENGINE.GETITEMATTRText('APINVNEG',
5811: childkey,
5812: 'SUPPLIER_DISPLAY_NAME'));
5813: WF_ENGINE.SetItemAttrText('APINVNEG',
5814: l_new_child_itemkey,
5809: 'SUPPLIER_DISPLAY_NAME',
5810: WF_ENGINE.GETITEMATTRText('APINVNEG',
5811: childkey,
5812: 'SUPPLIER_DISPLAY_NAME'));
5813: WF_ENGINE.SetItemAttrText('APINVNEG',
5814: l_new_child_itemkey,
5815: 'SUPPLIER_ROLE',
5816: WF_ENGINE.GETITEMATTRText('APINVNEG',
5817: childkey,
5812: 'SUPPLIER_DISPLAY_NAME'));
5813: WF_ENGINE.SetItemAttrText('APINVNEG',
5814: l_new_child_itemkey,
5815: 'SUPPLIER_ROLE',
5816: WF_ENGINE.GETITEMATTRText('APINVNEG',
5817: childkey,
5818: 'SUPPLIER_ROLE'));
5819:
5820: END IF;
5817: childkey,
5818: 'SUPPLIER_ROLE'));
5819:
5820: END IF;
5821: WF_ENGINE.startProcess('APINVNEG', l_new_child_itemkey);
5822: MO_GLOBAL.INIT ('SQLAP');
5823: MO_GLOBAL.set_policy_context('S',l_org_id);
5824:
5825: IF childkey IS NOT NULL THEN
5822: MO_GLOBAL.INIT ('SQLAP');
5823: MO_GLOBAL.set_policy_context('S',l_org_id);
5824:
5825: IF childkey IS NOT NULL THEN
5826: l_notf_receipient_type := WF_ENGINE.GetItemAttrText('APINVNEG',
5827: childkey,
5828: 'NOTF_RECEIPIENT_TYPE');
5829: IF l_notf_receipient_type = 'INTERNAL' THEN
5830:
5827: childkey,
5828: 'NOTF_RECEIPIENT_TYPE');
5829: IF l_notf_receipient_type = 'INTERNAL' THEN
5830:
5831: wf_engine.CompleteActivity(
5832: itemType => 'APINVNEG',
5833: itemKey => childkey,
5834: activity => 'APPROVAL_NEGOTIATION:WAITINTLINEAPRVL',
5835: result => 'NULL');
5833: itemKey => childkey,
5834: activity => 'APPROVAL_NEGOTIATION:WAITINTLINEAPRVL',
5835: result => 'NULL');
5836: ELSE
5837: wf_engine.CompleteActivity(
5838: itemType => 'APINVNEG',
5839: itemKey => childkey,
5840: activity => 'APPROVAL_NEGOTIATION:WAITEXTLINEAPRVL',
5841: result => 'NULL');
5954: CLOSE csr_ap_inv_details;
5955: l_iteration := nvl(p_approval_iteration,1);
5956: l_itemkey := to_char(p_invoice_id) || '_' || to_char(l_iteration);
5957:
5958: l_debug_info := 'Before Calling WF_ENGINE.createProcess(APINVAPR,'
5959: || l_itemkey || ',APPROVAL_MAIN);';
5960: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
5961: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
5962: l_api_name,l_debug_info);
5961: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
5962: l_api_name,l_debug_info);
5963: END IF;
5964:
5965: wf_engine.createProcess('APINVAPR', l_itemkey, 'APPROVAL_MAIN');
5966: l_debug_info := 'Before setting item attributes' ;
5967: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
5968: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
5969: l_api_name,l_debug_info);
5968: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
5969: l_api_name,l_debug_info);
5970: END IF;
5971:
5972: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5973: l_itemkey,
5974: 'INVOICE_ID',
5975: l_invoice_id);
5976: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5972: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5973: l_itemkey,
5974: 'INVOICE_ID',
5975: l_invoice_id);
5976: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5977: l_itemkey,
5978: 'ORG_ID',
5979: l_org_id);
5980: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5976: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5977: l_itemkey,
5978: 'ORG_ID',
5979: l_org_id);
5980: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5981: l_itemkey,
5982: 'INVOICE_TOTAL',
5983: l_total);
5984: WF_ENGINE.SetItemAttrText('APINVAPR',
5980: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5981: l_itemkey,
5982: 'INVOICE_TOTAL',
5983: l_total);
5984: WF_ENGINE.SetItemAttrText('APINVAPR',
5985: l_itemkey,
5986: 'INVOICE_SUPPLIER_NAME',
5987: l_vendor_name);
5988: WF_ENGINE.SetItemAttrText('APINVAPR',
5984: WF_ENGINE.SetItemAttrText('APINVAPR',
5985: l_itemkey,
5986: 'INVOICE_SUPPLIER_NAME',
5987: l_vendor_name);
5988: WF_ENGINE.SetItemAttrText('APINVAPR',
5989: l_itemkey,
5990: 'INVOICE_NUMBER',
5991: l_invoice_num);
5992: WF_ENGINE.SetItemAttrDate('APINVAPR',
5988: WF_ENGINE.SetItemAttrText('APINVAPR',
5989: l_itemkey,
5990: 'INVOICE_NUMBER',
5991: l_invoice_num);
5992: WF_ENGINE.SetItemAttrDate('APINVAPR',
5993: l_itemkey,
5994: 'INVOICE_DATE',
5995: l_invoice_date);
5996: WF_ENGINE.SetItemAttrText('APINVAPR',
5992: WF_ENGINE.SetItemAttrDate('APINVAPR',
5993: l_itemkey,
5994: 'INVOICE_DATE',
5995: l_invoice_date);
5996: WF_ENGINE.SetItemAttrText('APINVAPR',
5997: l_itemkey,
5998: 'INVOICE_DESCRIPTION',
5999: l_invoice_description);
6000: WF_ENGINE.SetItemAttrNumber('APINVAPR',
5996: WF_ENGINE.SetItemAttrText('APINVAPR',
5997: l_itemkey,
5998: 'INVOICE_DESCRIPTION',
5999: l_invoice_description);
6000: WF_ENGINE.SetItemAttrNumber('APINVAPR',
6001: l_itemkey,
6002: 'ITERATION',
6003: l_iteration);
6004: WF_ENGINE.SetItemAttrText('APINVAPR',
6000: WF_ENGINE.SetItemAttrNumber('APINVAPR',
6001: l_itemkey,
6002: 'ITERATION',
6003: l_iteration);
6004: WF_ENGINE.SetItemAttrText('APINVAPR',
6005: l_itemkey,
6006: 'NOTIFICATION_KEY',
6007: l_itemkey);
6008:
6024: and nvl(discarded_flag,'N')='N' /*bug 14748974 */
6025: ;
6026:
6027: IF l_num > 0 THEN
6028: WF_ENGINE.SetItemAttrText('APINVAPR',
6029: l_itemkey,
6030: 'INV_MATCH_TYPE',
6031: 'MATCHED');
6032:
6045: (po_header_id IS NOT NULL and nvl(discarded_flag,'N')='Y'));
6046: --bug 14748974 ends
6047:
6048: ELSE
6049: WF_ENGINE.SetItemAttrText('APINVAPR',
6050: l_itemkey,
6051: 'INV_MATCH_TYPE',
6052: 'UNMATCHED');
6053: UPDATE AP_INVOICE_LINES_ALL
6054: SET WFAPPROVAL_STATUS = 'NOT REQUIRED'
6055: where invoice_id = p_invoice_id;
6056: END IF;
6057:
6058: l_debug_info := 'Before Calling WF_ENGINE.startProcess(APINVAPR,'
6059: || l_itemkey || ');';
6060: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6061: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6062: l_api_name,l_debug_info);
6060: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6061: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6062: l_api_name,l_debug_info);
6063: END IF;
6064: WF_ENGINE.startProcess('APINVAPR', l_itemkey);
6065: l_debug_info := 'After Calling WF_ENGINE.startProcess' ;
6066: p_wfitemkey := l_itemkey;
6067: l_debug_info := 'End';
6068: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6061: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6062: l_api_name,l_debug_info);
6063: END IF;
6064: WF_ENGINE.startProcess('APINVAPR', l_itemkey);
6065: l_debug_info := 'After Calling WF_ENGINE.startProcess' ;
6066: p_wfitemkey := l_itemkey;
6067: l_debug_info := 'End';
6068: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6069: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6164: end if;
6165:
6166: IF p_line_number IS NULL THEN
6167: --End WF processes
6168: WF_Engine.abortProcess(
6169: itemType => 'APINVAPR',
6170: itemKey => l_invoice_key,
6171: process => 'APPROVAL_MAIN');
6172:
6193: itemIdIn => l_item_id);
6194:
6195: IF l_not_key <> nvl(l_old_not_key, 'dummy') THEN
6196:
6197: WF_Engine.abortProcess(
6198: itemType => 'APINVAPR',
6199: itemKey => l_not_key,
6200: process => 'APPROVAL_INVOICE_LINES');
6201:
6230: itemIdIn => l_item_id);
6231:
6232: IF l_not_key <> nvl(l_old_not_key, 'dummy') THEN
6233:
6234: WF_Engine.abortProcess(
6235: itemType => 'APINVAPR',
6236: itemKey => l_not_key,
6237: process => 'APPROVAL_INVOICE_LINES');
6238:
6320: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6321: l_api_name,l_debug_info);
6322: END IF;
6323:
6324: l_invoice_id := WF_ENGINE.GetItemAttrNumber('APINVAPR',
6325: p_itemkey,
6326: 'INVOICE_ID');
6327:
6328: l_iteration := WF_ENGINE.GetItemAttrNumber('APINVAPR',
6324: l_invoice_id := WF_ENGINE.GetItemAttrNumber('APINVAPR',
6325: p_itemkey,
6326: 'INVOICE_ID');
6327:
6328: l_iteration := WF_ENGINE.GetItemAttrNumber('APINVAPR',
6329: p_itemkey,
6330: 'ITERATION');
6331:
6332: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6328: l_iteration := WF_ENGINE.GetItemAttrNumber('APINVAPR',
6329: p_itemkey,
6330: 'ITERATION');
6331:
6332: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6333: p_itemkey,
6334: 'NOTF_ITERATION');
6335:
6336: l_comments := WF_ENGINE.GetItemAttrText('APINVAPR',
6332: l_notf_iteration := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6333: p_itemkey,
6334: 'NOTF_ITERATION');
6335:
6336: l_comments := WF_ENGINE.GetItemAttrText('APINVAPR',
6337: p_itemkey,
6338: 'WF_NOTE');
6339:
6340: l_org_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6336: l_comments := WF_ENGINE.GetItemAttrText('APINVAPR',
6337: p_itemkey,
6338: 'WF_NOTE');
6339:
6340: l_org_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6341: p_itemkey,
6342: 'ORG_ID');
6343:
6344: l_approver_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6340: l_org_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6341: p_itemkey,
6342: 'ORG_ID');
6343:
6344: l_approver_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6345: p_itemkey,
6346: 'APPROVER_NAME');
6347:
6348: l_esc_role_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6344: l_approver_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6345: p_itemkey,
6346: 'APPROVER_NAME');
6347:
6348: l_esc_role_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6349: p_itemkey,
6350: 'ESC_ROLE_NAME');
6351:
6352: l_role_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6348: l_esc_role_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6349: p_itemkey,
6350: 'ESC_ROLE_NAME');
6351:
6352: l_role_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6353: p_itemkey,
6354: 'ROLE_NAME');
6355:
6356: l_approver_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6352: l_role_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6353: p_itemkey,
6354: 'ROLE_NAME');
6355:
6356: l_approver_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6357: p_itemkey,
6358: 'APPROVER_ID');
6359:
6360: l_esc_flag := WF_ENGINE.GetItemAttrText('APINVAPR',
6356: l_approver_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6357: p_itemkey,
6358: 'APPROVER_ID');
6359:
6360: l_esc_flag := WF_ENGINE.GetItemAttrText('APINVAPR',
6361: p_itemkey,
6362: 'ESCALATED');
6363: l_esc_approver_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6364: p_itemkey,
6359:
6360: l_esc_flag := WF_ENGINE.GetItemAttrText('APINVAPR',
6361: p_itemkey,
6362: 'ESCALATED');
6363: l_esc_approver_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6364: p_itemkey,
6365: 'ESC_APPROVER_NAME');
6366:
6367: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6363: l_esc_approver_name := WF_ENGINE.GetItemAttrText('APINVAPR',
6364: p_itemkey,
6365: 'ESC_APPROVER_NAME');
6366:
6367: l_esc_approver_id := WF_ENGINE.GETITEMATTRNumber('APINVAPR',
6368: p_itemkey,
6369: 'ESC_APPROVER_ID');
6370:
6371: l_user_id := nvl(to_number(fnd_profile.value('USER_ID')),-1);
6495: AND INVOICE_ID = p_invoice_id
6496: AND LINE_NUMBER = p_line_number;
6497: IF l_sent = 0 THEN
6498: BEGIN
6499: wf_engine.CompleteActivity(
6500: itemType => 'APINVAPR',
6501: itemKey => p_itemkey,
6502: activity => 'APPROVAL_INVOICE_LINES:WAITLINEAPRVL',
6503: result => 'NULL');
6751: l_hold_release_code ap_holds_all.release_lookup_code%TYPE;
6752: l_debug_info VARCHAR2(2000);
6753: l_api_name CONSTANT VARCHAR2(200) := 'continue_hold_workflow';
6754: BEGIN
6755: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6756: itemkey,
6757: 'ORG_ID');
6758:
6759: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6755: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6756: itemkey,
6757: 'ORG_ID');
6758:
6759: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6760: itemkey,
6761: 'INVOICE_ID');
6762:
6763: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6759: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6760: itemkey,
6761: 'INVOICE_ID');
6762:
6763: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6764: itemkey,
6765: 'HOLD_ID');
6766: l_debug_info := 'Before select';
6767: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6776: and aha.org_id = l_org_id
6777: and aha.hold_lookup_code = ahc.hold_lookup_code
6778: and aha.hold_id = l_hold_id;
6779: IF l_hold_release_code IS NULL THEN
6780: resultout := wf_engine.eng_completed||':'||'Y';
6781: ELSE
6782: resultout := wf_engine.eng_completed||':'||'N';
6783: END IF;
6784: l_debug_info := 'After select, reultout : ' || resultout;
6778: and aha.hold_id = l_hold_id;
6779: IF l_hold_release_code IS NULL THEN
6780: resultout := wf_engine.eng_completed||':'||'Y';
6781: ELSE
6782: resultout := wf_engine.eng_completed||':'||'N';
6783: END IF;
6784: l_debug_info := 'After select, reultout : ' || resultout;
6785: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6786: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6808: l_wait_time NUMBER;
6809: l_debug_info VARCHAR2(2000);
6810: l_api_name CONSTANT VARCHAR2(200) := 'exists_initial_wait';
6811: BEGIN
6812: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6813: itemkey,
6814: 'ORG_ID');
6815:
6816: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6812: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6813: itemkey,
6814: 'ORG_ID');
6815:
6816: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6817: itemkey,
6818: 'INVOICE_ID');
6819:
6820: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6816: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6817: itemkey,
6818: 'INVOICE_ID');
6819:
6820: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6821: itemkey,
6822: 'HOLD_ID');
6823: l_debug_info := 'Before select';
6824: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6833: and aha.org_id = l_org_id
6834: and aha.hold_lookup_code = ahc.hold_lookup_code
6835: and aha.hold_id = l_hold_id;
6836: IF l_wait_time > 0 THEN
6837: WF_ENGINE.SetItemAttrNumber(itemtype,
6838: itemkey,
6839: 'INITIAL_WAIT_TIME',
6840: l_wait_time);
6841:
6838: itemkey,
6839: 'INITIAL_WAIT_TIME',
6840: l_wait_time);
6841:
6842: resultout := wf_engine.eng_completed||':'||'Y';
6843: ELSE
6844: resultout := wf_engine.eng_completed||':'||'N';
6845: END IF;
6846: l_debug_info := 'After select, reultout : ' || resultout;
6840: l_wait_time);
6841:
6842: resultout := wf_engine.eng_completed||':'||'Y';
6843: ELSE
6844: resultout := wf_engine.eng_completed||':'||'N';
6845: END IF;
6846: l_debug_info := 'After select, reultout : ' || resultout;
6847: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6848: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6871: l_wait_time NUMBER;
6872: l_debug_info VARCHAR2(2000);
6873: l_api_name CONSTANT VARCHAR2(200) := 'is_hold_released';
6874: BEGIN
6875: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6876: itemkey,
6877: 'ORG_ID');
6878:
6879: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6875: l_org_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6876: itemkey,
6877: 'ORG_ID');
6878:
6879: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6880: itemkey,
6881: 'INVOICE_ID');
6882:
6883: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6879: l_invoice_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6880: itemkey,
6881: 'INVOICE_ID');
6882:
6883: l_hold_id := WF_ENGINE.GETITEMATTRNumber(itemtype,
6884: itemkey,
6885: 'HOLD_ID');
6886: l_debug_info := 'Before select';
6887: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6899: and aha.hold_lookup_code = ahc.hold_lookup_code
6900: and aha.hold_id = l_hold_id;
6901: IF l_hold_release_code IS NOT NULL
6902: OR l_wait_time = 0 THEN
6903: resultout := wf_engine.eng_completed||':'||'Y';
6904: ELSE
6905: WF_ENGINE.SetItemAttrNumber(itemtype,
6906: itemkey,
6907: 'REMINDER_WAIT_TIME',
6901: IF l_hold_release_code IS NOT NULL
6902: OR l_wait_time = 0 THEN
6903: resultout := wf_engine.eng_completed||':'||'Y';
6904: ELSE
6905: WF_ENGINE.SetItemAttrNumber(itemtype,
6906: itemkey,
6907: 'REMINDER_WAIT_TIME',
6908: l_wait_time);
6909: resultout := wf_engine.eng_completed||':'||'N';
6905: WF_ENGINE.SetItemAttrNumber(itemtype,
6906: itemkey,
6907: 'REMINDER_WAIT_TIME',
6908: l_wait_time);
6909: resultout := wf_engine.eng_completed||':'||'N';
6910: END IF;
6911: l_debug_info := 'After select, reultout : ' || resultout;
6912: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6913: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6935: l_api_name,l_debug_info);
6936: END IF;
6937:
6938: BEGIN
6939: -- Bug 8266290 : Added the below WF_Engine call and if condition
6940: WF_Engine.ItemStatus ( itemType => 'APINVHDN',
6941: itemKey => to_char(p_hold_id),
6942: status => l_status,
6943: result => l_result ) ;
6936: END IF;
6937:
6938: BEGIN
6939: -- Bug 8266290 : Added the below WF_Engine call and if condition
6940: WF_Engine.ItemStatus ( itemType => 'APINVHDN',
6941: itemKey => to_char(p_hold_id),
6942: status => l_status,
6943: result => l_result ) ;
6944: -- Bug 9402921 : Added l_success logic
6943: result => l_result ) ;
6944: -- Bug 9402921 : Added l_success logic
6945: l_success := TRUE ;
6946:
6947: l_debug_info := 'WF_Engine call successful';
6948: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6949: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6950: l_api_name,l_debug_info);
6951: END IF;
6951: END IF;
6952: EXCEPTION
6953: WHEN OTHERS THEN
6954: l_success := FALSE ;
6955: l_debug_info := 'WF_Engine call failed' ;
6956: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
6957: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
6958: l_api_name,l_debug_info);
6959: END IF;
6965: WHERE hold_id = p_hold_id;
6966:
6967: IF l_success THEN -- Bug 9402921 : Added if-end if
6968: -- Bug 7693776 begin
6969: WF_Engine.abortProcess( itemType => 'APINVHDN',
6970: itemKey => to_char(p_hold_id) );
6971:
6972: AME_API2.clearAllApprovals( applicationIdIn => 200,
6973: transactionIdIn => to_char(p_hold_id),
7408: l_process, l_invoice_id;
7409:
7410: EXIT WHEN key_Cur%NOTFOUND OR key_Cur%NOTFOUND IS NULL;
7411:
7412: WF_Engine.abortProcess(
7413: itemType => l_item_type,
7414: itemKey => l_item_key,
7415: process => l_process);
7416:
7506: WHERE Notification_status = 'SENT'
7507: AND child_process_item_key = p_itemkey
7508: AND invoice_id = p_invoice_id;
7509: IF l_sent = 0 THEN
7510: wf_engine.CompleteActivity(
7511: itemType => 'APINVAPR',
7512: itemKey => p_itemkey,
7513: activity => 'APPROVAL_INVOICE_LINES:WAITLINEAPRVL',
7514: result => 'NULL');
7538: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
7539: l_api_name,l_debug_info);
7540: END IF;
7541: BEGIN
7542: wf_engine.CompleteActivity(
7543: itemType => 'APINVAPR',
7544: itemKey => l_invoice_key,
7545: activity => 'APPROVAL_MAIN:BLOCK',
7546: result => 'NULL');
7565: l_match_type VARCHAR2(80);
7566: l_debug_info VARCHAR2(2000);
7567: l_api_name CONSTANT VARCHAR2(200) := 'is_invoice_matched';
7568: BEGIN
7569: l_match_type := WF_ENGINE.GETITEMATTRText(itemtype,
7570: itemkey,
7571: 'INV_MATCH_TYPE');
7572:
7573:
7571: 'INV_MATCH_TYPE');
7572:
7573:
7574: IF l_match_type = 'MATCHED' THEN
7575: resultout := wf_engine.eng_completed||':'||'Y';
7576: ELSE
7577: resultout := wf_engine.eng_completed||':'||'N';
7578: END IF;
7579: l_debug_info := 'resultout : ' || resultout;
7573:
7574: IF l_match_type = 'MATCHED' THEN
7575: resultout := wf_engine.eng_completed||':'||'Y';
7576: ELSE
7577: resultout := wf_engine.eng_completed||':'||'N';
7578: END IF;
7579: l_debug_info := 'resultout : ' || resultout;
7580: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
7581: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
7598: l_api_name CONSTANT VARCHAR2(200) := 'aprvl_process_reject_int';
7599: l_debug_info VARCHAR2(2000);
7600: l_parent_key VARCHAR2(150);
7601: BEGIN
7602: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
7603: itemkey,
7604: 'PARENT_KEY');
7605:
7606: wf_engine.CompleteActivity(
7602: l_parent_key := WF_ENGINE.GetItemAttrText(itemtype,
7603: itemkey,
7604: 'PARENT_KEY');
7605:
7606: wf_engine.CompleteActivity(
7607: itemType => 'APINVAPR',
7608: itemKey => l_parent_key,
7609: activity => 'APPROVAL_INVOICE:DOCUMENT_APPROVAL_REQUEST',
7610: result => 'REJECTED');
7607: itemType => 'APINVAPR',
7608: itemKey => l_parent_key,
7609: activity => 'APPROVAL_INVOICE:DOCUMENT_APPROVAL_REQUEST',
7610: result => 'REJECTED');
7611: resultout := wf_engine.eng_completed||':'||'Y';
7612: EXCEPTION
7613:
7614: WHEN OTHERS
7615: THEN
7635: END IF;
7636: -- Bug 6845397. Getting invoice id.
7637: l_invoice_id := substr(p_itemkey, 1, instr(p_itemkey,'_')-1);
7638: BEGIN
7639: wf_engine.CompleteActivity(
7640: itemType => 'APINVAPR',
7641: itemKey => p_itemkey,
7642: activity => l_activity, -- Bug 8462325.
7643: result => 'APPROVED');
7689: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
7690: l_api_name,l_debug_info);
7691: END IF;
7692: BEGIN
7693: wf_engine.CompleteActivity(
7694: itemType => 'APINVAPR',
7695: itemKey => p_itemkey,
7696: activity => l_activity, -- for Bug 8689391
7697: result => 'REJECTED');
7717: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
7718: l_api_name,l_debug_info);
7719: END IF;
7720: BEGIN
7721: wf_engine.CompleteActivity(
7722: itemType => 'APINVNEG',
7723: itemKey => p_itemkey,
7724: activity => 'APPROVAL_NEGOTIATION:NOTIFY_SUP_NEGOTIATION',
7725: result => 'ACCEPT');
7744: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
7745: l_api_name,l_debug_info);
7746: END IF;
7747: BEGIN
7748: wf_engine.CompleteActivity(
7749: itemType => 'APINVNEG',
7750: itemKey => p_itemkey,
7751: activity => 'APPROVAL_NEGOTIATION:NOTIFY_INT_NEGOTIATION',
7752: result => 'ACCEPT');
7772: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
7773: l_api_name,l_debug_info);
7774: END IF;
7775: BEGIN
7776: wf_engine.CompleteActivity(
7777: itemType => 'APINVNEG',
7778: itemKey => p_itemkey,
7779: activity => 'APPROVAL_NEGOTIATION:NOTIFY_SUP_NEGOTIATION',
7780: result => 'CANCELINVOICE');
7800: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
7801: l_api_name,l_debug_info);
7802: END IF;
7803:
7804: WF_ENGINE.SetItemAttrText('APINVAPR',
7805: p_itemkey,
7806: 'WF_NOTE',
7807: p_notes);
7808:
7840: l_inv_type ap_invoices_all.invoice_type_lookup_code%TYPE;
7841: l_debug_info VARCHAR2(2000);
7842: l_api_name CONSTANT VARCHAR2(200) := 'is_payment_request';
7843: BEGIN
7844: l_invoice_id := WF_ENGINE.GETITEMATTRNumber
7845: (itemtype,
7846: itemkey,
7847: 'INVOICE_ID');
7848: SELECT ai.invoice_type_lookup_code
7850: FROM ap_invoices_all ai
7851: WHERE invoice_id = l_invoice_id;
7852:
7853: IF l_inv_type = 'PAYMENT REQUEST' THEN
7854: resultout := wf_engine.eng_completed||':'||'Y';
7855: ELSE
7856: resultout := wf_engine.eng_completed||':'||'N';
7857: END IF;
7858: l_debug_info := 'resultout : ' || resultout;
7852:
7853: IF l_inv_type = 'PAYMENT REQUEST' THEN
7854: resultout := wf_engine.eng_completed||':'||'Y';
7855: ELSE
7856: resultout := wf_engine.eng_completed||':'||'N';
7857: END IF;
7858: l_debug_info := 'resultout : ' || resultout;
7859: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
7860: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||
7925: WHERE approval_history_id=(select max(approval_history_id)from ap_inv_aprvl_hist
7926: where invoice_id= p_invoice_id);
7927:
7928: BEGIN
7929: l_nid := WF_ENGINE.context_nid;
7930: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
7931: itemkey,
7932: 'INVOICE_ID');
7933:
7926: where invoice_id= p_invoice_id);
7927:
7928: BEGIN
7929: l_nid := WF_ENGINE.context_nid;
7930: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
7931: itemkey,
7932: 'INVOICE_ID');
7933:
7934: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype,
7930: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
7931: itemkey,
7932: 'INVOICE_ID');
7933:
7934: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype,
7935: itemkey,
7936: 'ORG_ID');
7937:
7938: l_iteration := WF_ENGINE.GetItemAttrNumber( itemtype,
7934: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype,
7935: itemkey,
7936: 'ORG_ID');
7937:
7938: l_iteration := WF_ENGINE.GetItemAttrNumber( itemtype,
7939: itemkey,
7940: 'ITERATION');
7941: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
7942: itemkey,
7937:
7938: l_iteration := WF_ENGINE.GetItemAttrNumber( itemtype,
7939: itemkey,
7940: 'ITERATION');
7941: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
7942: itemkey,
7943: 'WF_NOTE');
7944: l_notf_iteration := WF_ENGINE.GetItemAttrnumber(itemtype,
7945: itemkey,
7940: 'ITERATION');
7941: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
7942: itemkey,
7943: 'WF_NOTE');
7944: l_notf_iteration := WF_ENGINE.GetItemAttrnumber(itemtype,
7945: itemkey,
7946: 'NOTF_ITERATION');
7947: -- bug # 8244218 begins
7948: l_esc_flag := WF_ENGINE.GetItemAttrnumber(itemtype,
7944: l_notf_iteration := WF_ENGINE.GetItemAttrnumber(itemtype,
7945: itemkey,
7946: 'NOTF_ITERATION');
7947: -- bug # 8244218 begins
7948: l_esc_flag := WF_ENGINE.GetItemAttrnumber(itemtype,
7949: itemkey,
7950: 'ESCALATED');
7951: /*WF_ENGINE.GetItemAttrnumber(itemtype,
7952: itemkey,
7947: -- bug # 8244218 begins
7948: l_esc_flag := WF_ENGINE.GetItemAttrnumber(itemtype,
7949: itemkey,
7950: 'ESCALATED');
7951: /*WF_ENGINE.GetItemAttrnumber(itemtype,
7952: itemkey,
7953: 'ESCALATED'); */
7954: -- bug # 8244218 ends
7955: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
7951: /*WF_ENGINE.GetItemAttrnumber(itemtype,
7952: itemkey,
7953: 'ESCALATED'); */
7954: -- bug # 8244218 ends
7955: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
7956: itemkey,
7957: 'ROLE_ACTUAL');
7958: l_esc_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
7959: itemkey,
7954: -- bug # 8244218 ends
7955: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
7956: itemkey,
7957: 'ROLE_ACTUAL');
7958: l_esc_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
7959: itemkey,
7960: 'ESC_ROLE_ACTUAL');
7961: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype,
7962: itemkey,
7957: 'ROLE_ACTUAL');
7958: l_esc_role_actual := WF_ENGINE.GetItemAttrText(itemtype,
7959: itemkey,
7960: 'ESC_ROLE_ACTUAL');
7961: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype,
7962: itemkey,
7963: 'FORWARD_ROLE');
7964: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
7965: itemkey,
7960: 'ESC_ROLE_ACTUAL');
7961: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype,
7962: itemkey,
7963: 'FORWARD_ROLE');
7964: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
7965: itemkey,
7966: 'INVOICE_TOTAL');
7967: -- getting approver in the document_approver and setting in the ROLE_ACTUAL attribute
7968: -- So even if the notification is delegated the ame will be updated in the for the actual approver
7968: -- So even if the notification is delegated the ame will be updated in the for the actual approver
7969: -- the further level of approval will be done by the owners supervisors and also the same
7970: -- notification won't be sent to this approver again
7971: IF ((nvl(l_esc_flag,'N') = 'N')and (l_fwd_role is null) ) THEN
7972: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
7973: itemkey,
7974: 'DOCUMENT_APPROVER');
7975: WF_ENGINE.SetItemAttrText(itemtype,
7976: itemkey,
7971: IF ((nvl(l_esc_flag,'N') = 'N')and (l_fwd_role is null) ) THEN
7972: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
7973: itemkey,
7974: 'DOCUMENT_APPROVER');
7975: WF_ENGINE.SetItemAttrText(itemtype,
7976: itemkey,
7977: 'ROLE_ACTUAL',
7978: l_role_name);
7979:
7977: 'ROLE_ACTUAL',
7978: l_role_name);
7979:
7980: elsif ((nvl(l_esc_flag,'N') = 'Y')and (l_esc_role_actual is null) ) THEN
7981: l_esc_role :=WF_ENGINE.GetItemAttrText( itemtype,
7982: itemkey,
7983: 'ESC_ROLE_NAME');
7984: WF_ENGINE.SetItemAttrText( itemtype,
7985: itemkey,
7980: elsif ((nvl(l_esc_flag,'N') = 'Y')and (l_esc_role_actual is null) ) THEN
7981: l_esc_role :=WF_ENGINE.GetItemAttrText( itemtype,
7982: itemkey,
7983: 'ESC_ROLE_NAME');
7984: WF_ENGINE.SetItemAttrText( itemtype,
7985: itemkey,
7986: 'ESC_ROLE_ACTUAL',
7987: l_esc_role);
7988:
7990: -- end
7991:
7992:
7993: IF (funcmode ='FORWARD') then
7994: l_rec_role :=WF_ENGINE.context_text;
7995: l_status:='DELEGATED';
7996:
7997: --fnd_client_info.set_org_context(l_org_id);
7998: --Now set the environment
8028: l_name,
8029: l_display_name);
8030:
8031:
8032: WF_ENGINE.SetItemAttrText(itemtype,
8033: itemkey,
8034: 'FORWARD_ROLE',
8035: l_role);
8036: IF nvl(l_esc_flag,'N') = 'N' THEN
8035: l_role);
8036: IF nvl(l_esc_flag,'N') = 'N' THEN
8037:
8038:
8039: WF_ENGINE.SetItemAttrText(itemtype,
8040: itemkey,
8041: 'DOCUMENT_APPROVER',
8042: l_role);
8043: WF_ENGINE.SetItemAttrText( itemtype,
8039: WF_ENGINE.SetItemAttrText(itemtype,
8040: itemkey,
8041: 'DOCUMENT_APPROVER',
8042: l_role);
8043: WF_ENGINE.SetItemAttrText( itemtype,
8044: itemkey,
8045: 'APPROVER_NAME',
8046: l_display_name);
8047:
8044: itemkey,
8045: 'APPROVER_NAME',
8046: l_display_name);
8047:
8048: WF_ENGINE.SetItemAttrNumber(itemtype,
8049: itemkey,
8050: 'APPROVER_ID',
8051: l_orig_sys_id);
8052: /* WF_ENGINE.SetItemAttrText( itemtype,
8048: WF_ENGINE.SetItemAttrNumber(itemtype,
8049: itemkey,
8050: 'APPROVER_ID',
8051: l_orig_sys_id);
8052: /* WF_ENGINE.SetItemAttrText( itemtype,
8053: itemkey,
8054: 'ORIG_SYSTEM',
8055: l_orig_system); */
8056:
8054: 'ORIG_SYSTEM',
8055: l_orig_system); */
8056:
8057: else
8058: WF_ENGINE.SetItemAttrText(itemtype,
8059: itemkey,
8060: 'ESC_ROLE_NAME',
8061: l_role);
8062: WF_ENGINE.SetItemAttrText( itemtype,
8058: WF_ENGINE.SetItemAttrText(itemtype,
8059: itemkey,
8060: 'ESC_ROLE_NAME',
8061: l_role);
8062: WF_ENGINE.SetItemAttrText( itemtype,
8063: itemkey,
8064: 'ESC_APPROVER_NAME',
8065: l_display_name);
8066:
8063: itemkey,
8064: 'ESC_APPROVER_NAME',
8065: l_display_name);
8066:
8067: WF_ENGINE.SetItemAttrNumber(itemtype,
8068: itemkey,
8069: 'ESC_APPROVER_ID',
8070: l_orig_sys_id);
8071:
8070: l_orig_sys_id);
8071:
8072: end if ;
8073: -- Bug 10323137 starts
8074: l_comments := nvl(l_comments,NVL(WF_ENGINE.context_user_comment,'None'));
8075: -- Bug 10323137 ends
8076: l_comments :='To: '||l_display_name||' '||' With Comment:'||l_comments;
8077:
8078: l_hist_rec.HISTORY_TYPE := 'DOCUMENTAPPROVAL';
8099: UPDATE AP_INV_APRVL_HIST
8100: set APPROVER_COMMENTS = l_comments, approver_name = l_display_name
8101: WHERE APPROVAL_HISTORY_ID =(select max(APPROVAL_HISTORY_ID) from AP_INV_APRVL_HIST
8102: where invoice_id=l_invoice_id);*/
8103: resultout := wf_engine.eng_completed || ':' || wf_engine.eng_null;
8104: return;
8105: End if;
8106:
8107: /* BEGIN
8130: l_org_id,
8131: l_result);
8132:
8133:
8134: WF_ENGINE.SetItemAttrText( itemtype,
8135: itemkey,
8136: 'FORWARD_ROLE',
8137: NULL);-- */
8138:
8135: itemkey,
8136: 'FORWARD_ROLE',
8137: NULL);-- */
8138:
8139: resultout := wf_engine.eng_completed || ':' || wf_engine.eng_null;
8140: return;
8141: End if;
8142:
8143:
8184: l_error_message VARCHAR2(2000); -- Bug 5037108
8185: l_debug_info VARCHAR2(50); -- Bug 5037108
8186:
8187: BEGIN
8188: l_forward_role_name := WF_ENGINE.GetItemAttrText(itemtype,
8189: itemkey,
8190: 'FORWARD_ROLE');
8191: l_current_role_name := WF_ENGINE.GetItemAttrText(itemtype,
8192: itemkey,
8187: BEGIN
8188: l_forward_role_name := WF_ENGINE.GetItemAttrText(itemtype,
8189: itemkey,
8190: 'FORWARD_ROLE');
8191: l_current_role_name := WF_ENGINE.GetItemAttrText(itemtype,
8192: itemkey,
8193: 'DOCUMENT_APPROVER');
8194:
8195: IF l_forward_role_name is NULL or l_forward_role_name=' ' THEN
8192: itemkey,
8193: 'DOCUMENT_APPROVER');
8194:
8195: IF l_forward_role_name is NULL or l_forward_role_name=' ' THEN
8196: resultout := wf_engine.eng_completed||':'||'N';
8197: ELSE
8198: IF(nvl(l_forward_role_name,'') = nvl(l_current_role_name,'')) then
8199: resultout := wf_engine.eng_completed||':'||'Y';
8200: /* -- Bug 5037108 starts
8195: IF l_forward_role_name is NULL or l_forward_role_name=' ' THEN
8196: resultout := wf_engine.eng_completed||':'||'N';
8197: ELSE
8198: IF(nvl(l_forward_role_name,'') = nvl(l_current_role_name,'')) then
8199: resultout := wf_engine.eng_completed||':'||'Y';
8200: /* -- Bug 5037108 starts
8201: BEGIN
8202: SELECT invoice_id
8203: INTO l_temp_invoice_id
8219: SET wfapproval_status = 'REJECTED'
8220: WHERE invoice_id = substr(itemkey, 1, instr(itemkey,'_')-1)
8221: AND wfapproval_status <> 'MANUALLY APPROVED'; */
8222: ELSE
8223: resultout := wf_engine.eng_completed||':'||'N';
8224: END If;
8225:
8226: END IF;
8227:
8307: WHERE invap.Notification_Key = itemkey
8308: AND al.line_number = invap.line_number
8309: AND al.invoice_id = invap.invoice_id;
8310: BEGIN
8311: l_nid := WF_ENGINE.context_nid;
8312: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
8313: itemkey,
8314: 'INVOICE_ID');
8315:
8308: AND al.line_number = invap.line_number
8309: AND al.invoice_id = invap.invoice_id;
8310: BEGIN
8311: l_nid := WF_ENGINE.context_nid;
8312: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
8313: itemkey,
8314: 'INVOICE_ID');
8315:
8316: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype,
8312: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype,
8313: itemkey,
8314: 'INVOICE_ID');
8315:
8316: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype,
8317: itemkey,
8318: 'ORG_ID');
8319:
8320: l_iteration := WF_ENGINE.GetItemAttrNumber( itemtype,
8316: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype,
8317: itemkey,
8318: 'ORG_ID');
8319:
8320: l_iteration := WF_ENGINE.GetItemAttrNumber( itemtype,
8321: itemkey,
8322: 'ITERATION');
8323: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
8324: itemkey,
8319:
8320: l_iteration := WF_ENGINE.GetItemAttrNumber( itemtype,
8321: itemkey,
8322: 'ITERATION');
8323: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
8324: itemkey,
8325: 'WF_NOTE');
8326: l_notf_iteration := WF_ENGINE.GetItemAttrnumber(itemtype,
8327: itemkey,
8322: 'ITERATION');
8323: l_comments := WF_ENGINE.GetItemAttrText(itemtype,
8324: itemkey,
8325: 'WF_NOTE');
8326: l_notf_iteration := WF_ENGINE.GetItemAttrnumber(itemtype,
8327: itemkey,
8328: 'NOTF_ITERATION');
8329: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
8330: itemkey,
8325: 'WF_NOTE');
8326: l_notf_iteration := WF_ENGINE.GetItemAttrnumber(itemtype,
8327: itemkey,
8328: 'NOTF_ITERATION');
8329: l_esc_flag := WF_ENGINE.GetItemAttrText(itemtype,
8330: itemkey,
8331: 'ESCALATED');
8332:
8333: -- getting approver in the ROLE_NAME and setting in the ROLE_ACTUAL attribute
8335: -- So even if the notification is delegated the ame will be updated in the for the actual approver
8336: -- the further level of approval will be done by the owners supervisors and also the same
8337: -- notification won't be sent to this approver again
8338: IF nvl(l_esc_flag,'N') = 'N' THEN
8339: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
8340: itemkey,
8341: 'ROLE_NAME');
8342:
8343: WF_ENGINE.SetItemAttrText(itemtype,
8339: l_role_name :=WF_ENGINE.GetItemAttrText(itemtype,
8340: itemkey,
8341: 'ROLE_NAME');
8342:
8343: WF_ENGINE.SetItemAttrText(itemtype,
8344: itemkey,
8345: 'ROLE_ACTUAL',
8346: l_role_name);
8347:
8345: 'ROLE_ACTUAL',
8346: l_role_name);
8347:
8348: elsif nvl(l_esc_flag,'N') = 'Y' THEN
8349: l_esc_role :=WF_ENGINE.GetItemAttrText( itemtype,
8350: itemkey,
8351: 'ESC_ROLE_NAME');
8352: WF_ENGINE.SetItemAttrText( itemtype,
8353: itemkey,
8348: elsif nvl(l_esc_flag,'N') = 'Y' THEN
8349: l_esc_role :=WF_ENGINE.GetItemAttrText( itemtype,
8350: itemkey,
8351: 'ESC_ROLE_NAME');
8352: WF_ENGINE.SetItemAttrText( itemtype,
8353: itemkey,
8354: 'ESC_ROLE_ACTUAL',
8355: l_esc_role);
8356:
8356:
8357: end if ;
8358: -- end
8359: IF (funcmode ='FORWARD') then
8360: l_rec_role :=WF_ENGINE.context_text;
8361: l_status:='DELEGATED';
8362:
8363: --fnd_client_info.set_org_context(l_org_id);
8364: --Now set the environment
8393: l_orig_sys_id,
8394: l_name,
8395: l_display_name);
8396:
8397: WF_ENGINE.SetItemAttrText(itemtype,
8398: itemkey,
8399: 'FORWARD_ROLE_LINES',
8400: l_role);
8401:
8402:
8403: IF nvl(l_esc_flag,'N') = 'N' THEN
8404:
8405:
8406: WF_ENGINE.SetItemAttrText(itemtype,
8407: itemkey,
8408: 'ROLE_NAME',
8409: l_role);
8410: WF_ENGINE.SetItemAttrText( itemtype,
8406: WF_ENGINE.SetItemAttrText(itemtype,
8407: itemkey,
8408: 'ROLE_NAME',
8409: l_role);
8410: WF_ENGINE.SetItemAttrText( itemtype,
8411: itemkey,
8412: 'APPROVER_NAME',
8413: l_display_name);
8414:
8411: itemkey,
8412: 'APPROVER_NAME',
8413: l_display_name);
8414:
8415: WF_ENGINE.SetItemAttrNumber(itemtype,
8416: itemkey,
8417: 'APPROVER_ID',
8418: l_orig_sys_id);
8419: /* WF_ENGINE.SetItemAttrText( itemtype,
8415: WF_ENGINE.SetItemAttrNumber(itemtype,
8416: itemkey,
8417: 'APPROVER_ID',
8418: l_orig_sys_id);
8419: /* WF_ENGINE.SetItemAttrText( itemtype,
8420: itemkey,
8421: 'ORIG_SYSTEM',
8422: l_orig_system); */
8423:
8421: 'ORIG_SYSTEM',
8422: l_orig_system); */
8423:
8424: else
8425: WF_ENGINE.SetItemAttrText(itemtype,
8426: itemkey,
8427: 'ESC_ROLE_NAME',
8428: l_role);
8429: WF_ENGINE.SetItemAttrText( itemtype,
8425: WF_ENGINE.SetItemAttrText(itemtype,
8426: itemkey,
8427: 'ESC_ROLE_NAME',
8428: l_role);
8429: WF_ENGINE.SetItemAttrText( itemtype,
8430: itemkey,
8431: 'ESC_APPROVER_NAME',
8432: l_display_name);
8433:
8430: itemkey,
8431: 'ESC_APPROVER_NAME',
8432: l_display_name);
8433:
8434: WF_ENGINE.SetItemAttrNumber(itemtype,
8435: itemkey,
8436: 'ESC_APPROVER_ID',
8437: l_orig_sys_id);
8438:
8478: UPDATE AP_INV_APRVL_HIST
8479: set APPROVER_COMMENTS = l_comments, approver_name = l_display_name
8480: WHERE APPROVAL_HISTORY_ID =(select max(APPROVAL_HISTORY_ID) from AP_INV_APRVL_HIST
8481: where invoice_id=l_invoice_id);*/
8482: resultout := wf_engine.eng_completed || ':' || wf_engine.eng_null;
8483: return;
8484: End if;
8485:
8486: /* BEGIN
8510: l_org_id,
8511: l_result);
8512:
8513:
8514: WF_ENGINE.SetItemAttrText( itemtype,
8515: itemkey,
8516: 'FORWARD_ROLE',
8517: NULL);
8518:
8515: itemkey,
8516: 'FORWARD_ROLE',
8517: NULL);
8518:
8519: resultout := wf_engine.eng_completed || ':' || wf_engine.eng_null;
8520: return;
8521: End if;*/
8522: -- Don't allow transfer
8523: if ( funcmode = 'TRANSFER' ) then
8562: l_error_message VARCHAR2(2000);
8563: l_debug_info VARCHAR2(50);
8564:
8565: BEGIN
8566: l_forward_role_name := WF_ENGINE.GetItemAttrText(itemtype,
8567: itemkey,
8568: 'FORWARD_ROLE_LINES');
8569: l_current_role_name := WF_ENGINE.GetItemAttrText(itemtype,
8570: itemkey,
8565: BEGIN
8566: l_forward_role_name := WF_ENGINE.GetItemAttrText(itemtype,
8567: itemkey,
8568: 'FORWARD_ROLE_LINES');
8569: l_current_role_name := WF_ENGINE.GetItemAttrText(itemtype,
8570: itemkey,
8571: 'ROLE_NAME');
8572:
8573: IF l_forward_role_name is NULL or l_forward_role_name=' ' THEN
8570: itemkey,
8571: 'ROLE_NAME');
8572:
8573: IF l_forward_role_name is NULL or l_forward_role_name=' ' THEN
8574: resultout := wf_engine.eng_completed||':'||'N';
8575: ELSE
8576: IF(nvl(l_forward_role_name,'') = nvl(l_current_role_name,'')) then
8577: resultout := wf_engine.eng_completed||':'||'Y';
8578: /* -- Bug 5037108 starts
8573: IF l_forward_role_name is NULL or l_forward_role_name=' ' THEN
8574: resultout := wf_engine.eng_completed||':'||'N';
8575: ELSE
8576: IF(nvl(l_forward_role_name,'') = nvl(l_current_role_name,'')) then
8577: resultout := wf_engine.eng_completed||':'||'Y';
8578: /* -- Bug 5037108 starts
8579: BEGIN
8580: SELECT invoice_id
8581: INTO l_temp_invoice_id
8597: SET wfapproval_status = 'REJECTED'
8598: WHERE invoice_id = substr(itemkey, 1, instr(itemkey,'_')-1)
8599: AND wfapproval_status <> 'MANUALLY APPROVED'; */
8600: ELSE
8601: resultout := wf_engine.eng_completed||':'||'N';
8602: END If;
8603:
8604: END IF;
8605:
8633: * Parameters : As per standard API format for Workflow Engine as documented
8634: * in Workflow Developer's Guide
8635: *
8636: * Logic : As per Workflow API Reference, the global engine variable
8637: * WF_ENGINE.context_user will be set to 'email:
8639: * her own behalf. The code has been written based on this to :
8640: * 1) Check whether WF_ENGINE.context_user is set to 'email:...'
8641: * 2) If yes, check how many times the email address exists in
8636: * Logic : As per Workflow API Reference, the global engine variable
8637: * WF_ENGINE.context_user will be set to 'email:
8638: * if user is taking the RESPOND action through e-mail on his or
8639: * her own behalf. The code has been written based on this to :
8640: * 1) Check whether WF_ENGINE.context_user is set to 'email:...'
8641: * 2) If yes, check how many times the email address exists in
8642: * wf_roles
8643: * 3) If it does not exist or exists more than once, then do nothing.
8644: * This will let the context to be set as per WF Engine ( which
8640: * 1) Check whether WF_ENGINE.context_user is set to 'email:...'
8641: * 2) If yes, check how many times the email address exists in
8642: * wf_roles
8643: * 3) If it does not exist or exists more than once, then do nothing.
8644: * This will let the context to be set as per WF Engine ( which
8645: * works under SYSADMIN context ). If the role does not exist then
8646: * we have no way of setting the context and if it exists multiple
8647: * times then we cannot set the context based on one particular
8648: * occurrence of the record and in that case it will be better to
8678: END IF;
8679:
8680: IF ( funcmode = 'RESPOND' ) then
8681: l_debug_info := 'Entered the IF block. FND_GLOBAL.user_id = ' || FND_GLOBAL.user_id ||
8682: ', WF_ENGINE.context_user = ' || WF_ENGINE.context_user ;
8683: IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL )
8684: THEN
8685: FND_LOG.string( G_LEVEL_STATEMENT, G_MODULE_NAME || l_api_name, l_debug_info);
8686: END IF;
8684: THEN
8685: FND_LOG.string( G_LEVEL_STATEMENT, G_MODULE_NAME || l_api_name, l_debug_info);
8686: END IF;
8687:
8688: IF SUBSTR( WF_ENGINE.context_user, 1, 6) = 'email:'
8689: THEN
8690: BEGIN
8691: SELECT COUNT( name )
8692: INTO l_user_role_count
8690: BEGIN
8691: SELECT COUNT( name )
8692: INTO l_user_role_count
8693: FROM wf_roles
8694: WHERE UPPER( email_address ) = UPPER( SUBSTR( WF_ENGINE.context_user, 7 ) )
8695: AND orig_system = 'PER'
8696: AND status = 'ACTIVE' ;
8697: EXCEPTION
8698: WHEN OTHERS THEN
8709: THEN
8710: SELECT name
8711: INTO l_user_name
8712: FROM wf_roles
8713: WHERE UPPER( email_address ) = UPPER( SUBSTR( WF_ENGINE.context_user, 7 ) )
8714: AND orig_system = 'PER'
8715: AND status = 'ACTIVE' ;
8716:
8717: l_debug_info := 'l_user_name = ' || l_user_name ||
8858: FROM FND_USER
8859: WHERE USER_NAME=p_rec_role;
8860:
8861: BEGIN
8862: --Getting data from WF Engine
8863: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey, 'INVOICE_ID');
8864: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype, itemkey, 'ORG_ID');
8865: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8859: WHERE USER_NAME=p_rec_role;
8860:
8861: BEGIN
8862: --Getting data from WF Engine
8863: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey, 'INVOICE_ID');
8864: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype, itemkey, 'ORG_ID');
8865: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8860:
8861: BEGIN
8862: --Getting data from WF Engine
8863: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey, 'INVOICE_ID');
8864: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype, itemkey, 'ORG_ID');
8865: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8861: BEGIN
8862: --Getting data from WF Engine
8863: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey, 'INVOICE_ID');
8864: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype, itemkey, 'ORG_ID');
8865: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8862: --Getting data from WF Engine
8863: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey, 'INVOICE_ID');
8864: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype, itemkey, 'ORG_ID');
8865: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8863: l_invoice_id := WF_ENGINE.GetItemAttrNumber(itemtype, itemkey, 'INVOICE_ID');
8864: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype, itemkey, 'ORG_ID');
8865: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8864: l_org_id := WF_ENGINE.GETITEMATTRNumber( itemtype, itemkey, 'ORG_ID');
8865: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8865: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8873: l_disp_not_receiver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DISP_NOT_RECEIVER');
8866: l_doc_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8873: l_disp_not_receiver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DISP_NOT_RECEIVER');
8874: l_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ITERATION');
8867: l_line_approver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_NAME');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8873: l_disp_not_receiver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DISP_NOT_RECEIVER');
8874: l_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ITERATION');
8875: l_notf_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_ITERATION');
8868: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8873: l_disp_not_receiver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DISP_NOT_RECEIVER');
8874: l_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ITERATION');
8875: l_notf_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_ITERATION');
8876: l_comments := WF_ENGINE.GetItemAttrText(itemtype,itemkey,'WF_NOTE');
8869: l_notification_cxt := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_CONTEXT');
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8873: l_disp_not_receiver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DISP_NOT_RECEIVER');
8874: l_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ITERATION');
8875: l_notf_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_ITERATION');
8876: l_comments := WF_ENGINE.GetItemAttrText(itemtype,itemkey,'WF_NOTE');
8877:
8870: l_notification_key := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTIFICATION_KEY');
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8873: l_disp_not_receiver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DISP_NOT_RECEIVER');
8874: l_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ITERATION');
8875: l_notf_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_ITERATION');
8876: l_comments := WF_ENGINE.GetItemAttrText(itemtype,itemkey,'WF_NOTE');
8877:
8878:
8871: l_forward_role_lines := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE_LINES');
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8873: l_disp_not_receiver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DISP_NOT_RECEIVER');
8874: l_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ITERATION');
8875: l_notf_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_ITERATION');
8876: l_comments := WF_ENGINE.GetItemAttrText(itemtype,itemkey,'WF_NOTE');
8877:
8878:
8879:
8872: l_approver_name := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'APPROVER_NAME');
8873: l_disp_not_receiver := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DISP_NOT_RECEIVER');
8874: l_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ITERATION');
8875: l_notf_iteration := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'NOTF_ITERATION');
8876: l_comments := WF_ENGINE.GetItemAttrText(itemtype,itemkey,'WF_NOTE');
8877:
8878:
8879:
8880: --Defaulting the org id
8881: MO_GLOBAL.INIT ('SQLAP');
8882: MO_GLOBAL.set_policy_context('S',l_org_id);
8883: --Checking if the mode is TRANSFER
8884: IF ( funcmode = 'TRANSFER' ) THEN
8885: l_transfer_to_role :=WF_ENGINE.context_new_role; --Obtaining the forwardees role
8886: l_original_recipient := WF_ENGINE.context_original_recipient; -- Obtaining the forwarder's role
8887: l_rec_role := WF_ENGINE.context_text;
8888: fwd_rec.name := l_transfer_to_role; --Setting the name of the forwardee record to the forwardee role
8889: NxtApprover_rec.name :=l_original_recipient; --Setting the name of the forwarder record to the forwarder role
8882: MO_GLOBAL.set_policy_context('S',l_org_id);
8883: --Checking if the mode is TRANSFER
8884: IF ( funcmode = 'TRANSFER' ) THEN
8885: l_transfer_to_role :=WF_ENGINE.context_new_role; --Obtaining the forwardees role
8886: l_original_recipient := WF_ENGINE.context_original_recipient; -- Obtaining the forwarder's role
8887: l_rec_role := WF_ENGINE.context_text;
8888: fwd_rec.name := l_transfer_to_role; --Setting the name of the forwardee record to the forwardee role
8889: NxtApprover_rec.name :=l_original_recipient; --Setting the name of the forwarder record to the forwarder role
8890: NxtApprover_rec.approval_status := ame_util.ForwardStatus; --Setting the status as ame_util.ForwardStatus which is 'FORWARD'
8883: --Checking if the mode is TRANSFER
8884: IF ( funcmode = 'TRANSFER' ) THEN
8885: l_transfer_to_role :=WF_ENGINE.context_new_role; --Obtaining the forwardees role
8886: l_original_recipient := WF_ENGINE.context_original_recipient; -- Obtaining the forwarder's role
8887: l_rec_role := WF_ENGINE.context_text;
8888: fwd_rec.name := l_transfer_to_role; --Setting the name of the forwardee record to the forwardee role
8889: NxtApprover_rec.name :=l_original_recipient; --Setting the name of the forwarder record to the forwarder role
8890: NxtApprover_rec.approval_status := ame_util.ForwardStatus; --Setting the status as ame_util.ForwardStatus which is 'FORWARD'
8891: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL', l_transfer_to_role); --Setting the role_actual attribute to forwardee role
8887: l_rec_role := WF_ENGINE.context_text;
8888: fwd_rec.name := l_transfer_to_role; --Setting the name of the forwardee record to the forwardee role
8889: NxtApprover_rec.name :=l_original_recipient; --Setting the name of the forwarder record to the forwarder role
8890: NxtApprover_rec.approval_status := ame_util.ForwardStatus; --Setting the status as ame_util.ForwardStatus which is 'FORWARD'
8891: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL', l_transfer_to_role); --Setting the role_actual attribute to forwardee role
8892: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'DOCUMENT_APPROVER', L_Transfer_To_Role); --Setting the DOCUMENT_APPROVER attribute to forwardee role
8893: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE', l_transfer_to_role); --Setting the FORWARD_ROLE attribute to forwardee role
8894:
8895: l_hist_rec.INVOICE_ID := l_invoice_id;
8888: fwd_rec.name := l_transfer_to_role; --Setting the name of the forwardee record to the forwardee role
8889: NxtApprover_rec.name :=l_original_recipient; --Setting the name of the forwarder record to the forwarder role
8890: NxtApprover_rec.approval_status := ame_util.ForwardStatus; --Setting the status as ame_util.ForwardStatus which is 'FORWARD'
8891: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL', l_transfer_to_role); --Setting the role_actual attribute to forwardee role
8892: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'DOCUMENT_APPROVER', L_Transfer_To_Role); --Setting the DOCUMENT_APPROVER attribute to forwardee role
8893: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE', l_transfer_to_role); --Setting the FORWARD_ROLE attribute to forwardee role
8894:
8895: l_hist_rec.INVOICE_ID := l_invoice_id;
8896: l_hist_rec.ITERATION := l_iteration;
8889: NxtApprover_rec.name :=l_original_recipient; --Setting the name of the forwarder record to the forwarder role
8890: NxtApprover_rec.approval_status := ame_util.ForwardStatus; --Setting the status as ame_util.ForwardStatus which is 'FORWARD'
8891: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL', l_transfer_to_role); --Setting the role_actual attribute to forwardee role
8892: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'DOCUMENT_APPROVER', L_Transfer_To_Role); --Setting the DOCUMENT_APPROVER attribute to forwardee role
8893: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE', l_transfer_to_role); --Setting the FORWARD_ROLE attribute to forwardee role
8894:
8895: l_hist_rec.INVOICE_ID := l_invoice_id;
8896: l_hist_rec.ITERATION := l_iteration;
8897: l_hist_rec.RESPONSE := 'TRANSFERRED';
8927: l_orig_system := 'FND_USR';
8928: l_orig_sys_id := l_forward_to_user_id;
8929: END IF;
8930: WF_DIRECTORY.GetUserName( l_orig_system, l_orig_sys_id, l_name,l_display_name);
8931: l_invoice_total := WF_ENGINE.GETITEMATTRNumber(itemtype,
8932: itemkey,
8933: 'INVOICE_TOTAL');
8934: l_hist_rec.APPROVER_NAME := l_display_name;
8935: l_comments := nvl(l_comments,'None');
8939: Elsif (Approvaltype = 'LINESAPPROVAL') Then
8940:
8941: l_hist_rec.HISTORY_TYPE := 'LINESAPPROVAL';
8942:
8943: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'ROLE_NAME', L_Transfer_To_Role); --Setting the ROLE_NAME attribute to forwardee role
8944: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'FORWARD_ROLE_LINES', L_Transfer_To_Role); --Setting the FORWARD_ROLE_LINES attribute to forwardee role
8945: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER', l_transfer_to_role); --Setting the DOCUMENT_APPROVER attribute to forwardee role
8946: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE', l_transfer_to_role); --Setting the FORWARD_ROLE attribute to forwardee role
8947:
8940:
8941: l_hist_rec.HISTORY_TYPE := 'LINESAPPROVAL';
8942:
8943: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'ROLE_NAME', L_Transfer_To_Role); --Setting the ROLE_NAME attribute to forwardee role
8944: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'FORWARD_ROLE_LINES', L_Transfer_To_Role); --Setting the FORWARD_ROLE_LINES attribute to forwardee role
8945: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER', l_transfer_to_role); --Setting the DOCUMENT_APPROVER attribute to forwardee role
8946: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE', l_transfer_to_role); --Setting the FORWARD_ROLE attribute to forwardee role
8947:
8948: OPEN Items_Cur(itemkey);
8941: l_hist_rec.HISTORY_TYPE := 'LINESAPPROVAL';
8942:
8943: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'ROLE_NAME', L_Transfer_To_Role); --Setting the ROLE_NAME attribute to forwardee role
8944: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'FORWARD_ROLE_LINES', L_Transfer_To_Role); --Setting the FORWARD_ROLE_LINES attribute to forwardee role
8945: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER', l_transfer_to_role); --Setting the DOCUMENT_APPROVER attribute to forwardee role
8946: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE', l_transfer_to_role); --Setting the FORWARD_ROLE attribute to forwardee role
8947:
8948: OPEN Items_Cur(itemkey);
8949: LOOP
8942:
8943: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'ROLE_NAME', L_Transfer_To_Role); --Setting the ROLE_NAME attribute to forwardee role
8944: Wf_Engine.Setitemattrtext(Itemtype, Itemkey, 'FORWARD_ROLE_LINES', L_Transfer_To_Role); --Setting the FORWARD_ROLE_LINES attribute to forwardee role
8945: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER', l_transfer_to_role); --Setting the DOCUMENT_APPROVER attribute to forwardee role
8946: WF_ENGINE.SetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE', l_transfer_to_role); --Setting the FORWARD_ROLE attribute to forwardee role
8947:
8948: OPEN Items_Cur(itemkey);
8949: LOOP
8950:
9002: CLOSE Items_Cur;
9003:
9004: END IF;
9005: --Obtaining the roles to check id they are properly set
9006: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
9007: l_doc_approver :=WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
9008: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
9009: L_Line_Approver :=Wf_Engine.Getitemattrtext(Itemtype, Itemkey, 'ROLE_NAME');
9010:
9003:
9004: END IF;
9005: --Obtaining the roles to check id they are properly set
9006: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
9007: l_doc_approver :=WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
9008: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
9009: L_Line_Approver :=Wf_Engine.Getitemattrtext(Itemtype, Itemkey, 'ROLE_NAME');
9010:
9011: --Setting the resultout variable
9004: END IF;
9005: --Obtaining the roles to check id they are properly set
9006: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
9007: l_doc_approver :=WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
9008: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
9009: L_Line_Approver :=Wf_Engine.Getitemattrtext(Itemtype, Itemkey, 'ROLE_NAME');
9010:
9011: --Setting the resultout variable
9012: resultout := wf_engine.eng_completed || ':' || wf_engine.eng_null;
9005: --Obtaining the roles to check id they are properly set
9006: l_fwd_role := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'FORWARD_ROLE');
9007: l_doc_approver :=WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'DOCUMENT_APPROVER');
9008: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
9009: L_Line_Approver :=Wf_Engine.Getitemattrtext(Itemtype, Itemkey, 'ROLE_NAME');
9010:
9011: --Setting the resultout variable
9012: resultout := wf_engine.eng_completed || ':' || wf_engine.eng_null;
9013: RETURN;
9008: l_role_actual := WF_ENGINE.GetItemAttrText(itemtype, itemkey, 'ROLE_ACTUAL');
9009: L_Line_Approver :=Wf_Engine.Getitemattrtext(Itemtype, Itemkey, 'ROLE_NAME');
9010:
9011: --Setting the resultout variable
9012: resultout := wf_engine.eng_completed || ':' || wf_engine.eng_null;
9013: RETURN;
9014: END IF;
9015:
9016: