1 PACKAGE BODY MTL_ITEM_REVISIONS_SV1 AS
2 /* $Header: POXPIIRB.pls 120.0.12000000.1 2007/01/16 23:03:56 appldev ship $ */
3
4 /*================================================================
5
6 FUNCTION NAME: val_item_revision()
7
8 ==================================================================*/
9 FUNCTION val_item_revision(x_item_revision IN VARCHAR2,
10 x_inventory_item_id IN NUMBER,
11 x_organization_id IN NUMBER)
12 RETURN BOOLEAN IS
13
14 x_progress varchar2(3) := null;
15 x_temp binary_integer := 0;
16
17 BEGIN
18 x_progress := '010';
19
20 /* check to see if there are x_item_revision exists
21 in mtl_item_revisions table */
22
23 /* Bug 1833599 - Removed the organization_id check from the sql as the
24 revision is just validated against the item and then in POXPISVB.pls, it is validated against
25 the ship to org and item */
26 /* Note: I haven't removed the x_organization_id parameter because it would introduce dependencies
27 right now */
28
29 SELECT count(*)
30 INTO x_temp
31 FROM mtl_item_revisions
32 WHERE revision = x_item_revision
33 AND inventory_item_id = x_inventory_item_id;
34
35 IF x_temp = 0 THEN
36 RETURN FALSE; /* validation fails */
37 ELSE
38 RETURN TRUE; /* validation succeeds */
39 END IF;
40
41 EXCEPTION
42 WHEN others THEN
43 po_message_s.sql_error
44 ('val_item_revision', x_progress, sqlcode);
45 raise;
46 END val_item_revision;
47
48 END MTL_ITEM_REVISIONS_SV1;