1 PACKAGE OKL_AM_TERMNT_QUOTE_PUB AUTHID CURRENT_USER AS
2 /* $Header: OKLPTNQS.pls 120.6 2008/02/29 10:16:47 veramach ship $ */
3 /*#
4 * Terminate Quote API allows users to create, update and approve termination
5 * quotes.
6 * @rep:scope public
7 * @rep:product OKL
8 * @rep:displayname Termination Quote API
9 * @rep:category BUSINESS_ENTITY OKL_CONTRACT_LIFECYCLE
10 * @rep:businessevent oracle.apps.okl.am.sendquote
11 * @rep:lifecycle active
12 * @rep:compatibility S
13 */
14
15
16
17 ---------------------------------------------------------------------------
18 -- GLOBAL MESSAGE CONSTANTS
19 ---------------------------------------------------------------------------
20 G_PKG_NAME CONSTANT VARCHAR2(200) := 'OKL_AM_TERMNT_QUOTE_PUB';
21 G_APP_NAME CONSTANT VARCHAR2(3) := OKL_API.G_APP_NAME;
22 G_UNEXPECTED_ERROR CONSTANT VARCHAR2(200) := 'OKC_CONTRACTS_UNEXPECTED_ERROR';
23 G_SQLERRM_TOKEN CONSTANT VARCHAR2(200) := 'SQLERRM';
24 G_SQLCODE_TOKEN CONSTANT VARCHAR2(200) := 'SQLCODE';
25
26 SUBTYPE term_rec_type IS OKL_AM_TERMNT_QUOTE_PVT.term_rec_type;
27 SUBTYPE term_tbl_type IS OKL_AM_TERMNT_QUOTE_PVT.term_tbl_type;
28 SUBTYPE clev_tbl_type IS OKL_AM_TERMNT_QUOTE_PVT.clev_tbl_type;
29 SUBTYPE qte_ln_dtl_tbl IS OKL_AM_TERMNT_QUOTE_PVT.qte_ln_dtl_tbl;
30 ---------------------------------------------------------------------------
31 -- Procedures and Functions
32 ---------------------------------------------------------------------------
33
34 -- terminates the quote.
35 -- checks if accepted_yn is set to 'Y' then calls the terminate contract
36 --Bug #3921591: pagarg +++ Rollover +++
37 -- additional parameter has been added to the call, to identify the acceptance source
38 PROCEDURE terminate_quote(
39 p_api_version IN NUMBER,
40 p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
41 x_return_status OUT NOCOPY VARCHAR2,
42 x_msg_count OUT NOCOPY NUMBER,
43 x_msg_data OUT NOCOPY VARCHAR2,
44 p_term_rec IN term_rec_type,
45 x_term_rec OUT NOCOPY term_rec_type,
46 x_err_msg OUT NOCOPY VARCHAR2,
47 p_acceptance_source IN VARCHAR2 DEFAULT null);
48
49 -- terminates the quote for a input of tbl type
50 --Bug #3921591: pagarg +++ Rollover +++
51 -- additional parameter has been added to the call, to identify the acceptance source
52 PROCEDURE terminate_quote(
53 p_api_version IN NUMBER,
54 p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
55 x_return_status OUT NOCOPY VARCHAR2,
56 x_msg_count OUT NOCOPY NUMBER,
57 x_msg_data OUT NOCOPY VARCHAR2,
58 p_term_tbl IN term_tbl_type,
59 x_term_tbl OUT NOCOPY term_tbl_type,
60 x_err_msg OUT NOCOPY VARCHAR2,
61 p_acceptance_source IN VARCHAR2 DEFAULT null);
62
63 -- calls send quote workflow
64 /*#
65 * Submit for Approval API submits the termination quote for approval.
66 * @param p_api_version API version
67 * @param p_init_msg_list Initialize message stack
68 * @param x_return_status Return status from the API
69 * @param x_msg_count Message count if error messages are encountered
70 * @param x_msg_data Message data error message
71 * @param p_term_rec Record type for termination quote details
72 * @param x_term_rec Record type for termination quote details.
73 * @rep:displayname Submit Termination Quote for Approval
74 * @rep:scope public
75 * @rep:lifecycle active
76 * @rep:category BUSINESS_ENTITY OKL_CONTRACT_LIFECYCLE
77 */
78 PROCEDURE submit_for_approval(
79 p_api_version IN NUMBER,
80 p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
81 x_return_status OUT NOCOPY VARCHAR2,
82 x_msg_count OUT NOCOPY NUMBER,
83 x_msg_data OUT NOCOPY VARCHAR2,
84 p_term_rec IN term_rec_type,
85 x_term_rec OUT NOCOPY term_rec_type);
86
87 -- Checks If the given asset line is serialized or not
88 FUNCTION check_asset_sno(p_asset_line IN OKL_K_LINES.ID%TYPE,
89 x_sno_yn OUT NOCOPY VARCHAR2,
90 x_clev_tbl OUT NOCOPY clev_tbl_type) RETURN VARCHAR2;
91
92 -- Create records in Quote Line details after proper validation
93
94 /*#
95 * Quote Line Details API creates the quote line details for the termination
96 * quote.
97 * @param p_api_version API version
98 * @param p_init_msg_list Initialize message stack
99 * @param x_return_status Return status from the API
100 * @param x_msg_count Message count if error messages are encountered
101 * @param x_msg_data Message data error message
102 * @param p_qld_tbl Table of Records of termination quote line details
103 * @rep:displayname Create Termination Quote Line Details
104 * @rep:scope public
105 * @rep:lifecycle active
106 * @rep:category BUSINESS_ENTITY OKL_CONTRACT_LIFECYCLE
107 */
108 PROCEDURE quote_line_dtls(p_api_version IN NUMBER,
109 p_init_msg_list IN VARCHAR2 DEFAULT OKL_API.G_FALSE,
110 x_return_status OUT NOCOPY VARCHAR2,
111 x_msg_count OUT NOCOPY NUMBER,
112 x_msg_data OUT NOCOPY VARCHAR2,
113 p_qld_tbl IN OUT NOCOPY qte_ln_dtl_tbl);
114
115
116 -- RMUNJULU 23-DEC-02 2667636 Added 2 new Subtypes and 4 new procedures for
117 -- inserting and updating quote lines table
118
119 SUBTYPE tqlv_rec_type IS OKL_TXL_QUOTE_LINES_PUB.tqlv_rec_type;
120 SUBTYPE tqlv_tbl_type IS OKL_TXL_QUOTE_LINES_PUB.tqlv_tbl_type;
121 G_FALSE VARCHAR2(1) := OKC_API.G_FALSE;
122
123 -- Creates quote line
124 /*#
125 * Create Quote Line API creates the quote lines for the termination quote.
126 * @param p_api_version API version
127 * @param p_init_msg_list Initialize message stack
128 * @param x_return_status Return status from the API
129 * @param x_msg_count Message count if error messages are encountered
130 * @param x_msg_data Message data error message
131 * @param p_tqlv_rec Record type for termination quote line details
132 * @param x_tqlv_rec Record type for termination quote line details
133 * @rep:displayname Create Termination Quote Line
134 * @rep:scope public
135 * @rep:lifecycle active
136 * @rep:category BUSINESS_ENTITY OKL_CONTRACT_LIFECYCLE
137 */
138 PROCEDURE create_quote_line(
139 p_api_version IN NUMBER,
140 p_init_msg_list IN VARCHAR2 DEFAULT G_FALSE,
141 x_return_status OUT NOCOPY VARCHAR2,
142 x_msg_count OUT NOCOPY NUMBER,
143 x_msg_data OUT NOCOPY VARCHAR2,
144 p_tqlv_rec IN tqlv_rec_type,
145 x_tqlv_rec OUT NOCOPY tqlv_rec_type);
146
147
148 -- Creates multiple quote lines
149 /*#
150 * Create Quote Line API creates the quote lines for the termination quote.
151 * @param p_api_version API version
152 * @param p_init_msg_list Initialize message stack
153 * @param x_return_status Return status from the API
154 * @param x_msg_count Message count if error messages are encountered
155 * @param x_msg_data Message data error message
156 * @param p_tqlv_tbl Table of Records of termination quote line details
157 * @param x_tqlv_tbl Table of Records of termination quote line details
158 * @rep:displayname Create Termination Quote Line
159 * @rep:scope public
160 * @rep:lifecycle active
161 * @rep:category BUSINESS_ENTITY OKL_CONTRACT_LIFECYCLE
162 */
163 PROCEDURE create_quote_line(
164 p_api_version IN NUMBER,
165 p_init_msg_list IN VARCHAR2 DEFAULT G_FALSE,
166 x_return_status OUT NOCOPY VARCHAR2,
167 x_msg_count OUT NOCOPY NUMBER,
168 x_msg_data OUT NOCOPY VARCHAR2,
169 p_tqlv_tbl IN tqlv_tbl_type,
170 x_tqlv_tbl OUT NOCOPY tqlv_tbl_type);
171
172
173 -- Updates quote line
174 /*#
175 * Update Quote Line API updates the quote lines for the termination quote.
176 * @param p_api_version API version
177 * @param p_init_msg_list Initialize message stack
178 * @param x_return_status Return status from the API
179 * @param x_msg_count Message count if error messages are encountered
180 * @param x_msg_data Message data error message
181 * @param p_tqlv_rec Record type for termination quote line details
182 * @param x_tqlv_rec Record type for termination quote line details
183 * @rep:displayname Update Termination Quote Line
184 * @rep:scope public
185 * @rep:lifecycle active
186 * @rep:category BUSINESS_ENTITY OKL_CONTRACT_LIFECYCLE
187 */
188 PROCEDURE update_quote_line(
189 p_api_version IN NUMBER,
190 p_init_msg_list IN VARCHAR2 DEFAULT G_FALSE,
191 x_return_status OUT NOCOPY VARCHAR2,
192 x_msg_count OUT NOCOPY NUMBER,
193 x_msg_data OUT NOCOPY VARCHAR2,
194 p_tqlv_rec IN tqlv_rec_type,
195 x_tqlv_rec OUT NOCOPY tqlv_rec_type);
196
197
198 -- Updates multiple quote lines
199 /*#
200 * Update Quote Line API updates the quote lines for the termination quote.
201 * @param p_api_version API version
202 * @param p_init_msg_list Initialize message stack
203 * @param x_return_status Return status from the API
204 * @param x_msg_count Message count if error messages are encountered
205 * @param x_msg_data Message data error message
206 * @param p_tqlv_tbl Table of Records of termination quote line details
207 * @param x_tqlv_tbl Table of Records of termination quote line details
208 * @rep:displayname Update Termination Quote Line
209 * @rep:scope public
210 * @rep:lifecycle active
211 * @rep:category BUSINESS_ENTITY OKL_CONTRACT_LIFECYCLE
212 */
213 PROCEDURE update_quote_line(
214 p_api_version IN NUMBER,
215 p_init_msg_list IN VARCHAR2 DEFAULT G_FALSE,
216 x_return_status OUT NOCOPY VARCHAR2,
217 x_msg_count OUT NOCOPY NUMBER,
218 x_msg_data OUT NOCOPY VARCHAR2,
219 p_tqlv_tbl IN tqlv_tbl_type,
220 x_tqlv_tbl OUT NOCOPY tqlv_tbl_type);
221
222
223 -- RMUNJULU 16-JAN-03 2754574 Added delete procedures
224 -- deletes quote line
225 PROCEDURE delete_quote_line(
226 p_api_version IN NUMBER,
227 p_init_msg_list IN VARCHAR2 DEFAULT G_FALSE,
228 x_return_status OUT NOCOPY VARCHAR2,
229 x_msg_count OUT NOCOPY NUMBER,
230 x_msg_data OUT NOCOPY VARCHAR2,
231 p_tqlv_rec IN tqlv_rec_type);
232
233 -- deletes multiple quote lines
234 PROCEDURE delete_quote_line(
235 p_api_version IN NUMBER,
236 p_init_msg_list IN VARCHAR2 DEFAULT G_FALSE,
237 x_return_status OUT NOCOPY VARCHAR2,
238 x_msg_count OUT NOCOPY NUMBER,
239 x_msg_data OUT NOCOPY VARCHAR2,
240 p_tqlv_tbl IN tqlv_tbl_type);
241
242
243 END OKL_AM_TERMNT_QUOTE_PUB;