1 PACKAGE AHL_INV_RESERVATIONS_GRP AS
2 /* $Header: AHLGRSVS.pls 120.5 2005/06/30 11:52 anraj noship $ */
3 /*
4 * This Group package provides the apis that will get final availability of the document line
5 * for which the reservation is being created/modified and validate whether a supply or a demand line
6 * for which the reservation is being created/ modified is a valid document line
7 */
8
9 G_PKG_NAME CONSTANT VARCHAR2(30) := 'AHL_INV_RESERVATIONS_GRP';
10
11
12 /*
13 * The purpose of this API is to get the final availability of the document line for which the reservation is being
14 * created/modified. This procedure will be called by the inventory APIs to get the expected availability at the
15 * document level. The reason being that the actual ordered/receipt quantity on the document may not reflect the
16 * expected quantity that is pending. Reservation API needs to know the final availability so that the ATR (available
17 * to reserve) can be calculated.
18 *
19 * Parameters:
20 * p_organization_id Organization id of the document to be validated
21 * p_item_id Inventory item id of the document to be validated
22 * p_revision Revision of the item
23 * p_lot_number Lot number of the item
24 * p_subinventory_code Subinventory code
25 * p_locator_id Locator id of the subinventory if the subinventory is locator controlled
26 * p_supply_demand_code The action determines whether the calling API is querying for a supply or demand
27 * p_supply_demand_type_id This holds the demand type for which the availability is to be checked
28 * p_supply_demand_header_id This holds the header information of the demand document for which the availability is to be checked
29 * p_supply_demand_line_id This holds the line information of the demand document for which the availability is to be checked
30 * p_supply_demand_line_detail This holds the line information of the demand document for which the availability is to be checked
31 * p_lpn_id This is the lpn for the supply document for which the availability is going to be computed
32 * p_project_id This holds the project id for the demand document
33 * p_task_id This holds the task id for the demand document
34 * x_available_quantity Returns the final available quantity on the document line for which the reservation is being made
35 */
36 PROCEDURE get_available_supply_demand (
37 p_api_version_number IN NUMBER := 1.0
38 , p_init_msg_lst IN VARCHAR2 := fnd_api.g_false
39 , x_return_status OUT NOCOPY VARCHAR2
40 , x_msg_count OUT NOCOPY NUMBER
41 , x_msg_data OUT NOCOPY VARCHAR2
42 , p_organization_id IN NUMBER := null
43 , p_item_id IN NUMBER := null
44 , p_revision IN VARCHAR2 := null
45 , p_lot_number IN VARCHAR2 := null
46 , p_subinventory_code IN VARCHAR2 := null
47 , p_locator_id IN NUMBER := null
48 , p_supply_demand_code IN NUMBER
49 , p_supply_demand_type_id IN NUMBER
50 , p_supply_demand_header_id IN NUMBER
51 , p_supply_demand_line_id IN NUMBER
52 , p_supply_demand_line_detail IN NUMBER := fnd_api.g_miss_num
53 , p_lpn_id IN NUMBER := fnd_api.g_miss_num
54 , p_project_id IN NUMBER := null
55 , p_task_id IN NUMBER := null
56 , x_available_quantity OUT NOCOPY NUMBER
57 , x_source_uom_code OUT NOCOPY VARCHAR2
58 , x_source_primary_uom_code OUT NOCOPY VARCHAR2
59 );
60
61 /*
62 * The purpose of this API is to validate whether a supply or a demand line for which the reservation is being
63 * created/ modified is a valid document line. This procedure will be called by the inventory APIs to validate a
64 * supply or a demand document, if the supply/demand document line is non-inventory.
65 *
66 * Parameters:
67 * p_api_version_number Api Version Number,Standard API parameter
68 * p_init_msg_lst Initialize the message stack,Standard API parameter
69 * x_return_status Return status,Standard API parameter
70 * x_msg_count Return message count,Standard API parameter
71 * x_msg_data Return message data,Standard API parameter
72 * p_organization_id Organization id of the document to be validated
73 * p_item_id Inventory item id of the document to be validated
74 * p_supply_demand_code The action determines whether the calling API is querying for a supply or demand
75 * p_supply_demand_type_id This holds the demand type for which the availability is to be checked
76 * p_supply_demand_header_id This holds the header information of the demand document for which the availability is to be checked
77 * p_supply_demand_line_id This holds the line information of the demand document for which the availability is to be checked
78 * p_supply_demand_line_detail This holds the line information of the demand document for which the availability is to be checked
79 * p_demand_ship_date This is will be filled in for reservations that are crossdocked. For non-crossdocked reservations, this will be the need-by-date of the demand
80 * p_expected_receipt_date This is will be filled in for reservations that are crossdocked. For non-crossdocked reservations, this will be null.
81 * x_valid_status Returns whether the supply or demand document is valid or not
82 */
83 PROCEDURE validate_supply_demand (
84 p_api_version_number IN NUMBER := 1.0
85 , p_init_msg_lst IN VARCHAR2 := fnd_api.g_false
86 , x_return_status OUT NOCOPY VARCHAR2
87 , x_msg_count OUT NOCOPY NUMBER
88 , x_msg_data OUT NOCOPY VARCHAR2
89 , p_organization_id IN NUMBER
90 , p_item_id IN NUMBER
91 , p_supply_demand_code IN NUMBER
92 , p_supply_demand_type_id IN NUMBER
93 , p_supply_demand_header_id IN NUMBER
94 , p_supply_demand_line_id IN NUMBER
95 , p_supply_demand_line_detail IN NUMBER := fnd_api.g_miss_num
96 , p_demand_ship_date IN DATE
97 , p_expected_receipt_date IN DATE
98 , x_valid_status OUT NOCOPY VARCHAR2
99 );
100
101 END AHL_INV_RESERVATIONS_GRP;