1 PACKAGE BODY FLM_KANBAN_CUSTOM_PKG AS
2 /* $Header: flmkacpb.pls 120.3 2011/06/09 23:04:46 sunarang noship $ */
3
4
5 FUNCTION status_change_hook(kanban_card_id IN NUMBER,
6 from_supply_status IN NUMBER,
7 to_supply_status IN NUMBER)
8 RETURN NUMBER
9 IS
10 l_valid_status NUMBER := 1; /* 1 = Valid, other Values = Invalid. */
11 BEGIN
12 /* Add Custom Code here */
13
14 return l_valid_status;
15 EXCEPTION
16 WHEN OTHERS THEN
17 return 0;
18 END status_change_hook;
19
20 FUNCTION custom_kanban_number(p_pull_sequence_id IN NUMBER)
21 RETURN VARCHAR2
22 IS
23 l_card_number varchar2(200) := null;
24
25 Begin
26 /* Add Custom Code here */
27
28 return l_card_number;
29 EXCEPTION
30 WHEN OTHERS THEN
31 return null;
32 End custom_kanban_number;
33
34 Procedure cancel_kanban_card_hook(p_kanban_card_id IN NUMBER)
35 IS
36 Begin
37 /* Add Custom Code here */
38 null;
39 EXCEPTION
40 WHEN OTHERS THEN
41 null;
42 End cancel_kanban_card_hook;
43
44 PROCEDURE GET_DEFAULT_SUPPLIER (p_pull_seq_id IN NUMBER,
45 x_supplier_id OUT NOCOPY NUMBER,
46 x_suppier_site_id OUT NOCOPY NUMBER,
47 x_retcode OUT NOCOPY VARCHAR2,
48 x_err_msg OUT NOCOPY VARCHAR2)
49 IS
50
51 BEGIN
52 /*Replace this with custom logic to derive the supplier and site */
53 NULL;
54
55 END GET_DEFAULT_SUPPLIER;
56
57 -- PROCEDURE INTRAORG_TRANSFER_HOOK
58 -- This procedure called from FLM_KANBAN_TRANSFER.COMPLETE_INTRA_TRANSFER API
59
60 PROCEDURE INTRAORG_TRANSFER_HOOK(p_kanban_card_id IN NUMBER
61 ,p_intra_order_id IN NUMBER
62 ,p_intra_line_id IN NUMBER
63 ,p_transfer_qty IN NUMBER
64 ,p_kanban_size IN NUMBER
65 ,x_retcode OUT NOCOPY VARCHAR2
66 ,x_errmsg OUT NOCOPY VARCHAR2
67 )
68 IS
69 BEGIN
70 /* Add Custom Code here */
71 x_retcode := FND_API.G_RET_STS_SUCCESS;
72 END INTRAORG_TRANSFER_HOOK;
73
74
75 -- PROCEDURE INTERORG_TRANSFER_HOOK
76 -- This procedure called from FLM_KANBAN_TRANSFER.COMPLETE_INTER_TRANSFER API
77
78 PROCEDURE INTERORG_TRANSFER_HOOK(p_kanban_card_id IN NUMBER
79 ,p_inter_order_id IN NUMBER
80 ,p_inter_line_id IN NUMBER
81 ,p_transfer_qty IN NUMBER
82 ,p_kanban_size IN NUMBER
83 ,x_retcode OUT NOCOPY VARCHAR2
84 ,x_errmsg OUT NOCOPY VARCHAR2
85 )
86 IS
87 BEGIN
88 /* Add Custom Code here */
89 x_retcode := FND_API.G_RET_STS_SUCCESS;
90 END INTERORG_TRANSFER_HOOK;
91
92
93 -- This procedure called from FLM_RECEIPT_PUB.receive_supplier
94 PROCEDURE receive_supplier_hook
95 ( p_kanban_card_id IN NUMBER,
96 p_po_header_id IN NUMBER,
97 p_po_distribution_id IN NUMBER,
98 p_receipt_quantity IN NUMBER,
99 x_return_status OUT NOCOPY VARCHAR2,
100 x_msg_data OUT NOCOPY VARCHAR2
101 )
102 IS
103 BEGIN
104 /* Add Custom Code here */
105 x_return_status := FND_API.G_RET_STS_SUCCESS;
106 END receive_supplier_hook;
107
108 -- This procedure called from FLM_RECEIPT_PUB.receive_interorg
109 PROCEDURE receive_interorg_hook
110 ( p_kanban_card_id IN NUMBER,
111 p_shipment_header_id IN NUMBER,
112 p_shipment_line_id IN NUMBER,
113 p_receipt_quantity IN NUMBER,
114 x_return_status OUT NOCOPY VARCHAR2,
115 x_msg_data OUT NOCOPY VARCHAR2
116 )
117 IS
118 BEGIN
119 /* Add Custom Code here */
120 x_return_status := FND_API.G_RET_STS_SUCCESS;
121 END receive_interorg_hook;
122
123
124 procedure health_for_ps(
125 p_pull_sequence_id IN NUMBER
126 ,x_return_status OUT NOCOPY VARCHAR2
127 ,x_error_code OUT NOCOPY VARCHAR2
128 ,x_good_health OUT NOCOPY NUMBER
129 ,x_bad_health OUT NOCOPY NUMBER
130 ) is
131
132
133 Begin
134
135 /* Add the custom code to derive the x_good_health and x_bad_health for a Pull Sequence. */
136
137 -- dbms_output.put_line('Pull Sequence id : '||p_pull_sequence_id);
138 -- dbms_output.put_line('Good Health is : '||x_good_health);
139 -- dbms_output.put_line('Bad Health is : '||x_bad_health);
140 null;
141
142 end;
143
144
145
146 PROCEDURE UNMOVED_CARDS_HOOK(
147 p_org_id IN NUMBER
148 ,p_pull_sequence_id IN NUMBER
149 ,x_return_status OUT NOCOPY VARCHAR2
150 ,x_error_code OUT NOCOPY VARCHAR2
151 ,x_pull_sequence_id IN OUT NOCOPY NUMBER
152 ,x_uc_from_custom IN OUT NOCOPY flm_custom_uc_table
153 ,x_uc_setup_from_custom IN OUT NOCOPY flm_custom_uc_setup_table
154 ) is
155
156 Begin
157
158 /* Add logic here to populate one of these 2 collections with required data. */
159 /*
160 x_uc_from_custom - This collection contains these elements
161 kanban_card_id : Kanban card id for this pull_sequence.
162 unmoved_flag : 1 to mark this card as unmoved and null to mark this card as moved.
163 last_activity_date : Date last activity happened in this status.
164
165 x_uc_setup_from_custom - This collections contains following elements
166 status : supply status of the card for which user wants to track the unmoved cards for this pull_sequence
167 leadtime_days : No. of leadtime days, after which customer expects this card to be in unmoved status.
168 */
169
170 /*
171 This is an example code of how to populate data for collection x_uc_from_custom
172
173
174
175 if p_pull_sequence_id = 2817 then
176 x_uc_from_custom := flm_kanban_custom_pkg.flm_custom_uc_table();
177 x_uc_from_custom.Extend;
178
179 for i in x_uc_from_custom.first..x_uc_from_custom.last loop
180
181 x_uc_from_custom(x_uc_from_custom.last).kanban_card_id := 1376;
182 x_uc_from_custom(x_uc_from_custom.last).unmoved_flag := 1;
183 x_uc_from_custom(x_uc_from_custom.last).last_activity_date := sysdate -1;
184 x_uc_from_custom.Extend;
185
186 end loop;
187
188 end if;
189
190 */
191 null;
192
193 /*
194 This is an example code of how to populate data for collection x_uc_setup_from_custom
195
196
197 if p_pull_sequence_id = 2817 then
198 x_uc_setup_from_custom := flm_kanban_custom_pkg.flm_custom_uc_setup_table();
199 x_uc_setup_from_custom.Extend;
200
201 for i in x_uc_setup_from_custom.first..x_uc_setup_from_custom.last loop
202 x_uc_setup_from_custom(x_uc_setup_from_custom.last).status := 1;
203 x_uc_setup_from_custom(x_uc_setup_from_custom.last).leadtime_days := 2;
204 x_uc_setup_from_custom.Extend;
205 end loop;
206
207
208 x_pull_sequence_id := p_pull_sequence_id;
209 end if;
210 */
211
212
213 end;
214
215
216
217
218
219 END FLM_KANBAN_CUSTOM_PKG;