345:
346: FUNCTION glzcbc
347: (
348: p_mode IN VARCHAR2,
349: p_conc_proc IN VARCHAR2 := FND_API.G_FALSE
350: ) RETURN NUMBER AS
351:
352: CURSOR c_event_details
353: is
556: -- Get accounting date
557: igc_cbc_po_grp.get_cbc_acct_date
558: (
559: p_api_version => 1.0
560: ,p_init_msg_list => FND_API.G_FALSE
561: ,p_commit => FND_API.G_FALSE
562: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
563: ,x_return_status => l_return_status
564: ,x_msg_count => l_msg_count
557: igc_cbc_po_grp.get_cbc_acct_date
558: (
559: p_api_version => 1.0
560: ,p_init_msg_list => FND_API.G_FALSE
561: ,p_commit => FND_API.G_FALSE
562: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
563: ,x_return_status => l_return_status
564: ,x_msg_count => l_msg_count
565: ,x_msg_data => l_msg_data
558: (
559: p_api_version => 1.0
560: ,p_init_msg_list => FND_API.G_FALSE
561: ,p_commit => FND_API.G_FALSE
562: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
563: ,x_return_status => l_return_status
564: ,x_msg_count => l_msg_count
565: ,x_msg_data => l_msg_data
566: ,p_document_id => l_document_id
573: IF (g_debug_mode = 'Y') THEN
574: Put_Debug_Msg(l_full_path, 'Returned from igc_cbc_po_grp.get_cbc_acct_date '||l_return_status||' : '||l_packet_accounting_date );
575: END IF;
576:
577: IF l_return_status <> FND_API.G_RET_STS_SUCCESS OR l_packet_accounting_date IS NULL
578: THEN
579: ROLLBACK TO IGC_GLZCBC ;
580: RETURN(0) ;
581: END IF;
585: --Get the accounting date from the database
586: igc_cbc_po_grp.get_cbc_acct_date
587: (
588: p_api_version => 1.0
589: ,p_init_msg_list => FND_API.G_FALSE
590: ,p_commit => FND_API.G_FALSE
591: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
592: ,x_return_status => l_return_status
593: ,x_msg_count => l_msg_count
586: igc_cbc_po_grp.get_cbc_acct_date
587: (
588: p_api_version => 1.0
589: ,p_init_msg_list => FND_API.G_FALSE
590: ,p_commit => FND_API.G_FALSE
591: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
592: ,x_return_status => l_return_status
593: ,x_msg_count => l_msg_count
594: ,x_msg_data => l_msg_data
587: (
588: p_api_version => 1.0
589: ,p_init_msg_list => FND_API.G_FALSE
590: ,p_commit => FND_API.G_FALSE
591: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
592: ,x_return_status => l_return_status
593: ,x_msg_count => l_msg_count
594: ,x_msg_data => l_msg_data
595: ,p_document_id => l_document_id
602: -- This section would normally be executed when called from
603: -- Doc Import with automatic funds reservation.
604: -- It would not get executed if invoked from the front
605: -- end forms.
606: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
607: OR l_accounting_date IS NULL
608: THEN
609: --Default the accounting date
610: igc_cbc_po_grp.get_cbc_acct_date
609: --Default the accounting date
610: igc_cbc_po_grp.get_cbc_acct_date
611: (
612: p_api_version => 1.0
613: ,p_init_msg_list => FND_API.G_FALSE
614: ,p_commit => FND_API.G_FALSE
615: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
616: ,x_return_status => l_return_status
617: ,x_msg_count => l_msg_count
610: igc_cbc_po_grp.get_cbc_acct_date
611: (
612: p_api_version => 1.0
613: ,p_init_msg_list => FND_API.G_FALSE
614: ,p_commit => FND_API.G_FALSE
615: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
616: ,x_return_status => l_return_status
617: ,x_msg_count => l_msg_count
618: ,x_msg_data => l_msg_data
611: (
612: p_api_version => 1.0
613: ,p_init_msg_list => FND_API.G_FALSE
614: ,p_commit => FND_API.G_FALSE
615: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
616: ,x_return_status => l_return_status
617: ,x_msg_count => l_msg_count
618: ,x_msg_data => l_msg_data
619: ,p_document_id => l_document_id
623: ,x_cbc_acct_date => l_accounting_date
624: ) ;
625:
626: -- If there were any errors or if a valid accounting date was not found, return error
627: IF l_return_status <> FND_API.G_RET_STS_SUCCESS OR l_accounting_date IS NULL
628: THEN
629:
630: ROLLBACK TO IGC_GLZCBC ;
631: RETURN(0) ;
634: -- A valid accounting date was obtained. Therefore update the document.
635: igc_cbc_po_grp.update_cbc_acct_date
636: (
637: p_api_version => 1.0
638: ,p_init_msg_list => FND_API.G_FALSE
639: ,p_commit => FND_API.G_FALSE
640: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
641: ,x_return_status => l_return_status
642: ,x_msg_count => l_msg_count
635: igc_cbc_po_grp.update_cbc_acct_date
636: (
637: p_api_version => 1.0
638: ,p_init_msg_list => FND_API.G_FALSE
639: ,p_commit => FND_API.G_FALSE
640: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
641: ,x_return_status => l_return_status
642: ,x_msg_count => l_msg_count
643: ,x_msg_data => l_msg_data
636: (
637: p_api_version => 1.0
638: ,p_init_msg_list => FND_API.G_FALSE
639: ,p_commit => FND_API.G_FALSE
640: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
641: ,x_return_status => l_return_status
642: ,x_msg_count => l_msg_count
643: ,x_msg_data => l_msg_data
644: ,p_document_id => l_document_id
646: ,p_document_sub_type => l_document_subtype
647: ,p_cbc_acct_date => l_accounting_date
648: ) ;
649:
650: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
651: THEN
652: ROLLBACK TO IGC_GLZCBC ;
653: RETURN(0) ;
654: END IF ;