DBA Data[Home] [Help]

PACKAGE BODY: APPS.WMS_REPLENISHMENT_PUB

Source


1 PACKAGE BODY WMS_REPLENISHMENT_PUB AS
2 /* $Header: WMSREPPB.pls 120.11 2008/04/01 01:45:39 satkumar noship $ */
3 
4 
5 PROCEDURE DYNAMIC_REPLENISHMENT(p_organization_id                   IN NUMBER,
6 				P_Batch_id                 IN NUMBER,
7                                 p_Plan_Tasks               IN VARCHAR2,
8                                 p_Release_Sequence_Rule_Id IN NUMBER,
9                                 P_repl_level               IN NUMBER DEFAULT 1,
10                                 x_msg_count                OUT NOCOPY NUMBER,
11                                 x_return_status            OUT NOCOPY VARCHAR2,
12                                 x_msg_data                 OUT nocopy VARCHAR2) IS
13 
14 BEGIN
15 
16    wms_replenishment_pvt.DYNAMIC_REPLENISHMENT( p_org_id=>p_organization_id,
17 						P_Batch_id=>p_batch_id,
18 						p_Plan_Tasks=>p_plan_tasks,
19 						p_Release_Sequence_Rule_Id=>p_Release_Sequence_Rule_Id,
20 						x_msg_count=>x_msg_count,
21 						x_return_status=>x_return_status,
22 						x_msg_data=>x_msg_data);
23 
24 END dynamic_replenishment;
25 
26 
27 PROCEDURE DYNAMIC_REPLENISHMENT_CP(
28 				   errbuf                OUT NOCOPY VARCHAR2,
29 				   retcode               OUT NOCOPY NUMBER,
30 				   P_Batch_id                 IN NUMBER,
31 				   p_organization_id          IN NUMBER,
32 				   p_Plan_Tasks               IN VARCHAR2,
33 				   p_Release_Sequence_Rule_Id IN NUMBER
34 				   ) is
35 x_msg_count number;
36 x_return_status VARCHAR2(1);
37 x_msg_data VARCHAR2(100);
38 
39 begin
40 
41    --Calling Dynamic Replenishment
42    wms_replenishment_pvt.DYNAMIC_REPLENISHMENT( p_org_id=>p_organization_id,
43 						P_Batch_id=>p_batch_id,
44 						p_Plan_Tasks=>p_plan_tasks,
45 						p_Release_Sequence_Rule_Id=>p_Release_Sequence_Rule_Id,
46 						x_msg_count=>x_msg_count,
47 						x_return_status=>x_return_status,
48 						x_msg_data=>x_msg_data);
49 
50    errbuf := x_msg_data;
51    IF X_RETURN_status <> fnd_api.g_ret_sts_success THEN
52       -- Error
53       retcode := 2;
54     ELSE -- Success
55       retcode := 0;
56    END IF;
57 
58 END Dynamic_Replenishment_CP;
59 
60 
61 PROCEDURE PUSH_REPLENISHMENT_CP(
62 				errbuf                OUT NOCOPY VARCHAR2,
63 				retcode               OUT NOCOPY NUMBER,
64 				p_organization_id           IN NUMBER,
65 				p_Item_id                   IN NUMBER,
66 				p_ABC_assignment_group_id   IN NUMBER, -- For ABC Compile Group
67 				p_abc_class_id              IN NUMBER, -- For Item Classification
68 				p_Order_Type_id             IN NUMBER,
69 				p_customer_class            IN VARCHAR2,
70 				p_customer_id               IN NUMBER,
71 				p_Carrier_id                IN NUMBER,
72 				p_Ship_Method_code          IN VARCHAR2,
73 				p_Scheduled_Ship_Date_To    IN NUMBER,
74 				p_Scheduled_Ship_Date_From  IN NUMBER,
75 				p_Forward_Pick_Sub          IN VARCHAR2,
76 				p_repl_UOM                  IN VARCHAR2,
77 				p_Repl_Lot_Size             IN NUMBER,
78 				p_Min_Order_lines_threshold IN NUMBER,
79 				p_Min_repl_qty_threshold    IN NUMBER,
80 				p_max_NUM_items_for_repl    IN NUMBER,
81 				p_Sort_Criteria             IN NUMBER,
82 				p_Release_Sequence_Rule_Id  IN NUMBER,
83         p_Create_Reservation        IN VARCHAR2,
84         p_Auto_Allocate             IN VARCHAR2,
85   			p_Plan_Tasks                IN VARCHAR2) IS
86 
87      x_msg_count number;
88      x_return_status VARCHAR2(1);
89      x_msg_data VARCHAR2(100);
90 
91 
92 BEGIN
93 
94 
95    wms_replenishment_pvt.PUSH_REPLENISHMENT(
96 					    p_repl_level=>1,
97 					    p_Item_id => p_Item_id,
98 					    p_organization_id => p_organization_id,
99 					    p_ABC_assignment_group_id => p_ABC_assignment_group_id,
100 					    p_abc_class_id => p_abc_class_id,
101 					    p_Order_Type_id => p_Order_Type_id,
102 					    p_Carrier_id => p_Carrier_id,
103 					    p_customer_class => p_customer_class,
104 					    p_customer_id => p_customer_id,
105 					    p_Ship_Method_code => p_Ship_Method_code,
106 					    p_Scheduled_Ship_Date_To => p_Scheduled_Ship_Date_To,
107 					    p_Scheduled_Ship_Date_From => p_Scheduled_Ship_Date_From,
108 					    p_Forward_Pick_Sub => p_Forward_Pick_Sub,
109 					    p_repl_UOM => p_repl_UOM,
110 					    p_Repl_Lot_Size => p_Repl_Lot_Size,
111 					    p_Release_Sequence_Rule_Id => p_Release_Sequence_Rule_Id,
112 					    p_Min_Order_lines_threshold => p_Min_Order_lines_threshold,
113 					    p_Min_repl_qty_threshold => p_Min_repl_qty_threshold,
114 					    p_max_NUM_items_for_repl => p_max_NUM_items_for_repl,
115 					    p_Sort_Criteria => p_Sort_Criteria,
116      p_Auto_Allocate =>p_auto_allocate,
117      p_Plan_Tasks =>p_Plan_Tasks,
118      p_Create_Reservation =>p_Create_Reservation,
119      x_return_status => x_return_status,
120      x_msg_count => x_msg_count,
121      x_msg_data => x_msg_data);
122 
123 
124    errbuf := x_msg_data;
125 
126  IF X_RETURN_status <> fnd_api.g_ret_sts_success THEN
127       -- Error
128       retcode := 2;
129     ELSE -- Success
130       retcode := 0;
131    END IF;
132 
133 END push_replenishment_cp;
134 
135 
136 
137 PROCEDURE PUSH_REPLENISHMENT(P_repl_level                IN NUMBER DEFAULT 1,
138 			     p_Item_id                   IN NUMBER,
139 			     p_organization_id           IN NUMBER,
140 			     p_ABC_assignment_group_id   IN NUMBER, -- For ABC Compile Group
141 			     p_abc_class_id              IN NUMBER, -- For Item Classification
142 			     p_Order_Type_id             IN NUMBER,
143 			     p_Carrier_id                IN NUMBER,
144 			     p_customer_class            IN VARCHAR2,
145 			     p_customer_id               IN NUMBER,
146 			     p_Ship_Method_code          IN VARCHAR2,
147 			     p_Scheduled_Ship_Date_To    IN NUMBER,
148 			     p_Scheduled_Ship_Date_From  IN NUMBER,
149 			     p_Forward_Pick_Sub          IN VARCHAR2,
150 			     p_repl_UOM                  IN VARCHAR2,
151 			     p_Repl_Lot_Size             IN NUMBER,
152 			     p_Min_Order_lines_threshold IN NUMBER,
153 			     p_Min_repl_qty_threshold    IN NUMBER,
154 			     p_max_NUM_items_for_repl    IN NUMBER,
155 			     p_Sort_Criteria             IN NUMBER,
156 			     p_Auto_Allocate             IN VARCHAR2,
157   p_Plan_Tasks                IN VARCHAR2,
158   p_Release_Sequence_Rule_Id  IN NUMBER,
159   p_Create_Reservation        IN VARCHAR2,
160   x_return_status             OUT NOCOPY VARCHAR2,
161   x_msg_count                 OUT NOCOPY NUMBER,
162   x_msg_data                  OUT NOCOPY
163    VARCHAR2) IS
164 
165 
166  BEGIN
167 
168     wms_replenishment_pvt.PUSH_REPLENISHMENT(
169 					    p_repl_level=>1,
170 					    p_Item_id => p_Item_id,
171 					    p_organization_id => p_organization_id,
172 					    p_ABC_assignment_group_id => p_ABC_assignment_group_id,
173 					    p_abc_class_id => p_abc_class_id,
174 					    p_Order_Type_id => p_Order_Type_id,
175 					    p_Carrier_id => p_Carrier_id,
176 					    p_customer_class => p_customer_class,
177 					    p_customer_id => p_customer_id,
178 					    p_Ship_Method_code => p_Ship_Method_code,
179 					    p_Scheduled_Ship_Date_To => p_Scheduled_Ship_Date_To,
180 					    p_Scheduled_Ship_Date_From => p_Scheduled_Ship_Date_From,
181 					    p_Forward_Pick_Sub => p_Forward_Pick_Sub,
182 					    p_repl_UOM => p_repl_UOM,
183 					    p_Repl_Lot_Size => p_Repl_Lot_Size,
184 					    p_Release_Sequence_Rule_Id => p_Release_Sequence_Rule_Id,
185 					    p_Min_Order_lines_threshold => p_Min_Order_lines_threshold,
186 					    p_Min_repl_qty_threshold => p_Min_repl_qty_threshold,
187 					    p_max_NUM_items_for_repl => p_max_NUM_items_for_repl,
188 					    p_Sort_Criteria => p_Sort_Criteria,
189      p_Auto_Allocate =>p_Auto_Allocate,
190      p_Plan_Tasks =>p_Plan_Tasks,
191      p_Create_Reservation =>p_Create_Reservation,
192      x_return_status => x_return_status,
193      x_msg_count => x_msg_count,
194      x_msg_data => x_msg_data);
195 
196  END push_replenishment;
197 
198  PROCEDURE UPDATE_DELIVERY_DETAIL (
199 				   p_delivery_detail_id IN NUMBER,
200 				   P_PRIMARY_QUANTITY IN NUMBER,
201 				   P_SPLIT_DELIVERY_DETAIL_ID IN NUMBER DEFAULT NULL,
202 				   p_split_source_line_id     IN NUMBER DEFAULT NULL,
203 				   x_return_status              OUT             NOCOPY VARCHAR2
204 				   ) IS
205 
206  BEGIN
207 
208 
209 
210     wms_replenishment_pvt.UPDATE_DELIVERY_DETAIL (
211 						  p_delivery_detail_id =>p_delivery_detail_id ,
212 						  P_PRIMARY_QUANTITY   =>P_PRIMARY_QUANTITY ,
213 						  P_SPLIT_DELIVERY_DETAIL_ID =>P_SPLIT_DELIVERY_DETAIL_ID ,
214 						  p_split_source_line_id  => p_split_source_line_id,
215 						  x_return_status         =>x_return_status
216 						  );
217 
218 
219 
220  END update_delivery_detail;
221 
222 
223  PROCEDURE allocate_repl_move_order_cp (errbuf                OUT NOCOPY VARCHAR2,
224 					retcode               OUT nocopy NUMBER,
225 					p_Quantity_function_id IN VARCHAR2)
226    IS
227 
228       x_msg_count number;
229       x_return_status VARCHAR2(1);
230       x_msg_data VARCHAR2(100);
231       L_quantity_function_id VARCHAR2(10);
232 
233  BEGIN
234     --Code added to bug 6885177
235     if p_Quantity_function_id = 'NULL' THEN
236 
237        L_Quantity_function_id := NULL;
238      ELSE
239         L_Quantity_function_id := p_Quantity_function_id ;
240 
241     end if;
242     -- code ended for Bug 6885177
243 
244     wms_replenishment_pvt.allocate_repl_move_order
245       (
246        p_Quantity_function_id => L_quantity_function_id,
247        x_return_status => x_return_status,
248        x_msg_count => x_msg_count,
249        x_msg_data => x_msg_data);
250 
251     errbuf := x_msg_data;
252     IF X_RETURN_status <> fnd_api.g_ret_sts_success THEN
253        -- Error
254        retcode := 2;
255      ELSE -- Success
256        retcode := 0;
257     END IF;
258 
259  END allocate_repl_move_order_cp;
260 
261 
262  END wms_replenishment_pub;