1 PACKAGE MSC_X_REPLENISH AUTHID CURRENT_USER AS
2 /* $Header: MSCXSFVS.pls 120.2 2008/02/25 10:34:08 hbinjola ship $ */
3
4 -- constants used for SCE order type code
5 REPLENISHMENT CONSTANT NUMBER := 19;
6 REQUISITION CONSTANT NUMBER := 20;
7 SUPPLY_SCHEDULE CONSTANT NUMBER := 2;
8 ALLOCATED_ONHAND CONSTANT NUMBER := 9;
9 UNALLOCATED_ONHAND CONSTANT NUMBER := 10;
10 ASN CONSTANT NUMBER := 15;
11 SHIPMENT_RECEIPT CONSTANT NUMBER := 16;
12 PURCHASE_ORDER CONSTANT NUMBER := 13;
13
14 -- constants used for replenishment status
15 UNRELEASED CONSTANT NUMBER := 0;
16 RELEASED CONSTANT NUMBER := 1;
17 REJECTED CONSTANT NUMBER := 2;
18
19 VMI_PLAN_ID CONSTANT NUMBER := -1;
20 REORDER_POINT_CODE CONSTANT NUMBER := 1;
21 MIN_MAX_CODE CONSTANT NUMBER := 2;
22 AUTO_RELEASE_YES CONSTANT NUMBER := 1;
23
24 COMPANY_MAPPING CONSTANT NUMBER := 1;
25 ORGANIZATION_MAPPING CONSTANT NUMBER := 2;
26 SITE_MAPPING CONSTANT NUMBER := 3;
27
28 OEM_COMPANY_ID CONSTANT NUMBER := 1;
29
30 -- This procedure will be called by Concurrent Program to perform
31 -- VMI replenishment
32 PROCEDURE vmi_replenish_wrapper
33 ( errbuf OUT NOCOPY VARCHAR2
34 , retcode OUT NOCOPY VARCHAR2
35 , p_supplier_replenish_flag IN VARCHAR2
36 , p_supplier_time_fence IN NUMBER
37 , p_customer_replenish_flag IN VARCHAR2
38 , p_customer_time_fence IN NUMBER
39 );
40
41 -- This procedure will be called by Concurrent Program to perform
42 -- SCE VMI replenishment
43 PROCEDURE vmi_replenish_concurrent
44 ( p_supplier_time_fence IN NUMBER
45 );
46
47 -- This procedure will start the Workflow process for VMI replenishment
48 PROCEDURE vmi_replenish_wf
49 ( p_supplier_time_fence IN NUMBER
50 , p_inventory_item_id IN NUMBER
51 , p_organization_id IN NUMBER
52 , p_plan_id IN NUMBER
53 , p_sr_instance_id IN NUMBER
54 , p_supplier_id IN NUMBER
55 , p_supplier_site_id IN NUMBER
56 );
57
58 -- This procedure is associated with the 'Create Replenishment' Workflow
59 -- activity and will create a VMI replenishment if there is a shortage
60 -- of supply
61 PROCEDURE vmi_replenish
62 ( itemtype in varchar2
63 , itemkey in varchar2
64 , actid in number
65 , funcmode in varchar2
66 , resultout out nocopy varchar2
67 );
68
69 -- This procedure is associated with the 'Release Replenishment' Workflow
70 -- activity and will create a VMI requsition if there is a shortage
71 -- of supply
72 PROCEDURE vmi_release
73 ( itemtype in varchar2
74 , itemkey in varchar2
75 , actid in number
76 , funcmode in varchar2
77 , resultout out nocopy varchar2
78 );
79
80 -- This procedure is associated with the 'Reject Replenishment' Workflow
81 -- activity and will change the replenishment status from 0 (unrealeased)
82 -- to 2 (rejected)
83 PROCEDURE vmi_reject
84 ( itemtype in varchar2
85 , itemkey in varchar2
86 , actid in number
87 , funcmode in varchar2
88 , resultout out nocopy varchar2
89 );
90
91 -- This function is used to check if an item is a VMI item
92 FUNCTION is_vmi_item (
93 p_inventory_item_id IN NUMBER
94 , p_organization_id IN NUMBER
95 , p_plan_id IN NUMBER
96 , p_sr_instance_id IN NUMBER
97 , p_supplier_id IN NUMBER DEFAULT NULL
98 , p_supplier_site_id IN NUMBER DEFAULT NULL
99 ) RETURN BOOLEAN;
100
101 -- This procedure is associated with the 'Is Auto Release' Workflow
102 -- activity
103 PROCEDURE is_auto_release
104 ( itemtype in varchar2
105 , itemkey in varchar2
106 , actid in number
107 , funcmode in varchar2
108 , resultout out nocopy varchar2
109 );
110
111 -- This procedure is associated with the 'Is Auto Release' Workflow
112 -- activity
113 PROCEDURE is_seller_approve
114 ( itemtype in varchar2
115 , itemkey in varchar2
116 , actid in number
117 , funcmode in varchar2
118 , resultout out nocopy varchar2
119 );
120
121 -- This procesure prints out debug info.
122 PROCEDURE print_debug_info(
123 p_debug_info IN VARCHAR2
124 );
125
126 -- This procesure prints out message to user
127 PROCEDURE print_user_info(
128 p_user_info IN VARCHAR2
129 );
130
131 FUNCTION aps_to_sce(
132 p_tp_key IN NUMBER
133 , p_map_type IN NUMBER
134 , p_sr_instance_id IN NUMBER DEFAULT NULL
135 ) RETURN NUMBER;
136
137 -- This function is used to convert APS tp key to SCE company key
138 FUNCTION sce_to_aps(
139 p_company_key IN NUMBER
140 , p_map_type IN NUMBER
141 ) RETURN NUMBER;
142
143 PROCEDURE create_requisition
144 ( p_item_id NUMBER
145 , p_quantity NUMBER
146 , p_need_by_date VARCHAR2
147 , p_customer_id NUMBER
148 , p_customer_site_id NUMBER
149 , p_supplier_id NUMBER
150 , p_supplier_site_id NUMBER
151 , p_uom_code VARCHAR2 DEFAULT NULL
152 , p_error_msg out nocopy varchar2
153 , p_sr_instance_id NUMBER DEFAULT NULL
154 );
155
156 PROCEDURE temp_tables;
157 --This is to create temp tables.
158
159 END MSC_X_REPLENISH;