1 package CST_ACCRUAL_REC_PVT AUTHID CURRENT_USER AS
2 /* $Header: CSTACRHS.pls 120.1.12010000.1 2008/07/24 17:19:17 appldev ship $ */
3
4 -- Start of comments
5 -- API name : Get_Accounts
6 -- Type : Private
7 -- Pre-reqs : None.
8 -- Function : Get all the "default accounts" for a given operating unit.
9 -- Only distint accrual account IDs are return.
10 -- Parameters :
11 -- IN : p_ou_id IN NUMBER Required
12 -- Operating Unit Identifier.
13 -- OUT : x_count OUT NOCOPY NUBMER Required
14 -- Succes Indicator
15 -- 1 => Success
16 -- -1 => Failure
17 -- : x_err_num OUT NOCOPY NUMBER Required
18 -- Standard Error Parameter
19 -- : x_err_code OUT NOCOPY VARCHAR2 Required
20 -- Standard Error Parameter
21 -- : x_err_msg OUT NOCOPY VARCHAR2 Required
22 -- Standard Error Parameter
23 -- Version : Current version 1.0
24 -- Previous version 1.0
25 -- Initial version 1.0
26 -- End of comments
27 procedure get_accounts( p_ou_id in number,
28 x_count out nocopy number,
29 x_err_num out nocopy number,
30 x_err_code out nocopy varchar2,
31 x_err_msg out nocopy varchar2);
32
33 -- Start of comments
34 -- API name : Flip_Flag
35 -- Type : Private
36 -- Pre-reqs : None.
37 -- Function : Sets the write_off_select_flag column in the appropriate
38 -- database tables to 'Y' or NULL.
39 -- Parameters :
40 -- IN : p_row_id IN VARCHAR2 Required
41 -- Row Identifier
42 -- : p_bit IN VARCHAR2 Required
43 -- Determines whether to set the column to 'Y' or NULL
44 -- FND_API.G_TRUE => 'Y'
45 -- FND_API.G_FALSE => NULL
46 -- : p_prog IN NUMBER Required
47 -- Codes which tables's write_off_select_flag column will be altered
48 -- 0 => cst_reconciliation_summary (AP and PO Form)
49 -- 1 => cst_misc_reconciliation (Miscellaneous Form)
50 -- 2 => cst_write_offs (View Write-Offs Form)
51 -- OUT : x_count OUT NOCOPY NUBMER Required
52 -- Succes Indicator
53 -- FND_API.G_TRUE => Success
54 -- FND_API.G_FALSE => Failure
55 -- : x_err_num OUT NOCOPY NUMBER Required
56 -- Standard Error Parameter
57 -- : x_err_code OUT NOCOPY VARCHAR2 Required
58 -- Standard Error Parameter
59 -- : x_err_msg OUT NOCOPY VARCHAR2 Required
60 -- Standard Error Parameter
61 -- Version : Current version 1.0
62 -- Previous version 1.0
63 -- Initial version 1.0
64 -- End of comments
65 procedure flip_flag ( p_row_id in varchar2,
66 p_bit in varchar2,
67 p_prog in number,
68 x_count out nocopy varchar2,
69 x_err_num out nocopy number,
70 x_err_code out nocopy varchar2,
71 x_err_msg out nocopy varchar2);
72
73 -- Start of comments
74 -- API name : Calc_Age_In_Days
75 -- Type : Private
76 -- Pre-reqs : None.
77 -- Function : Calculates age in days using the profile option CST_ACCRUAL_AGE_IN_DAYS
78 -- Parameters :
79 -- IN : p_lrd IN DATE Required
80 -- Last Receipt Date
81 -- : p_lid IN DATE Required
82 -- Last Invoice Date
83 -- OUT : x_count OUT NOCOPY NUBMER Required
84 -- Age In Days Value
85 -- : x_err_num OUT NOCOPY NUMBER Required
86 -- Standard Error Parameter
87 -- : x_err_code OUT NOCOPY VARCHAR2 Required
88 -- Standard Error Parameter
89 -- : x_err_msg OUT NOCOPY VARCHAR2 Required
90 -- Standard Error Parameter
91 -- Version : Current version 1.0
92 -- Previous version 1.0
93 -- Initial version 1.0
94 -- End of comments
95 procedure calc_age_in_days ( p_lrd in date,
96 p_lid in date,
97 x_count out nocopy number,
98 x_err_num out nocopy number,
99 x_err_code out nocopy varchar2,
100 x_err_msg out nocopy varchar2);
101
102 -- Start of comments
103 -- API name : Calc_Age_In_Days
104 -- Type : Private
105 -- Pre-reqs : None.
106 -- Function : Calculates age in days using the profile option CST_ACCRUAL_AGE_IN_DAYS
107 -- Parameters :
108 -- IN : p_lrd IN DATE Required
109 -- Last Receipt Date
110 -- : p_lid IN DATE Required
111 -- Last Invoice Date
112 -- RETURN : NUMBER
113 -- Age In Days Value
114 -- {x > -1} => Normal Completion
115 -- -1 => Error
116 -- Version : Current version 1.0
117 -- Previous version 1.0
118 -- Initial version 1.0
119 -- End of comments
120 function calc_age_in_days ( p_lrd in date,
121 p_lid in date) return number;
122
123 -- Start of comments
124 -- API name : Update_All
125 -- Type : Private
126 -- Pre-reqs : None.
127 -- Function : Sets all the write_off_select_flags to 'Y' in the appropriate
128 -- table whose rows are returned by the where clause
129 -- Parameters :
130 -- IN : p_where IN VARCHAR2 Required
131 -- Where Clause
132 -- : p_prog IN NUMBER Required
133 -- Codes which table's write_off_select_flag column will be altered
134 -- 0 => cst_reconciliation_summary (AP and PO Form)
135 -- 1 => cst_misc_reconciliation (Miscellaneous Form)
136 -- 2 => cst_write_offs (View Write-Offs Form)
137 -- : p_ou_id IN NUMBER Required
138 -- Operating Unit Identifier
139 -- OUT : x_out OUT NOCOPY NUBMER Required
140 -- Sum of distributions/transactions selected
141 -- : x_tot OUT NOCOPY NUMBER Required
142 -- Number of rows selected for update
143 -- : x_err_num OUT NOCOPY NUMBER Required
144 -- Standard Error Parameter
145 -- : x_err_code OUT NOCOPY VARCHAR2 Required
146 -- Standard Error Parameter
147 -- : x_err_msg OUT NOCOPY VARCHAR2 Required
148 -- Standard Error Parameter
149 -- Version : Current version 1.0
150 -- Previous version 1.0
151 -- Initial version 1.0
152 -- End of comments
153 procedure update_all (
154 p_where in varchar2,
155 p_prog in number,
156 p_ou_id in number,
157 x_out out nocopy number,
158 x_tot out nocopy number,
159 x_err_num out nocopy number,
160 x_err_code out nocopy varchar2,
161 x_err_msg out nocopy varchar2);
162
163 -- Start of comments
164 -- API name : Insert_Misc_Data_All
165 -- Type : Private
166 -- Pre-reqs : None.
167 -- Function : Write-off transactions selected in the Miscellaneous
168 -- Accrual Write-Off Form in Costing tables. Proecedue will also generate
169 -- Write-Off events in SLA. At the end, all the written-off transactions are
170 -- removed from cst_misc_reconciliation.
171 -- Parameters :
172 -- IN : p_wo_date IN DATE Required
173 -- Write-Off Date
174 -- : p_off_id IN NUMBER Required
175 -- Offset Account
176 -- : p_rea_id IN NUMBER Optional
177 -- Write-Off Reason
178 -- : p_comments IN VARCHAR2 Optional
179 -- Write-Off Comments
180 -- : p_sob_id IN NUMBER Required
181 -- Ledger/Set of Books
182 -- : p_ou_id IN NUMBER Required
183 -- Operating Unit Identifier
184 -- OUT : x_count OUT NOCOPY NUBMER Required
185 -- Success Indicator
186 -- {x > 0} => Success
187 -- -1 => Failure
188 -- : x_err_num OUT NOCOPY NUMBER Required
189 -- Standard Error Parameter
190 -- : x_err_code OUT NOCOPY VARCHAR2 Required
191 -- Standard Error Parameter
192 -- : x_err_msg OUT NOCOPY VARCHAR2 Required
193 -- Standard Error Parameter
194 -- Version : Current version 1.0
195 -- Previous version 1.0
196 -- Initial version 1.0
197 -- End of comments
198 procedure insert_misc_data_all(
199 p_wo_date in date,
200 p_off_id in number,
201 p_rea_id in number,
202 p_comments in varchar2,
203 p_sob_id in number,
204 p_ou_id in number,
205 x_count out nocopy number,
206 x_err_num out nocopy number,
207 x_err_code out nocopy varchar2,
208 x_err_msg out nocopy varchar2);
209
210
211 -- Start of comments
212 -- API name : Insert_Appo_Data_All
213 -- Type : Private
214 -- Pre-reqs : None.
215 -- Function : Write-off PO distributions selected in the AP and PO
216 -- Accrual Write-Off Form in Costing tables. Proecedue will also generate
217 -- Write-Off events in SLA. A single write-off event will be generated
218 -- regardless of the number of transactions that make up the PO distribution.
219 -- At the end, all the written-off PO distributions
220 -- and individual AP and PO transactions are removed from
221 -- cst_reconciliation_summary and cst_ap_po_reconciliation..
222 -- Parameters :
223 -- IN : p_wo_date IN DATE Required
224 -- Write-Off Date
225 -- : p_rea_id IN NUMBER Optional
226 -- Write-Off Reason
227 -- : p_comments IN VARCHAR2 Optional
228 -- Write-Off Comments
229 -- : p_sob_id IN NUMBER Required
230 -- Ledger/Set of Books
231 -- : p_ou_id IN NUMBER Required
232 -- Operating Unit Identifier
233 -- OUT : x_count OUT NOCOPY NUBMER Required
234 -- Success Indicator
235 -- {x > 0} => Success
236 -- -1 => Failure
237 -- : x_err_num OUT NOCOPY NUMBER Required
238 -- Standard Error Parameter
239 -- : x_err_code OUT NOCOPY VARCHAR2 Required
240 -- Standard Error Parameter
241 -- : x_err_msg OUT NOCOPY VARCHAR2 Required
242 -- Standard Error Parameter
243 -- Version : Current version 1.0
244 -- Previous version 1.0
245 -- Initial version 1.0
246 -- End of comments
247 procedure insert_appo_data_all(
248 p_wo_date in date,
249 p_rea_id in number,
250 p_comments in varchar2,
251 p_sob_id in number,
252 p_ou_id in number,
253 x_count out nocopy number,
254 x_err_num out nocopy number,
255 x_err_code out nocopy varchar2,
256 x_err_msg out nocopy varchar2);
257
258 -- Start of comments
259 -- API name : Is_Reversible
260 -- Type : Private
261 -- Pre-reqs : None.
262 -- Function : Checks whether a specific write-off distribution is reversible.
263 -- A write-off is reversible if the write-off was performed in release 12 and later,
264 -- has the transaction type code 'WRITE OFF', has not alredy been reversed and is
265 -- not already part of another write-off distribution.
266 -- Parameters :
267 -- IN : p_wo_id IN NUMBER Required
268 -- Write-Off Date
269 -- : p_txn_c IN VARCHAR2 Required
270 -- Transaction Type
271 -- : p_off_id IN NUMBER Required
272 -- Offset Accont
273 -- : p_ou_id IN NUMBER Required
274 -- Operating Unit Identifier
275 -- OUT : x_count OUT NOCOPY NUBMER Required
276 -- Reversible Indicator
277 -- FND_API.G_TRUE => Reversible
278 -- FND_API.G_FALSE => Not Reversible
279 -- : x_err_num OUT NOCOPY NUMBER Required
280 -- Standard Error Parameter
281 -- : x_err_code OUT NOCOPY VARCHAR2 Required
282 -- Standard Error Parameter
283 -- : x_err_msg OUT NOCOPY VARCHAR2 Required
284 -- Standard Error Parameter
285 -- Version : Current version 1.0
286 -- Previous version 1.0
287 -- Initial version 1.0
288 -- End of comments
289 procedure is_reversible(
290 p_wo_id in number,
291 p_txn_c in varchar2,
292 p_off_id in number,
293 p_ou_id in number,
294 x_count out nocopy varchar2,
295 x_err_num out nocopy number,
296 x_err_code out nocopy varchar2,
297 x_err_msg out nocopy varchar2);
298
299 -- Start of comments
300 -- API name : Reverse_Write_Offs
301 -- Type : Private
302 -- Pre-reqs : None.
303 -- Function : Performs a write-off reversal and insert distributions and/or
304 -- individual transactions back into the appropriate tables.
305 -- If the reversing miscellaneous write-offs, then a write-off
306 -- reversal is created and the individual miscellaneous transactions
307 -- is inserted back into cst_misc_reconciliation. If reversing an
308 -- AP and PO distribution, then a write-off reversal is created and all
309 -- the individual AP and PO transactions in addition to all write-offs
310 -- and reversals sharing the same PO distribution ID and accrual account
311 -- are summed up and if they equal a non-zero value, they are inserted
312 -- into the cst_reconciliation_summary and cst_ap_po_reconciliation
313 -- as appropriate (see package body).
314 -- Parameters :
315 -- IN : p_wo_date IN DATE Required
316 -- Write-Off Date
320 -- Write-Off Comments
317 -- : p_rea_id IN NUMBER Optional
318 -- Write-Off Reason
319 -- : p_comments IN VARCHAR2 Optional
321 -- : p_sob_id IN NUMBER Required
322 -- Ledger/Set of Books
323 -- : p_ou_id IN NUMBER Required
324 -- Operating Unit Identifier
325 -- OUT : x_count OUT NOCOPY NUBMER Required
326 -- Success Indicator
327 -- {x > 0} => Success
328 -- -1 => Failure
329 -- : x_err_num OUT NOCOPY NUMBER Required
330 -- Standard Error Parameter
331 -- : x_err_code OUT NOCOPY VARCHAR2 Required
332 -- Standard Error Parameter
333 -- : x_err_msg OUT NOCOPY VARCHAR2 Required
334 -- Standard Error Parameter
335 -- Version : Current version 1.0
336 -- Previous version 1.0
337 -- Initial version 1.0
338 -- End of comments
339 procedure reverse_write_offs(
340 p_wo_date in date,
341 p_rea_id in number,
342 p_comments in varchar2,
343 p_sob_id in number,
344 p_ou_id in number,
345 x_count out nocopy number,
346 x_err_num out nocopy number,
347 x_err_code out nocopy varchar2,
348 x_err_msg out nocopy varchar2);
349
350 END CST_ACCRUAL_REC_PVT;