73: l_tran_cat_id number;
74:
75: cursor c1 is
76: select routing_history_id
77: from pqh_routing_history
78: where transaction_id = l_transaction_id
79: and transaction_category_id = l_tran_cat_id
80: and user_action_cd ='OVERRIDE'
81: and nvl(approval_cd,'X') <> 'APPROVED'
81: and nvl(approval_cd,'X') <> 'APPROVED'
82: order by routing_history_id desc;
83: cursor c2(p_routing_history_id number) is
84: select approval_cd
85: from pqh_routing_history
86: where transaction_id = l_transaction_id
87: and routing_history_id > p_routing_history_id
88: and transaction_category_id = l_tran_cat_id
89: order by routing_history_id desc;
535: , p_routing_history_id OUT NOCOPY NUMBER
536: )
537: IS
538: l_proc VARCHAR2(61) := g_package || 'create_routing_history';
539: l_rha_tab pqh_routing_history_api.t_rha_tab;
540: l_routing_history_id pqh_routing_history.routing_history_id%type;
541: l_object_version_number pqh_routing_history.object_version_number%type;
542: l_effective_date date := trunc(sysdate);
543: j binary_integer := 0;
536: )
537: IS
538: l_proc VARCHAR2(61) := g_package || 'create_routing_history';
539: l_rha_tab pqh_routing_history_api.t_rha_tab;
540: l_routing_history_id pqh_routing_history.routing_history_id%type;
541: l_object_version_number pqh_routing_history.object_version_number%type;
542: l_effective_date date := trunc(sysdate);
543: j binary_integer := 0;
544: BEGIN
537: IS
538: l_proc VARCHAR2(61) := g_package || 'create_routing_history';
539: l_rha_tab pqh_routing_history_api.t_rha_tab;
540: l_routing_history_id pqh_routing_history.routing_history_id%type;
541: l_object_version_number pqh_routing_history.object_version_number%type;
542: l_effective_date date := trunc(sysdate);
543: j binary_integer := 0;
544: BEGIN
545: hr_utility.set_location(l_proc || 'Entering',10);
561: end if;
562: END LOOP;
563: hr_utility.set_location(l_proc || 'out of xfer ',14);
564:
565: pqh_routing_history_api.create_routing_history_bp (
566: p_validate => false
567: ,p_routing_history_id => l_routing_history_id
568: ,p_approval_cd => p_approval_cd
569: ,p_comments => p_comments
608: IS
609: l_proc VARCHAR2(61) := g_package || 'update_routing_history';
610: BEGIN
611: hr_utility.set_location(l_proc || 'Entering',10);
612: UPDATE pqh_routing_history
613: set
614: user_action_cd = p_user_action_cd
615: WHERE routing_history_id = p_routing_history_id;
616: hr_utility.set_location(l_proc || 'Exiting',100);
632: CURSOR c_rht IS
633: SELECT '1-USR-TO' order_by
634: , rht.routing_history_id routing_history_id
635: , user_name user_name
636: FROM pqh_routing_history rht
637: , fnd_user usr
638: WHERE usr.user_id = rht.forwarded_by_user_id
639: AND transaction_category_id = p_transaction_category_id
640: AND transaction_id = p_transaction_id
642: UNION
643: SELECT '2-POS'
644: , rht.routing_history_id
645: , wfr.name
646: FROM pqh_routing_history rht
647: , wf_roles wfr
648: WHERE wfr.orig_system = 'POS'
649: AND wfr.orig_system_id = rht.forwarded_by_position_id
650: AND rht.forwarded_to_user_id IS NULL
654: UNION
655: SELECT '3-RLS'
656: , rht.routing_history_id
657: , wfr.name
658: FROM pqh_routing_history rht
659: , wf_roles wfr
660: , pqh_routing_list_members rlm
661: WHERE wfr.orig_system = 'PQH_ROLE'
662: AND rlm.routing_list_member_id = rht.forwarded_by_member_id
668: UNION
669: SELECT '4-USR-BY'
670: , rht.routing_history_id
671: , user_name
672: FROM pqh_routing_history rht
673: , fnd_user usr
674: WHERE usr.user_id = rht.forwarded_by_user_id
675: AND rht.forwarded_to_user_id IS NULL
676: AND transaction_category_id = p_transaction_category_id
769: l_proc VARCHAR2(61) := g_package || 'get_approver';
770: l_user VARCHAR2(100);
771: CURSOR c_rht IS
772: SELECT user_name
773: FROM pqh_routing_history rht
774: , fnd_user usr
775: WHERE usr.user_id = rht.forwarded_by_user_id
776: AND transaction_category_id = p_transaction_category_id
777: AND transaction_id = p_transaction_id
831: , forwarded_by_member_id
832: , forwarded_by_position_id
833: , forwarded_by_user_id
834: , forwarded_by_role_id
835: FROM pqh_routing_history rht
836: , fnd_user usr
837: WHERE usr.user_id = rht.forwarded_by_user_id
838: AND routing_history_id = (
839: SELECT MIN(routing_history_id)
836: , fnd_user usr
837: WHERE usr.user_id = rht.forwarded_by_user_id
838: AND routing_history_id = (
839: SELECT MIN(routing_history_id)
840: FROM pqh_routing_history
841: WHERE transaction_category_id = p_transaction_category_id
842: AND transaction_id = p_transaction_id
843: );
844: BEGIN
2036: RETURN VARCHAR2
2037: IS
2038: CURSOR c_get_status IS
2039: SELECT user_action_cd
2040: FROM pqh_routing_history
2041: WHERE transaction_id = p_transaction_id
2042: AND transaction_category_id = p_transaction_category_id
2043: ORDER BY routing_history_id desc;
2044: r_get_status c_get_status%ROWTYPE;
2085: WHERE transaction_id = p_transaction_id
2086: AND transaction_category_id = p_transaction_category_id
2087: AND STATUS IS NULL;
2088: -- r_get_fyi c_get_fyi%ROWTYPE;
2089: l_user_action_cd pqh_routing_history.user_action_cd%TYPE;
2090: l_transaction_id pqh_routing_history.transaction_id%TYPE;
2091: l_transaction_category_id pqh_routing_history.transaction_category_id%TYPE;
2092: l_user fnd_user.user_name%TYPE;
2093: l_transaction_status VARCHAR2(30);
2086: AND transaction_category_id = p_transaction_category_id
2087: AND STATUS IS NULL;
2088: -- r_get_fyi c_get_fyi%ROWTYPE;
2089: l_user_action_cd pqh_routing_history.user_action_cd%TYPE;
2090: l_transaction_id pqh_routing_history.transaction_id%TYPE;
2091: l_transaction_category_id pqh_routing_history.transaction_category_id%TYPE;
2092: l_user fnd_user.user_name%TYPE;
2093: l_transaction_status VARCHAR2(30);
2094: BEGIN
2087: AND STATUS IS NULL;
2088: -- r_get_fyi c_get_fyi%ROWTYPE;
2089: l_user_action_cd pqh_routing_history.user_action_cd%TYPE;
2090: l_transaction_id pqh_routing_history.transaction_id%TYPE;
2091: l_transaction_category_id pqh_routing_history.transaction_category_id%TYPE;
2092: l_user fnd_user.user_name%TYPE;
2093: l_transaction_status VARCHAR2(30);
2094: BEGIN
2095: hr_utility.set_location(l_proc || ' Entering',10);