1 PACKAGE user_pkg_lot AUTHID CURRENT_USER AS
2 /* $Header: INVUDLGS.pls 120.4 2011/09/19 12:35:17 kbavadek ship $ */
3 /*#
4 * The user defined lot generation procedures allow a user to create a lot
5 * in the system using the lot number generation logic defined by a user (and not by Oracle).
6 * @rep:scope public
7 * @rep:product INV
8 * @rep:lifecycle active
9 * @rep:displayname User Defined Lot Generation API
10 * @rep:category BUSINESS_ENTITY INV_LOT
11 */
12 /*#
13 * Use this procedure to define the logic to be used by the system
14 * when generating the lot numbers. This procedure is invoked by the
15 * system while generating a new lot number, if the lot generation
16 * level is set as "User Defined" for a particular organization.
17 * The user needs to fill in the logic for generating lot number in
18 * the stub provided and apply the package to the database.
19 * @ param p_org_id Organization Id is passed as input in this variable
20 * @ paraminfo {@rep:required}
21 * @ param p_inventory_item_id Inventory Item Id is passed as input in this variable
22 * @ paraminfo {@rep:required}
23 * @ param p_transaction_date Transaction Date is passed as input in this variable
24 * @ paraminfo {@rep:required}
25 * @ param p_revision Revision of the item is passed as input in this variable
26 * @ paraminfo {@rep:required}
27 * @ param p_subinventory_code Subinventory Code where the lot number will reside is passed as input in this variable
28 * @ paraminfo {@rep:required}
29 * @ param p_locator_id Locator Id is passed as input in this variable
30 * @ paraminfo {@rep:required}
31 * @ param p_transaction_Type_id Transaction Type Id is passed as input in this variable
32 * @ paraminfo {@rep:required}
33 * @ param p_transaction_Action_id Transaction Action Id is passed as input in this variable
34 * @ paraminfo {@rep:required}
35 * @ param p_transaction_source_type_id Transaction Source Type is passed as input in this variable
36 * @ paraminfo {@rep:required}
37 * @ param p_transaction_source_id Transaction Source ID is passed as input in this variable
38 * @ paraminfo {@rep:required}
39 * @ param p_transaction_source_line_id Transaction Source Line ID is passed as input in this variable
40 * @ paraminfo {@rep:required}
41 * @ param p_lot_number Lot number to be generated is passed as input in this variable
42 * @ paraminfo {@rep:required}
43 * @ param x_return_status Return status indicating success or failure.
44 * @ paraminfo {@rep:required}
45 * @return The new Lot Number generated.
46 * @rep:scope public
47 * @rep:lifecycle active
48 * @rep:displayname Generate User Defined Lot Number
49 */
50 -- OPM Convergence - added parent_lot_number
51 -- Fix for Bug#12925054. Added p_transaction_source_id and p_transaction_source_line_id
52 -- so that batch or wip job information can be included
53
54 FUNCTION generate_lot_number(p_org_id IN NUMBER,
55 p_inventory_item_id IN NUMBER,
56 p_transaction_date IN DATE,
57 p_revision IN VARCHAR2,
58 p_subinventory_code IN VARCHAR2,
59 p_locator_id IN NUMBER,
60 p_transaction_type_id IN NUMBER,
61 p_transaction_action_id IN NUMBER,
62 p_transaction_source_type_id IN NUMBER,
63 p_transaction_source_id IN NUMBER,
64 p_transaction_source_line_id IN NUMBER,
65 p_lot_number IN VARCHAR2,
66 p_parent_lot_number IN VARCHAR2,
67 x_return_status OUT NOCOPY VARCHAR2)
68 RETURN VARCHAR2;
69
70 /* Bug6836808
71 * Use this Function To Allow or Disallow
72 * Creation of New Lots Depending on some user logic,
73 * The user can write his own piece of code for the function
74 * to return TRUE or FALSE.
75 */
76
77 FUNCTION Allow_New_Lots( p_transaction_type_id IN NUMBER
78 )
79 RETURN BOOLEAN;
80
81 /*
82 * Hook for custom logic to allocate expired lots.
83 * Customers can then write their own logic to derive use_expired lots.
84 * By default, this value is returned as FALSE.
85 */
86
87 FUNCTION use_expired_lots( p_organization_id IN NUMBER
88 , p_inventory_item_id IN NUMBER
89 , p_demand_source_type_id IN NUMBER
90 , p_demand_source_line_id IN NUMBER
91 )
92 RETURN BOOLEAN;
93
94 END user_pkg_lot;
95
96