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.5 2009/05/07 06:23:34 rpillay ship $ */
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: -- Included ERROR for Bug# 7014234
82: CURSOR l_assettrx_csr(p_khr_id NUMBER) IS
83: SELECT count(*)
84: FROM OKL_TRX_ASSETS h, okl_txl_assets_v l

Line 138: SELECT SYSDATE INTO l_sysdate FROM dual;

134: ELSIF (l_return_status = OKL_API.G_RET_STS_ERROR) THEN
135: RAISE OKL_API.G_EXCEPTION_ERROR;
136: END IF;
137:
138: SELECT SYSDATE INTO l_sysdate FROM dual;
139:
140: IF p_assets_tbl.COUNT > 0 THEN
141:
142: okl_am_util_pvt.get_transaction_id(p_try_name => 'Asset Residual Change',

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

138: SELECT SYSDATE INTO l_sysdate FROM dual;
139:
140: IF p_assets_tbl.COUNT > 0 THEN
141:
142: okl_am_util_pvt.get_transaction_id(p_try_name => 'Asset Residual Change',
143: x_return_status => x_return_status,
144: x_try_id => l_try_id);
145:
146:

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

148: -- Unable to find a transaction type for this transaction
149: OKL_API.set_message(p_app_name => 'OKL',
150: p_msg_name => 'OKL_AM_NO_TRX_TYPE_FOUND',
151: p_token1 => 'TRY_NAME',
152: p_token1_value => 'Asset Residual Change');
153: RAISE OKC_API.G_EXCEPTION_ERROR;
154: END IF;
155:
156:

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

169: p_token1 => G_COL_NAME_TOKEN,
170: p_token1_value => 'LINE_ID');
171: ELSE
172: OPEN l_linesfullv_csr(p_assets_tbl(i).p_id) ;
173: FETCH l_linesfullv_csr INTO l_name, l_description, l_old_residual_value, l_oec, l_chr_id, l_contract_number;
174: IF l_linesfullv_csr%NOTFOUND THEN
175: l_record_status := OKL_API.G_RET_STS_ERROR;
176: -- Asset number is invalid
177: OKC_API.set_message( p_app_name => 'OKC',

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

221: OPEN l_quotes_csr(p_assets_tbl(i).p_id);
222: FETCH l_quotes_csr INTO l_name;
223: IF l_quotes_csr%FOUND THEN
224: l_record_status := OKL_API.G_RET_STS_ERROR;
225: -- Can not change Residual value for asset ASSET_NUMBER as an accepted termination quote exists for this asset.
226: OKL_API.set_message( p_app_name => 'OKL',
227: p_msg_name => 'OKL_AM_RVW_NOT_ALLOWED',
228: p_token1 => 'ASSET_NUMBER',
229: p_token1_value => l_name);

Line 231: 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

227: p_msg_name => 'OKL_AM_RVW_NOT_ALLOWED',
228: p_token1 => 'ASSET_NUMBER',
229: p_token1_value => l_name);
230:
231: 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
232:
233: l_record_status := OKL_API.G_RET_STS_ERROR;
234:
235: -- Asset failed because the new Residual Value is missing

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

231: 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
232:
233: l_record_status := OKL_API.G_RET_STS_ERROR;
234:
235: -- Asset failed because the new Residual Value is missing
236: OKL_API.set_message( p_app_name => 'OKL',
237: p_msg_name => 'OKL_AM_NO_NEW_RESIDUAL_VALUE',
238: p_token1 => 'ASSET_NUMBER',
239: p_token1_value => l_name);

Line 237: p_msg_name => 'OKL_AM_NO_NEW_RESIDUAL_VALUE',

233: l_record_status := OKL_API.G_RET_STS_ERROR;
234:
235: -- Asset failed because the new Residual Value is missing
236: OKL_API.set_message( p_app_name => 'OKL',
237: p_msg_name => 'OKL_AM_NO_NEW_RESIDUAL_VALUE',
238: p_token1 => 'ASSET_NUMBER',
239: p_token1_value => l_name);
240:
241: ELSIF p_assets_tbl(i).p_new_residual_value < 0 THEN

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

