335:
336: FUNCTION glzcbc
337: (
338: p_mode IN VARCHAR2,
339: p_conc_proc IN VARCHAR2 := FND_API.G_FALSE
340: ) RETURN NUMBER AS
341:
342: CURSOR c_event_details
343: is
536: -- Get accounting date
537: igc_cbc_po_grp.get_cbc_acct_date
538: (
539: p_api_version => 1.0
540: ,p_init_msg_list => FND_API.G_FALSE
541: ,p_commit => FND_API.G_FALSE
542: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
543: ,x_return_status => l_return_status
544: ,x_msg_count => l_msg_count
537: igc_cbc_po_grp.get_cbc_acct_date
538: (
539: p_api_version => 1.0
540: ,p_init_msg_list => FND_API.G_FALSE
541: ,p_commit => FND_API.G_FALSE
542: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
543: ,x_return_status => l_return_status
544: ,x_msg_count => l_msg_count
545: ,x_msg_data => l_msg_data
538: (
539: p_api_version => 1.0
540: ,p_init_msg_list => FND_API.G_FALSE
541: ,p_commit => FND_API.G_FALSE
542: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
543: ,x_return_status => l_return_status
544: ,x_msg_count => l_msg_count
545: ,x_msg_data => l_msg_data
546: ,p_document_id => l_document_id
553: IF (g_debug_mode = 'Y') THEN
554: Put_Debug_Msg(l_full_path, 'Returned from igc_cbc_po_grp.get_cbc_acct_date '||l_return_status||' : '||l_packet_accounting_date );
555: END IF;
556:
557: IF l_return_status <> FND_API.G_RET_STS_SUCCESS OR l_packet_accounting_date IS NULL
558: THEN
559: ROLLBACK TO IGC_GLZCBC ;
560: RETURN(0) ;
561: END IF;
565: --Get the accounting date from the database
566: igc_cbc_po_grp.get_cbc_acct_date
567: (
568: p_api_version => 1.0
569: ,p_init_msg_list => FND_API.G_FALSE
570: ,p_commit => FND_API.G_FALSE
571: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
572: ,x_return_status => l_return_status
573: ,x_msg_count => l_msg_count
566: igc_cbc_po_grp.get_cbc_acct_date
567: (
568: p_api_version => 1.0
569: ,p_init_msg_list => FND_API.G_FALSE
570: ,p_commit => FND_API.G_FALSE
571: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
572: ,x_return_status => l_return_status
573: ,x_msg_count => l_msg_count
574: ,x_msg_data => l_msg_data
567: (
568: p_api_version => 1.0
569: ,p_init_msg_list => FND_API.G_FALSE
570: ,p_commit => FND_API.G_FALSE
571: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
572: ,x_return_status => l_return_status
573: ,x_msg_count => l_msg_count
574: ,x_msg_data => l_msg_data
575: ,p_document_id => l_document_id
582: -- This section would normally be executed when called from
583: -- Doc Import with automatic funds reservation.
584: -- It would not get executed if invoked from the front
585: -- end forms.
586: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
587: OR l_accounting_date IS NULL
588: THEN
589: --Default the accounting date
590: igc_cbc_po_grp.get_cbc_acct_date
589: --Default the accounting date
590: igc_cbc_po_grp.get_cbc_acct_date
591: (
592: p_api_version => 1.0
593: ,p_init_msg_list => FND_API.G_FALSE
594: ,p_commit => FND_API.G_FALSE
595: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
596: ,x_return_status => l_return_status
597: ,x_msg_count => l_msg_count
590: igc_cbc_po_grp.get_cbc_acct_date
591: (
592: p_api_version => 1.0
593: ,p_init_msg_list => FND_API.G_FALSE
594: ,p_commit => FND_API.G_FALSE
595: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
596: ,x_return_status => l_return_status
597: ,x_msg_count => l_msg_count
598: ,x_msg_data => l_msg_data
591: (
592: p_api_version => 1.0
593: ,p_init_msg_list => FND_API.G_FALSE
594: ,p_commit => FND_API.G_FALSE
595: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
596: ,x_return_status => l_return_status
597: ,x_msg_count => l_msg_count
598: ,x_msg_data => l_msg_data
599: ,p_document_id => l_document_id
603: ,x_cbc_acct_date => l_accounting_date
604: ) ;
605:
606: -- If there were any errors or if a valid accounting date was not found, return error
607: IF l_return_status <> FND_API.G_RET_STS_SUCCESS OR l_accounting_date IS NULL
608: THEN
609:
610: ROLLBACK TO IGC_GLZCBC ;
611: RETURN(0) ;
614: -- A valid accounting date was obtained. Therefore update the document.
615: igc_cbc_po_grp.update_cbc_acct_date
616: (
617: p_api_version => 1.0
618: ,p_init_msg_list => FND_API.G_FALSE
619: ,p_commit => FND_API.G_FALSE
620: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
621: ,x_return_status => l_return_status
622: ,x_msg_count => l_msg_count
615: igc_cbc_po_grp.update_cbc_acct_date
616: (
617: p_api_version => 1.0
618: ,p_init_msg_list => FND_API.G_FALSE
619: ,p_commit => FND_API.G_FALSE
620: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
621: ,x_return_status => l_return_status
622: ,x_msg_count => l_msg_count
623: ,x_msg_data => l_msg_data
616: (
617: p_api_version => 1.0
618: ,p_init_msg_list => FND_API.G_FALSE
619: ,p_commit => FND_API.G_FALSE
620: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
621: ,x_return_status => l_return_status
622: ,x_msg_count => l_msg_count
623: ,x_msg_data => l_msg_data
624: ,p_document_id => l_document_id
626: ,p_document_sub_type => l_document_subtype
627: ,p_cbc_acct_date => l_accounting_date
628: ) ;
629:
630: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
631: THEN
632: ROLLBACK TO IGC_GLZCBC ;
633: RETURN(0) ;
634: END IF ;