DBA Data[Home] [Help]

APPS.OKL_AM_RV_WRITEDOWN_PVT dependencies on DUAL

Line 6: -- Procedure Name : create_residual_value_trx

2: /* $Header: OKLRRVWB.pls 120.4 2006/11/22 18:44:08 rravikir noship $ */
3:
4: -- Start of comments
5: --
6: -- Procedure Name : create_residual_value_trx
7: -- Description : The main body of the package. This procedure gets a table of line ids along with the new
8: -- residual values as parameter. It then validates the new RV to make sure that it is less than
9: -- the current RV and then creates residual value transactions in OKL_TRX_ASSETS_V and
10: -- OKL_TXL_ASSETS_V

Line 8: -- residual values as parameter. It then validates the new RV to make sure that it is less than

4: -- Start of comments
5: --
6: -- Procedure Name : create_residual_value_trx
7: -- Description : The main body of the package. This procedure gets a table of line ids along with the new
8: -- residual values as parameter. It then validates the new RV to make sure that it is less than
9: -- the current RV and then creates residual value transactions in OKL_TRX_ASSETS_V and
10: -- OKL_TXL_ASSETS_V
11: -- Business Rules :
12: -- Parameters : p_assets_tbl

Line 9: -- the current RV and then creates residual value transactions in OKL_TRX_ASSETS_V and

5: --
6: -- Procedure Name : create_residual_value_trx
7: -- Description : The main body of the package. This procedure gets a table of line ids along with the new
8: -- residual values as parameter. It then validates the new RV to make sure that it is less than
9: -- the current RV and then creates residual value transactions in OKL_TRX_ASSETS_V and
10: -- OKL_TXL_ASSETS_V
11: -- Business Rules :
12: -- Parameters : p_assets_tbl
13: -- History : SECHAWLA 24-DEC-02 : Bug # 2726739

Line 22: PROCEDURE create_residual_value_trx( p_api_version IN NUMBER,

18: -- transaction is done before all other validations.
19: -- End of comments
20:
21:
22: PROCEDURE create_residual_value_trx( p_api_version IN NUMBER,
23: p_init_msg_list IN VARCHAR2 ,
24: x_return_status OUT NOCOPY VARCHAR2,
25: x_msg_count OUT NOCOPY NUMBER,
26: x_msg_data OUT NOCOPY VARCHAR2,

Line 28: x_residual_value_status OUT NOCOPY VARCHAR2) IS -- this flag is redundant,

24: x_return_status OUT NOCOPY VARCHAR2,
25: x_msg_count OUT NOCOPY NUMBER,
26: x_msg_data OUT NOCOPY VARCHAR2,
27: p_assets_tbl IN assets_tbl_type,
28: x_residual_value_status OUT NOCOPY VARCHAR2) IS -- this flag is redundant,
29: -- we are keeping it for the time
30: -- being to avoid
31: -- rosetta regeneration
32:

Line 42: l_api_name CONSTANT VARCHAR2(30) := 'create_residual_value_trx';

38: l_overall_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
39: l_record_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
40:
41:
42: l_api_name CONSTANT VARCHAR2(30) := 'create_residual_value_trx';
43: l_api_version CONSTANT NUMBER := 1;
44:
45: i NUMBER := 0;
46: l_name VARCHAR2(150);

Line 48: l_old_residual_value NUMBER;

44:
45: i NUMBER := 0;
46: l_name VARCHAR2(150);
47: l_description VARCHAR2(1995);
48: l_old_residual_value NUMBER;
49: l_oec NUMBER;
50: l_chr_id NUMBER;
51: l_try_id okl_trx_types_v.id%TYPE;
52: lp_thpv_rec thpv_rec_type;

Line 73: SELECT l.name, l.item_description, l.residual_value, l.oec, l.chr_id, h.contract_number

69:
70:
71: -- This cursor selects line item fields and contract status for a given line ID
72: CURSOR l_linesfullv_csr(p_id NUMBER) IS
73: SELECT l.name, l.item_description, l.residual_value, l.oec, l.chr_id, h.contract_number
74: FROM okl_k_lines_full_v l, okc_k_headers_b h
75: WHERE l.chr_id = h.id
76: AND l.id = p_id;
77: -- we can use chr_id in the above cursor as we will be pulling data only for the TOP LINE (Financial Asset) which

Line 80: -- This cursor is used to check if a pending residual value writedown transaction already exists for a contract.