237: p_msg_name => 'OKL_AM_NO_NEW_RESIDUAL_VALUE',
238: p_token1 => 'ASSET_NUMBER',
239: p_token1_value => l_name);
240:
241: ELSIF p_assets_tbl(i).p_new_residual_value < 0 THEN
242:
243: l_record_status := OKL_API.G_RET_STS_ERROR;
244: -- Asset failed because the new Residual Value is negative
245: OKL_API.set_message( p_app_name => 'OKL',

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

240:
241: ELSIF p_assets_tbl(i).p_new_residual_value < 0 THEN
242:
243: l_record_status := OKL_API.G_RET_STS_ERROR;
244: -- Asset failed because the new Residual Value is negative
245: OKL_API.set_message( p_app_name => 'OKL',
246: p_msg_name => 'OKL_AM_NEGATIVE_RESIDUAL_VALUE',
247: p_token1 => 'ASSET_NUMBER',
248: p_token1_value => l_name);

Line 246: p_msg_name => 'OKL_AM_NEGATIVE_RESIDUAL_VALUE',

242:
243: l_record_status := OKL_API.G_RET_STS_ERROR;
244: -- Asset failed because the new Residual Value is negative
245: OKL_API.set_message( p_app_name => 'OKL',
246: p_msg_name => 'OKL_AM_NEGATIVE_RESIDUAL_VALUE',
247: p_token1 => 'ASSET_NUMBER',
248: p_token1_value => l_name);
249:
250: ELSIF l_old_residual_value IS NULL THEN

Line 250: ELSIF l_old_residual_value IS NULL THEN

246: p_msg_name => 'OKL_AM_NEGATIVE_RESIDUAL_VALUE',
247: p_token1 => 'ASSET_NUMBER',
248: p_token1_value => l_name);
249:
250: ELSIF l_old_residual_value IS NULL THEN
251: l_record_status := OKL_API.G_RET_STS_ERROR;
252: -- Asset failed because the old Residual Value is missing
253: OKL_API.set_message( p_app_name => 'OKL',
254: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',

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

248: p_token1_value => l_name);
249:
250: ELSIF l_old_residual_value IS NULL THEN
251: l_record_status := OKL_API.G_RET_STS_ERROR;
252: -- Asset failed because the old Residual Value is missing
253: OKL_API.set_message( p_app_name => 'OKL',
254: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',
255: p_token1 => 'ASSET_NUMBER',
256: p_token1_value => l_name);

Line 254: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',

250: ELSIF l_old_residual_value IS NULL THEN
251: l_record_status := OKL_API.G_RET_STS_ERROR;
252: -- Asset failed because the old Residual Value is missing
253: OKL_API.set_message( p_app_name => 'OKL',
254: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',
255: p_token1 => 'ASSET_NUMBER',
256: p_token1_value => l_name);
257:
258: ELSIF p_assets_tbl(i).p_new_residual_value < l_old_residual_value THEN

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

254: p_msg_name => 'OKL_AM_NO_OLD_RESIDUAL_VALUE',
255: p_token1 => 'ASSET_NUMBER',
256: p_token1_value => l_name);
257:
258: ELSIF p_assets_tbl(i).p_new_residual_value < l_old_residual_value THEN
259:
260: -- RRAVIKIR Legal Entity Changes
261: OPEN l_oklheaders_csr(cp_khr_id => l_chr_id);
262: FETCH l_oklheaders_csr into l_legal_entity_id;

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

