19: p_case_folder_id IN NUMBER,
20: p_score_model_id IN NUMBER Default NULL,
21: p_score IN NUMBER
22: ) IS
23: l_case_folder_type ar_cmgt_case_folders.type%type;
24: l_case_folder_status ar_cmgt_case_folders.status%type;
25: l_data_point_id ar_cmgt_score_dtls.DATA_POINT_ID%type;
26: l_party_id ar_cmgt_case_folders.party_id%type;
27: l_cust_account_id ar_cmgt_case_folders.cust_account_id%type;
20: p_score_model_id IN NUMBER Default NULL,
21: p_score IN NUMBER
22: ) IS
23: l_case_folder_type ar_cmgt_case_folders.type%type;
24: l_case_folder_status ar_cmgt_case_folders.status%type;
25: l_data_point_id ar_cmgt_score_dtls.DATA_POINT_ID%type;
26: l_party_id ar_cmgt_case_folders.party_id%type;
27: l_cust_account_id ar_cmgt_case_folders.cust_account_id%type;
28: l_site_use_id ar_cmgt_case_folders.site_use_id%type;
22: ) IS
23: l_case_folder_type ar_cmgt_case_folders.type%type;
24: l_case_folder_status ar_cmgt_case_folders.status%type;
25: l_data_point_id ar_cmgt_score_dtls.DATA_POINT_ID%type;
26: l_party_id ar_cmgt_case_folders.party_id%type;
27: l_cust_account_id ar_cmgt_case_folders.cust_account_id%type;
28: l_site_use_id ar_cmgt_case_folders.site_use_id%type;
29: l_score_model_id ar_cmgt_case_folders.score_model_id%type;
30: l_data_point_code ar_cmgt_data_points_b.data_point_code%type;
23: l_case_folder_type ar_cmgt_case_folders.type%type;
24: l_case_folder_status ar_cmgt_case_folders.status%type;
25: l_data_point_id ar_cmgt_score_dtls.DATA_POINT_ID%type;
26: l_party_id ar_cmgt_case_folders.party_id%type;
27: l_cust_account_id ar_cmgt_case_folders.cust_account_id%type;
28: l_site_use_id ar_cmgt_case_folders.site_use_id%type;
29: l_score_model_id ar_cmgt_case_folders.score_model_id%type;
30: l_data_point_code ar_cmgt_data_points_b.data_point_code%type;
31: BEGIN
24: l_case_folder_status ar_cmgt_case_folders.status%type;
25: l_data_point_id ar_cmgt_score_dtls.DATA_POINT_ID%type;
26: l_party_id ar_cmgt_case_folders.party_id%type;
27: l_cust_account_id ar_cmgt_case_folders.cust_account_id%type;
28: l_site_use_id ar_cmgt_case_folders.site_use_id%type;
29: l_score_model_id ar_cmgt_case_folders.score_model_id%type;
30: l_data_point_code ar_cmgt_data_points_b.data_point_code%type;
31: BEGIN
32: /* The following validation will be placed into the procedure
25: l_data_point_id ar_cmgt_score_dtls.DATA_POINT_ID%type;
26: l_party_id ar_cmgt_case_folders.party_id%type;
27: l_cust_account_id ar_cmgt_case_folders.cust_account_id%type;
28: l_site_use_id ar_cmgt_case_folders.site_use_id%type;
29: l_score_model_id ar_cmgt_case_folders.score_model_id%type;
30: l_data_point_code ar_cmgt_data_points_b.data_point_code%type;
31: BEGIN
32: /* The following validation will be placed into the procedure
33: 1. If Score Model Id is passed then it must match with the case folder
68: l_score_model_id,
69: l_party_id,
70: l_cust_account_id,
71: l_site_use_id
72: from ar_cmgt_case_folders
73: where case_folder_id = p_case_folder_id ;
74:
75: IF l_case_folder_type = 'CASE' and
76: ((l_case_folder_status = 'CREATED') or (l_case_folder_status = 'SAVED')
93: update ar_cmgt_cf_dtls
94: set score = p_score,
95: data_point_value = p_score
96: where CASE_FOLDER_ID = ( select CASE_FOLDER_ID
97: from ar_cmgt_case_folders
98: where type = 'DATA'
99: and party_id = l_party_id
100: and cust_account_id = l_cust_account_id
101: and site_use_id = l_site_use_id)
174: x_msg_data OUT NOCOPY VARCHAR2,
175: p_case_folder_id IN NUMBER,
176: p_data_point_id IN data_point_id_varray
177: ) IS
178: l_case_folder_type ar_cmgt_case_folders.type%type;
179: l_case_folder_status ar_cmgt_case_folders.status%type;
180: l_data_point_id ar_cmgt_cf_dtls.DATA_POINT_ID%type;
181: BEGIN
182: /* The following validation will be placed into the procedure
175: p_case_folder_id IN NUMBER,
176: p_data_point_id IN data_point_id_varray
177: ) IS
178: l_case_folder_type ar_cmgt_case_folders.type%type;
179: l_case_folder_status ar_cmgt_case_folders.status%type;
180: l_data_point_id ar_cmgt_cf_dtls.DATA_POINT_ID%type;
181: BEGIN
182: /* The following validation will be placed into the procedure
183: 1. Case folder Id must be of typed 'CASE'
204: select type,
205: status
206: into l_case_folder_type,
207: l_case_folder_status
208: from ar_cmgt_case_folders
209: where case_folder_id = p_case_folder_id ;
210:
211: IF l_case_folder_type = 'CASE' and
212: ((l_case_folder_status = 'CREATED') or (l_case_folder_status = 'SAVED')
299: p_case_folder_id IN NUMBER,
300: p_recommendations_type IN VARCHAR2,
301: p_recommendations_tbl IN credit_recommendation_tbl
302: ) IS
303: l_case_folder_type ar_cmgt_case_folders.type%type;
304: l_case_folder_status ar_cmgt_case_folders.status%type;
305: l_credit_request_id ar_cmgt_case_folders.credit_request_id%type;
306: l_credit_type ar_cmgt_credit_requests.credit_type%type;
307: l_lookup_type fnd_lookups.lookup_type%type;
300: p_recommendations_type IN VARCHAR2,
301: p_recommendations_tbl IN credit_recommendation_tbl
302: ) IS
303: l_case_folder_type ar_cmgt_case_folders.type%type;
304: l_case_folder_status ar_cmgt_case_folders.status%type;
305: l_credit_request_id ar_cmgt_case_folders.credit_request_id%type;
306: l_credit_type ar_cmgt_credit_requests.credit_type%type;
307: l_lookup_type fnd_lookups.lookup_type%type;
308: l_application_id ar_cmgt_credit_requests.SOURCE_RESP_APPLN_ID%type;
301: p_recommendations_tbl IN credit_recommendation_tbl
302: ) IS
303: l_case_folder_type ar_cmgt_case_folders.type%type;
304: l_case_folder_status ar_cmgt_case_folders.status%type;
305: l_credit_request_id ar_cmgt_case_folders.credit_request_id%type;
306: l_credit_type ar_cmgt_credit_requests.credit_type%type;
307: l_lookup_type fnd_lookups.lookup_type%type;
308: l_application_id ar_cmgt_credit_requests.SOURCE_RESP_APPLN_ID%type;
309:
330:
331: x_return_status := FND_API.G_RET_STS_SUCCESS;
332: IF p_case_folder_id IS NOT NULL THEN
333: BEGIN
334: select ar_cmgt_case_folders.type,
335: ar_cmgt_case_folders.status,
336: ar_cmgt_case_folders.credit_request_id,
337: ar_cmgt_credit_requests.credit_type,
338: ar_cmgt_credit_requests.SOURCE_RESP_APPLN_ID
331: x_return_status := FND_API.G_RET_STS_SUCCESS;
332: IF p_case_folder_id IS NOT NULL THEN
333: BEGIN
334: select ar_cmgt_case_folders.type,
335: ar_cmgt_case_folders.status,
336: ar_cmgt_case_folders.credit_request_id,
337: ar_cmgt_credit_requests.credit_type,
338: ar_cmgt_credit_requests.SOURCE_RESP_APPLN_ID
339: into l_case_folder_type,
332: IF p_case_folder_id IS NOT NULL THEN
333: BEGIN
334: select ar_cmgt_case_folders.type,
335: ar_cmgt_case_folders.status,
336: ar_cmgt_case_folders.credit_request_id,
337: ar_cmgt_credit_requests.credit_type,
338: ar_cmgt_credit_requests.SOURCE_RESP_APPLN_ID
339: into l_case_folder_type,
340: l_case_folder_status,
340: l_case_folder_status,
341: l_credit_request_id,
342: l_credit_type,
343: l_application_id
344: from ar_cmgt_case_folders,
345: ar_cmgt_credit_requests
346: where ar_cmgt_case_folders.case_folder_id = p_case_folder_id ;
347:
348: IF l_case_folder_type = 'CASE' and
342: l_credit_type,
343: l_application_id
344: from ar_cmgt_case_folders,
345: ar_cmgt_credit_requests
346: where ar_cmgt_case_folders.case_folder_id = p_case_folder_id ;
347:
348: IF l_case_folder_type = 'CASE' and
349: ((l_case_folder_status = 'CREATED') or (l_case_folder_status = 'SAVED')
350: or (l_case_folder_status = 'IN_PROCESS') ) THEN
472: x_msg_count OUT NOCOPY NUMBER,
473: x_msg_data OUT NOCOPY VARCHAR2,
474: p_case_folder_id IN NUMBER
475: ) IS
476: l_case_folder_type ar_cmgt_case_folders.type%type;
477: l_case_folder_status ar_cmgt_case_folders.status%type;
478: l_credit_request_id ar_cmgt_case_folders.credit_request_id%type;
479: BEGIN
480: /* The following validation will be placed into the API
473: x_msg_data OUT NOCOPY VARCHAR2,
474: p_case_folder_id IN NUMBER
475: ) IS
476: l_case_folder_type ar_cmgt_case_folders.type%type;
477: l_case_folder_status ar_cmgt_case_folders.status%type;
478: l_credit_request_id ar_cmgt_case_folders.credit_request_id%type;
479: BEGIN
480: /* The following validation will be placed into the API
481: 1. Case folder Id must be of typed 'CASE'.
474: p_case_folder_id IN NUMBER
475: ) IS
476: l_case_folder_type ar_cmgt_case_folders.type%type;
477: l_case_folder_status ar_cmgt_case_folders.status%type;
478: l_credit_request_id ar_cmgt_case_folders.credit_request_id%type;
479: BEGIN
480: /* The following validation will be placed into the API
481: 1. Case folder Id must be of typed 'CASE'.
482: 2. The case folder status must be in 'CREATED' or 'SAVED' status.
505: credit_request_id
506: into l_case_folder_type,
507: l_case_folder_status,
508: l_credit_request_id
509: from ar_cmgt_case_folders
510: where case_folder_id = p_case_folder_id ;
511:
512: IF l_case_folder_type = 'CASE' and
513: ((l_case_folder_status = 'CREATED') or (l_case_folder_status = 'SAVED')
512: IF l_case_folder_type = 'CASE' and
513: ((l_case_folder_status = 'CREATED') or (l_case_folder_status = 'SAVED')
514: or (l_case_folder_status = 'IN_PROCESS') ) THEN
515: /* Update case folder status to 'SUBMIT' and kick of the worlflow */
516: update ar_cmgt_case_folders
517: set status = 'SUBMIT'
518: where case_folder_id = p_case_folder_id ;
519:
520: AR_CMGT_WF_ENGINE.START_WORKFLOW