DBA Data[Home] [Help]

PACKAGE BODY: APPS.RCV_SETUP_S

Source


1 PACKAGE BODY RCV_SETUP_S AS
2 /* $Header: RCVSTS1B.pls 115.1 2002/11/23 01:00:02 sbull ship $*/
3 
4 /*===========================================================================
5 
6    FUNCTION NAME:	get_override_routing()
7 
8 ===========================================================================*/
9 FUNCTION get_override_routing  RETURN VARCHAR2 IS
10 
11 /*
12 ** Function will return Override Routing Option
13 ** If Override Routing Option is NULL then
14 **   Default the Option to 'N'
15 ** Function will be referencing a 'FND_PROFILE.GET' procedure defined
16 ** by AOL grp . It will return the value of the PROFILE being asked for,
17 ** or will return NULL value.
18 */
19 
20 x_progress VARCHAR2(3) := '';
21 option_value VARCHAR2(1);
22 
23 BEGIN
24    x_progress := '010';
25 
26    option_value := fnd_profile.value('OVERRIDE_ROUTING');
27 
28    if option_value is null then
29      option_value := 'N';
30    end if;
31 
32    RETURN(option_value);
33 
34    EXCEPTION
35    WHEN OTHERS THEN
36       po_message_s.sql_error('get_override_routing', x_progress,sqlcode);
37    RAISE;
38 
39 END get_override_routing;
40 /*===========================================================================
41 
42   FUNCTION NAME:	get_trx_proc_mode()
43 
44 ===========================================================================*/
45 FUNCTION get_trx_proc_mode RETURN VARCHAR2 IS
46 
47 /*
48 ** Function will return Receiving's Transaction Processor Mode (RCV_TP_MODE)
49 ** If Transaction Processor Mode is NULL then
50 **   Default the Mode to 'ONLINE'
51 ** Function will be referencing a 'FND_PROFILE.GET' procedure defined
52 ** by AOL grp . It will return the value of the PROFILE being asked for,
53 ** or will return NULL value.
54 */
55 
56 x_progress VARCHAR2(3) := '';
57 transaction_processor_value VARCHAR2(10);
58 
59 BEGIN
60 
61    x_progress := '010';
62 
63    fnd_profile.get('RCV_TP_MODE',transaction_processor_value);
64 
65    if transaction_processor_value is null then
66       transaction_processor_value := 'ONLINE';
67    end if;
68 
69    RETURN(transaction_processor_value);
70 
71    EXCEPTION
72    WHEN OTHERS THEN
73       po_message_s.sql_error('get_trx_proc_mode', x_progress,sqlcode);
74    RAISE;
75 
76 END get_trx_proc_mode;
77 /*===========================================================================
78 
79   FUNCTION NAME:	get_print_traveller()
80 
81 ===========================================================================*/
82 FUNCTION get_print_traveller RETURN VARCHAR2 IS
83 
84 /*
85 ** Function will return Print Traveller Option
86 ** If Print Traveller Option is NULL then
87 **   Default the Option to 'N'
88 ** Function will be referencing a 'FND_PROFILE.GET' procedure defined
89 ** by AOL grp . It will return the value of the PROFILE being asked for,
90 ** or will return NULL value.
91 */
92 
93 x_progress VARCHAR2(3) := '';
94 option_value VARCHAR2(1);
95 
96 BEGIN
97 
98    x_progress := '010';
99 
100    fnd_profile.get('PRINT_TRAVELLER',option_value);
101 
102    if option_value is null then
103      option_value := 'N';
104    end if;
105 
106    RETURN(option_value);
107 
108    EXCEPTION
109    WHEN OTHERS THEN
110       po_message_s.sql_error('get_print_traveller', x_progress,sqlcode);
111    RAISE;
112 
113 END get_print_traveller;
114 /*===========================================================================
115 
116   PROCEDURE NAME:	get_org_locator_control()
117 
118 ===========================================================================*/
119 PROCEDURE get_org_locator_control(x_org_id           IN NUMBER,
120                                   x_locator_cc      OUT NOCOPY NUMBER,
121                                   x_negative_inv_rc OUT NOCOPY NUMBER) IS
122 
123 /*
124 ** Procedure will return negative_inventory_receipt_code,
125 ** Locator Control for the org
126 */
127 
128 x_progress      VARCHAR2(3) := '';
129 
130 BEGIN
131 
132    x_progress := '010';
133 
134    select stock_locator_control_code,
135           negative_inv_receipt_code
136    into   x_locator_cc,
137           x_negative_inv_rc
138    FROM   mtl_parameters
139    WHERE  organization_id = x_org_id;
140 
141 
142    EXCEPTION
143    WHEN NO_DATA_FOUND then
144      null;
145 
146    WHEN OTHERS THEN
147       po_message_s.sql_error('get_org_locator_control', x_progress,sqlcode);
148    RAISE;
149 
150 END get_org_locator_control;
151 
152 /*===========================================================================
153 
154    PROCEDURE NAME:	get_receipt_number_info()
155 
156 ===========================================================================*/
157 PROCEDURE get_receipt_number_info(
158 				x_user_defined_rcpt_num_code OUT NOCOPY VARCHAR2,
159                                 x_manual_rcpt_num_type       OUT NOCOPY VARCHAR2,
160                                 x_manual_po_num_type         OUT NOCOPY VARCHAR2) IS
161 
162 /*
163 **  Procedure gets the user defined receipt number code, manual receipt and
164 **  purchase order number types from po_system parameters.
165 */
166 
167 x_progress 			VARCHAR2(3) 	:= '';
168 x_currency_code                 VARCHAR2(30);
169 x_coa_id                        NUMBER;
170 x_po_encumberance_flag          VARCHAR2(1);
171 x_req_encumberance_flag         VARCHAR2(1);
172 x_sob_id                        NUMBER;
173 x_ship_to_location_id           NUMBER;
174 x_bill_to_location_id           NUMBER;
175 x_fob_lookup_code               VARCHAR2(30);
176 x_freight_terms_lookup_code     VARCHAR2(30);
177 x_terms_id                      NUMBER;
178 x_default_rate_type             VARCHAR2(30);
179 x_taxable_flag                  VARCHAR2(30);
180 x_receiving_flag                VARCHAR2(30);
181 x_enforce_buyer_name_flag       VARCHAR2(1);
182 x_enforce_buyer_auth_flag       VARCHAR2(1);
183 x_line_type_id                  NUMBER;
184 x_po_num_code                   VARCHAR2(30);
185 x_price_lookup_code             VARCHAR2(30);
186 x_invoice_close_tolerance       NUMBER;
187 x_receive_close_tolerance       NUMBER;
188 x_security_structure_id         NUMBER;
189 x_expense_accrual_code          VARCHAR2(30);
190 x_inv_org_id                    NUMBER;
191 x_rev_sort_ordering             NUMBER;
192 x_min_rel_amount                NUMBER;
193 x_notify_blanket_flag           VARCHAR2(1);
194 x_budgetary_control_flag        VARCHAR2(1);
195 x_user_defined_req_num_code     VARCHAR2(30);
196 x_rfq_required_flag             VARCHAR2(1);
197 x_manual_req_num_type           VARCHAR2(30);
198 x_enforce_full_lot_qty          VARCHAR2(30);
199 x_disposition_warning_flag      VARCHAR2(1);
200 x_reserve_at_completion_flag    VARCHAR2(1);
201 x_use_positions_flag            VARCHAR2(1);
202 x_default_quote_warning_delay   NUMBER;
203 x_inspection_required_flag      VARCHAR2(1);
204 x_user_defined_quote_num_code   VARCHAR2(30);
205 x_manual_quote_num_type         VARCHAR2(30);
206 x_user_defined_rfq_num_code     VARCHAR2(30);
207 x_manual_rfq_num_type           VARCHAR2(30);
208 x_ship_via_lookup_code          VARCHAR2(30);
209 x_qty_rcv_tolerance             NUMBER;
210 
211 BEGIN
212 
213    x_progress := '010';
214 
215    PO_CORE_S.get_po_parameters(
216 		     x_currency_code,
217                      x_coa_id      ,
218                      x_po_encumberance_flag,
219                      x_req_encumberance_flag,
220                      x_sob_id ,
221                      x_ship_to_location_id ,
222                      x_bill_to_location_id ,
223                      x_fob_lookup_code          ,
224                      x_freight_terms_lookup_code ,
225                      x_terms_id           ,
226                      x_default_rate_type  ,
227                      x_taxable_flag      ,
228                      x_receiving_flag   ,
229                      x_enforce_buyer_name_flag ,
230                      x_enforce_buyer_auth_flag ,
231                      x_line_type_id        ,
232                      x_manual_po_num_type ,
233                      x_po_num_code       ,
234                      x_price_lookup_code  ,
235                      x_invoice_close_tolerance ,
236                      x_receive_close_tolerance ,
237                      x_security_structure_id ,
238                      x_expense_accrual_code ,
239                      x_inv_org_id       ,
240                      x_rev_sort_ordering ,
241                      x_min_rel_amount   ,
242                      x_notify_blanket_flag ,
243                      x_budgetary_control_flag,
244                      x_user_defined_req_num_code,
245                      x_rfq_required_flag,
246                      x_manual_req_num_type,
247                      x_enforce_full_lot_qty,
248                      x_disposition_warning_flag,
249                      x_reserve_at_completion_flag,
250                      x_user_defined_rcpt_num_code,
251                      x_manual_rcpt_num_type ,
252                      x_use_positions_flag,
253                      x_default_quote_warning_delay,
254                      x_inspection_required_flag  ,
255                      x_user_defined_quote_num_code,
256                      x_manual_quote_num_type     ,
257                      x_user_defined_rfq_num_code,
258                      x_manual_rfq_num_type     ,
259                      x_ship_via_lookup_code   ,
260                      x_qty_rcv_tolerance     );
261 
262    EXCEPTION
263    WHEN OTHERS THEN
264       po_message_s.sql_error('get_receipt_number_info', x_progress,sqlcode);
265    RAISE;
266 
267 END get_receipt_number_info;
268 /*===========================================================================
269 
270   FUNCTION NAME : get_chart_of_accounts
271 
272   DESCRIPTION   :
273 
274   CLIENT/SERVER : SERVER
275 
276   LIBRARY NAME  :
277 
278   OWNER         : SUBHAJIT PURKAYASTHA
279 
280   PARAMETERS    :
281 
282   ALGORITHM     : Retreive chart of accounts id from
283                   financials_system_parameters and gl_sets_of_books table
284 
285   NOTES         :
286 
287 ===========================================================================*/
288 FUNCTION get_chart_of_accounts RETURN NUMBER is
289   x_progress                      VARCHAR2(3) := NULL;
290   x_currency_code                 VARCHAR2(30);
291   x_coa_id                        NUMBER;
292   x_po_encumberance_flag          VARCHAR2(1);
293   x_req_encumberance_flag         VARCHAR2(1);
294   x_sob_id                        NUMBER;
295   x_ship_to_location_id           NUMBER;
296   x_bill_to_location_id           NUMBER;
297   x_fob_lookup_code               VARCHAR2(30);
298   x_freight_terms_lookup_code     VARCHAR2(30);
299   x_terms_id                      NUMBER;
300   x_default_rate_type             VARCHAR2(30);
301   x_taxable_flag                  VARCHAR2(30);
302   x_receiving_flag                VARCHAR2(30);
303   x_enforce_buyer_name_flag       VARCHAR2(1);
304   x_enforce_buyer_auth_flag       VARCHAR2(1);
305   x_line_type_id                  NUMBER;
306   x_manual_po_num_type            VARCHAR2(30);
307   x_po_num_code                   VARCHAR2(30);
308   x_price_lookup_code             VARCHAR2(30);
309   x_invoice_close_tolerance       NUMBER;
310   x_receive_close_tolerance       NUMBER;
311   x_security_structure_id         NUMBER;
312   x_expense_accrual_code          VARCHAR2(30);
313   x_inv_org_id                    NUMBER;
314   x_rev_sort_ordering             NUMBER;
315   x_min_rel_amount                NUMBER;
316   x_notify_blanket_flag           VARCHAR2(1);
317   x_budgetary_control_flag        VARCHAR2(1);
318   x_user_defined_req_num_code     VARCHAR2(30);
319   x_rfq_required_flag             VARCHAR2(1);
320   x_manual_req_num_type           VARCHAR2(30);
321   x_enforce_full_lot_qty          VARCHAR2(30);
322   x_disposition_warning_flag      VARCHAR2(1);
323   x_reserve_at_completion_flag    VARCHAR2(1);
324   x_user_defined_rcpt_num_code    VARCHAR2(30);
325   x_manual_rcpt_num_type          VARCHAR2(30);
326   x_use_positions_flag            VARCHAR2(1);
327   x_default_quote_warning_delay   NUMBER;
328   x_inspection_required_flag      VARCHAR2(1);
329   x_user_defined_quote_num_code   VARCHAR2(30);
330   x_manual_quote_num_type         VARCHAR2(30);
331   x_user_defined_rfq_num_code     VARCHAR2(30);
332   x_manual_rfq_num_type           VARCHAR2(30);
333   x_ship_via_lookup_code          VARCHAR2(30);
334   x_qty_rcv_tolerance             NUMBER;
335 
336 begin
337   x_progress := 10;
338 
339   PO_CORE_S.get_po_parameters( x_currency_code,
340                                x_coa_id      ,
341                                x_po_encumberance_flag,
342                                x_req_encumberance_flag,
343                                x_sob_id ,
344                                x_ship_to_location_id ,
345                                x_bill_to_location_id ,
346                                x_fob_lookup_code          ,
347                                x_freight_terms_lookup_code ,
348                                x_terms_id            ,
349                                x_default_rate_type  ,
350                                x_taxable_flag      ,
351                                x_receiving_flag   ,
352                                x_enforce_buyer_name_flag ,
353                                x_enforce_buyer_auth_flag ,
354                                x_line_type_id        ,
355                                x_manual_po_num_type ,
356                                x_po_num_code       ,
357                                x_price_lookup_code  ,
358                                x_invoice_close_tolerance ,
359                                x_receive_close_tolerance ,
360                                x_security_structure_id ,
361                                x_expense_accrual_code ,
362                                x_inv_org_id       ,
363                                x_rev_sort_ordering ,
364                                x_min_rel_amount   ,
365                                x_notify_blanket_flag ,
366                                x_budgetary_control_flag,
367                                x_user_defined_req_num_code,
368                                x_rfq_required_flag,
369                                x_manual_req_num_type,
370                                x_enforce_full_lot_qty,
371                                x_disposition_warning_flag,
372                                x_reserve_at_completion_flag,
373                                x_user_defined_rcpt_num_code,
374                                x_manual_rcpt_num_type ,
375                                x_use_positions_flag,
376                                x_default_quote_warning_delay,
377                                x_inspection_required_flag  ,
378                                x_user_defined_quote_num_code,
379                                x_manual_quote_num_type     ,
380                                x_user_defined_rfq_num_code,
381                                x_manual_rfq_num_type     ,
382                                x_ship_via_lookup_code   ,
383                                x_qty_rcv_tolerance     );
384 
385   RETURN(x_coa_id);
386 
387   EXCEPTION
388   WHEN OTHERS THEN
389     po_message_s.sql_error('get_chart_of_accounts', x_progress,sqlcode);
390     RAISE;
391 
392 end get_chart_of_accounts;
393 
394 END RCV_SETUP_S;