DBA Data[Home] [Help]

PACKAGE: APPS.CTO_MATCH_AND_RESERVE

Source


1 package CTO_MATCH_AND_RESERVE as
2 /* $Header: CTOMCRSS.pls 120.1 2005/06/16 15:59:41 appldev  $ */
3 /*============================================================================+
4 |  Copyright (c) 1993 Oracle Corporation    Belmont, California, USA          |
5 |                        All rights reserved.                                 |
6 |                        Oracle Manufacturing                                 |
7 +=============================================================================+
8 |                                                                             |
9 | FILE NAME   : CTOMCRSS.pls                                                  |
10 | DESCRIPTION:                                                                |
11 |               This file creates a package that containst procedures called  |
12 |               from the Match and Reserve menu from Order Entry's Enter      |
13 |               Orders form.                                                  |
14 |                                                                             |
15 |               match_inquiry -                                               |
16 |               This function is called when the Match and Reserve            |
17 |               menu is  invoked.  It does the following:                     |
18 |               1.  Checks if the order line is eligible to be matched        |
19 |                   and reserved.                                             |
20 |               2.  If it is, it determines if the order line is already      |
21 |                   linked to a configuration item.  If it is, it uses that   |
22 |                   config item in the available quantity inquiry.  If it     |
23 |                   does not, it attempts to match the configuration from     |
24 |                   oe_order_lines against bom_ato_configurations.            |
25 |                3.  If a configuration item exists, it calls Inventory's     |
26 |                   API to query available quantity (on-hand and available    |
27 |                   to reserve).  If it has any quantity available to reserve |
28 |                   it returns true.                                          |
29 |                                                                             |
30 |                                                                             |
31 | To Do:        Handle Errors.  Need to discuss with Usha and Girish what     |
32 |               error information to include in Notification.                 |
33 |                                                                             |
34 | HISTORY     :                                                               |
35 |               May 10, 99  Angela Makalintal   Initial version		          |
36 =============================================================================*/
37 
38 /*****************************************************************************
39    Function:  match_inquiry
40    Parameters:  p_model_line_id   - line id of the top model in oe_order_lines
41                 x_match_config_id - config id of the matching configuration
42                                   from bom_ato_configurations
43                 x_error_message   - error message if match function fails
44                 x_message_name    - name of error message if match
45                                     function fails
46 
47    Description:  This function looks for a configuration in
48                  bom_ato_configurations that matches the ordered
49                  configuration in oe_order_lines.
50 
51 *****************************************************************************/
52 function match_inquiry(
53 	p_model_line_id         in  number,
54         p_automatic_reservation in  boolean,
55         p_quantity_to_reserve   in  number,
56         p_reservation_uom_code  in  varchar2,
57 	x_config_id             out nocopy number,
58         x_available_qty         out nocopy number,
59         x_quantity_reserved     out nocopy number,
60         x_error_message         out nocopy varchar2,
61         x_message_name          out nocopy varchar2
62 )
63 RETURN boolean;
64 
65 function create_config_reservation(
66 	p_model_line_id        IN NUMBER,
67 	p_config_item_id       IN NUMBER,
68 	p_quantity_to_reserve  IN NUMBER,
69         p_reservation_uom_code IN VARCHAR2,
70         x_quantity_reserved    OUT nocopy NUMBER,
71 	x_error_msg            OUT nocopy VARCHAR2,
72 	x_error_msg_name       OUT nocopy VARCHAR2
73     )
74 return boolean;
75 
76 function config_line_exists(p_model_line_id IN NUMBER,
77                             x_config_line_id OUT nocopy NUMBER,
78                             x_config_item_id OUT nocopy NUMBER)
79 return boolean;
80 
81 end CTO_MATCH_AND_RESERVE;