76: AND l.id = p_id;
77: -- we can use chr_id in the above cursor as we will be pulling data only for the TOP LINE (Financial Asset) which
78: -- will always have the chr_id.
79:
80: -- This cursor is used to check if a pending residual value writedown transaction already exists for a contract.
81: CURSOR l_assettrx_csr(p_khr_id NUMBER) IS
82: SELECT count(*)
83: FROM OKL_TRX_ASSETS h, okl_txl_assets_v l
84: WHERE h.id = l.tas_id

Line 126: SELECT SYSDATE INTO l_sysdate FROM dual;

122: ELSIF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
123: RAISE OKL_API.G_EXCEPTION_ERROR;
124: END IF;
125:
126: SELECT SYSDATE INTO l_sysdate FROM dual;
127:
128: IF p_assets_tbl.COUNT > 0 THEN
129:
130: okl_am_util_pvt.get_transaction_id(p_try_name => 'Asset Residual Change',

Line 130: okl_am_util_pvt.get_transaction_id(p_try_name => 'Asset Residual Change',

126: SELECT SYSDATE INTO l_sysdate FROM dual;
127:
128: IF p_assets_tbl.COUNT > 0 THEN
129:
130: okl_am_util_pvt.get_transaction_id(p_try_name => 'Asset Residual Change',
131: x_return_status => x_return_status,
132: x_try_id => l_try_id);
133:
134:

Line 140: p_token1_value => 'Asset Residual Change');

136: -- Unable to find a transaction type for this transaction
137: OKL_API.set_message(p_app_name => 'OKL',
138: p_msg_name => 'OKL_AM_NO_TRX_TYPE_FOUND',
139: p_token1 => 'TRY_NAME',
140: p_token1_value => 'Asset Residual Change');
141: RAISE OKC_API.G_EXCEPTION_ERROR;
142: END IF;
143:
144:

Line 161: FETCH l_linesfullv_csr INTO l_name, l_description, l_old_residual_value, l_oec, l_chr_id, l_contract_number;

157: p_token1 => G_COL_NAME_TOKEN,
158: p_token1_value => 'LINE_ID');
159: ELSE
160: OPEN l_linesfullv_csr(p_assets_tbl(i).p_id) ;
161: FETCH l_linesfullv_csr INTO l_name, l_description, l_old_residual_value, l_oec, l_chr_id, l_contract_number;
162: IF l_linesfullv_csr%NOTFOUND THEN
163: l_record_status := OKL_API.G_RET_STS_ERROR;
164: -- Asset number is invalid
165: OKC_API.set_message( p_app_name => 'OKC',

Line 193: -- Can not change Residual value for asset ASSET_NUMBER as an accepted termination quote exists for this asset.

189: OPEN l_quotes_csr(p_assets_tbl(i).p_id);
190: FETCH l_quotes_csr INTO l_name;
191: IF l_quotes_csr%FOUND THEN
192: l_record_status := OKL_API.G_RET_STS_ERROR;
193: -- Can not change Residual value for asset ASSET_NUMBER as an accepted termination quote exists for this asset.
194: OKL_API.set_message( p_app_name => 'OKL',
195: p_msg_name => 'OKL_AM_RVW_NOT_ALLOWED',
196: p_token1 => 'ASSET_NUMBER',
197: p_token1_value => l_name);

Line 199: ELSIF p_assets_tbl(i).p_new_residual_value IS NULL OR p_assets_tbl(i).p_new_residual_value = OKL_API.G_MISS_NUM THEN

195: p_msg_name => 'OKL_AM_RVW_NOT_ALLOWED',
196: p_token1 => 'ASSET_NUMBER',
197: p_token1_value => l_name);
198:
199: ELSIF p_assets_tbl(i).p_new_residual_value IS NULL OR p_assets_tbl(i).p_new_residual_value = OKL_API.G_MISS_NUM THEN
200:
201: l_record_status := OKL_API.G_RET_STS_ERROR;
202:
203: -- Asset failed because the new Residual Value is missing

Line 203: -- Asset failed because the new Residual Value is missing

199: ELSIF p_assets_tbl(i).p_new_residual_value IS NULL OR p_assets_tbl(i).p_new_residual_value = OKL_API.G_MISS_NUM THEN
200:
201: l_record_status := OKL_API.G_RET_STS_ERROR;
202:
203: -- Asset failed because the new Residual Value is missing
204: OKL_API.set_message( p_app_name => 'OKL',
205: p_msg_name => 'OKL_AM_NO_NEW_RESIDUAL_VALUE',
206: p_token1 => 'ASSET_NUMBER',
207: p_token1_value => l_name);

Line 205: p_msg_name => 'OKL_AM_NO_NEW_RESIDUAL_VALUE',

