1 package CTO_CONFIG_ITEM_PK AUTHID CURRENT_USER as
2 /* $Header: CTOCITMS.pls 120.1.12010000.2 2010/03/03 08:08:32 abhissri ship $ */
3
4 gUserID number ;
5 gLoginId number ;
6
7 --
8 -- bugfix 2301167: Added the following 2 global variables for wt/vol calculation.
9 -- we shouldn't calculate the wt/vol for the upper level config if lower level
10 -- config has errored out. For this, the following 2 globals are used.
11 -- 0 means success. -1 means error.
12 --
13
14 --Commenting these variables as part of bugfix 9223554
15 --gWtStatus number := 0 ;
16 --gVolStatus number := 0 ;
17
18 --Bugfix 9223554
19 type g_wt_vol_tbl_type is table of number index by binary_integer;
20 g_wt_tbl g_wt_vol_tbl_type;
21 g_vol_tbl g_wt_vol_tbl_type;
22
23
24 type smc_rec is record (
25 item_id oe_order_lines.inventory_item_id%type,
26 sequence_id oe_order_lines.component_sequence_id%type,
27 quantity oe_order_lines.ordered_quantity%type ,
28 check_atp bom_explosions.check_atp%type
29 );
30
31 type SmcTab is table of smc_rec index by binary_integer;
32
33
34 /*---------------------------------------------------------------------+
35 Name : create_item
36
37 Description : This function creates a new inventory_item for the
38 ordered configuration. It also validates the setup
39 and profile options. It generates new item number
40 and then stores the item in mtl_system_items.
41
42 Returns : TRUE - If the function completes succesfully
43 FALSE - If the function completes with error
44
45 Inventory_item_id of the newly generated item is
46 returned in pConfigId
47 +---------------------------------------------------------------------*/
48 FUNCTION Create_Item(
49 pModelId in number,
50 pLineId in number,
51 pConfigId in out NOCOPY number, /* NOCOPY Project */
52 xMsgCount out NOCOPY number,
53 xMsgData out NOCOPY varchar2,
54 p_mode in varchar2 default 'AUTOCONFIG' )
55 RETURN integer;
56
57
58 /*---------------------------------------------------------------------+
59 Name : create_item_data
60
61 Description : This function populates the additional item data
62 for the newly created configuration item.
63 All necessary inventory and cost tables are populated
64
65 Returns : TRUE - If the function completes succesfully
66 FALSE - If the function completes with error
67
68 +----------------------------------------------------------------------*/
69 FUNCTION Create_Item_Data(
70 pModelId in number,
71 pConfigId in number,
72 pLineId in number,
73 p_mode in varchar2 default 'AUTOCONFIG' )
74 return integer;
75
76
77 /*---------------------------------------------------------------------+
78 Name : link_item
79
80 Description : This function links a newly created or a matching
81 config item to the order line. It calls OE's
82 process_order API to insert config line in oe_order_lines
83
84 Returns : TRUE - If the function completes succesfully
85 FALSE - If the function completes with error
86
87 +----------------------------------------------------------------------*/
88 FUNCTION link_item(
89 pOrgId in number ,
90 pModelId in number ,
91 pConfigId in number ,
92 pLineId in number ,
93 xMsgCount out NOCOPY number,
94 xMsgData out NOCOPY varchar2)
95 RETURN integer;
96
97
98 function delink_item (
99 pModelLineId in number ,
100 pConfigId in number ,
101 xErrorMessage out NOCOPY varchar2 ,
102 xMessageName out NOCOPY varchar2 ,
103 xTableName out NOCOPY varchar2 )
104 return integer;
105
106 function Get_Mandatory_Components(
107 p_ship_set in MRP_ATP_PUB.ATP_Rec_Typ,
108 p_organization_id in number default null,
109 p_inventory_item_id in number default null,
110 x_smc_rec out NOCOPY MRP_ATP_PUB.ATP_Rec_Typ,
111 xErrorMessage out NOCOPY varchar2,
112 xMessageName out NOCOPY varchar2,
113 xTableName out NOCOPY varchar2 )
114 return integer;
115
116 function evaluate_order( p_atp_flag mtl_system_items.atp_flag%type
117 , p_atp_comp mtl_system_items.atp_components_flag%type
118 , p_item_type mtl_system_items.bom_item_type%type )
119 return number ;
120
121 FUNCTION chk_model_in_bcod(
122 pLineId in number)
123 return integer;
124
125 -- begin bugfix 1811007 : added new procedure ato_weight_volume
126 PROCEDURE ato_weight_volume(
127 p_ato_line_id IN NUMBER,
128 p_orgn_id IN NUMBER,
129 weight_uom IN OUT NOCOPY VARCHAR2, /* NOCOPY Project */
130 weight OUT NOCOPY NUMBER,
131 volume_uom IN OUT NOCOPY VARCHAR2, /* NOCOPY Project */
132 volume OUT NOCOPY NUMBER,
133 status IN OUT NOCOPY NUMBER,
134 pConfigId IN NUMBER); ----3737772 (FP 3473737)
135
136 -- end bugfix 1811007
137
138
139
140 function get_attribute_control( p_attribute_name varchar2)
141 return number;
142
143
144 function evaluate_atp_attributes( p_atp_flag in mtl_system_items_b.atp_flag%type
145 , p_atp_components_flag in mtl_system_items_b.atp_components_flag%type )
146 return char ;
147
148
149 function get_atp_flag
150 return char ;
151
152
153 end CTO_CONFIG_ITEM_PK;
154