1 PACKAGE OKC_OC_INT_CONFIG_PVT AS
2 /* $Header: OKCRCFGS.pls 120.0 2005/05/26 09:42:48 appldev noship $ */
3
4 G_UNEXPECTED_ERROR CONSTANT VARCHAR2(200) := 'OKC_CONTRACTS_UNEXP_ERROR';
5 G_SQLCODE_TOKEN CONSTANT VARCHAR2(200) := 'SQLCODE';
6 G_SQLERRM_TOKEN CONSTANT VARCHAR2(200) := 'SQLERRM';
7 G_PKG_NAME CONSTANT VARCHAR2(200) := 'OKC_OC_INT_CONFIG_PVT';
8 G_APP_NAME CONSTANT VARCHAR2(3) := OKC_API.G_APP_NAME;
9
10 G_MODEL_LINE CONSTANT OKC_K_LINES_B.CONFIG_ITEM_TYPE%TYPE := 'TOP_MODEL_LINE';
11 G_BASE_LINE CONSTANT OKC_K_LINES_B.CONFIG_ITEM_TYPE%TYPE := 'TOP_BASE_LINE';
12 G_NORMAL_LINE CONSTANT OKC_K_LINES_B.CONFIG_ITEM_TYPE%TYPE := 'CONFIG';
13 rolledup_line_list_price NUMBER :=0;
14 rolledup_price_negotiated NUMBER :=0;
15
16 -- Bug : 1686001 Changed references aso_quote_lines_all to okx_quote_lines_v
17 TYPE line_inf_rec_type IS RECORD(cle_id okc_k_lines_b.id%TYPE
18 ,lse_id okc_k_lines_b.lse_id%TYPE
19 ,lty_code okc_line_styles_b.lty_code%TYPE
20 ,object1_id1 okx_order_headers_v.id1%TYPE
21 ,line_num NUMBER
22 ,subline NUMBER
23 ,line_qty okx_quote_lines_v.quantity%TYPE
24 ,line_uom okx_quote_lines_v.uom_code%TYPE
25 ,line_type OKC_K_LINES_B.CONFIG_ITEM_TYPE%TYPE
26 );
27
28 TYPE line_inf_tbl_type IS TABLE OF line_inf_rec_type INDEX BY BINARY_INTEGER;
29
30 TYPE source_inf_rec_type IS RECORD(o_flag VARCHAR2(1) DEFAULT OKC_API.G_FALSE
31 ,q_flag VARCHAR2(1) DEFAULT OKC_API.G_FALSE
32 ,line_id OKX_ORDER_LINES_V.ID1%TYPE
33 ,line_number OKX_ORDER_LINES_V.LINE_NUMBER%TYPE
34 ,Object_number OKX_ORDER_HEADERS_V.ORDER_NUMBER%TYPE
35 );
36
37
38 TYPE line_rel_rec_type IS RECORD (k_line_id okc_k_lines_b.id%TYPE
39 ,k_parent_line_id okc_k_lines_b.id%TYPE
40 ,q_line_idx NUMBER
41 ,q_item_type_code okx_quote_lines_v.item_type_code%TYPE
42 );
43
44 TYPE line_rel_tab_type IS TABLE OF line_rel_rec_type INDEX BY BINARY_INTEGER;
45
46 g_miss_kl_rel_tab line_rel_tab_type;
47
48 g_okc_model_item CONSTANT VARCHAR2(30) := 'TOP_MODEL_LINE';
49 g_okc_base_item CONSTANT VARCHAR2(30) := 'TOP_BASE_LINE';
50 g_okc_config_item CONSTANT VARCHAR2(30) := 'CONFIG';
51 g_okc_service_item CONSTANT VARCHAR2(30) := 'SRV';
52
53
54 g_aso_model_item CONSTANT VARCHAR2(30) := 'MDL';
55 g_aso_config_item CONSTANT VARCHAR2(30) := 'CFG';
56 g_aso_service_item CONSTANT VARCHAR2(30) := 'SRV';
57
58
59 g_aso_op_code_create VARCHAR2(30) := 'CREATE';
60 g_aso_op_code_update VARCHAR2(30) := 'UPDATE';
61 g_aso_op_code_delete VARCHAR2(30) := 'DELETE';
62
63
64
65 -------------------------------------------------------------------------------------------------------------------------------------------
66 -- Procedure: create_k_config_lines
67 -- Purpose: To create the lines in contract corresponding to child lines of a Model Item in Order or Quote.
68 -- For Each Model Item line in quote and Order 2 Contract lines will be created.One Contract Line will be
69 -- having config_item_type_code ='TOP_MODEL_LINE' and other one which is child of this one will have
70 -- having config_item_type_code ='TOP_BASE_LINE'
71 --
72 -- This Procedure then calls create_config_sublines to create/transfer Option class and Option Item lines
73 -- from order or quote to Contract.
74
75 -- In Parameters: p_source_inf_rec It will contain info like order/quote header id and Flag stating that If this
76 -- proceedure is being called for Order or Contract.
77 -- p_clev_rec Contract Line rec of Top line
78 -- p_cimv_rec Contract Item rec of Top line
79 -- p_line_inf_tab PL/SQL table to return relationship between K Line and Quote/Order Line
80 -- Out Parameters: x_return_status Return Status
81 --------------------------------------------------------------------------------------------------------------------------------------------
82 Procedure create_k_config_lines( p_source_inf_rec IN SOURCE_INF_REC_TYPE,
83 p_clev_rec IN OKC_CONTRACT_PUB.CLEV_REC_TYPE,
84 p_cimv_rec IN OKC_CONTRACT_ITEM_PUB.CIMV_REC_TYPE,
85 p_line_inf_tab IN OUT NOCOPY LINE_INF_TBL_TYPE,
86 x_clev_rec OUT NOCOPY OKC_CONTRACT_PUB.CLEV_REC_TYPE,
87 x_return_status OUT NOCOPY VARCHAR2
88 );
89
90 -- =====================================================================================
91 --
92 -- Purpose: To build the relationship between quote lines which is
93 -- populated in the aso_line_relationships table
94 --
95 -- IN parameters: px_k2q_line_tbl - holds k to q relation
96 -- px_qte_line_tbl - holds quote line information
97 -- px_qte_line_dtl_tbl - holds quote line detail information
98 --
99 -- OUT parameters: l_line_rltship_tab - holds the information about relationship
100 -- between quote lines.
101 -- x_return_status - Return status of the procedure executed.
102 --
103 -- =====================================================================================
104
105
106 PROCEDURE quote_line_relationship( px_k2q_line_tbl IN line_rel_tab_type DEFAULT g_miss_kl_rel_tab
107 ,px_qte_line_tbl IN ASO_QUOTE_PUB.qte_line_tbl_type
108 ,px_qte_line_dtl_tbl IN ASO_QUOTE_PUB.qte_line_dtl_tbl_type
109 ,x_line_rltship_tab OUT NOCOPY ASO_QUOTE_PUB.line_rltship_tbl_type
110 ,x_return_status OUT NOCOPY VARCHAR2
111 );
112
113
114
115 END OKC_OC_INT_CONFIG_PVT;