201: l_record_status := OKL_API.G_RET_STS_ERROR;
202:
203: -- Asset failed because the new Residual Value is missing
204: OKL_API.set_message( p_app_name => 'OKL',
205: p_msg_name => 'OKL_AM_NO_NEW_RESIDUAL_VALUE',
206: p_token1 => 'ASSET_NUMBER',
207: p_token1_value => l_name);
208:
209: ELSIF p_assets_tbl(i).p_new_residual_value < 0 THEN

Line 209: ELSIF p_assets_tbl(i).p_new_residual_value < 0 THEN

205: p_msg_name => 'OKL_AM_NO_NEW_RESIDUAL_VALUE',
206: p_token1 => 'ASSET_NUMBER',
207: p_token1_value => l_name);
208:
209: ELSIF p_assets_tbl(i).p_new_residual_value < 0 THEN
210:
211: l_record_status := OKL_API.G_RET_STS_ERROR;
212: -- Asset failed because the new Residual Value is negative
213: OKL_API.set_message( p_app_name => 'OKL',

Line 212: -- Asset failed because the new Residual Value is negative

208:
209: ELSIF p_assets_tbl(i).p_new_residual_value < 0 THEN
210:
211: l_record_status := OKL_API.G_RET_STS_ERROR;
212: -- Asset failed because the new Residual Value is negative
213: OKL_API.set_message( p_app_name => 'OKL',
214: p_msg_name => 'OKL_AM_NEGATIVE_RESIDUAL_VALUE',
215: p_token1 => 'ASSET_NUMBER',
216: p_token1_value => l_name);

Line 214: p_msg_name => 'OKL_AM_NEGATIVE_RESIDUAL_VALUE',

210:
211: l_record_status := OKL_API.G_RET_STS_ERROR;
212: -- Asset failed because the new Residual Value is negative
213: OKL_API.set_message( p_app_name => 'OKL',
214: p_msg_name => 'OKL_AM_NEGATIVE_RESIDUAL_VALUE',
215: p_token1 => 'ASSET_NUMBER',
216: p_token1_value => l_name);
217:
218: ELSIF l_old_residual_value IS NULL THEN

Line 218: ELSIF l_old_residual_value IS NULL THEN

214: p_msg_name => 'OKL_AM_NEGATIVE_RESIDUAL_VALUE',
215: p_token1 => 'ASSET_NUMBER',
216: p_token1_value => l_name);
217:
218: ELSIF l_old_residual_value IS NULL THEN
219: l_record_status := OKL_API.G_RET_STS_ERROR;
220: -- Asset failed because the old Residual Value is missing
221: OKL_API.set_message( p_app_name => 'OKL',
222: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',

Line 220: -- Asset failed because the old Residual Value is missing

216: p_token1_value => l_name);
217:
218: ELSIF l_old_residual_value IS NULL THEN
219: l_record_status := OKL_API.G_RET_STS_ERROR;
220: -- Asset failed because the old Residual Value is missing
221: OKL_API.set_message( p_app_name => 'OKL',
222: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',
223: p_token1 => 'ASSET_NUMBER',
224: p_token1_value => l_name);

Line 222: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',

218: ELSIF l_old_residual_value IS NULL THEN
219: l_record_status := OKL_API.G_RET_STS_ERROR;
220: -- Asset failed because the old Residual Value is missing
221: OKL_API.set_message( p_app_name => 'OKL',
222: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',
223: p_token1 => 'ASSET_NUMBER',
224: p_token1_value => l_name);
225:
226: ELSIF p_assets_tbl(i).p_new_residual_value < l_old_residual_value THEN

Line 226: ELSIF p_assets_tbl(i).p_new_residual_value < l_old_residual_value THEN

222: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',
223: p_token1 => 'ASSET_NUMBER',
224: p_token1_value => l_name);
225:
226: ELSIF p_assets_tbl(i).p_new_residual_value < l_old_residual_value THEN
227:
228: -- RRAVIKIR Legal Entity Changes
229: OPEN l_oklheaders_csr(cp_khr_id => l_chr_id);
230: FETCH l_oklheaders_csr into l_legal_entity_id;

Line 281: p_amount => p_assets_tbl(i).p_new_residual_value,