309: okl_accounting_util.convert_to_functional_currency(
310: p_khr_id => l_chr_id,
311: p_to_currency => l_func_curr_code,
312: p_transaction_date => l_sysdate ,
313: p_amount => p_assets_tbl(i).p_new_residual_value,
314: x_return_status => x_return_status,
315: x_contract_currency => lx_contract_currency,
316: x_currency_conversion_type => lx_currency_conversion_type,
317: x_currency_conversion_rate => lx_currency_conversion_rate,

Line 341: lp_tlpv_rec.old_residual_value := l_old_residual_value;

337: lp_tlpv_rec.line_number := 1;
338: lp_tlpv_rec.tal_type := 'ADL';
339: lp_tlpv_rec.asset_number := l_name;
340: lp_tlpv_rec.description := l_description;
341: lp_tlpv_rec.old_residual_value := l_old_residual_value;
342: lp_tlpv_rec.new_residual_value := p_assets_tbl(i).p_new_residual_value;
343: lp_tlpv_rec.original_cost := l_oec;
344: lp_tlpv_rec.current_units := 1;
345: --lp_tlpv_rec.dnz_asset_id := l_asset_id;

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

338: lp_tlpv_rec.tal_type := 'ADL';
339: lp_tlpv_rec.asset_number := l_name;
340: lp_tlpv_rec.description := l_description;
341: lp_tlpv_rec.old_residual_value := l_old_residual_value;
342: lp_tlpv_rec.new_residual_value := p_assets_tbl(i).p_new_residual_value;
343: lp_tlpv_rec.original_cost := l_oec;
344: lp_tlpv_rec.current_units := 1;
345: --lp_tlpv_rec.dnz_asset_id := l_asset_id;
346: lp_tlpv_rec.dnz_khr_id := l_chr_id;

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

355: x_tlpv_rec => lx_tlpv_rec);
356: END IF;
357:
358:
359: ELSIF p_assets_tbl(i).p_new_residual_value = l_old_residual_value THEN
360: l_record_status := OKL_API.G_RET_STS_ERROR;
361: -- Asset failed because the new Residual Value is same as the old value.
362: OKL_API.set_message( p_app_name => 'OKL',
363: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',

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

357:
358:
359: ELSIF p_assets_tbl(i).p_new_residual_value = l_old_residual_value THEN
360: l_record_status := OKL_API.G_RET_STS_ERROR;
361: -- Asset failed because the new Residual Value is same as the old value.
362: OKL_API.set_message( p_app_name => 'OKL',
363: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',
364: p_token1 => 'ASSET_NUMBER',
365: p_token1_value => l_name);

Line 363: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',

359: ELSIF p_assets_tbl(i).p_new_residual_value = l_old_residual_value THEN
360: l_record_status := OKL_API.G_RET_STS_ERROR;
361: -- Asset failed because the new Residual Value is same as the old value.
362: OKL_API.set_message( p_app_name => 'OKL',
363: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',
364: p_token1 => 'ASSET_NUMBER',
365: p_token1_value => l_name);
366:
367: ELSE -- new residual < old residual

Line 367: ELSE -- new residual < old residual

363: p_msg_name => 'OKL_AM_SAME_RESIDUAL_VALUE',
364: p_token1 => 'ASSET_NUMBER',
365: p_token1_value => l_name);
366:
367: ELSE -- new residual < old residual
368:
369: l_record_status := OKL_API.G_RET_STS_ERROR;
370: -- Asset failed because the new Residual Value is not lower than the old value.
371: OKL_API.set_message( p_app_name => 'OKL',

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

366:
367: ELSE -- new residual < old residual
368:
369: l_record_status := OKL_API.G_RET_STS_ERROR;
370: -- Asset failed because the new Residual Value is not lower than the old value.
371: OKL_API.set_message( p_app_name => 'OKL',
372: p_msg_name => 'OKL_AM_INVALID_RESIDUAL_VALUE',
373: p_token1 => 'ASSET_NUMBER',
374: p_token1_value => l_name);

Line 372: p_msg_name => 'OKL_AM_INVALID_RESIDUAL_VALUE',

368:
369: l_record_status := OKL_API.G_RET_STS_ERROR;
370: -- Asset failed because the new Residual Value is not lower than the old value.
371: OKL_API.set_message( p_app_name => 'OKL',
372: p_msg_name => 'OKL_AM_INVALID_RESIDUAL_VALUE',
373: p_token1 => 'ASSET_NUMBER',
374: p_token1_value => l_name);
375:
376:

Line 463: END create_residual_value_trx;

459: x_msg_count,
460: x_msg_data,
461: '_PVT'
462: );
463: END create_residual_value_trx;
464: END OKL_AM_RV_WRITEDOWN_PVT;