1: PACKAGE BODY PO_PALT_ASSIGNMENTS AS
2: /* $Header: POPTASGB.pls 120.16.12020000.8 2013/03/26 06:08:24 smvinod ship $ */
3:
4: Function GetAssignmentNumber
5: (pReqLines IN VARCHAR2)
8: TYPE ReqLinesCurTyp IS REF CURSOR;
9: ReqlinesCur ReqLinesCurTyp;
10:
11: l_requisition_line_Id NUMBER;
12: l_Requisition_Details po_palt_assignments.Requisition_Details;
13: i PLS_INTEGER := 0;
14: l_Assignment_Number VARCHAR2(30);
15: l_Assignment_count NUMBER;
16:
25: EXIT WHEN ReqlinesCur%NOTFOUND;
26: END LOOP;
27: CLOSE ReqlinesCur;
28:
29: l_Assignment_Number := po_palt_assignments_hook.AssignmentNumberCustHook(l_Requisition_Details);
30: IF (l_Assignment_Number is not NULL) THEN
31: SELECT count(*)
32: INTO l_Assignment_count
33: FROM PO_CLM_ASSIGNMENTS
385:
386: BEGIN
387: x_progress := '10';
388: SELECT Count(*) INTO x_currCodeCount FROM (
389: SELECT DISTINCT Nvl(CURRENCY_CODE,PO_PALT_ASSIGNMENTS.GetLineFuncCurrCode(ORG_ID))
390: FROM po_requisition_lines_all WHERE assignment_number = pAssignmentNum);
391:
392: x_progress := '20';
393:
393:
394: IF x_currCodeCount > 1 THEN
395: x_currCode := 'Multiple';
396: ELSE
397: SELECT DISTINCT Nvl(CURRENCY_CODE,PO_PALT_ASSIGNMENTS.GetLineFuncCurrCode(ORG_ID)) INTO x_currCode
398: FROM po_requisition_lines_all WHERE assignment_number = pAssignmentNum;
399:
400: END IF;
401:
491: ReqlinesCur ReqLinesCurTyp;
492: sql_stmt VARCHAR2(500);
493: l_requisition_line_Id NUMBER;
494: i PLS_INTEGER := 0;
495: l_Requisition_Details po_palt_assignments.Requisition_Details;
496: BEGIN
497: sql_stmt := 'SELECT REQUISITION_LINE_ID REQUISITION_ID FROM PO_REQUISITION_LINES_ALL WHERE REQUISITION_HEADER_ID = ' || p_par_req_header_id;
498: OPEN ReqlinesCur FOR sql_stmt;
499: LOOP
503: EXIT WHEN ReqlinesCur%NOTFOUND;
504: END LOOP;
505: CLOSE ReqlinesCur;
506:
507: l_assignment_number := PO_PALT_ASSIGNMENTS_HOOK.AssignmentNumberCustHook(l_Requisition_Details);
508: -- If assignment number from hook is null, then create new assignment
509: IF l_assignment_number IS NULL THEN
510: l_assignment_number := PO_CLM_ASSIGNMENT_SEQUENCE.NEXTVAL;
511:
588: l_par_auto_assign_flag VARCHAR2(1);
589: x_assignment_no NUMBER;
590: BEGIN
591:
592: l_progress := 'PO_PALT_ASSIGNMENTS.create_auto_assignment_for_par Start';
593: po_wf_debug_pkg.Insert_debug(itemtype,itemkey, l_progress );
594:
595: l_par_draft_id := po_wf_util_pkg.GetItemAttrNumber (itemtype => itemtype,
596: itemkey => itemkey,
659: END IF;
660:
661: resultout := wf_engine.eng_completed;
662:
663: l_progress := 'PO_PALT_ASSIGNMENTS.create_auto_assignment_for_par End';
664: po_wf_debug_pkg.Insert_debug(itemtype,itemkey, l_progress );
665:
666: END create_auto_assignment_for_par;
667:
664: po_wf_debug_pkg.Insert_debug(itemtype,itemkey, l_progress );
665:
666: END create_auto_assignment_for_par;
667:
668: END PO_PALT_ASSIGNMENTS;