277: okl_accounting_util.convert_to_functional_currency(
278: p_khr_id => l_chr_id,
279: p_to_currency => l_func_curr_code,
280: p_transaction_date => l_sysdate ,
281: p_amount => p_assets_tbl(i).p_new_residual_value,
282: x_return_status => x_return_status,
283: x_contract_currency => lx_contract_currency,
284: x_currency_conversion_type => lx_currency_conversion_type,
285: x_currency_conversion_rate => lx_currency_conversion_rate,

Line 309: lp_tlpv_rec.old_residual_value := l_old_residual_value;

305: lp_tlpv_rec.line_number := 1;
306: lp_tlpv_rec.tal_type := 'ADL';
307: lp_tlpv_rec.asset_number := l_name;
308: lp_tlpv_rec.description := l_description;
309: lp_tlpv_rec.old_residual_value := l_old_residual_value;
310: lp_tlpv_rec.new_residual_value := p_assets_tbl(i).p_new_residual_value;
311: lp_tlpv_rec.original_cost := l_oec;
312: lp_tlpv_rec.current_units := 1;
313: --lp_tlpv_rec.dnz_asset_id := l_asset_id;

Line 310: lp_tlpv_rec.new_residual_value := p_assets_tbl(i).p_new_residual_value;

306: lp_tlpv_rec.tal_type := 'ADL';
307: lp_tlpv_rec.asset_number := l_name;
308: lp_tlpv_rec.description := l_description;
309: lp_tlpv_rec.old_residual_value := l_old_residual_value;
310: lp_tlpv_rec.new_residual_value := p_assets_tbl(i).p_new_residual_value;
311: lp_tlpv_rec.original_cost := l_oec;
312: lp_tlpv_rec.current_units := 1;
313: --lp_tlpv_rec.dnz_asset_id := l_asset_id;
314: lp_tlpv_rec.dnz_khr_id := l_chr_id;

Line 327: ELSIF p_assets_tbl(i).p_new_residual_value = l_old_residual_value THEN

323: x_tlpv_rec => lx_tlpv_rec);
324: END IF;
325:
326:
327: ELSIF p_assets_tbl(i).p_new_residual_value = l_old_residual_value THEN
328: l_record_status := OKL_API.G_RET_STS_ERROR;
329: -- Asset failed because the new Residual Value is same as the old value.
330: OKL_API.set_message( p_app_name => 'OKL',
331: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',

Line 329: -- Asset failed because the new Residual Value is same as the old value.

325:
326:
327: ELSIF p_assets_tbl(i).p_new_residual_value = l_old_residual_value THEN
328: l_record_status := OKL_API.G_RET_STS_ERROR;
329: -- Asset failed because the new Residual Value is same as the old value.
330: OKL_API.set_message( p_app_name => 'OKL',
331: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',
332: p_token1 => 'ASSET_NUMBER',
333: p_token1_value => l_name);

Line 331: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',

327: ELSIF p_assets_tbl(i).p_new_residual_value = l_old_residual_value THEN
328: l_record_status := OKL_API.G_RET_STS_ERROR;
329: -- Asset failed because the new Residual Value is same as the old value.
330: OKL_API.set_message( p_app_name => 'OKL',
331: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',
332: p_token1 => 'ASSET_NUMBER',
333: p_token1_value => l_name);
334:
335: ELSE -- new residual < old residual

Line 335: ELSE -- new residual < old residual

331: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',
332: p_token1 => 'ASSET_NUMBER',
333: p_token1_value => l_name);
334:
335: ELSE -- new residual < old residual
336:
337: l_record_status := OKL_API.G_RET_STS_ERROR;
338: -- Asset failed because the new Residual Value is not lower than the old value.
339: OKL_API.set_message( p_app_name => 'OKL',

Line 338: -- Asset failed because the new Residual Value is not lower than the old value.

334:
335: ELSE -- new residual < old residual
336:
337: l_record_status := OKL_API.G_RET_STS_ERROR;
338: -- Asset failed because the new Residual Value is not lower than the old value.
339: OKL_API.set_message( p_app_name => 'OKL',
340: p_msg_name => 'OKL_AM_INVALID_RESIDUAL_VALUE',
341: p_token1 => 'ASSET_NUMBER',
342: p_token1_value => l_name);

Line 340: p_msg_name => 'OKL_AM_INVALID_RESIDUAL_VALUE',

336:
337: l_record_status := OKL_API.G_RET_STS_ERROR;
338: -- Asset failed because the new Residual Value is not lower than the old value.
339: OKL_API.set_message( p_app_name => 'OKL',
340: p_msg_name => 'OKL_AM_INVALID_RESIDUAL_VALUE',
341: p_token1 => 'ASSET_NUMBER',
342: p_token1_value => l_name);
343:
344:

Line 431: END create_residual_value_trx;

427: x_msg_count,
428: x_msg_data,
429: '_PVT'
430: );
431: END create_residual_value_trx;
432: END OKL_AM_RV_WRITEDOWN_PVT;