1 PACKAGE csd_receive_util AS
2 /* $Header: csdvruts.pls 120.2.12020000.2 2013/04/03 07:01:28 subhat ship $ */
3
4 /*----------------------------------------------------*/
5 /* Record name: RCV_REC_TYPE */
6 /* description : Record used for interfacing the */
7 /* receiving API. This reocrd is used */
8 /* to pass information to the receiving */
9 /* API to populate the interface tables */
10 /*----------------------------------------------------*/
11 TYPE rcv_rec_type IS RECORD (
12 customer_id NUMBER, -- value for this can not be G_MISS_NUM should be valid
13 -- customer id or null
14 customer_site_id NUMBER, -- value for this can not be G_MISS_NUM should be valid
15 -- customer site id or null
16 employee_id NUMBER,
17 quantity NUMBER,
18 uom_code VARCHAR2 (3),
19 unit_of_measure VARCHAR2 (25),
20 inventory_item_id NUMBER,
21 item_revision VARCHAR2 (3),
22 to_organization_id NUMBER,
23 destination_type_code VARCHAR2 (25),
24 subinventory VARCHAR2 (30),
25 locator_id NUMBER,
26 deliver_to_location_id NUMBER,
27 requisition_number NUMBER,
28 requisition_line_id NUMBER,
29 order_header_id NUMBER,
30 order_line_id NUMBER,
31 order_number VARCHAR2 (30),
32 doc_number VARCHAR2 (30),
33 internal_order_flag VARCHAR2 (1),
34 from_organization_id NUMBER,
35 expected_receipt_date DATE,
36 transaction_date DATE,
37 ship_to_location_id NUMBER,
38 serial_number VARCHAR2 (30),
39 lot_number VARCHAR2 (80), -- fix for bug#4625226
40 category_id NUMBER,
41 routing_header_id NUMBER,
42 primary_unit_of_measure VARCHAR2(25),
43 lot_control_code NUMBER,
44 serial_control_code NUMBER,
45 currency_code VARCHAR2 (3),
46 -- Added for internal orders
47 shipped_date date,
48 shipment_number VARCHAR2(30),
49 shipment_header_id NUMBER,
50 shipment_line_id NUMBER,
51 ATTRIBUTE_CATEGORY VARCHAR2(30),
52 ATTRIBUTE1 VARCHAR2(150),
53 ATTRIBUTE2 VARCHAR2(150),
54 ATTRIBUTE3 VARCHAR2(150),
55 ATTRIBUTE4 VARCHAR2(150),
56 ATTRIBUTE5 VARCHAR2(150),
57 ATTRIBUTE6 VARCHAR2(150),
58 ATTRIBUTE7 VARCHAR2(150),
59 ATTRIBUTE8 VARCHAR2(150),
60 ATTRIBUTE9 VARCHAR2(150),
61 ATTRIBUTE10 VARCHAR2(150),
62 ATTRIBUTE11 VARCHAR2(150),
63 ATTRIBUTE12 VARCHAR2(150),
64 ATTRIBUTE13 VARCHAR2(150),
65 ATTRIBUTE14 VARCHAR2(150),
66 ATTRIBUTE15 VARCHAR2(150)
67 );
68
69 TYPE rcv_tbl_type IS TABLE OF rcv_rec_type
70 INDEX BY BINARY_INTEGER;
71
72 /*----------------------------------------------------*/
73 /* Record name : RCV_ERROR_MSG_REC */
74 /* description : Record used to capture the error */
75 /* messages for a order header and line */
76 /*----------------------------------------------------*/
77 TYPE rcv_error_msg_rec IS RECORD
78 (
79 group_id NUMBER,
80 header_interface_id NUMBER,
81 interface_transaction_id NUMBER,
82 order_header_id NUMBER,
83 order_line_id NUMBER,
84 column_name VARCHAR2(30),
85 error_message VARCHAR2(2000)
86 );
87
88 TYPE rcv_error_msg_tbl IS TABLE OF rcv_error_msg_rec
89 INDEX BY BINARY_INTEGER;
90
91 /*--------------------------------------------------------------------------------------*/
92 /* function name: is_auto_rcv_available */
93 /* description : This function will check if the item is eligible for auto receive */
94 /* */
95 /* Called from : This is called from the LOGISTICS UI and also the */
96 /* CSD_RECEIVE_PVT.RECEIVE_ITEM API. */
97 /* Input Parm : p_inventory_item_id NUMBER inventory item id */
98 /* p_inv_org_id NUMBER org id of the receiving */
99 /* sub inventory */
100 /* p_internal_ro_flag VARCHAR2 indicates if the repair */
101 /* order is internal */
102 /* p_from_inv_org_id NUMBER org id from which the */
103 /* transfer is made in the */
104 /* case if internal orders */
105 /* returns Routing header id. NUMBER */
106 /*------------------------------------------------------------------------------------*/
107
108
109 FUNCTION is_auto_rcv_available (
110 p_inventory_item_id IN NUMBER,
111 p_inv_org_id IN NUMBER,
112 p_internal_ro_flag IN VARCHAR2,
113 p_from_inv_org_id IN NUMBER
114 )
115 RETURN NUMBER;
116
117 /*-----------------------------------------------------------------------------------------------------------*/
118 /* procedure name: VALIDATE_RCV_INPUT */
119 /* description : Validates the RMA data. Checks for mandatory fields for */
120 /* Receiving Open interface API. */
121 /* Called from : CSD_RECEIVE_PVT.RECEIVE_ITEM */
122 /* Input Parm :
123 /* p_validation_level NUMBER Optional API uses this parameter to determine which */
124 /* validation steps must be done and which steps */
125 /* should be skipped. */
126 /* p_receive_rec CSD_RCV_UTIL.RCV_REC_TYPE Required */
127 /* Output Parm : x_return_status VARCHAR2 Return status after the call. The status can be*/
128 /* fnd_api.g_ret_sts_success (success) */
129 /* fnd_api.g_ret_sts_error (error) */
130 /* fnd_api.g_ret_sts_unexp_error (unexpected) */
131 /*-----------------------------------------------------------------------------------------------------------*/
132 PROCEDURE validate_rcv_input (
133 p_validation_level IN NUMBER,
134 x_return_status OUT NOCOPY VARCHAR2,
135 p_receive_rec IN csd_receive_util.rcv_rec_type
136 );
137
138 /*-----------------------------------------------------------------------------------------------------------*/
139 /* procedure name: CHECK_RCV_ERRORS */
140 /* description : Checks the PO_INTERFACE_ERRORS table to see of there are any error records created by the */
141 /* receiving transaction processor.. */
142 /* Called from : CSD_RECEIVE_PVT.RECEIVE_ITEM */
143 /* Input Parm : p_request_group_id NUMBER Required */
144 /* Output Parm : x_return_status VARCHAR2 Return status after the call. The status can be */
145 /* fnd_api.g_ret_sts_success (success) */
146 /* fnd_api.g_ret_sts_error (error) */
147 /* fnd_api.g_ret_sts_unexp_error (unexpected) */
148 /* x_rcv_error_tbl rcv_error_tbl Returns table of rcv_error messages */
149 /*-----------------------------------------------------------------------------------------------------------*/
150 PROCEDURE check_rcv_errors (
151 x_return_status OUT NOCOPY VARCHAR2,
152 x_rcv_error_msg_tbl OUT NOCOPY csd_receive_util.rcv_error_msg_tbl,
153 p_request_group_id IN NUMBER
154 );
155
156 /*-----------------------------------------------------------------------------------------------------------*/
157 /* procedure name: get_employee_id */
158 /* description : This will return the employee id for the given user id. */
159 /* */
160 /* Called from : CSD_RECEIVE_PVT.RECEIVE_ITEM */
161 /* Input Parm : p_request_group_id NUMBER Required */
162 /* Output Parm : x_return_status VARCHAR2 Return status after the call. The status can be*/
163 /* fnd_api.g_ret_sts_success (success) */
164 /* fnd_api.g_ret_sts_error (error) */
165 /* fnd_api.g_ret_sts_unexp_error (unexpected) */
166 /*-----------------------------------------------------------------------------------------------------------*/
167 PROCEDURE get_employee_id (
168 p_user_id IN NUMBER,
169 x_employee_id OUT NOCOPY NUMBER
170 );
171
172 /*-----------------------------------------------------------------------------------------------------------*/
173 /* procedure name: get_rcv_item_params */
174 /* description : This will populate some required fields in the receiving data structure */
175 /* */
176 /* Called from : CSD_RECEIVE_PVT.RECEIVE_ITEM */
177 /* Input Parm : p_receive_rec CSD_RCV_UTIL.RCV_REC_TYPE Required */
178 /* Output Parm : x_return_status VARCHAR2 Return status after the call. The status can be*/
179 /* fnd_api.g_ret_sts_success (success) */
180 /* fnd_api.g_ret_sts_error (error) */
181 /* fnd_api.g_ret_sts_unexp_error (unexpected) */
182 /*-----------------------------------------------------------------------------------------------------------*/
183 PROCEDURE get_rcv_item_params (
184 p_receive_rec IN OUT NOCOPY csd_receive_util.rcv_rec_type
185 );
186 END csd_receive_util;