25: p_msg in varchar2)
26: IS
27: l_module varchar2(2000);
28: BEGIN
29: /* Taken from Package FND_LOG
30: LEVEL_UNEXPECTED CONSTANT NUMBER := 6;
31: LEVEL_ERROR CONSTANT NUMBER := 5;
32: LEVEL_EXCEPTION CONSTANT NUMBER := 4;
33: LEVEL_EVENT CONSTANT NUMBER := 3;
36: */
37:
38: l_module := 'pos.plsql.pos_wcapprove_pvt.'||p_api_name;
39: IF(g_asn_debug = 'Y')THEN
40: IF ( p_level >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
41: FND_LOG.string(LOG_LEVEL => p_level,
42: MODULE => l_module,
43: MESSAGE => p_msg);
44: END IF;
37:
38: l_module := 'pos.plsql.pos_wcapprove_pvt.'||p_api_name;
39: IF(g_asn_debug = 'Y')THEN
40: IF ( p_level >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) THEN
41: FND_LOG.string(LOG_LEVEL => p_level,
42: MODULE => l_module,
43: MESSAGE => p_msg);
44: END IF;
45:
100: begin
101: l_progress := 'POS_WCAPPROVE_PVT.start_wf_progress: 01';
102:
103: IF (g_asn_debug = 'Y') THEN
104: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
105: 'Enter Start_wf_process ' || l_progress);
106: END IF;
107:
108: If (p_itemkey is NULL) then
134:
135: exception
136: when others then
137: IF (g_asn_debug = 'Y') THEN
138: debug_log(FND_LOG.LEVEL_UNEXPECTED,
139: l_api_name,'Exception to check process '
140: || l_progress);
141: END IF;
142: raise;
143: end;
144:
145:
146: IF (g_asn_debug = 'Y') THEN
147: debug_log(FND_LOG.LEVEL_STATEMENT,
148: l_api_name,'l_wf_created ' || l_wf_created);
149: END IF;
150:
151: if l_wf_created = 0 then
153: ItemType => p_itemtype,
154: ItemKey => l_itemkey,
155: process => p_workflow_process );
156: IF (g_asn_debug = 'Y') THEN
157: debug_log(FND_LOG.LEVEL_STATEMENT,
158: l_api_name,'Workflow process created ' );
159: END IF;
160: end if;
161:
161:
162:
163: /* Initialize workflow item attributes */
164: IF (g_asn_debug = 'Y') THEN
165: debug_log(FND_LOG.LEVEL_STATEMENT,
166: l_api_name,'Initialize workflow attributes ' );
167: END IF;
168:
169: wf_engine.SetItemAttrNumber ( itemtype => p_itemtype,
172: avalue => p_work_confirmation_id);
173:
174:
175: IF (g_asn_debug = 'Y') THEN
176: debug_log(FND_LOG.LEVEL_STATEMENT,
177: l_api_name,'p_work_confirmation_id '||p_work_confirmation_id );
178: END IF;
179:
180: select shipment_num
183: where shipment_header_id = p_work_confirmation_id
184: and nvl(asn_type,'STD') = 'WC';
185:
186: IF (g_asn_debug = 'Y') THEN
187: debug_log(FND_LOG.LEVEL_STATEMENT,
188: l_api_name,'l_work_confirmation_number '
189: ||l_work_confirmation_number );
190:
191: END IF;
202: from rcv_shipment_lines
203: where shipment_header_id = p_work_confirmation_id;
204:
205: IF (g_asn_debug = 'Y') THEN
206: debug_log(FND_LOG.LEVEL_STATEMENT,
207: l_api_name,'l_po_header_id ' || l_po_header_id); END IF;
208:
209: wf_engine.SetItemAttrNumber ( itemtype => p_itemtype,
210: itemkey => l_itemkey,
251: fnd_global.APPS_INITIALIZE (l_user_id, l_responsibility_id, l_application_id);
252: end if;
253:
254: IF (g_asn_debug = 'Y') THEN
255: debug_log(FND_LOG.LEVEL_STATEMENT,
256: l_api_name,'Start process ' );
257: debug_log(FND_LOG.LEVEL_STATEMENT,
258: l_api_name,'itemtype '||p_itemtype );
259: debug_log(FND_LOG.LEVEL_STATEMENT,
253:
254: IF (g_asn_debug = 'Y') THEN
255: debug_log(FND_LOG.LEVEL_STATEMENT,
256: l_api_name,'Start process ' );
257: debug_log(FND_LOG.LEVEL_STATEMENT,
258: l_api_name,'itemtype '||p_itemtype );
259: debug_log(FND_LOG.LEVEL_STATEMENT,
260: l_api_name,'l_itemkey '||l_itemkey );
261: END IF;
255: debug_log(FND_LOG.LEVEL_STATEMENT,
256: l_api_name,'Start process ' );
257: debug_log(FND_LOG.LEVEL_STATEMENT,
258: l_api_name,'itemtype '||p_itemtype );
259: debug_log(FND_LOG.LEVEL_STATEMENT,
260: l_api_name,'l_itemkey '||l_itemkey );
261: END IF;
262: wf_engine.StartProcess(itemtype => p_itemtype,
263: itemkey => l_itemkey );
264:
265: end if; --} itemtype, itemkey and work_confirmation_id not null
266:
267: IF (g_asn_debug = 'Y') THEN
268: debug_log(FND_LOG.LEVEL_STATEMENT,
269: l_api_name,'Leave start_wf_process ' );
270: End if;
271: Exception
272: when others then
270: End if;
271: Exception
272: when others then
273: IF (g_asn_debug = 'Y') THEN
274: debug_log(FND_LOG.LEVEL_UNEXPECTED,
275: l_api_name,'Exception in Start_wf_process ' || l_progress);
276: END IF;
277: x_return_status := FND_API.G_RET_STS_ERROR;
278: raise;
310:
311: l_progress := 'POS_WCAPPROVE_PVT.close_old_notifications: 01';
312:
313: IF (g_asn_debug = 'Y') THEN
314: debug_log(FND_LOG.LEVEL_STATEMENT,
315: l_api_name,'Enter close_old_notif ' || l_progress);
316: debug_log(FND_LOG.LEVEL_STATEMENT,
317: l_api_name,'p_itemtype ' || p_itemtype);
318: debug_log(FND_LOG.LEVEL_STATEMENT,
312:
313: IF (g_asn_debug = 'Y') THEN
314: debug_log(FND_LOG.LEVEL_STATEMENT,
315: l_api_name,'Enter close_old_notif ' || l_progress);
316: debug_log(FND_LOG.LEVEL_STATEMENT,
317: l_api_name,'p_itemtype ' || p_itemtype);
318: debug_log(FND_LOG.LEVEL_STATEMENT,
319: l_api_name,'p_itemkey ' || p_itemkey);
320: END IF;
314: debug_log(FND_LOG.LEVEL_STATEMENT,
315: l_api_name,'Enter close_old_notif ' || l_progress);
316: debug_log(FND_LOG.LEVEL_STATEMENT,
317: l_api_name,'p_itemtype ' || p_itemtype);
318: debug_log(FND_LOG.LEVEL_STATEMENT,
319: l_api_name,'p_itemkey ' || p_itemkey);
320: END IF;
321:
322: if (p_funcmode <> wf_engine.eng_run) then
330: itemkey => p_itemkey,
331: aname => 'WORK_CONFIRMATION_ID');
332:
333: IF (g_asn_debug = 'Y') THEN
334: debug_log(FND_LOG.LEVEL_STATEMENT,
335: l_api_name,'l_work_confirmation_id ' ||
336: l_work_confirmation_id);
337: END IF;
338: /* If the document has been previously submitted to workflow,
346: fetch ship_header_cursor into l_wf_itemkey;
347: close ship_header_cursor;
348:
349: IF (g_asn_debug = 'Y') THEN
350: debug_log(FND_LOG.LEVEL_STATEMENT,
351: l_api_name,'l_wf_itemkey ' || l_wf_itemkey);
352: END IF;
353:
354: if (l_wf_itemkey is not null) then
361:
362: l_progress := 'POS_WCAPPROVE_PVT.close_old_notif: 02.';
363:
364: IF (g_asn_debug = 'Y') THEN
365: debug_log(FND_LOG.LEVEL_STATEMENT,
366: l_api_name,'Leave close_old_notif ' || l_progress);
367: END IF;
368:
369: exception
368:
369: exception
370: when others then
371: IF (g_asn_debug = 'Y') THEN
372: debug_log(FND_LOG.LEVEL_UNEXPECTED,
373: l_api_name,'Exception in close_old_notif ' || l_progress);
374: END IF;
375: raise;
376: end Close_old_notif;
398:
399: begin
400: l_progress := 'POS_WCAPPROVE_PVT.set_startup_values: 01.';
401: IF (g_asn_debug = 'Y') THEN
402: debug_log(FND_LOG.LEVEL_STATEMENT,
403: l_api_name,'Enter in set_startup_values ' || l_progress);
404: END IF;
405:
406: if (p_funcmode <> wf_engine.eng_run) then
414: aname => 'WORK_CONFIRMATION_ID');
415:
416:
417: IF (g_asn_debug = 'Y') THEN
418: debug_log(FND_LOG.LEVEL_STATEMENT,
419: l_api_name,'l_work_confirmation_id ' ||
420: l_work_confirmation_id);
421: END IF;
422:
432: from fnd_user
433: where user_id = l_wc_preparer_id;
434:
435: IF (g_asn_debug = 'Y') THEN
436: debug_log(FND_LOG.LEVEL_STATEMENT,
437: l_api_name,'l_wc_preparer_id ' ||
438: l_wc_preparer_id);
439: END IF;
440:
453: end if;
454:
455:
456: IF (g_asn_debug = 'Y') THEN
457: debug_log(FND_LOG.LEVEL_STATEMENT,
458: l_api_name,'l_wc_preparer_name ' || l_wc_preparer_name);
459: debug_log(FND_LOG.LEVEL_STATEMENT,
460: l_api_name,'l_wc_preparer_display_name ' ||
461: l_wc_preparer_display_name);
455:
456: IF (g_asn_debug = 'Y') THEN
457: debug_log(FND_LOG.LEVEL_STATEMENT,
458: l_api_name,'l_wc_preparer_name ' || l_wc_preparer_name);
459: debug_log(FND_LOG.LEVEL_STATEMENT,
460: l_api_name,'l_wc_preparer_display_name ' ||
461: l_wc_preparer_display_name);
462: END IF;
463: wf_engine.SetItemAttrText ( itemtype => p_itemType,
476: itemkey => p_itemkey,
477: aname => 'PO_DOCUMENT_ID');
478:
479: IF (g_asn_debug = 'Y') THEN
480: debug_log(FND_LOG.LEVEL_STATEMENT,
481: l_api_name,'l_po_header_id ' || l_po_header_id);
482: END IF;
483:
484: /* We need doc_status only if the document is rejected.
499: from po_headers_all poh
500: where po_header_id = l_po_header_id;
501:
502: IF (g_asn_debug = 'Y') THEN
503: debug_log(FND_LOG.LEVEL_STATEMENT,
504: l_api_name,'l_po_number ' || l_po_number);
505: debug_log(FND_LOG.LEVEL_STATEMENT,
506: l_api_name,'l_preparer_id ' || l_po_preparer_id);
507: END IF;
501:
502: IF (g_asn_debug = 'Y') THEN
503: debug_log(FND_LOG.LEVEL_STATEMENT,
504: l_api_name,'l_po_number ' || l_po_number);
505: debug_log(FND_LOG.LEVEL_STATEMENT,
506: l_api_name,'l_preparer_id ' || l_po_preparer_id);
507: END IF;
508:
509: wf_engine.SetItemAttrNumber ( itemtype => p_itemtype,
515: get_user_name('PER',l_po_preparer_id, l_po_preparer_name,
516: l_po_preparer_display_name);
517:
518: IF (g_asn_debug = 'Y') THEN
519: debug_log(FND_LOG.LEVEL_STATEMENT,
520: l_api_name,'l_po_preparer_name ' || l_po_preparer_name);
521: debug_log(FND_LOG.LEVEL_STATEMENT,
522: l_api_name,'l_po_preparer_display_name ' ||
523: l_po_preparer_display_name);
517:
518: IF (g_asn_debug = 'Y') THEN
519: debug_log(FND_LOG.LEVEL_STATEMENT,
520: l_api_name,'l_po_preparer_name ' || l_po_preparer_name);
521: debug_log(FND_LOG.LEVEL_STATEMENT,
522: l_api_name,'l_po_preparer_display_name ' ||
523: l_po_preparer_display_name);
524: END IF;
525: wf_engine.SetItemAttrText ( itemtype => p_itemType,
592: x_resultout := wf_engine.eng_completed || ':' || 'ACTIVITY_PERFORMED';
593:
594: l_progress := 'POS_WCAPPROVE_PVT.set_startup_values: 06.';
595: IF (g_asn_debug = 'Y') THEN
596: debug_log(FND_LOG.LEVEL_STATEMENT,
597: l_api_name,'Leave set_startup_values '
598: || l_progress);
599: END IF;
600: exception
599: END IF;
600: exception
601: when others then
602: IF (g_asn_debug = 'Y') THEN
603: debug_log(FND_LOG.LEVEL_UNEXPECTED,
604: l_api_name,'Exception in set_startup_values '
605: || l_progress);
606: END IF;
607: raise;
619: begin
620:
621: l_progress := 'POS_WCAPPROVE_PVT.update_workflow_info: 01.';
622: IF (g_asn_debug = 'Y') THEN
623: debug_log(FND_LOG.LEVEL_STATEMENT,
624: l_api_name,'Enter in update_workflow_info ' || l_progress);
625: END IF;
626:
627: if (p_funcmode <> wf_engine.eng_run) then
636: aname => 'WORK_CONFIRMATION_ID');
637:
638: l_progress := 'POS_WCAPPROVE_PVT.update_workflow_info: 02.';
639: IF (g_asn_debug = 'Y') THEN
640: debug_log(FND_LOG.LEVEL_STATEMENT,
641: l_api_name,'l_shipment_header_id ' || l_shipment_header_id);
642: END IF;
643:
644: UpdateWorkflowInfo(p_itemtype,p_itemkey,l_shipment_header_id);
646: x_resultout := wf_engine.eng_completed || ':' || 'ACTIVITY_PERFORMED';
647:
648: l_progress := 'POS_WCAPPROVE_PVT.update_workflow_info: 02.';
649: IF (g_asn_debug = 'Y') THEN
650: debug_log(FND_LOG.LEVEL_STATEMENT,
651: l_api_name,'Leave update_workflow_info ' || l_progress);
652: END IF;
653:
654: exception
653:
654: exception
655: when others then
656: IF (g_asn_debug = 'Y') THEN
657: debug_log(FND_LOG.LEVEL_UNEXPECTED,
658: l_api_name,'Exception in update_workflow_info '
659: || l_progress);
660: END IF;
661: raise;
684: l_api_name varchar2(50) := p_itemkey || ' get_wc_attributes';
685: begin
686: l_progress := 'POS_WCAPPROVE_PVT.get_wc_attributes: 01.';
687: IF (g_asn_debug = 'Y') THEN
688: debug_log(FND_LOG.LEVEL_STATEMENT,
689: l_api_name,'Enter in get_wc_attributes '
690: || l_progress);
691: end if;
692:
701: itemkey => p_itemkey,
702: aname => 'WORK_CONFIRMATION_ID');
703:
704: IF (g_asn_debug = 'Y') THEN
705: debug_log(FND_LOG.LEVEL_STATEMENT,
706: l_api_name,'l_shipment_header_id '|| l_shipment_header_id);
707: end if;
708:
709: /* See if atleast one shipment have attachments*/
718: from rcv_shipment_lines
719: where shipment_header_id=l_shipment_header_id);
720:
721: IF (g_asn_debug = 'Y') THEN
722: debug_log(FND_LOG.LEVEL_STATEMENT,
723: l_api_name,'l_attach_count '||
724: l_attach_count);
725: end if;
726:
733: fetch get_attachments into l_shipment_line_id;
734: exit when get_attachments%notfound;
735:
736: IF (g_asn_debug = 'Y') THEN
737: debug_log(FND_LOG.LEVEL_STATEMENT,
738: l_api_name,'l_shipment_line_id '||
739: l_shipment_line_id);
740: end if;
741:
749: x_resultout := wf_engine.eng_completed || ':' || 'ACTIVITY_PERFORMED';
750: exception
751: when others then
752: IF (g_asn_debug = 'Y') THEN
753: debug_log(FND_LOG.LEVEL_UNEXPECTED,
754: l_api_name,'Exception in Get_WC_Attributes '
755: || l_progress);
756: END IF;
757: raise;
799: BEGIN
800:
801: l_progress := 'POS_WCAPPROVE_PVT.Ins_Actionhist_submit: 01.';
802: IF (g_asn_debug = 'Y') THEN
803: debug_log(FND_LOG.LEVEL_STATEMENT,
804: l_api_name,'Enter in Ins_Actionhist_submit '
805: || l_progress);
806: END IF;
807:
815: itemkey => p_itemkey,
816: aname => 'WORK_CONFIRMATION_ID');
817:
818: IF (g_asn_debug = 'Y') THEN
819: debug_log(FND_LOG.LEVEL_STATEMENT,
820: l_api_name,'l_shipment_header_id ' || l_shipment_header_id);
821: END IF;
822:
823: l_progress := 'POS_WCAPPROVE_PVT.Ins_Actionhist_submit: 02.';
826: itemkey => p_itemkey,
827: aname => 'WC_PREPARER_ID');
828:
829: IF (g_asn_debug = 'Y') THEN
830: debug_log(FND_LOG.LEVEL_STATEMENT,
831: l_api_name,'l_wc_preparer_id ' || l_wc_preparer_id);
832: END IF;
833:
834:
859: l_sequence_num := l_sequence_num +1;
860: END IF;
861:
862: IF (g_asn_debug = 'Y') THEN
863: debug_log(FND_LOG.LEVEL_STATEMENT,
864: l_api_name,'l_sequence_num ' ||
865: l_sequence_num);
866: END IF;
867:
872: (l_sequence_num > 0 and l_action_code is NOT NULL)) THEN --{
873:
874:
875: IF (g_asn_debug = 'Y') THEN
876: debug_log(FND_LOG.LEVEL_STATEMENT,
877: l_api_name,'before call to InsertPOActionHistory ' ||
878: l_sequence_num);
879: END IF;
880:
903: ELSE --}{
904: l_sequence_num := l_sequence_num - 1;
905:
906: IF (g_asn_debug = 'Y') THEN
907: debug_log(FND_LOG.LEVEL_STATEMENT,
908: l_api_name,'before call to Upd_ActionHistory_Submit ' ||
909: l_sequence_num);
910: END IF;
911:
922: END IF; --}
923:
924: /* Insert the null action code*/
925: IF (g_asn_debug = 'Y') THEN
926: debug_log(FND_LOG.LEVEL_STATEMENT,
927: l_api_name,'insert null action_code ' ||
928: l_sequence_num);
929: END IF;
930:
955: x_resultout := wf_engine.eng_completed || ':' || 'ACTIVITY_PERFORMED';
956:
957: l_progress := 'POS_WCAPPROVE_PVT.Ins_Actionhist_submit: 07.';
958: IF (g_asn_debug = 'Y') THEN
959: debug_log(FND_LOG.LEVEL_STATEMENT,
960: l_api_name,'Leave Ins_Actionhist_submit ' || l_progress);
961: END IF;
962: exception
963: when others then
961: END IF;
962: exception
963: when others then
964: IF (g_asn_debug = 'Y') THEN
965: debug_log(FND_LOG.LEVEL_UNEXPECTED,
966: l_api_name,'Exception in Ins_Actionhist_submit '
967: || l_progress);
968: END IF;
969: raise;
1000: BEGIN
1001:
1002: l_progress := 'POS_WCAPPROVE_PVT.get_next_approver: 01.';
1003: IF (g_asn_debug = 'Y') THEN
1004: debug_log(FND_LOG.LEVEL_STATEMENT,
1005: l_api_name,'Enter in get_next_approver '
1006: || l_progress);
1007: END IF;
1008:
1007: END IF;
1008:
1009: if (p_funcmode <> wf_engine.eng_run) then
1010: IF (g_asn_debug = 'Y') THEN
1011: debug_log(FND_LOG.LEVEL_STATEMENT,
1012: l_api_name,'funcmode in get_next_approver '
1013: || l_progress);
1014: END IF;
1015:
1022: itemkey => p_itemkey,
1023: aname => 'WORK_CONFIRMATION_ID');
1024:
1025: IF (g_asn_debug = 'Y') THEN
1026: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
1027: 'l_shipment_header_id ' || l_shipment_header_id);
1028: END IF;
1029:
1030: l_po_header_id := wf_engine.GetItemAttrNumber
1032: itemkey => p_itemkey,
1033: aname => 'PO_DOCUMENT_ID');
1034:
1035: IF (g_asn_debug = 'Y') THEN
1036: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
1037: 'l_po_header_id ' || l_po_header_id);
1038: END IF;
1039:
1040: l_work_confirmation_number :=
1042: itemkey => p_itemkey,
1043: aname => 'WORK_CONFIRMATION_NUMBER');
1044:
1045: IF (g_asn_debug = 'Y') THEN
1046: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
1047: 'l_work_confirmation_number ' || l_work_confirmation_number);
1048: END IF;
1049:
1050: l_transaction_type := wf_engine.GetItemAttrText (itemtype => p_itemtype,
1051: itemkey => p_itemkey,
1052: aname => 'AME_TRANSACTION_TYPE');
1053:
1054: IF (g_asn_debug = 'Y') THEN
1055: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
1056: 'l_transaction_type ' || l_transaction_type);
1057: END IF;
1058: l_progress := 'POS_WCAPPROVE_PVT.get_next_approver: 02.';
1059: IF (g_asn_debug = 'Y') THEN
1056: 'l_transaction_type ' || l_transaction_type);
1057: END IF;
1058: l_progress := 'POS_WCAPPROVE_PVT.get_next_approver: 02.';
1059: IF (g_asn_debug = 'Y') THEN
1060: debug_log(FND_LOG.LEVEL_STATEMENT,
1061: l_api_name,'in get_next_approver '
1062: || l_progress);
1063: End if;
1064:
1073: itemkey => p_itemkey,
1074: aname => 'APPROVER_USER_NAME');
1075:
1076: IF (g_asn_debug = 'Y') THEN
1077: debug_log(FND_LOG.LEVEL_STATEMENT,
1078: l_api_name,'l_forward_from_user_name '
1079: || nvl(l_forward_from_user_name,'NONAME'));
1080: End if;
1081: If (l_forward_from_user_name is null) then
1084: itemkey => p_itemkey,
1085: aname => 'WC_PREPARER_NAME');
1086:
1087: IF (g_asn_debug = 'Y') THEN
1088: debug_log(FND_LOG.LEVEL_STATEMENT,
1089: l_api_name,'l_wc_preparer_name '
1090: || nvl(l_wc_preparer_name ,'NONAME'));
1091: End if;
1092:
1118: aname => 'RESPOND_TO_WC_URL' ,
1119: avalue => l_respond_to_wc_url);
1120:
1121: IF (g_asn_debug = 'Y') THEN
1122: debug_log(FND_LOG.LEVEL_STATEMENT,
1123: l_api_name,'before call to applicablerule ');
1124: End if;
1125: ame_api3.getApplicableRules1(applicationIdIn=>l_application_Id,
1126: transactionIdIn=>l_shipment_header_id,
1135: * value.
1136: */
1137: if (l_rule_id.count = 0 ) then --{
1138: IF (g_asn_debug = 'Y') THEN
1139: debug_log(FND_LOG.LEVEL_STATEMENT,
1140: l_api_name,'no rule is setup ');
1141: End if;
1142: l_default_approver :=
1143: wf_engine.GetItemAttrText (itemtype => p_itemtype,
1144: itemkey => p_itemkey,
1145: aname => 'DEFAULT_APPROVER');
1146:
1147: IF (g_asn_debug = 'Y') THEN
1148: debug_log(FND_LOG.LEVEL_STATEMENT,
1149: l_api_name,'l_default_approver '
1150: || l_default_approver);
1151: END IF;
1152:
1152:
1153: If l_default_approver = 'BUYER' then --{
1154:
1155: IF (g_asn_debug = 'Y') THEN
1156: debug_log(FND_LOG.LEVEL_STATEMENT,
1157: l_api_name,'already approved by buyer ');
1158: End if;
1159:
1160: x_resultout:='COMPLETE:'||'NO_NEXT_APPROVER';
1160: x_resultout:='COMPLETE:'||'NO_NEXT_APPROVER';
1161: return;
1162: elsif(l_default_approver= 'NONE') then --}{
1163: IF (g_asn_debug = 'Y') THEN
1164: debug_log(FND_LOG.LEVEL_STATEMENT,
1165: l_api_name,'Send buyer as default approver ');
1166: End if;
1167:
1168: wf_engine.SetItemAttrText ( itemtype => p_itemType,
1175: itemkey => p_itemkey,
1176: aname => 'PO_PREPARER_ID');
1177:
1178: IF (g_asn_debug = 'Y') THEN
1179: debug_log(FND_LOG.LEVEL_STATEMENT,
1180: l_api_name,'l_po_preparer_id '
1181: || l_po_preparer_id);
1182: end if;
1183:
1189:
1190: else --}{
1191:
1192: IF (g_asn_debug = 'Y') THEN
1193: debug_log(FND_LOG.LEVEL_STATEMENT,
1194: l_api_name,'call ame api ');
1195: End if;
1196:
1197: ame_api2.getNextApprovers4(applicationIdIn=>l_application_Id,
1208: elsif (l_next_approver.count = 0 ) then --}{
1209: x_resultout:='COMPLETE:'||'NO_NEXT_APPROVER';
1210: return;
1211: IF (g_asn_debug = 'Y') THEN
1212: debug_log(FND_LOG.LEVEL_STATEMENT,
1213: l_api_name,'no_next_approver ');
1214: End if;
1215: return;
1216: ELSE --}{
1257: end if; --}
1258:
1259:
1260: IF (g_asn_debug = 'Y') THEN
1261: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
1262: 'person_id ' || l_next_approver_id);
1263: END IF;
1264:
1265: IF (g_asn_debug = 'Y') THEN
1262: 'person_id ' || l_next_approver_id);
1263: END IF;
1264:
1265: IF (g_asn_debug = 'Y') THEN
1266: debug_log(FND_LOG.LEVEL_STATEMENT,
1267: l_api_name,'l_next_approver_id '
1268: || l_next_approver_id);
1269: debug_log(FND_LOG.LEVEL_STATEMENT,
1270: l_api_name,'l_insertion_type '
1265: IF (g_asn_debug = 'Y') THEN
1266: debug_log(FND_LOG.LEVEL_STATEMENT,
1267: l_api_name,'l_next_approver_id '
1268: || l_next_approver_id);
1269: debug_log(FND_LOG.LEVEL_STATEMENT,
1270: l_api_name,'l_insertion_type '
1271: || l_insertion_type);
1272: debug_log(FND_LOG.LEVEL_STATEMENT,
1273: l_api_name,'l_authority_type '
1268: || l_next_approver_id);
1269: debug_log(FND_LOG.LEVEL_STATEMENT,
1270: l_api_name,'l_insertion_type '
1271: || l_insertion_type);
1272: debug_log(FND_LOG.LEVEL_STATEMENT,
1273: l_api_name,'l_authority_type '
1274: || l_authority_type);
1275: END IF;
1276:
1307: l_next_approver_user_name,
1308: l_next_approver_disp_name);
1309:
1310: IF (g_asn_debug = 'Y') THEN
1311: debug_log(FND_LOG.LEVEL_STATEMENT,
1312: l_api_name,'l_next_approver_user_name '
1313: || l_next_approver_user_name);
1314: debug_log(FND_LOG.LEVEL_STATEMENT,
1315: l_api_name,'l_next_approver_disp_name '
1310: IF (g_asn_debug = 'Y') THEN
1311: debug_log(FND_LOG.LEVEL_STATEMENT,
1312: l_api_name,'l_next_approver_user_name '
1313: || l_next_approver_user_name);
1314: debug_log(FND_LOG.LEVEL_STATEMENT,
1315: l_api_name,'l_next_approver_disp_name '
1316: || l_next_approver_disp_name);
1317: end if;
1318: wf_engine.SetItemAttrText( itemtype => p_itemType,
1343:
1344: Exception
1345: when approver_exception then
1346: IF (g_asn_debug = 'Y') THEN
1347: debug_log(FND_LOG.LEVEL_UNEXPECTED,
1348: l_api_name,
1349: 'Exception in ame_util.getNextApprove '
1350: || l_progress);
1351: END IF;
1351: END IF;
1352: raise;
1353: when others then
1354: IF (g_asn_debug = 'Y') THEN
1355: debug_log(FND_LOG.LEVEL_UNEXPECTED,
1356: l_api_name,'Exception in get_next_approve '
1357: || l_progress);
1358: END IF;
1359: raise;
1415:
1416:
1417: l_progress := 'POS_WCAPPROVE_PVT.Insert_Action_History: 01.';
1418: IF (g_asn_debug = 'Y') THEN
1419: debug_log(FND_LOG.LEVEL_STATEMENT,
1420: l_api_name,'Enter in Insert_Action_History '
1421: || l_progress);
1422: END IF;
1423:
1426: l_approver_id := wf_engine.GetItemAttrNumber(itemtype=>p_itemtype,
1427: itemkey=>p_itemkey,
1428: aname=>'APPROVER_EMPID');
1429: IF (g_asn_debug = 'Y') THEN
1430: debug_log(FND_LOG.LEVEL_STATEMENT,
1431: l_api_name,'l_approver_id '
1432: || l_approver_id);
1433: END IF;
1434:
1435: l_shipment_header_id:= wf_engine.GetItemAttrNumber(itemtype=>p_itemtype,
1436: itemkey=>p_itemkey,
1437: aname=>'WORK_CONFIRMATION_ID');
1438: IF (g_asn_debug = 'Y') THEN
1439: debug_log(FND_LOG.LEVEL_STATEMENT,
1440: l_api_name,'l_shipment_header_id '
1441: || l_shipment_header_id);
1442: END IF;
1443:
1453: AND object_id = l_shipment_header_id
1454: AND action_code IS NULL;
1455:
1456: IF (g_asn_debug = 'Y') THEN
1457: debug_log(FND_LOG.LEVEL_STATEMENT,
1458: l_api_name,'l_count '
1459: || l_count);
1460: END IF;
1461:
1472: WHERE object_type_code = 'WC'
1473: AND object_id = l_shipment_header_id;
1474:
1475: IF (g_asn_debug = 'Y') THEN
1476: debug_log(FND_LOG.LEVEL_STATEMENT,
1477: l_api_name,'l_sequence_num '
1478: || l_sequence_num);
1479: END IF;
1480:
1483: FETCH get_action_history INTO Recinfo;
1484:
1485: IF (get_action_history%NOTFOUND) then
1486: IF (g_asn_debug = 'Y') THEN
1487: debug_log(FND_LOG.LEVEL_STATEMENT,
1488: l_api_name,
1489: 'no_data_round ' );
1490: END IF;
1491:
1505: If l_count = 1 then
1506:
1507:
1508: IF (g_asn_debug = 'Y') THEN
1509: debug_log(FND_LOG.LEVEL_STATEMENT,
1510: l_api_name,
1511: 'update Action history ' );
1512: END IF;
1513:
1528: raise invalid_data;
1529:
1530: Else --}{
1531: IF (g_asn_debug = 'Y') THEN
1532: debug_log(FND_LOG.LEVEL_STATEMENT,
1533: l_api_name,
1534: 'Insert Action history ' );
1535: END IF;
1536:
1563:
1564:
1565: --end loop;--}
1566: IF (g_asn_debug = 'Y') THEN
1567: debug_log(FND_LOG.LEVEL_STATEMENT,
1568: l_api_name,
1569: 'Exit Insert Action history ' );
1570: END IF;
1571:
1571:
1572: exception
1573: when invalid_action then
1574: IF (g_asn_debug = 'Y') THEN
1575: debug_log(FND_LOG.LEVEL_EXCEPTION,
1576: l_api_name,'invalid_action in Insert_Action_History '
1577: || l_progress);
1578: END IF;
1579: raise;
1578: END IF;
1579: raise;
1580: when invalid_data then
1581: IF (g_asn_debug = 'Y') THEN
1582: debug_log(FND_LOG.LEVEL_EXCEPTION,
1583: l_api_name,'invalid_data in Insert_Action_History '
1584: || l_progress);
1585: END IF;
1586: raise;
1585: END IF;
1586: raise;
1587: when others then
1588: IF (g_asn_debug = 'Y') THEN
1589: debug_log(FND_LOG.LEVEL_UNEXPECTED,
1590: l_api_name,'Exception in Insert_Action_History '
1591: || l_progress);
1592: END IF;
1593: raise;
1624: BEGIN
1625:
1626: l_progress := 'POS_WCAPPROVE_PVT.Approve_shipment_lines: 01.';
1627: IF (g_asn_debug = 'Y') THEN
1628: debug_log(FND_LOG.LEVEL_STATEMENT,
1629: l_api_name,'Enter in Approve_shipment_lines '
1630: || l_progress);
1631: END IF;
1632:
1645: FETCH c_group_id INTO l_notification_id;
1646: CLOSE c_group_id;
1647:
1648: IF (g_asn_debug = 'Y') THEN
1649: debug_log(FND_LOG.LEVEL_STATEMENT,
1650: l_api_name,
1651: ' l_notification_id ' || l_notification_id);
1652: END IF;
1653:
1660: AND attribute_name = 'NOTE';
1661: end if;
1662:
1663: IF (g_asn_debug = 'Y') THEN
1664: debug_log(FND_LOG.LEVEL_STATEMENT,
1665: l_api_name,
1666: ' l_note ' || l_note);
1667: END IF;
1668:
1674:
1675:
1676:
1677: IF (g_asn_debug = 'Y') THEN
1678: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_shipment_header_id ' || l_shipment_header_id);
1679: END IF;
1680: x_resultout:='COMPLETE' || ':' || 'ACTIVITY_PERFORMED';
1681: exception
1682: when others then
1680: x_resultout:='COMPLETE' || ':' || 'ACTIVITY_PERFORMED';
1681: exception
1682: when others then
1683: IF (g_asn_debug = 'Y') THEN
1684: debug_log(FND_LOG.LEVEL_UNEXPECTED,
1685: l_api_name,'Exception in Approve_shipment_lines '
1686: || l_progress);
1687: END IF;
1688: raise;
1720: BEGIN
1721:
1722: l_progress := 'POS_WCAPPROVE_PVT Reject_shipment_lines: 01.';
1723: IF (g_asn_debug = 'Y') THEN
1724: debug_log(FND_LOG.LEVEL_STATEMENT,
1725: l_api_name,'Enter in Reject_shipment_lines '
1726: || l_progress);
1727: END IF;
1728:
1741: FETCH c_group_id INTO l_notification_id;
1742: CLOSE c_group_id;
1743:
1744: IF (g_asn_debug = 'Y') THEN
1745: debug_log(FND_LOG.LEVEL_STATEMENT,
1746: l_api_name,
1747: ' l_notification_id ' || l_notification_id);
1748: END IF;
1749:
1756: AND attribute_name = 'NOTE';
1757: end if;
1758:
1759: IF (g_asn_debug = 'Y') THEN
1760: debug_log(FND_LOG.LEVEL_STATEMENT,
1761: l_api_name,
1762: ' l_note ' || l_note);
1763: END IF;
1764:
1772:
1773:
1774:
1775: IF (g_asn_debug = 'Y') THEN
1776: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_shipment_header_id ' || l_shipment_header_id);
1777: END IF;
1778: x_resultout:='COMPLETE' || ':' || 'ACTIVITY_PERFORMED';
1779: exception
1780: when others then
1778: x_resultout:='COMPLETE' || ':' || 'ACTIVITY_PERFORMED';
1779: exception
1780: when others then
1781: IF (g_asn_debug = 'Y') THEN
1782: debug_log(FND_LOG.LEVEL_UNEXPECTED,
1783: l_api_name,'Exception in Reject_shipment_lines '
1784: || l_progress);
1785: END IF;
1786: raise;
1804: BEGIN
1805:
1806: l_progress := 'POS_WCAPPROVE_PVT.Approve_OR_Reject: 01.';
1807: IF (g_asn_debug = 'Y') THEN
1808: debug_log(FND_LOG.LEVEL_STATEMENT,
1809: l_api_name,'Enter in Approve_OR_Reject '
1810: || l_progress);
1811: END IF;
1812:
1820: itemkey => p_itemkey,
1821: aname => 'WORK_CONFIRMATION_ID');
1822:
1823: IF (g_asn_debug = 'Y') THEN
1824: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_shipment_header_id ' || l_shipment_header_id);
1825: END IF;
1826:
1827:
1828: select count(*)
1831: where shipment_header_id = l_shipment_header_id
1832: and approval_status = 'REJECTED';
1833:
1834: IF (g_asn_debug = 'Y') THEN
1835: debug_log(FND_LOG.LEVEL_STATEMENT,
1836: l_api_name,'l_reject_lines ' || l_reject_lines);
1837: END IF;
1838:
1839: If (l_reject_lines > 0) then
1848:
1849: exception
1850: when others then
1851: IF (g_asn_debug = 'Y') THEN
1852: debug_log(FND_LOG.LEVEL_UNEXPECTED,
1853: l_api_name,'Exception in Approve_OR_Reject '
1854: || l_progress);
1855: END IF;
1856: raise;
1931:
1932: begin
1933: l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_List_Response: 01.';
1934: IF (g_asn_debug = 'Y') THEN
1935: debug_log(FND_LOG.LEVEL_STATEMENT,
1936: l_api_name,
1937: 'Enter in Update_Approval_List_Response '
1938: || l_progress);
1939: END IF;
1964: FETCH c_group_id INTO l_group_id;
1965: CLOSE c_group_id;
1966:
1967: IF (g_asn_debug = 'Y') THEN
1968: debug_log(FND_LOG.LEVEL_STATEMENT,
1969: l_api_name,
1970: ' l_group_id ' || l_group_id);
1971: END IF;
1972:
1976: FETCH c_response INTO l_role, l_response;
1977: CLOSE c_response;
1978:
1979: IF (g_asn_debug = 'Y') THEN
1980: debug_log(FND_LOG.LEVEL_STATEMENT,
1981: l_api_name,
1982: ' l_role ' || l_role);
1983: debug_log(FND_LOG.LEVEL_STATEMENT,
1984: l_api_name,
1979: IF (g_asn_debug = 'Y') THEN
1980: debug_log(FND_LOG.LEVEL_STATEMENT,
1981: l_api_name,
1982: ' l_role ' || l_role);
1983: debug_log(FND_LOG.LEVEL_STATEMENT,
1984: l_api_name,
1985: ' l_response '
1986: || substr(l_response,1,50));
1987: END IF;
1995: FROM wf_notifications wfn
1996: WHERE wfn.notification_id = l_group_id;
1997:
1998: IF (g_asn_debug = 'Y') THEN
1999: debug_log(FND_LOG.LEVEL_STATEMENT,
2000: l_api_name,
2001: ' l_responder ' || l_responder);
2002: debug_log(FND_LOG.LEVEL_STATEMENT,
2003: l_api_name,
1998: IF (g_asn_debug = 'Y') THEN
1999: debug_log(FND_LOG.LEVEL_STATEMENT,
2000: l_api_name,
2001: ' l_responder ' || l_responder);
2002: debug_log(FND_LOG.LEVEL_STATEMENT,
2003: l_api_name,
2004: ' l_recipient_role '
2005: || l_recipient_role);
2006: debug_log(FND_LOG.LEVEL_STATEMENT,
2002: debug_log(FND_LOG.LEVEL_STATEMENT,
2003: l_api_name,
2004: ' l_recipient_role '
2005: || l_recipient_role);
2006: debug_log(FND_LOG.LEVEL_STATEMENT,
2007: l_api_name,
2008: ' l_response_end_date '
2009: || to_char(l_response_end_date,'DD-MON-YYYY'));
2010: end if;
2012: OPEN c_responderid(l_responder);
2013: FETCH c_responderid INTO l_responder_id;
2014:
2015: IF (g_asn_debug = 'Y') THEN
2016: debug_log(FND_LOG.LEVEL_STATEMENT,
2017: l_api_name,
2018: ' l_responder_id ' || l_responder_id);
2019: end if;
2020:
2025: FETCH c_responderid INTO l_responder_id;
2026: CLOSE c_responderid;
2027:
2028: IF (g_asn_debug = 'Y') THEN
2029: debug_log(FND_LOG.LEVEL_STATEMENT,
2030: l_api_name,
2031: ' l_responder_id1 ' || l_responder_id);
2032: end if;
2033: End if;--}
2051: l_responder_user_name,
2052: l_responder_disp_name);
2053:
2054: IF (g_asn_debug = 'Y') THEN
2055: debug_log(FND_LOG.LEVEL_STATEMENT,
2056: l_api_name,
2057: ' l_responder_user_name '
2058: || l_responder_user_name);
2059: debug_log(FND_LOG.LEVEL_STATEMENT,
2055: debug_log(FND_LOG.LEVEL_STATEMENT,
2056: l_api_name,
2057: ' l_responder_user_name '
2058: || l_responder_user_name);
2059: debug_log(FND_LOG.LEVEL_STATEMENT,
2060: l_api_name,
2061: ' l_responder_disp_name '
2062: || l_responder_disp_name);
2063: end if;
2084: itemkey => p_itemkey,
2085: aname => 'FORWARD_TO_ID');
2086: END IF;
2087: IF (g_asn_debug = 'Y') THEN
2088: debug_log(FND_LOG.LEVEL_STATEMENT,
2089: l_api_name,
2090: ' l_forward_to_id '
2091: || l_forward_to_id);
2092: END IF;
2103: itemkey => p_itemkey,
2104: aname => 'WORK_CONFIRMATION_ID');
2105:
2106: IF (g_asn_debug = 'Y') THEN
2107: debug_log(FND_LOG.LEVEL_STATEMENT,
2108: l_api_name,
2109: ' l_shipment_header_id '
2110: || l_shipment_header_id);
2111: END IF;
2114: itemkey=>p_itemkey,
2115: aname=>'APPROVER_EMPID');
2116:
2117: IF (g_asn_debug = 'Y') THEN
2118: debug_log(FND_LOG.LEVEL_STATEMENT,
2119: l_api_name,
2120: ' l_approver_id '
2121: || l_approver_id);
2122: END IF;
2125: itemkey => p_itemkey,
2126: aname => 'AME_INSERTION_TYPE');
2127:
2128: IF (g_asn_debug = 'Y') THEN
2129: debug_log(FND_LOG.LEVEL_STATEMENT,
2130: l_api_name,
2131: ' l_insertion_type '
2132: || l_insertion_type);
2133: END IF;
2136: itemkey => p_itemkey,
2137: aname => 'AME_AUTHORITY_TYPE');
2138:
2139: IF (g_asn_debug = 'Y') THEN
2140: debug_log(FND_LOG.LEVEL_STATEMENT,
2141: l_api_name,
2142: ' l_authority_type '
2143: || l_authority_type);
2144: END IF;
2147: itemkey => p_itemkey,
2148: aname => 'AME_TRANSACTION_TYPE');
2149:
2150: IF (g_asn_debug = 'Y') THEN
2151: debug_log(FND_LOG.LEVEL_STATEMENT,
2152: l_api_name,
2153: ' l_transaction_type '
2154: || l_transaction_type);
2155: END IF;
2158: (itemtype => p_itemtype,
2159: itemkey => p_itemkey,
2160: aname => 'AME_APPROVER_TYPE');
2161: IF (g_asn_debug = 'Y') THEN
2162: debug_log(FND_LOG.LEVEL_STATEMENT,
2163: l_api_name,
2164: ' l_approver_type '
2165: || l_approver_type);
2166: END IF;
2170: itemkey => p_itemkey,
2171: aname => 'DEFAULT_APPROVER');
2172:
2173: IF (g_asn_debug = 'Y') THEN
2174: debug_log(FND_LOG.LEVEL_STATEMENT,
2175: l_api_name,'l_default_approver '
2176: || l_default_approver);
2177: END IF;
2178:
2177: END IF;
2178:
2179: If l_default_approver = 'BUYER' then --{
2180: IF (g_asn_debug = 'Y') THEN
2181: debug_log(FND_LOG.LEVEL_STATEMENT,
2182: l_api_name,'Approved by buyer. Dont call ame api ');
2183: END IF;
2184: x_resultout:='COMPLETE' || ':' || 'ACTIVITY_PERFORMED';
2185: return;
2194: l_current_approver.orig_system := 'PER';
2195: end if;
2196:
2197: IF (g_asn_debug = 'Y') THEN
2198: debug_log(FND_LOG.LEVEL_STATEMENT,
2199: l_api_name,
2200: ' orig_system '
2201: || l_current_approver.orig_system);
2202: END IF;
2239:
2240:
2241:
2242: IF (g_asn_debug = 'Y') THEN
2243: debug_log(FND_LOG.LEVEL_STATEMENT,
2244: l_api_name,
2245: ' name '
2246: || l_current_approver.name);
2247: END IF;
2262: RETURN;
2263: Exception
2264: when others then
2265: IF (g_asn_debug = 'Y') THEN
2266: debug_log(FND_LOG.LEVEL_UNEXPECTED,
2267: l_api_name,'Exception in update_approval_list_response '
2268: || l_progress);
2269: END IF;
2270: raise;
2280: l_api_name varchar2(50) := p_itemkey || ' update_action_history_approve';
2281: begin
2282: l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_History_Approve: 01.';
2283: IF (g_asn_debug = 'Y') THEN
2284: debug_log(FND_LOG.LEVEL_STATEMENT,
2285: l_api_name,
2286: 'Enter in Update_Action_History_Approve '
2287: || l_progress);
2288: END IF;
2298:
2299: x_resultout:='COMPLETE' || ':' || 'ACTIVITY_PERFORMED';
2300:
2301: IF (g_asn_debug = 'Y') THEN
2302: debug_log(FND_LOG.LEVEL_STATEMENT,
2303: l_api_name,
2304: 'Leave in Update_Action_History_Approve '
2305: || l_progress);
2306: END IF;
2310:
2311: Exception
2312: when others then
2313: IF (g_asn_debug = 'Y') THEN
2314: debug_log(FND_LOG.LEVEL_UNEXPECTED,
2315: l_api_name,'Exception in update_action_history_approve '
2316: || l_progress);
2317: END IF;
2318: raise;
2328: l_api_name varchar2(50) := p_itemkey || ' update_action_history_Reject';
2329: begin
2330: l_progress := 'POS_WCAPPROVE_PVT.Update_action_history_reject: 01.';
2331: IF (g_asn_debug = 'Y') THEN
2332: debug_log(FND_LOG.LEVEL_STATEMENT,
2333: l_api_name,
2334: 'Enter in Update_Action_History_Reject '
2335: || l_progress);
2336: END IF;
2346:
2347: x_resultout:='COMPLETE' || ':' || 'ACTIVITY_PERFORMED';
2348:
2349: IF (g_asn_debug = 'Y') THEN
2350: debug_log(FND_LOG.LEVEL_STATEMENT,
2351: l_api_name,
2352: 'Leave in Update_Action_History_Reject '
2353: || l_progress);
2354: END IF;
2358:
2359: Exception
2360: when others then
2361: IF (g_asn_debug = 'Y') THEN
2362: debug_log(FND_LOG.LEVEL_UNEXPECTED,
2363: l_api_name,'Exception in update_action_history_Reject '
2364: || l_progress);
2365: END IF;
2366: raise;
2409:
2410: begin
2411: l_progress := 'POS_WCAPPROVE_PVT.Update_Action_history: 01.';
2412: IF (g_asn_debug = 'Y') THEN
2413: debug_log(FND_LOG.LEVEL_STATEMENT,
2414: l_api_name,
2415: 'Enter in Update_Action_History '
2416: || l_progress);
2417: END IF;
2422: itemkey => p_itemkey,
2423: aname => 'WORK_CONFIRMATION_ID');
2424:
2425: IF (g_asn_debug = 'Y') THEN
2426: debug_log(FND_LOG.LEVEL_STATEMENT,
2427: l_api_name,
2428: ' l_shipment_header_id '
2429: || l_shipment_header_id);
2430: END IF;
2439: and wias.item_key = p_itemkey
2440: and wias.notification_id = wf.group_id;
2441:
2442: IF (g_asn_debug = 'Y') THEN
2443: debug_log(FND_LOG.LEVEL_STATEMENT,
2444: l_api_name,
2445: ' l_notification_id '
2446: || l_notification_id);
2447: END IF;
2455: FROM wf_notifications wfn
2456: WHERE wfn.notification_id = l_notification_id;
2457:
2458: IF (g_asn_debug = 'Y') THEN
2459: debug_log(FND_LOG.LEVEL_STATEMENT,
2460: l_api_name,
2461: ' l_responder ' || l_responder);
2462: debug_log(FND_LOG.LEVEL_STATEMENT,
2463: l_api_name,
2458: IF (g_asn_debug = 'Y') THEN
2459: debug_log(FND_LOG.LEVEL_STATEMENT,
2460: l_api_name,
2461: ' l_responder ' || l_responder);
2462: debug_log(FND_LOG.LEVEL_STATEMENT,
2463: l_api_name,
2464: ' l_recipient_role ' || l_recipient_role);
2465: debug_log(FND_LOG.LEVEL_STATEMENT,
2466: l_api_name,
2461: ' l_responder ' || l_responder);
2462: debug_log(FND_LOG.LEVEL_STATEMENT,
2463: l_api_name,
2464: ' l_recipient_role ' || l_recipient_role);
2465: debug_log(FND_LOG.LEVEL_STATEMENT,
2466: l_api_name,
2467: ' l_original_recipient '||l_original_recipient);
2468: debug_log(FND_LOG.LEVEL_STATEMENT,
2469: l_api_name,
2464: ' l_recipient_role ' || l_recipient_role);
2465: debug_log(FND_LOG.LEVEL_STATEMENT,
2466: l_api_name,
2467: ' l_original_recipient '||l_original_recipient);
2468: debug_log(FND_LOG.LEVEL_STATEMENT,
2469: l_api_name,
2470: ' l_more_info_role ' || l_more_info_role);
2471: END IF;
2472:
2519: l_progress := 'POS_WCAPPROVE_PVT.update_approval_history: 04.';
2520:
2521:
2522: IF (g_asn_debug = 'Y') THEN
2523: debug_log(FND_LOG.LEVEL_STATEMENT,
2524: l_api_name,'l_comments ' ||
2525: l_comments);
2526: END IF;
2527:
2534: l_comments,
2535: l_shipment_header_id);
2536:
2537: IF (g_asn_debug = 'Y') THEN
2538: debug_log(FND_LOG.LEVEL_STATEMENT,
2539: l_api_name,'After updateactionhistory' ||
2540: l_shipment_header_id);
2541: end if;
2542: --end loop; --}
2541: end if;
2542: --end loop; --}
2543:
2544: IF (g_asn_debug = 'Y') THEN
2545: debug_log(FND_LOG.LEVEL_STATEMENT,
2546: l_api_name,'Leave update_action_history' );
2547: end if;
2548:
2549: return;
2550:
2551: EXCEPTION
2552: when others then
2553: IF (g_asn_debug = 'Y') THEN
2554: debug_log(FND_LOG.LEVEL_UNEXPECTED,
2555: l_api_name,'Exception in Update_Action_History '
2556: || l_progress);
2557: END IF;
2558: raise;
2598: BEGIN
2599:
2600: l_progress := 'POS_WCAPPROVE_PVT.UpdateActionHistory: 01.';
2601: IF (g_asn_debug = 'Y') THEN
2602: debug_log(FND_LOG.LEVEL_STATEMENT,
2603: l_api_name,'Enter in UpdateActionHistory '
2604: || l_progress);
2605: debug_log(FND_LOG.LEVEL_STATEMENT,
2606: l_api_name,'p_shipment_header_id '
2601: IF (g_asn_debug = 'Y') THEN
2602: debug_log(FND_LOG.LEVEL_STATEMENT,
2603: l_api_name,'Enter in UpdateActionHistory '
2604: || l_progress);
2605: debug_log(FND_LOG.LEVEL_STATEMENT,
2606: l_api_name,'p_shipment_header_id '
2607: || p_shipment_header_id);
2608: END IF;
2609:
2630:
2631: /* Add a blank line if the last line is not blank.
2632: */
2633: IF (g_asn_debug = 'Y') THEN
2634: debug_log(FND_LOG.LEVEL_STATEMENT,
2635: l_api_name,
2636: 'Before call to InsertPOActionHistory ');
2637: End if;
2638:
2733: /**
2734: ** update pending row of action history with approval action
2735: */
2736: IF (g_asn_debug = 'Y') THEN
2737: debug_log(FND_LOG.LEVEL_STATEMENT,
2738: l_api_name,
2739: 'Before call to UpdatePOActionHistory '
2740: ||l_progress);
2741: End if;
2755:
2756: EXCEPTION
2757: when no_data_found then
2758: IF (g_asn_debug = 'Y') THEN
2759: debug_log(FND_LOG.LEVEL_UNEXPECTED,
2760: l_api_name,
2761: 'No data found in UpdateActionHistory '
2762: || l_progress);
2763: END IF;
2764: raise;
2765:
2766: when others then
2767: IF (g_asn_debug = 'Y') THEN
2768: debug_log(FND_LOG.LEVEL_UNEXPECTED,
2769: l_api_name,'Exception in UpdateActionHistory '
2770: || l_progress);
2771: END IF;
2772: raise;
2784: BEGIN
2785:
2786: l_progress := 'POS_WCAPPROVE_PVT.get_user_name: 01.';
2787: IF (g_asn_debug = 'Y') THEN
2788: debug_log(FND_LOG.LEVEL_STATEMENT,
2789: l_api_name,'Enter in get_user_name '
2790: || l_progress);
2791: END IF;
2792:
2795: x_username,
2796: x_user_display_name);
2797:
2798: IF (g_asn_debug = 'Y') THEN
2799: debug_log(FND_LOG.LEVEL_STATEMENT,
2800: l_api_name,'x_username '
2801: || x_username);
2802: debug_log(FND_LOG.LEVEL_STATEMENT,
2803: l_api_name,'x_user_display_name '
2798: IF (g_asn_debug = 'Y') THEN
2799: debug_log(FND_LOG.LEVEL_STATEMENT,
2800: l_api_name,'x_username '
2801: || x_username);
2802: debug_log(FND_LOG.LEVEL_STATEMENT,
2803: l_api_name,'x_user_display_name '
2804: || x_user_display_name);
2805: END IF;
2806: EXCEPTION
2805: END IF;
2806: EXCEPTION
2807: when others then
2808: IF (g_asn_debug = 'Y') THEN
2809: debug_log(FND_LOG.LEVEL_UNEXPECTED,
2810: l_api_name,'Exception in get_user_name '
2811: || l_progress);
2812: END IF;
2813: raise;
2831:
2832: BEGIN
2833: l_progress := 'POS_WCAPPROVE_PVT.UpdatePOActionHistory: 01.';
2834: IF (g_asn_debug = 'Y') THEN
2835: debug_log(FND_LOG.LEVEL_STATEMENT,
2836: l_api_name,'Enter in UpdatePOActionHistory '
2837: || l_progress);
2838: debug_log(FND_LOG.LEVEL_STATEMENT,
2839: l_api_name,'object_id '||p_object_id
2834: IF (g_asn_debug = 'Y') THEN
2835: debug_log(FND_LOG.LEVEL_STATEMENT,
2836: l_api_name,'Enter in UpdatePOActionHistory '
2837: || l_progress);
2838: debug_log(FND_LOG.LEVEL_STATEMENT,
2839: l_api_name,'object_id '||p_object_id
2840: || 'object_type_code '|| p_object_type_code
2841: || 'p_employee_id '|| nvl(p_employee_id,-9999)
2842: || 'p_action_code '|| nvl(p_action_code,'NO ACTION')
2852: * user taking the action, not the employee id to
2853: * which the work confirmation was forwarded to.
2854: */
2855: IF (g_asn_debug = 'Y') THEN
2856: debug_log(FND_LOG.LEVEL_STATEMENT,
2857: l_api_name,'ohject_id and '
2858: || 'object_type_code not null');
2859: END IF;
2860:
2860:
2861: /*
2862: If (p_old_employee_id is NULL) then
2863: IF (g_asn_debug = 'Y') THEN
2864: debug_log(FND_LOG.LEVEL_STATEMENT,
2865: l_api_name,'p_employee_id is null '
2866: || l_progress);
2867: END IF;
2868:
2871: FROM FND_USER FND, HR_EMPLOYEES_CURRENT_V HR
2872: WHERE FND.USER_ID = NVL(p_user_id, fnd_global.user_id)
2873: AND FND.EMPLOYEE_ID = HR.EMPLOYEE_ID;
2874: IF (g_asn_debug = 'Y') THEN
2875: debug_log(FND_LOG.LEVEL_STATEMENT,
2876: l_api_name,'l_employee_id '
2877: || l_employee_id);
2878: END IF;
2879:
2880: end if;
2881:
2882: l_progress := 'POS_WCAPPROVE_PVT.UpdatePOActionHistory: 02.';
2883: IF (g_asn_debug = 'Y') THEN
2884: debug_log(FND_LOG.LEVEL_STATEMENT,
2885: l_api_name,'Before Update '
2886: || l_progress);
2887: END IF;
2888: */
2888: */
2889:
2890:
2891: IF (g_asn_debug = 'Y') THEN
2892: debug_log(FND_LOG.LEVEL_STATEMENT,
2893: l_api_name,'l_note '
2894: || l_note);
2895: end if;
2896:
2923:
2924: ELSE --}{
2925: l_progress := 'POS_WCAPPROVE_PVT.UpdatePOActionHistory: 02.';
2926: IF (g_asn_debug = 'Y') THEN
2927: debug_log(FND_LOG.LEVEL_STATEMENT,
2928: l_api_name,
2929: 'Either object id or code is null '
2930: || l_progress);
2931: END IF;
2934:
2935: EXCEPTION
2936: when invalid_action then
2937: IF (g_asn_debug = 'Y') THEN
2938: debug_log(FND_LOG.LEVEL_EXCEPTION,
2939: l_api_name,'invalid_action in UpdatePOActionHistory '
2940: || l_progress);
2941: END IF;
2942: raise;
2941: END IF;
2942: raise;
2943: when others then
2944: IF (g_asn_debug = 'Y') THEN
2945: debug_log(FND_LOG.LEVEL_UNEXPECTED,
2946: l_api_name,'Exception in UpdatePOActionHistory '
2947: || l_progress);
2948: END IF;
2949: raise;
2980:
2981:
2982: l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 01.';
2983: IF (g_asn_debug = 'Y') THEN
2984: debug_log(FND_LOG.LEVEL_STATEMENT,
2985: l_api_name,'Enter in InsertPOActionHistory '
2986: || l_progress);
2987: END IF;
2988:
2988:
2989: l_sequence_num := p_sequence_num;
2990:
2991: IF (g_asn_debug = 'Y') THEN
2992: debug_log(FND_LOG.LEVEL_STATEMENT,
2993: l_api_name,'l_sequence_num '
2994: || l_sequence_num);
2995: END IF;
2996:
3022:
3023: l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 07.';
3024:
3025: IF (g_asn_debug = 'Y') THEN
3026: debug_log(FND_LOG.LEVEL_STATEMENT,
3027: l_api_name,'l_sequence_num before insert '
3028: || l_sequence_num);
3029: END IF;
3030:
3077:
3078: EXCEPTION
3079: when others then
3080: IF (g_asn_debug = 'Y') THEN
3081: debug_log(FND_LOG.LEVEL_UNEXPECTED,
3082: l_api_name,'Exception in InsertPOActionHistory '
3083: || l_progress);
3084: END IF;
3085: raise;
3148: BEGIN
3149:
3150: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 01.';
3151: IF (g_asn_debug = 'Y') THEN
3152: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'Enter in post_approval_notif ' || l_progress);
3153: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemtype ' || p_itemtype);
3154: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemkey ' || p_itemkey);
3155: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_actid ' || p_actid);
3156: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_funcmode ' || p_funcmode);
3149:
3150: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 01.';
3151: IF (g_asn_debug = 'Y') THEN
3152: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'Enter in post_approval_notif ' || l_progress);
3153: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemtype ' || p_itemtype);
3154: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemkey ' || p_itemkey);
3155: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_actid ' || p_actid);
3156: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_funcmode ' || p_funcmode);
3157: END IF;
3150: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 01.';
3151: IF (g_asn_debug = 'Y') THEN
3152: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'Enter in post_approval_notif ' || l_progress);
3153: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemtype ' || p_itemtype);
3154: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemkey ' || p_itemkey);
3155: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_actid ' || p_actid);
3156: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_funcmode ' || p_funcmode);
3157: END IF;
3158:
3151: IF (g_asn_debug = 'Y') THEN
3152: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'Enter in post_approval_notif ' || l_progress);
3153: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemtype ' || p_itemtype);
3154: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemkey ' || p_itemkey);
3155: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_actid ' || p_actid);
3156: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_funcmode ' || p_funcmode);
3157: END IF;
3158:
3159: if (p_funcmode IN ('FORWARD', 'QUESTION', 'ANSWER')) THEN
3152: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'Enter in post_approval_notif ' || l_progress);
3153: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemtype ' || p_itemtype);
3154: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_itemkey ' || p_itemkey);
3155: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_actid ' || p_actid);
3156: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'p_funcmode ' || p_funcmode);
3157: END IF;
3158:
3159: if (p_funcmode IN ('FORWARD', 'QUESTION', 'ANSWER')) THEN
3160: if (p_funcmode = 'FORWARD') then
3168: l_shipment_header_id := wf_engine.GetItemAttrNumber(itemtype => p_itemtype,
3169: itemkey => p_itemkey,
3170: aname => 'WORK_CONFIRMATION_ID');
3171: IF (g_asn_debug = 'Y') THEN
3172: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_shipment_header_id ' ||l_shipment_header_id);
3173: END IF;
3174:
3175: Wf_Directory.GetRoleOrigSysInfo(WF_ENGINE.CONTEXT_NEW_ROLE, l_origsys, l_new_recipient_id);
3176:
3185: OPEN get_action_history;
3186: FETCH get_action_history INTO Recinfo;
3187: IF (get_action_history%NOTFOUND) then
3188: IF (g_asn_debug = 'Y') THEN
3189: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'no_data_round');
3190: END IF;
3191: RAISE NO_DATA_FOUND;
3192: END IF;
3193: CLOSE get_action_history;
3226:
3227: if (p_funcmode = 'RESPOND') then
3228: l_notification_id := WF_ENGINE.context_nid;
3229: IF (g_asn_debug = 'Y') THEN
3230: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'l_notification_id '||l_notification_id );
3231: END IF;
3232:
3233: l_result := wf_notification.GetAttrText(l_notification_id, 'RESULT');
3234:
3232:
3233: l_result := wf_notification.GetAttrText(l_notification_id, 'RESULT');
3234:
3235: IF (g_asn_debug = 'Y') THEN
3236: debug_log(FND_LOG.LEVEL_STATEMENT, l_api_name, 'l_result '||l_result );
3237: END IF;
3238:
3239: if (l_result = 'FORWARD') THEN
3240:
3262: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 03.' ;
3263:
3264: --
3265: IF (g_asn_debug = 'Y') THEN
3266: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress);
3267: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_preserved_ctx ' ||l_preserved_ctx);
3268: END IF;
3269: --
3270:
3263:
3264: --
3265: IF (g_asn_debug = 'Y') THEN
3266: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress);
3267: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_preserved_ctx ' ||l_preserved_ctx);
3268: END IF;
3269: --
3270:
3271:
3279: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 04.' ;
3280:
3281: --
3282: IF (g_asn_debug = 'Y') THEN
3283: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress);
3284: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_responder_id ' ||l_responder_id);
3285: END IF;
3286: --
3287:
3280:
3281: --
3282: IF (g_asn_debug = 'Y') THEN
3283: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress);
3284: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_responder_id ' ||l_responder_id);
3285: END IF;
3286: --
3287:
3288: l_session_user_id := fnd_global.user_id;
3290: l_session_appl_id := fnd_global.resp_appl_id;
3291:
3292: --
3293: IF (g_asn_debug = 'Y') THEN
3294: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_user_id ' ||l_session_user_id);
3295: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_resp_id ' ||l_session_resp_id);
3296: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_appl_id ' ||l_session_appl_id);
3297: END IF;
3298: --
3291:
3292: --
3293: IF (g_asn_debug = 'Y') THEN
3294: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_user_id ' ||l_session_user_id);
3295: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_resp_id ' ||l_session_resp_id);
3296: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_appl_id ' ||l_session_appl_id);
3297: END IF;
3298: --
3299:
3292: --
3293: IF (g_asn_debug = 'Y') THEN
3294: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_user_id ' ||l_session_user_id);
3295: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_resp_id ' ||l_session_resp_id);
3296: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_appl_id ' ||l_session_appl_id);
3297: END IF;
3298: --
3299:
3300: IF (l_session_user_id = -1) THEN
3310: END IF;
3311:
3312: --
3313: IF (g_asn_debug = 'Y') THEN
3314: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_user_id ' ||l_session_user_id);
3315: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_resp_id ' ||l_session_resp_id);
3316: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_appl_id ' ||l_session_appl_id);
3317: END IF;
3318: --
3311:
3312: --
3313: IF (g_asn_debug = 'Y') THEN
3314: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_user_id ' ||l_session_user_id);
3315: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_resp_id ' ||l_session_resp_id);
3316: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_appl_id ' ||l_session_appl_id);
3317: END IF;
3318: --
3319:
3312: --
3313: IF (g_asn_debug = 'Y') THEN
3314: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_user_id ' ||l_session_user_id);
3315: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_resp_id ' ||l_session_resp_id);
3316: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_session_appl_id ' ||l_session_appl_id);
3317: END IF;
3318: --
3319:
3320: l_preparer_resp_id := wf_engine.GetItemAttrNumber(itemtype => p_itemtype,
3327: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 05.' ;
3328:
3329: --
3330: IF (g_asn_debug = 'Y') THEN
3331: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress);
3332: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_preparer_resp_id ' ||l_preparer_resp_id);
3333: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_preparer_appl_id ' ||l_preparer_appl_id);
3334: END IF;
3335: --
3328:
3329: --
3330: IF (g_asn_debug = 'Y') THEN
3331: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress);
3332: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_preparer_resp_id ' ||l_preparer_resp_id);
3333: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_preparer_appl_id ' ||l_preparer_appl_id);
3334: END IF;
3335: --
3336:
3329: --
3330: IF (g_asn_debug = 'Y') THEN
3331: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress);
3332: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_preparer_resp_id ' ||l_preparer_resp_id);
3333: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_preparer_appl_id ' ||l_preparer_appl_id);
3334: END IF;
3335: --
3336:
3337: if (l_responder_id is not null) then
3344: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 06.' ;
3345:
3346: --
3347: IF (g_asn_debug = 'Y') THEN
3348: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress || 'When the response is made from email using guest user feature');
3349: END IF;
3350: --
3351:
3352: wf_engine.SetItemAttrNumber(itemtype => p_itemtype,
3365: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 07.' ;
3366:
3367: --
3368: IF (g_asn_debug = 'Y') THEN
3369: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress || 'When the response is made from sysadmin login');
3370: END IF;
3371: --
3372:
3373: if (l_session_resp_id is null) THEN
3376: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 08.' ;
3377:
3378: --
3379: IF (g_asn_debug = 'Y') THEN
3380: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress || 'When the response is made from the default worklist');
3381: END IF;
3382: --
3383:
3384: wf_engine.SetItemAttrNumber(itemtype => p_itemtype,
3404: l_progress := 'POS_WCAPPROVE_PVT.post_approval_notif: 09.' ;
3405:
3406: --
3407: IF (g_asn_debug = 'Y') THEN
3408: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,'l_progress ' ||l_progress || 'When the response is made after choosing a correct responsibility');
3409: END IF;
3410: --
3411:
3412:
3450:
3451: EXCEPTION
3452: when no_data_found then
3453: IF (g_asn_debug = 'Y') THEN
3454: debug_log(FND_LOG.LEVEL_UNEXPECTED, l_api_name, 'No data found in post_approval_notif ' || l_progress);
3455: END IF;
3456: raise;
3457:
3458: when others then
3456: raise;
3457:
3458: when others then
3459: IF (g_asn_debug = 'Y') THEN
3460: debug_log(FND_LOG.LEVEL_UNEXPECTED, l_api_name,'Exception in post_approval_notif ' || l_progress);
3461: END IF;
3462: raise;
3463: END post_approval_notif;
3464:
3480: l_view_wc_lines_detail_url varchar2(1000);
3481: begin
3482: l_progress := 'POS_WCAPPROVE_PVT.reject_doc: 01.';
3483: IF (g_asn_debug = 'Y') THEN
3484: debug_log(FND_LOG.LEVEL_STATEMENT,
3485: l_api_name,
3486: 'Enter in reject_doc '
3487: || l_progress);
3488: END IF;
3510: l_progress := 'POS_WCAPPROVE_PVT.reject_doc: 03.';
3511: IF (l_result = 'N') THEN
3512:
3513: IF (g_asn_debug = 'Y') THEN
3514: debug_log(FND_LOG.LEVEL_STATEMENT,
3515: l_api_name,
3516: 'Could not Reject the document '
3517: || l_progress);
3518: END IF;
3521:
3522: IF (l_result = 'Y') THEN
3523:
3524: IF (g_asn_debug = 'Y') THEN
3525: debug_log(FND_LOG.LEVEL_STATEMENT,
3526: l_api_name,
3527: 'Rejected the document '
3528: || l_progress);
3529: END IF;
3538: itemkey => p_itemkey,
3539: aname => 'PO_DOCUMENT_ID');
3540:
3541: IF (g_asn_debug = 'Y') THEN
3542: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
3543: 'l_po_header_id ' || l_po_header_id);
3544: END IF;
3545:
3546: l_work_confirmation_number :=
3548: itemkey => p_itemkey,
3549: aname => 'WORK_CONFIRMATION_NUMBER');
3550:
3551: IF (g_asn_debug = 'Y') THEN
3552: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
3553: 'l_work_confirmation_number ' || l_work_confirmation_number);
3554: END IF;
3555:
3556: -- bug 10012891 - encoding value of work confirmation number as per http standards
3571: END IF;
3572: EXCEPTION
3573: when others then
3574: IF (g_asn_debug = 'Y') THEN
3575: debug_log(FND_LOG.LEVEL_UNEXPECTED,
3576: l_api_name,'Exception in reject_doc '
3577: || l_progress);
3578: END IF;
3579: raise;
3598: l_work_confirmation_number varchar2(30);
3599: begin
3600: l_progress := 'POS_WCAPPROVE_PVT.Approve_doc: 01.';
3601: IF (g_asn_debug = 'Y') THEN
3602: debug_log(FND_LOG.LEVEL_STATEMENT,
3603: l_api_name,
3604: 'Enter in Approve_doc '
3605: || l_progress);
3606: END IF;
3626: l_progress := 'POS_WCAPPROVE_PVT.Approve_doc: 03.';
3627: IF (l_result = 'N') THEN
3628:
3629: IF (g_asn_debug = 'Y') THEN
3630: debug_log(FND_LOG.LEVEL_STATEMENT,
3631: l_api_name,
3632: 'Could not Reject the document '
3633: || l_progress);
3634: END IF;
3637:
3638: IF (l_result = 'Y') THEN
3639:
3640: IF (g_asn_debug = 'Y') THEN
3641: debug_log(FND_LOG.LEVEL_STATEMENT,
3642: l_api_name,
3643: 'Approved the document '
3644: || l_progress);
3645: END IF;
3653: itemkey => p_itemkey,
3654: aname => 'PO_DOCUMENT_ID');
3655:
3656: IF (g_asn_debug = 'Y') THEN
3657: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
3658: 'l_po_header_id ' || l_po_header_id);
3659: END IF;
3660:
3661: l_work_confirmation_number :=
3663: itemkey => p_itemkey,
3664: aname => 'WORK_CONFIRMATION_NUMBER');
3665:
3666: IF (g_asn_debug = 'Y') THEN
3667: debug_log(FND_LOG.LEVEL_STATEMENT,l_api_name,
3668: 'l_work_confirmation_number ' || l_work_confirmation_number);
3669: END IF;
3670:
3671: -- bug 10012891 - encoding value of work confirmation number as per http standards
3687: END IF;
3688: EXCEPTION
3689: when others then
3690: IF (g_asn_debug = 'Y') THEN
3691: debug_log(FND_LOG.LEVEL_UNEXPECTED,
3692: l_api_name,'Exception in Approve_doc '
3693: || l_progress);
3694: END IF;
3695: raise;
3719: l_note po_action_history.note%type;
3720: begin
3721: l_progress := 'POS_WCAPPROVE_PVT.update_approval_status: 01.';
3722: IF (g_asn_debug = 'Y') THEN
3723: debug_log(FND_LOG.LEVEL_STATEMENT,
3724: l_api_name,
3725: 'Enter in update_approval_status '
3726: || l_progress);
3727: debug_log(FND_LOG.LEVEL_STATEMENT,
3723: debug_log(FND_LOG.LEVEL_STATEMENT,
3724: l_api_name,
3725: 'Enter in update_approval_status '
3726: || l_progress);
3727: debug_log(FND_LOG.LEVEL_STATEMENT,
3728: l_api_name,
3729: 'p_note '
3730: || p_note);
3731: END IF;
3754:
3755: IF (NOT l_locked_doc) THEN
3756:
3757: IF (g_asn_debug = 'Y') THEN
3758: debug_log(FND_LOG.LEVEL_STATEMENT,
3759: l_api_name,'Could not lock row '
3760: || l_progress);
3761: END IF;
3762: ROLLBACK;
3789: x_resultout := 'Y';
3790: exception
3791: when others then
3792: IF (g_asn_debug = 'Y') THEN
3793: debug_log(FND_LOG.LEVEL_UNEXPECTED,
3794: l_api_name,'Exception in update_approval_status '
3795: || l_progress);
3796: END IF;
3797: raise;
4011:
4012: begin
4013: l_progress := 'POS_WCAPPROVE_PVT.insert_into_rti: 01.';
4014: IF (g_asn_debug = 'Y') THEN
4015: debug_log(FND_LOG.LEVEL_STATEMENT,
4016: l_api_name,
4017: 'Enter in insert_into_rti '
4018: || l_progress);
4019: END IF;
4036: into l_group_id
4037: from dual;
4038:
4039: IF (g_asn_debug = 'Y') THEN
4040: debug_log(FND_LOG.LEVEL_STATEMENT,
4041: l_api_name,'l_header_interface_id ' ||
4042: l_header_interface_id ||
4043: ' l_group_id ' || l_group_id);
4044: END IF;
4052: X_emp_name, X_location_id, X_location_code,
4053: X_is_buyer, X_emp_flag );
4054:
4055: IF (g_asn_debug = 'Y') THEN
4056: debug_log(FND_LOG.LEVEL_STATEMENT,
4057: l_api_name,'x_emp_id ' ||
4058: x_emp_id);
4059: END IF;
4060:
4058: x_emp_id);
4059: END IF;
4060:
4061: IF (g_asn_debug = 'Y') THEN
4062: debug_log(FND_LOG.LEVEL_STATEMENT,
4063: l_api_name,'before cursor open');
4064: END IF;
4065:
4066: /* ******************************************************************
4080:
4081: l_progress := 'POS_WCAPPROVE_PVT.insert_into_rti:02.';
4082:
4083: IF (g_asn_debug = 'Y') THEN
4084: debug_log(FND_LOG.LEVEL_STATEMENT,
4085: l_api_name,'before cursor fetch');
4086: END IF;
4087:
4088: fetch get_wcr_info into wcr_line_info;
4088: fetch get_wcr_info into wcr_line_info;
4089: exit when get_wcr_info%notfound;
4090:
4091: IF (g_asn_debug = 'Y') THEN
4092: debug_log(FND_LOG.LEVEL_STATEMENT,
4093: l_api_name,'l_shipment_line_id ' ||
4094: wcr_line_info.shipment_line_id);
4095: END IF;
4096:
4096:
4097: l_clm_flag := wcr_line_info.clm_flag;
4098:
4099: IF (g_asn_debug = 'Y') THEN
4100: debug_log(FND_LOG.LEVEL_STATEMENT,
4101: l_api_name,'l_clm_flag ' ||
4102: l_clm_flag);
4103: END IF;
4104:
4108: from mtl_units_of_measure muom
4109: WHERE muom.unit_of_measure = wcr_line_info.unit_of_measure;
4110:
4111: IF (g_asn_debug = 'Y') THEN
4112: debug_log(FND_LOG.LEVEL_STATEMENT,
4113: l_api_name,'l_uom_code ' ||
4114: l_uom_code);
4115: END IF;
4116:
4116:
4117: end if;
4118:
4119: IF (g_asn_debug = 'Y') THEN
4120: debug_log(FND_LOG.LEVEL_STATEMENT,
4121: l_api_name,'before cursor open');
4122: END IF;
4123:
4124: l_matching_basis:= wcr_line_info.matching_basis;
4155: loop --{
4156: l_progress := 'POS_WCAPPROVE_PVT.insert_into_rti:03.';
4157:
4158: IF (g_asn_debug = 'Y') THEN
4159: debug_log(FND_LOG.LEVEL_STATEMENT,
4160: l_api_name,'before cursor fetch');
4161: END IF;
4162:
4163: /* Bug 6709928 ,getting the destination_type_code,destination_type_context*/
4183:
4184: l_dist_count := l_dist_count + 1;
4185:
4186: IF (g_asn_debug = 'Y') THEN
4187: debug_log(FND_LOG.LEVEL_STATEMENT,
4188: l_api_name,'l_distribution_id ' ||
4189: wcr_line_info.po_distribution_id);
4190: END IF;
4191:
4189: wcr_line_info.po_distribution_id);
4190: END IF;
4191:
4192: IF (g_asn_debug = 'Y') THEN
4193: debug_log(FND_LOG.LEVEL_STATEMENT,
4194: l_api_name,'matching_basis '||l_matching_basis );
4195: END IF;
4196:
4197: l_partial_funded_flag := wcr_line_info.partial_funded_flag;
4207: where po_distribution_id= wcr_line_info.po_distribution_id
4208: and destination_type_code = 'RECEIVING';
4209:
4210: IF (g_asn_debug = 'Y') THEN
4211: debug_log(FND_LOG.LEVEL_STATEMENT,
4212: l_api_name,'l_transacted_amount '||
4213: l_transacted_amount );
4214: END IF;
4215:
4223: and transaction_status_code = 'PENDING'
4224: and transaction_type = 'RECEIVE';
4225:
4226: IF (g_asn_debug = 'Y') THEN
4227: debug_log(FND_LOG.LEVEL_STATEMENT,
4228: l_api_name,'l_interface_amount '||
4229: l_interface_amount );
4230: END IF;
4231:
4242: l_carry_over_amount := l_remaining_amount - l_available_amount;
4243:
4244:
4245: IF (g_asn_debug = 'Y') THEN
4246: debug_log(FND_LOG.LEVEL_STATEMENT,
4247: l_api_name,'l_available_amount '||
4248: l_available_amount );
4249: END IF;
4250:
4345: where po_distribution_id= wcr_line_info.po_distribution_id
4346: and destination_type_code = 'RECEIVING';
4347:
4348: IF (g_asn_debug = 'Y') THEN
4349: debug_log(FND_LOG.LEVEL_STATEMENT,
4350: l_api_name,'l_transacted_quantity '||
4351: l_transacted_quantity );
4352: END IF;
4353:
4361: and transaction_status_code = 'PENDING'
4362: and transaction_type = 'RECEIVE';
4363:
4364: IF (g_asn_debug = 'Y') THEN
4365: debug_log(FND_LOG.LEVEL_STATEMENT,
4366: l_api_name,'l_interface_quantity '||
4367: l_interface_quantity );
4368: END IF;
4369:
4379: for the current pay item after the current distribution is considered */
4380: l_carry_over_quantity := l_remaining_quantity - l_available_quantity;
4381:
4382: IF (g_asn_debug = 'Y') THEN
4383: debug_log(FND_LOG.LEVEL_STATEMENT,
4384: l_api_name,'l_available_quantity '||
4385: l_available_quantity );
4386: END IF;
4387:
4442: into l_interface_id
4443: from dual;
4444:
4445: IF (g_asn_debug = 'Y') THEN
4446: debug_log(FND_LOG.LEVEL_STATEMENT,
4447: l_api_name,'l_interface_id ' || l_interface_id);
4448: END IF;
4449:
4450: IF(wcr_line_info.matching_basis = 'QUANTITY') THEN
4726: wcr_line_info.material_stored_amount
4727: );
4728:
4729: IF (g_asn_debug = 'Y') THEN
4730: debug_log(FND_LOG.LEVEL_STATEMENT,
4731: l_api_name,'After insert ' );
4732:
4733: END IF;
4734:
4792: END IF;
4793:
4794: EXCEPTION WHEN OTHERS THEN
4795: IF (g_asn_debug = 'Y') THEN
4796: debug_log(FND_LOG.LEVEL_UNEXPECTED, l_api_name,'Exception in clm funding assignment'|| l_progress);
4797: END IF;
4798: raise;
4799: END;
4800: END IF;
4799: END;
4800: END IF;
4801:
4802: IF (g_asn_debug = 'Y') THEN
4803: debug_log(FND_LOG.LEVEL_STATEMENT,
4804: l_api_name,'Going to fetch the next shipment line if it exists ' );
4805: END IF;
4806:
4807: end loop; --}
4811: end if;
4812:
4813: GenReceiptNum(l_shipment_header_id,l_receipt_num);
4814: IF (g_asn_debug = 'Y') THEN
4815: debug_log(FND_LOG.LEVEL_STATEMENT,
4816: l_api_name,'l_receipt_num '||l_receipt_num);
4817: END IF;
4818:
4819: update rcv_shipment_headers
4823: last_update_login = fnd_global.login_id
4824: where shipment_header_id = l_shipment_header_id;
4825:
4826: IF (g_asn_debug = 'Y') THEN
4827: debug_log(FND_LOG.LEVEL_STATEMENT,
4828: l_api_name,'Leave insert_into_rti ' );
4829: END IF;
4830:
4831: x_resultout := wf_engine.eng_completed || ':' || 'ACTIVITY_PERFORMED';
4835: exception
4836:
4837: when others then
4838: IF (g_asn_debug = 'Y') THEN
4839: debug_log(FND_LOG.LEVEL_UNEXPECTED,
4840: l_api_name,'Exception in insert_into_rti '
4841: || l_progress);
4842: END IF;
4843: raise;
4859: l_api_name varchar2(50) := p_itemkey || ' Launch_RTP_Immediate';
4860: begin
4861: l_progress := 'POS_WCAPPROVE_PVT.Launch_RTP_Immediate: 01.';
4862: IF (g_asn_debug = 'Y') THEN
4863: debug_log(FND_LOG.LEVEL_STATEMENT,
4864: l_api_name,
4865: 'Enter in Launch_RTP_Immediate '
4866: || l_progress);
4867: END IF;
4876: itemkey => p_itemkey,
4877: aname => 'INTERFACE_GROUP_ID');
4878:
4879: IF (g_asn_debug = 'Y') THEN
4880: debug_log(FND_LOG.LEVEL_STATEMENT,
4881: l_api_name,
4882: 'l_group_id '
4883: || l_group_id);
4884: END IF;
4914: NULL, NULL, NULL, NULL, NULL, NULL, NULL,
4915: NULL, NULL, NULL, NULL, NULL, NULL, NULL);
4916:
4917: IF (g_asn_debug = 'Y') THEN
4918: debug_log(FND_LOG.LEVEL_STATEMENT,
4919: l_api_name, 'l_result_id '
4920: || l_result_id);
4921: END IF;
4922: if (l_result_id <= 0 or l_result_id is null) then
4930:
4931: end if;
4932:
4933: IF (g_asn_debug = 'Y') THEN
4934: debug_log(FND_LOG.LEVEL_STATEMENT,
4935: l_api_name, 'Leave RTP launch ' );
4936: END IF;
4937: x_resultout := wf_engine.eng_completed || ':' || 'ACTIVITY_PERFORMED';
4938: return;
4939:
4940: exception
4941: when others then
4942: IF (g_asn_debug = 'Y') THEN
4943: debug_log(FND_LOG.LEVEL_UNEXPECTED,
4944: l_api_name,'Exception in Launch_RTP_Immediate '
4945: || l_progress);
4946: END IF;
4947: raise;
4959:
4960: l_progress := 'POS_WCAPPROVE_PVT.CloseOldNotif: 01';
4961:
4962: IF (g_asn_debug = 'Y') THEN
4963: debug_log(FND_LOG.LEVEL_UNEXPECTED,
4964: l_api_name,'Enter in CloseOldNotif ' || l_progress);
4965: END IF;
4966: update wf_notifications set status = 'CLOSED'
4967: where notification_id in (
4975:
4976: exception
4977: when others then
4978: IF (g_asn_debug = 'Y') THEN
4979: debug_log(FND_LOG.LEVEL_UNEXPECTED,
4980: l_api_name,'Exception in CloseOldNotif ' || l_progress);
4981: END IF;
4982: raise;
4983: end CloseOldNotif;
4995:
4996: l_progress := 'POS_WCAPPROVE_PVT.UpdateWorkflowInfo: 01';
4997:
4998: IF (g_asn_debug = 'Y') THEN
4999: debug_log(FND_LOG.LEVEL_STATEMENT,
5000: l_api_name,'Enter in UpdateWorkflowInfo ' || l_progress);
5001: debug_log(FND_LOG.LEVEL_STATEMENT,
5002: l_api_name,'p_itemtype ' || p_itemtype);
5003: debug_log(FND_LOG.LEVEL_STATEMENT,
4997:
4998: IF (g_asn_debug = 'Y') THEN
4999: debug_log(FND_LOG.LEVEL_STATEMENT,
5000: l_api_name,'Enter in UpdateWorkflowInfo ' || l_progress);
5001: debug_log(FND_LOG.LEVEL_STATEMENT,
5002: l_api_name,'p_itemtype ' || p_itemtype);
5003: debug_log(FND_LOG.LEVEL_STATEMENT,
5004: l_api_name,'p_itemkey ' || p_itemkey);
5005: debug_log(FND_LOG.LEVEL_STATEMENT,
4999: debug_log(FND_LOG.LEVEL_STATEMENT,
5000: l_api_name,'Enter in UpdateWorkflowInfo ' || l_progress);
5001: debug_log(FND_LOG.LEVEL_STATEMENT,
5002: l_api_name,'p_itemtype ' || p_itemtype);
5003: debug_log(FND_LOG.LEVEL_STATEMENT,
5004: l_api_name,'p_itemkey ' || p_itemkey);
5005: debug_log(FND_LOG.LEVEL_STATEMENT,
5006: l_api_name,'p_shipment_header_id ' || p_shipment_header_id);
5007: END IF;
5001: debug_log(FND_LOG.LEVEL_STATEMENT,
5002: l_api_name,'p_itemtype ' || p_itemtype);
5003: debug_log(FND_LOG.LEVEL_STATEMENT,
5004: l_api_name,'p_itemkey ' || p_itemkey);
5005: debug_log(FND_LOG.LEVEL_STATEMENT,
5006: l_api_name,'p_shipment_header_id ' || p_shipment_header_id);
5007: END IF;
5008:
5009: UPDATE rcv_shipment_headers
5015: WHERE shipment_header_id = p_shipment_header_id;
5016:
5017:
5018:
5019: debug_log(FND_LOG.LEVEL_STATEMENT,
5020: l_api_name,'do i see this now? ' || p_shipment_header_id);
5021: exception
5022: when others then
5023: IF (g_asn_debug = 'Y') THEN
5020: l_api_name,'do i see this now? ' || p_shipment_header_id);
5021: exception
5022: when others then
5023: IF (g_asn_debug = 'Y') THEN
5024: debug_log(FND_LOG.LEVEL_UNEXPECTED,
5025: l_api_name,'Exception in UpdateWorkflowInfo ' || l_progress);
5026: END IF;
5027: raise;
5028: end UpdateWorkflowInfo;
5041: begin
5042:
5043: l_progress := 'POS_WCAPPROVE_PVT.Upd_ActionHistory_Submit: 01';
5044: IF (g_asn_debug = 'Y') THEN
5045: debug_log(FND_LOG.LEVEL_UNEXPECTED,
5046: l_api_name,'Enter in Upd_ActionHistory_Submit '
5047: || l_progress);
5048: END IF;
5049:
5070: sequence_num = p_sequence_num;
5071: exception
5072: when others then
5073: IF (g_asn_debug = 'Y') THEN
5074: debug_log(FND_LOG.LEVEL_UNEXPECTED,
5075: l_api_name,'Exception in Upd_ActionHistory_Submit ' || l_progress);
5076: END IF;
5077: raise;
5078: end Upd_ActionHistory_Submit;
5089: l_api_name varchar2(50) := ' get_multiorg_context';
5090: begin
5091: l_progress := 'POS_WCAPPROVE_PVT.get_multiorg_context: 01';
5092: IF (g_asn_debug = 'Y') THEN
5093: debug_log(FND_LOG.LEVEL_STATEMENT,
5094: l_api_name,'Enter in get_multiorg_context '
5095: || l_progress);
5096: END IF;
5097:
5100: CLOSE get_po_orgid;
5101: exception
5102: when others then
5103: IF (g_asn_debug = 'Y') THEN
5104: debug_log(FND_LOG.LEVEL_UNEXPECTED,
5105: l_api_name,'Exception in get_multiorg_context ' || l_progress);
5106: END IF;
5107: raise;
5108: end get_multiorg_context;
5136: l_api_name varchar2(50) := 'get_PoHeaderId';
5137: begin
5138: l_progress := 'POS_WCAPPROVE_PVT.get_PoHeaderId: 01';
5139: IF (g_asn_debug = 'Y') THEN
5140: debug_log(FND_LOG.LEVEL_UNEXPECTED,
5141: l_api_name,'Enter in get_PoHeaderId ' || l_progress);
5142: END IF;
5143:
5144: select max(po_header_id)
5150:
5151: exception
5152: when others then
5153: IF (g_asn_debug = 'Y') THEN
5154: debug_log(FND_LOG.LEVEL_UNEXPECTED,
5155: l_api_name,'Exception in get_PoHeaderId ' || l_progress);
5156: END IF;
5157: raise;
5158:
5173: from rcv_shipment_headers
5174: where shipment_header_id=p_shipment_header_id;
5175:
5176: IF (g_asn_debug = 'Y') THEN
5177: debug_log(FND_LOG.LEVEL_STATEMENT,
5178: l_api_name,'l_ship_to_org_id '
5179: ||l_ship_to_org_id);
5180: END IF;
5181:
5546:
5547: BEGIN
5548:
5549: --
5550: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5551: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','Inside POWC_SELECTOR procedure');
5552: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemtype : '||p_itemtype);
5553: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemkey : '||p_itemkey);
5554: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_actid : '||p_actid);
5547: BEGIN
5548:
5549: --
5550: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5551: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','Inside POWC_SELECTOR procedure');
5552: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemtype : '||p_itemtype);
5553: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemkey : '||p_itemkey);
5554: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_actid : '||p_actid);
5555: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_funcmode : '||p_funcmode);
5548:
5549: --
5550: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5551: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','Inside POWC_SELECTOR procedure');
5552: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemtype : '||p_itemtype);
5553: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemkey : '||p_itemkey);
5554: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_actid : '||p_actid);
5555: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_funcmode : '||p_funcmode);
5556: END IF;
5549: --
5550: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5551: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','Inside POWC_SELECTOR procedure');
5552: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemtype : '||p_itemtype);
5553: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemkey : '||p_itemkey);
5554: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_actid : '||p_actid);
5555: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_funcmode : '||p_funcmode);
5556: END IF;
5557: --
5550: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5551: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','Inside POWC_SELECTOR procedure');
5552: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemtype : '||p_itemtype);
5553: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemkey : '||p_itemkey);
5554: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_actid : '||p_actid);
5555: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_funcmode : '||p_funcmode);
5556: END IF;
5557: --
5558:
5551: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','Inside POWC_SELECTOR procedure');
5552: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemtype : '||p_itemtype);
5553: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_itemkey : '||p_itemkey);
5554: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_actid : '||p_actid);
5555: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','p_funcmode : '||p_funcmode);
5556: END IF;
5557: --
5558:
5559:
5577:
5578: --
5579: l_progress :='010 - ses_user_id:'||l_session_user_id ||' ses_resp_id :'||l_session_resp_id||' responder id:' ||l_responder_id||' org id :'||l_org_id;
5580:
5581: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5582: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress1 : '||l_progress);
5583: END IF;
5584: --
5585:
5578: --
5579: l_progress :='010 - ses_user_id:'||l_session_user_id ||' ses_resp_id :'||l_session_resp_id||' responder id:' ||l_responder_id||' org id :'||l_org_id;
5580:
5581: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5582: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress1 : '||l_progress);
5583: END IF;
5584: --
5585:
5586: IF (p_funcmode = 'TEST_CTX') THEN
5638: aname => 'RESPONDER_APPL_ID');
5639: --
5640: l_progress := '020 selection fn responder id not null';
5641:
5642: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5643: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress2 : '||l_progress);
5644: END IF;
5645: --
5646:
5639: --
5640: l_progress := '020 selection fn responder id not null';
5641:
5642: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5643: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress2 : '||l_progress);
5644: END IF;
5645: --
5646:
5647: --
5646:
5647: --
5648: l_progress :='030 selector fn : setting user id :'||l_responder_id ||' resp id '||l_resp_id_to_set||' l_appl id '||l_appl_id_to_set;
5649:
5650: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5651: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress3 : '||l_progress);
5652: END IF;
5653: --
5654: else
5647: --
5648: l_progress :='030 selector fn : setting user id :'||l_responder_id ||' resp id '||l_resp_id_to_set||' l_appl id '||l_appl_id_to_set;
5649:
5650: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5651: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress3 : '||l_progress);
5652: END IF;
5653: --
5654: else
5655: l_user_id_to_set := wf_engine.GetItemAttrNumber (itemtype => p_itemtype,
5663: aname => 'APPLICATION_ID');
5664: --
5665: l_progress := '040 selector fn responder id null';
5666:
5667: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5668: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress4 : '||l_progress);
5669: END IF;
5670: --
5671:
5664: --
5665: l_progress := '040 selector fn responder id null';
5666:
5667: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5668: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress4 : '||l_progress);
5669: END IF;
5670: --
5671:
5672: --
5671:
5672: --
5673: l_progress := '050 selector fn : set user '||l_user_id_to_set||' resp id ' ||l_resp_id_to_set||' appl id '||l_appl_id_to_set;
5674:
5675: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5676: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress4 : '||l_progress);
5677: END IF;
5678: --
5679: end if;
5672: --
5673: l_progress := '050 selector fn : set user '||l_user_id_to_set||' resp id ' ||l_resp_id_to_set||' appl id '||l_appl_id_to_set;
5674:
5675: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5676: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','l_progress4 : '||l_progress);
5677: END IF;
5678: --
5679: end if;
5680:
5691: END IF;
5692:
5693: EXCEPTION WHEN OTHERS THEN
5694:
5695: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5696: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','Exception in Selector Procedure');
5697: END IF;
5698:
5699: WF_CORE.context('POS_WCAPPROVE_PVT', 'POWC_SELECTOR', p_itemtype, p_itemkey, p_actid, p_funcmode);
5692:
5693: EXCEPTION WHEN OTHERS THEN
5694:
5695: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
5696: fnd_log.string(FND_LOG.LEVEL_PROCEDURE, 'pos.plsql.POS_WCAPPROVE_PVT.POWC_SELECTOR.invoked','Exception in Selector Procedure');
5697: END IF;
5698:
5699: WF_CORE.context('POS_WCAPPROVE_PVT', 'POWC_SELECTOR', p_itemtype, p_itemkey, p_actid, p_funcmode);
5700: RAISE;