216: ,p_contract_rec => l_contract_rec
217: ,p_party_contacts_tbl => l_party_contacts
218: ,p_contract_parties_tbl => l_contract_parties
219: ,p_risks_tbl => l_risks_tbl
220: ,p_commit => fnd_api.g_true
221: ,x_msg_data => x_return_msg
222: ,x_return_status=> x_return_status
223: ,x_msg_count => l_msg_count);
224:
241: WHEN OTHERS THEN
242:
243: PO_CLOSEOUT_PVT.Log( d_module, l_progress, 'PO_CLOSEOUT_PVT.create_contract : when others exception at '
244: || l_progress || ';' || SQLERRM );
245: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
246: x_return_msg := SQLERRM;
247: END create_contract;
248: --------------------------------------------------------------------------------
249: --Start of Comments
354: WHEN OTHERS THEN
355:
356: PO_CLOSEOUT_PVT.Log( d_module, l_progress, 'PO_CLOSEOUT_PVT.check_contract_exists : when others exception at '
357: || l_progress || ';' || SQLERRM );
358: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
359: x_return_msg := SQLERRM;
360:
361: END check_contract_exists;
362:
451: WHEN OTHERS THEN
452:
453: PO_CLOSEOUT_PVT.Log( d_module, d_position, 'PO_CLOSEOUT_PVT.get_contract : when others exception at '
454: || l_progress || ';' || SQLERRM );
455: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
456: x_return_msg := SQLERRM;
457:
458: END get_contract;
459:
933: l_document_rec.business_document_id := p_doc_id;
934:
935: OKC_REP_CLOSEOUT_PVT.validate_closeout_tasks(
936: p_api_version => 1.0,
937: p_init_msg_list => fnd_api.g_false,
938: p_commit => fnd_api.g_true,
939: p_document_rec => l_document_rec,
940: x_msg_data => x_msg_data,
941: x_msg_count => x_msg_count,
934:
935: OKC_REP_CLOSEOUT_PVT.validate_closeout_tasks(
936: p_api_version => 1.0,
937: p_init_msg_list => fnd_api.g_false,
938: p_commit => fnd_api.g_true,
939: p_document_rec => l_document_rec,
940: x_msg_data => x_msg_data,
941: x_msg_count => x_msg_count,
942: x_return_status => x_return_status,
1572: END IF;
1573:
1574: l_progress := 75;
1575: OKC_REP_CLOSEOUT_PVT.copy_set_tasks_to_each_po(p_api_version => 1.0
1576: , p_init_msg_list => fnd_api.g_false
1577: , p_commit => fnd_api.g_false
1578: , p_src_document_rec => l_src_document_rec
1579: , p_tgt_document_rec => l_tgt_document_rec
1580: , p_contract_rec => l_contract_rec
1573:
1574: l_progress := 75;
1575: OKC_REP_CLOSEOUT_PVT.copy_set_tasks_to_each_po(p_api_version => 1.0
1576: , p_init_msg_list => fnd_api.g_false
1577: , p_commit => fnd_api.g_false
1578: , p_src_document_rec => l_src_document_rec
1579: , p_tgt_document_rec => l_tgt_document_rec
1580: , p_contract_rec => l_contract_rec
1581: , p_contract_parties_tbl => l_contract_parties
1588: PO_CLOSEOUT_PVT.Log( d_module, l_progress, 'contract_id ' || l_contract_rec.contract_id);
1589: PO_CLOSEOUT_PVT.Log( d_module, l_progress, 'contract_ver ' || l_contract_rec.contract_version_num);
1590: PO_CLOSEOUT_PVT.Log( d_module, l_progress, 'contract_type ' || l_contract_rec.contract_type_txt);
1591: PO_CLOSEOUT_PVT.Log( d_module, l_progress, 'l_return_status ' || l_return_status);
1592: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
1593: fnd_file.put_line(FND_FILE.LOG, 'Contract creation is successful. Contract id is ' || l_contract_rec.contract_id);
1594: ELSE
1595: fnd_file.put_line(FND_FILE.LOG, 'There are warnings/Errors while creating the contract.');
1596: fnd_file.put_line(FND_FILE.LOG, 'Message:' || l_result_type);
1600: fnd_file.put_line(FND_FILE.LOG, 'Workflow process has been intiated');
1601: PO_CLOSEOUT_PVT.start_closeout_wf_process(p_doc_id => l_doc_id,
1602: x_return_status => l_return_status);
1603:
1604: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
1605: fnd_file.put_line(FND_FILE.LOG, 'Workflow is successfully initiated');
1606: COMMIT;
1607: ELSE
1608: fnd_file.put_line(FND_FILE.LOG, 'Error(s) occured while initiating the workflow');
1840: l_document_rec.business_document_id := p_req_id;
1841:
1842: OKC_REP_CLOSEOUT_PVT.validate_closeout_tasks(
1843: p_api_version => 1.0,
1844: p_init_msg_list => fnd_api.g_false,
1845: p_commit => fnd_api.g_true,
1846: p_document_rec => l_document_rec,
1847: x_msg_data => x_msg_data,
1848: x_msg_count => x_msg_count,
1841:
1842: OKC_REP_CLOSEOUT_PVT.validate_closeout_tasks(
1843: p_api_version => 1.0,
1844: p_init_msg_list => fnd_api.g_false,
1845: p_commit => fnd_api.g_true,
1846: p_document_rec => l_document_rec,
1847: x_msg_data => x_msg_data,
1848: x_msg_count => x_msg_count,
1849: x_return_status => x_return_status,
2656: okc_rep_closeout_pvt.delete_contract(p_api_version => 1.0,
2657: p_document_rec => l_document_rec,
2658: p_contract_type => l_contract_type,
2659: p_contract_id => l_contract_id,
2660: p_commit => fnd_api.g_true,
2661: x_msg_data => x_return_msg,
2662: x_msg_count => l_msg_count,
2663: x_return_status => x_return_status);
2664: ELSE
2662: x_msg_count => l_msg_count,
2663: x_return_status => x_return_status);
2664: ELSE
2665: x_return_msg := 'Contract does not exits for this document';
2666: x_return_status := FND_API.G_RET_STS_SUCCESS;
2667: END IF;
2668:
2669: PO_CLOSEOUT_PVT.Log( d_module, l_progress, 'x_return_msg ' || x_return_msg);
2670: PO_CLOSEOUT_PVT.Log( d_module, l_progress, 'l_msg_count ' || l_msg_count);
3330:
3331: OKC_REP_CLOSEOUT_PVT.Activate_tasks_closeout( p_api_version => 1.0,
3332: p_document_rec => l_document_rec,
3333: p_physical_completion_date => sysdate,
3334: p_init_msg_list => fnd_api.g_false ,
3335: p_commit => fnd_api.g_true,
3336: x_task_status => l_task_status,
3337: x_msg_data => l_msg_data,
3338: x_msg_count => l_msg_count,
3331: OKC_REP_CLOSEOUT_PVT.Activate_tasks_closeout( p_api_version => 1.0,
3332: p_document_rec => l_document_rec,
3333: p_physical_completion_date => sysdate,
3334: p_init_msg_list => fnd_api.g_false ,
3335: p_commit => fnd_api.g_true,
3336: x_task_status => l_task_status,
3337: x_msg_data => l_msg_data,
3338: x_msg_count => l_msg_count,
3339: x_return_status => l_return_status);
3346: PO_CLOSEOUT_PVT.Log( d_module, d_position, 'l_rev_number: '||l_rev_number);
3347: PO_CLOSEOUT_PVT.Log( d_module, d_position, 'l_doc_num: '||l_doc_num);
3348:
3349:
3350: IF (l_return_status = fnd_api.g_ret_sts_success AND l_task_status = 'COMPLETED') THEN
3351: resultout := wf_engine.eng_completed || ':' || 'COMPLETED' ;
3352: --When a document is reopened and If the tasks are already completed, workflow will directly initiates the signing process
3353: update PO_CLOSEOUT_DETAILS
3354: set incloseout = 'W'
3353: update PO_CLOSEOUT_DETAILS
3354: set incloseout = 'W'
3355: where reference_doc_id = l_document_id
3356: and closeout_doc_type = PO_CLOSEOUT_PVT.g_CLOSEOUT_TYPE_INDIVIDUAL;
3357: ELSIF (l_return_status = fnd_api.g_ret_sts_success AND l_task_status = 'INITIATED') THEN
3358: resultout := wf_engine.eng_completed || ':' || 'ACTIVATED' ;
3359: ELSIF (l_return_status = fnd_api.g_ret_sts_error OR l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
3360: resultout := wf_engine.eng_completed || ':' || 'ERROR' ;
3361: END IF;
3355: where reference_doc_id = l_document_id
3356: and closeout_doc_type = PO_CLOSEOUT_PVT.g_CLOSEOUT_TYPE_INDIVIDUAL;
3357: ELSIF (l_return_status = fnd_api.g_ret_sts_success AND l_task_status = 'INITIATED') THEN
3358: resultout := wf_engine.eng_completed || ':' || 'ACTIVATED' ;
3359: ELSIF (l_return_status = fnd_api.g_ret_sts_error OR l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
3360: resultout := wf_engine.eng_completed || ':' || 'ERROR' ;
3361: END IF;
3362:
3363: IF (PO_LOG.d_proc) THEN PO_LOG.proc_end(d_module); END IF;
3900:
3901: EXCEPTION
3902: WHEN No_Data_Found THEN
3903: PO_CLOSEOUT_PVT.Log( d_module, d_position, 'No records found to start workflow. Exited ');
3904: x_return_status := FND_API.G_RET_STS_SUCCESS;
3905: RETURN;
3906:
3907: END;
3908: l_progress := 10;
4146: AND closeout_doc_type = PO_CLOSEOUT_PVT.g_CLOSEOUT_TYPE_INDIVIDUAL;
4147:
4148: END IF;
4149:
4150: x_return_status := FND_API.G_RET_STS_SUCCESS;
4151:
4152: IF (PO_LOG.d_proc) THEN PO_LOG.proc_end(d_module); END IF;
4153:
4154: EXCEPTION
4152: IF (PO_LOG.d_proc) THEN PO_LOG.proc_end(d_module); END IF;
4153:
4154: EXCEPTION
4155: WHEN OTHERS THEN
4156: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4157:
4158: PO_CLOSEOUT_PVT.Log( d_module, d_position, 'PO_CLOSEOUT_PVT.start_closeout_wf_process : when others exception at '
4159: || l_progress || ';' || SQLERRM );
4160: RAISE;