3863: d_pos NUMBER;
3864: l_api_name CONSTANT VARCHAR2(30) := 'Val_Cancel_FinalClose_Action';
3865: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.Val_Cancel_FinalClose_Action' ;
3866: BEGIN
3867: IF (PO_LOG.d_proc) THEN
3868: PO_LOG.proc_begin(d_module);
3869: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
3870: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3864: l_api_name CONSTANT VARCHAR2(30) := 'Val_Cancel_FinalClose_Action';
3865: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.Val_Cancel_FinalClose_Action' ;
3866: BEGIN
3867: IF (PO_LOG.d_proc) THEN
3868: PO_LOG.proc_begin(d_module);
3869: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
3870: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3872: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
3865: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.Val_Cancel_FinalClose_Action' ;
3866: BEGIN
3867: IF (PO_LOG.d_proc) THEN
3868: PO_LOG.proc_begin(d_module);
3869: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
3870: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3872: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
3873: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
3866: BEGIN
3867: IF (PO_LOG.d_proc) THEN
3868: PO_LOG.proc_begin(d_module);
3869: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
3870: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3872: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
3873: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
3874: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
3867: IF (PO_LOG.d_proc) THEN
3868: PO_LOG.proc_begin(d_module);
3869: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
3870: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3872: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
3873: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
3874: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
3875: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
3868: PO_LOG.proc_begin(d_module);
3869: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
3870: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3872: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
3873: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
3874: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
3875: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
3876: END IF;
3869: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
3870: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3872: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
3873: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
3874: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
3875: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
3876: END IF;
3877: d_pos := 10;
3870: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3872: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
3873: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
3874: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
3875: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
3876: END IF;
3877: d_pos := 10;
3878: --Initialising the variables to default value
3871: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
3872: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
3873: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
3874: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
3875: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
3876: END IF;
3877: d_pos := 10;
3878: --Initialising the variables to default value
3879: x_return_status := FND_API.g_ret_sts_success;
3893: l_otl_field_name := PO_HXC_INTERFACE_PVT.field_PO_LINE_ID;
3894: l_otl_field_value := p_doc_line_id;
3895: END IF; --p_doc_level = 'HEADER'
3896: d_pos := 60;
3897: IF (PO_LOG.d_stmt) THEN
3898: PO_LOG.stmt(d_module,d_pos,'l_otl_field_name',l_otl_field_name);
3899: PO_LOG.stmt(d_module,d_pos,'l_otl_field_value',l_otl_field_value);
3900: END IF;
3901: PO_HXC_INTERFACE_PVT.check_timecard_exists(p_api_version => 1.0,
3894: l_otl_field_value := p_doc_line_id;
3895: END IF; --p_doc_level = 'HEADER'
3896: d_pos := 60;
3897: IF (PO_LOG.d_stmt) THEN
3898: PO_LOG.stmt(d_module,d_pos,'l_otl_field_name',l_otl_field_name);
3899: PO_LOG.stmt(d_module,d_pos,'l_otl_field_value',l_otl_field_value);
3900: END IF;
3901: PO_HXC_INTERFACE_PVT.check_timecard_exists(p_api_version => 1.0,
3902: x_return_status => x_return_status,
3895: END IF; --p_doc_level = 'HEADER'
3896: d_pos := 60;
3897: IF (PO_LOG.d_stmt) THEN
3898: PO_LOG.stmt(d_module,d_pos,'l_otl_field_name',l_otl_field_name);
3899: PO_LOG.stmt(d_module,d_pos,'l_otl_field_value',l_otl_field_value);
3900: END IF;
3901: PO_HXC_INTERFACE_PVT.check_timecard_exists(p_api_version => 1.0,
3902: x_return_status => x_return_status,
3903: p_field_name => l_otl_field_name,
3911: d_pos := 80;
3912: IF (l_timecard_exists) THEN
3913: FND_MESSAGE.set_name('PO','PO_CONTROL_OTL_INVALID_ACTION');
3914: FND_MSG_PUB.add;
3915: IF PO_LOG.d_exc THEN
3916: PO_LOG.exc(d_module,d_pos,'Document with timecard cannot be Cancelled or Finally Closed');
3917: END IF;
3918: RAISE FND_API.G_EXC_ERROR;
3919: END IF; -- IF(l_timecard_exists) THEN
3912: IF (l_timecard_exists) THEN
3913: FND_MESSAGE.set_name('PO','PO_CONTROL_OTL_INVALID_ACTION');
3914: FND_MSG_PUB.add;
3915: IF PO_LOG.d_exc THEN
3916: PO_LOG.exc(d_module,d_pos,'Document with timecard cannot be Cancelled or Finally Closed');
3917: END IF;
3918: RAISE FND_API.G_EXC_ERROR;
3919: END IF; -- IF(l_timecard_exists) THEN
3920: END IF; --p_doc_subtype = 'STANDARD'
3918: RAISE FND_API.G_EXC_ERROR;
3919: END IF; -- IF(l_timecard_exists) THEN
3920: END IF; --p_doc_subtype = 'STANDARD'
3921: d_pos := 90;
3922: IF (PO_LOG.d_proc) THEN
3923: PO_LOG.proc_end(d_module);
3924: END IF;
3925: EXCEPTION
3926: WHEN FND_API.g_exc_error THEN
3919: END IF; -- IF(l_timecard_exists) THEN
3920: END IF; --p_doc_subtype = 'STANDARD'
3921: d_pos := 90;
3922: IF (PO_LOG.d_proc) THEN
3923: PO_LOG.proc_end(d_module);
3924: END IF;
3925: EXCEPTION
3926: WHEN FND_API.g_exc_error THEN
3927: x_return_status := FND_API.g_ret_sts_error;
3927: x_return_status := FND_API.g_ret_sts_error;
3928: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3929: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3930: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
3931: IF PO_LOG.d_exc THEN
3932: PO_LOG.exc(d_module,d_pos,'Unexpected Error in ' || d_module);
3933: END IF;
3934: WHEN OTHERS THEN
3935: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3928: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3929: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3930: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
3931: IF PO_LOG.d_exc THEN
3932: PO_LOG.exc(d_module,d_pos,'Unexpected Error in ' || d_module);
3933: END IF;
3934: WHEN OTHERS THEN
3935: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3936: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
3933: END IF;
3934: WHEN OTHERS THEN
3935: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3936: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
3937: IF PO_LOG.d_exc THEN
3938: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
3939: END IF;
3940: END Val_Cancel_FinalClose_Action;
3941:
3934: WHEN OTHERS THEN
3935: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3936: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
3937: IF PO_LOG.d_exc THEN
3938: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
3939: END IF;
3940: END Val_Cancel_FinalClose_Action;
3941:
3942: ------------------------------------------------------------------------
4042: d_pos NUMBER;
4043: l_api_name CONSTANT VARCHAR2(30) := 'do_control_action';
4044: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.do_control_action';
4045: BEGIN
4046: IF (PO_LOG.d_proc) THEN
4047: PO_LOG.proc_begin(d_module);
4048: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4049: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4043: l_api_name CONSTANT VARCHAR2(30) := 'do_control_action';
4044: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.do_control_action';
4045: BEGIN
4046: IF (PO_LOG.d_proc) THEN
4047: PO_LOG.proc_begin(d_module);
4048: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4049: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4044: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.do_control_action';
4045: BEGIN
4046: IF (PO_LOG.d_proc) THEN
4047: PO_LOG.proc_begin(d_module);
4048: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4049: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4045: BEGIN
4046: IF (PO_LOG.d_proc) THEN
4047: PO_LOG.proc_begin(d_module);
4048: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4049: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4046: IF (PO_LOG.d_proc) THEN
4047: PO_LOG.proc_begin(d_module);
4048: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4049: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4047: PO_LOG.proc_begin(d_module);
4048: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4049: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4048: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4049: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4049: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4050: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4051: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4059: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4052: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4059: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4060: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4053: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4059: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4060: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4061: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4054: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4059: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4060: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4061: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4062: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4055: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4059: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4060: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4061: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4062: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4063: END IF;
4056: PO_LOG.proc_begin(d_module,'p_action_date',p_action_date);
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4059: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4060: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4061: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4062: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4063: END IF;
4064: d_pos := 10;
4057: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4059: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4060: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4061: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4062: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4063: END IF;
4064: d_pos := 10;
4065: --initialise the out variables to default value
4058: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4059: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4060: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4061: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4062: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4063: END IF;
4064: d_pos := 10;
4065: --initialise the out variables to default value
4066: l_online_report_id := NULL;
4076: FROM PO_LOOKUP_CODES
4077: WHERE lookup_type = 'CONTROL ACTIONS'
4078: AND lookup_code = p_control_action;
4079:
4080: IF (PO_LOG.d_stmt) THEN
4081: PO_LOG.stmt(d_module,d_pos,'l_control_action_disp_name', l_control_action_disp_name);
4082: END IF;
4083:
4084: IF p_control_action = PO_DOCUMENT_ACTION_PVT.g_doc_action_FINALLY_CLOSE THEN
4077: WHERE lookup_type = 'CONTROL ACTIONS'
4078: AND lookup_code = p_control_action;
4079:
4080: IF (PO_LOG.d_stmt) THEN
4081: PO_LOG.stmt(d_module,d_pos,'l_control_action_disp_name', l_control_action_disp_name);
4082: END IF;
4083:
4084: IF p_control_action = PO_DOCUMENT_ACTION_PVT.g_doc_action_FINALLY_CLOSE THEN
4085: d_pos := 20;
4091: p_header_id => p_doc_header_id,
4092: p_action => 'CANCEL_PO_SUPPLY',
4093: p_recreate_demand_flag => 'N',
4094: x_return_status => x_return_status);
4095: IF (PO_LOG.d_stmt) THEN
4096: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4097: END IF;
4098:
4099: d_pos := 30;
4092: p_action => 'CANCEL_PO_SUPPLY',
4093: p_recreate_demand_flag => 'N',
4094: x_return_status => x_return_status);
4095: IF (PO_LOG.d_stmt) THEN
4096: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4097: END IF;
4098:
4099: d_pos := 30;
4100: --PO_RESERVATION_MAINTAIN_SV.maintain_reservation nullifies the
4123: ,p_document_sub_type => p_doc_subtype
4124: ,p_cbc_acct_date => p_action_date);
4125:
4126: d_pos := 60;
4127: IF (PO_LOG.d_stmt) THEN
4128: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4129: END IF;
4130: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
4131: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4124: ,p_cbc_acct_date => p_action_date);
4125:
4126: d_pos := 60;
4127: IF (PO_LOG.d_stmt) THEN
4128: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4129: END IF;
4130: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
4131: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4132: END IF;
4143: from po_headers_all
4144: where po_header_id = p_doc_header_id;
4145: d_pos := 70;
4146:
4147: IF (PO_LOG.d_stmt) THEN
4148: PO_LOG.stmt(d_module,d_pos,'l_conterms_exist_flag',l_conterms_exist_flag);
4149: PO_LOG.stmt(d_module,d_pos,'l_document_start_date',l_document_start_date);
4150: PO_LOG.stmt(d_module,d_pos,'l_document_end_date',l_document_end_date);
4151: PO_LOG.stmt(d_module,d_pos,'l_cancel_flag',l_cancel_flag);
4144: where po_header_id = p_doc_header_id;
4145: d_pos := 70;
4146:
4147: IF (PO_LOG.d_stmt) THEN
4148: PO_LOG.stmt(d_module,d_pos,'l_conterms_exist_flag',l_conterms_exist_flag);
4149: PO_LOG.stmt(d_module,d_pos,'l_document_start_date',l_document_start_date);
4150: PO_LOG.stmt(d_module,d_pos,'l_document_end_date',l_document_end_date);
4151: PO_LOG.stmt(d_module,d_pos,'l_cancel_flag',l_cancel_flag);
4152: END IF;
4145: d_pos := 70;
4146:
4147: IF (PO_LOG.d_stmt) THEN
4148: PO_LOG.stmt(d_module,d_pos,'l_conterms_exist_flag',l_conterms_exist_flag);
4149: PO_LOG.stmt(d_module,d_pos,'l_document_start_date',l_document_start_date);
4150: PO_LOG.stmt(d_module,d_pos,'l_document_end_date',l_document_end_date);
4151: PO_LOG.stmt(d_module,d_pos,'l_cancel_flag',l_cancel_flag);
4152: END IF;
4153:
4146:
4147: IF (PO_LOG.d_stmt) THEN
4148: PO_LOG.stmt(d_module,d_pos,'l_conterms_exist_flag',l_conterms_exist_flag);
4149: PO_LOG.stmt(d_module,d_pos,'l_document_start_date',l_document_start_date);
4150: PO_LOG.stmt(d_module,d_pos,'l_document_end_date',l_document_end_date);
4151: PO_LOG.stmt(d_module,d_pos,'l_cancel_flag',l_cancel_flag);
4152: END IF;
4153:
4154: IF ((UPPER(NVL(l_conterms_exist_flag, 'N'))='Y') AND
4147: IF (PO_LOG.d_stmt) THEN
4148: PO_LOG.stmt(d_module,d_pos,'l_conterms_exist_flag',l_conterms_exist_flag);
4149: PO_LOG.stmt(d_module,d_pos,'l_document_start_date',l_document_start_date);
4150: PO_LOG.stmt(d_module,d_pos,'l_document_end_date',l_document_end_date);
4151: PO_LOG.stmt(d_module,d_pos,'l_cancel_flag',l_cancel_flag);
4152: END IF;
4153:
4154: IF ((UPPER(NVL(l_conterms_exist_flag, 'N'))='Y') AND
4155: (UPPER(NVL(l_cancel_flag, 'N'))='N')) THEN
4175: ,p_busdocdates_tbl => l_busdocdates_tbl
4176: ,x_return_status => x_return_status);
4177:
4178: d_pos := 100;
4179: IF (PO_LOG.d_stmt) THEN
4180: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4181: END IF;
4182: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
4183: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4176: ,x_return_status => x_return_status);
4177:
4178: d_pos := 100;
4179: IF (PO_LOG.d_stmt) THEN
4180: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4181: END IF;
4182: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
4183: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4184: END IF;
4217: /* Bug 8831247 ,Assigning the out parameter value to x_online_report_id */
4218: x_online_report_id:=l_online_report_id;
4219:
4220: d_pos := 130;
4221: IF (PO_LOG.d_stmt) THEN
4222: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4223: END IF;
4224: -- If the procedure does not complete successfully raise the
4225: -- appropriate exception
4218: x_online_report_id:=l_online_report_id;
4219:
4220: d_pos := 130;
4221: IF (PO_LOG.d_stmt) THEN
4222: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4223: END IF;
4224: -- If the procedure does not complete successfully raise the
4225: -- appropriate exception
4226: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
4284: ELSE
4285: l_doc_subtype := p_doc_subtype;
4286: END IF;
4287: d_pos := 190;
4288: IF (PO_LOG.d_stmt) THEN
4289: PO_LOG.stmt(d_module,d_pos,'l_doc_subtype',l_doc_subtype);
4290: END IF;
4291:
4292: PO_DOCUMENT_ACTION_PVT.do_manual_close(
4285: l_doc_subtype := p_doc_subtype;
4286: END IF;
4287: d_pos := 190;
4288: IF (PO_LOG.d_stmt) THEN
4289: PO_LOG.stmt(d_module,d_pos,'l_doc_subtype',l_doc_subtype);
4290: END IF;
4291:
4292: PO_DOCUMENT_ACTION_PVT.do_manual_close(
4293: p_action => p_control_action
4307: ,x_exception_msg => l_exc_msg
4308: ,x_online_report_id => l_online_report_id);
4309: END IF; -- IF p_control_action LIKE 'CANCEL%'
4310: d_pos := 200;
4311: IF (PO_LOG.d_stmt) THEN
4312: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4313: PO_LOG.stmt(d_module,d_pos,'l_return_code',l_return_code);
4314: PO_LOG.stmt(d_module,d_pos,'l_exc_msg',l_exc_msg);
4315: PO_LOG.stmt(d_module,d_pos,'l_online_report_id',l_online_report_id);
4308: ,x_online_report_id => l_online_report_id);
4309: END IF; -- IF p_control_action LIKE 'CANCEL%'
4310: d_pos := 200;
4311: IF (PO_LOG.d_stmt) THEN
4312: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4313: PO_LOG.stmt(d_module,d_pos,'l_return_code',l_return_code);
4314: PO_LOG.stmt(d_module,d_pos,'l_exc_msg',l_exc_msg);
4315: PO_LOG.stmt(d_module,d_pos,'l_online_report_id',l_online_report_id);
4316: END IF;
4309: END IF; -- IF p_control_action LIKE 'CANCEL%'
4310: d_pos := 200;
4311: IF (PO_LOG.d_stmt) THEN
4312: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4313: PO_LOG.stmt(d_module,d_pos,'l_return_code',l_return_code);
4314: PO_LOG.stmt(d_module,d_pos,'l_exc_msg',l_exc_msg);
4315: PO_LOG.stmt(d_module,d_pos,'l_online_report_id',l_online_report_id);
4316: END IF;
4317:
4310: d_pos := 200;
4311: IF (PO_LOG.d_stmt) THEN
4312: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4313: PO_LOG.stmt(d_module,d_pos,'l_return_code',l_return_code);
4314: PO_LOG.stmt(d_module,d_pos,'l_exc_msg',l_exc_msg);
4315: PO_LOG.stmt(d_module,d_pos,'l_online_report_id',l_online_report_id);
4316: END IF;
4317:
4318: IF(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
4311: IF (PO_LOG.d_stmt) THEN
4312: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4313: PO_LOG.stmt(d_module,d_pos,'l_return_code',l_return_code);
4314: PO_LOG.stmt(d_module,d_pos,'l_exc_msg',l_exc_msg);
4315: PO_LOG.stmt(d_module,d_pos,'l_online_report_id',l_online_report_id);
4316: END IF;
4317:
4318: IF(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
4319: IF (l_return_code = 'STATE_FAILED') THEN
4351: END IF;--l_return_code = 'STATE_FAILED'
4352: ELSE
4353: d_pos := 240;
4354: IF (l_exc_msg IS NOT NULL) THEN
4355: PO_LOG.exc(d_module,d_pos,l_exc_msg);
4356: END IF;
4357: RAISE FND_API.g_exc_unexpected_error;
4358: END IF;--x_return_status = FND_API.G_RET_STS_SUCCESS
4359: d_pos := 250;
4368: --set to N by the cancel code in control_document procedure
4369: IF g_cancel_flag_reset_flag THEN
4370: x_cancel_req_flag_reset := 'Y';
4371: END IF;
4372: IF (PO_LOG.d_stmt) THEN
4373: PO_LOG.stmt(d_module,d_pos,'x_approval_initiated',x_approval_initiated);
4374: END IF;
4375: d_pos := 260;
4376: EXCEPTION
4369: IF g_cancel_flag_reset_flag THEN
4370: x_cancel_req_flag_reset := 'Y';
4371: END IF;
4372: IF (PO_LOG.d_stmt) THEN
4373: PO_LOG.stmt(d_module,d_pos,'x_approval_initiated',x_approval_initiated);
4374: END IF;
4375: d_pos := 260;
4376: EXCEPTION
4377: WHEN FND_API.g_exc_error THEN
4377: WHEN FND_API.g_exc_error THEN
4378: x_return_status := FND_API.g_ret_sts_error;
4379: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4380: x_return_status := FND_API.g_ret_sts_unexp_error;
4381: IF PO_LOG.d_exc THEN
4382: PO_LOG.exc(d_module,d_pos,'Unexpected Error in ' || d_module);
4383: IF FND_MSG_PUB.count_msg = 0 THEN
4384: FND_MESSAGE.set_name('PO','PO_DOC_CONTROL_ACTION_FAILED');
4385: FND_MESSAGE.set_token('CONTROL_ACTION_NAME', l_control_action_disp_name);
4378: x_return_status := FND_API.g_ret_sts_error;
4379: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4380: x_return_status := FND_API.g_ret_sts_unexp_error;
4381: IF PO_LOG.d_exc THEN
4382: PO_LOG.exc(d_module,d_pos,'Unexpected Error in ' || d_module);
4383: IF FND_MSG_PUB.count_msg = 0 THEN
4384: FND_MESSAGE.set_name('PO','PO_DOC_CONTROL_ACTION_FAILED');
4385: FND_MESSAGE.set_token('CONTROL_ACTION_NAME', l_control_action_disp_name);
4386: FND_MESSAGE.set_token('ERROR_TEXT',l_exc_msg);
4389: END IF;
4390: WHEN OTHERS THEN
4391: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4392: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4393: IF PO_LOG.d_exc THEN
4394: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
4395: END IF;
4396: END do_control_action;
4397: ------------------------------------------------------------------------
4390: WHEN OTHERS THEN
4391: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4392: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4393: IF PO_LOG.d_exc THEN
4394: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
4395: END IF;
4396: END do_control_action;
4397: ------------------------------------------------------------------------
4398: --Start of Comments
4489: l_api_name CONSTANT VARCHAR2(30) := 'process_doc_control_action';
4490: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.process_doc_control_action';
4491: l_mode VARCHAR2(30);
4492: BEGIN
4493: IF (PO_LOG.d_proc) THEN
4494: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4495: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4496: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4490: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.process_doc_control_action';
4491: l_mode VARCHAR2(30);
4492: BEGIN
4493: IF (PO_LOG.d_proc) THEN
4494: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4495: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4496: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4491: l_mode VARCHAR2(30);
4492: BEGIN
4493: IF (PO_LOG.d_proc) THEN
4494: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4495: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4496: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4492: BEGIN
4493: IF (PO_LOG.d_proc) THEN
4494: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4495: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4496: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4493: IF (PO_LOG.d_proc) THEN
4494: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4495: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4496: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4494: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4495: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4496: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4495: PO_LOG.proc_begin(d_module,'p_control_action',p_control_action);
4496: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4496: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4497: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4498: PO_LOG.proc_begin(d_module,'p_doc_org_id',p_doc_org_id);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4506: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4499: PO_LOG.proc_begin(d_module,'p_doc_line_id',p_doc_line_id);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4506: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4507: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4500: PO_LOG.proc_begin(d_module,'p_doc_line_loc_id',p_doc_line_loc_id);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4506: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4507: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4508: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4501: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4506: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4507: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4508: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4509: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4502: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4506: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4507: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4508: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4509: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4510: END IF;
4503: PO_LOG.proc_begin(d_module,'p_gl_date',p_gl_date);
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4506: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4507: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4508: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4509: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4510: END IF;
4511: x_return_status := FND_API.G_RET_STS_SUCCESS;
4504: PO_LOG.proc_begin(d_module,'p_use_gldate',p_use_gldate);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4506: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4507: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4508: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4509: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4510: END IF;
4511: x_return_status := FND_API.G_RET_STS_SUCCESS;
4512: l_mode := UPPER(p_mode);
4505: PO_LOG.proc_begin(d_module,'p_reason',p_reason);
4506: PO_LOG.proc_begin(d_module,'p_note_to_vendor',p_note_to_vendor);
4507: PO_LOG.proc_begin(d_module,'p_communication_method',p_communication_method);
4508: PO_LOG.proc_begin(d_module,'p_communication_value',p_communication_value);
4509: PO_LOG.proc_begin(d_module,'p_cancel_reqs',p_cancel_reqs);
4510: END IF;
4511: x_return_status := FND_API.G_RET_STS_SUCCESS;
4512: l_mode := UPPER(p_mode);
4513:
4530: p_po_encumbrance_flag => p_po_encumbrance_flag,
4531: p_req_encumbrance_flag => p_req_encumbrance_flag,
4532: p_skip_valid_cbc_acct_date => FND_API.G_FALSE); --Bug#4569120
4533: d_pos := 20;
4534: IF (PO_LOG.d_stmt) THEN
4535: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4536: END IF;
4537: IF (x_return_status = FND_API.g_ret_sts_error) THEN
4538: RAISE FND_API.g_exc_error;
4531: p_req_encumbrance_flag => p_req_encumbrance_flag,
4532: p_skip_valid_cbc_acct_date => FND_API.G_FALSE); --Bug#4569120
4533: d_pos := 20;
4534: IF (PO_LOG.d_stmt) THEN
4535: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4536: END IF;
4537: IF (x_return_status = FND_API.g_ret_sts_error) THEN
4538: RAISE FND_API.g_exc_error;
4539: ELSIF (x_return_status = FND_API.g_ret_sts_unexp_error) THEN
4549: ,p_document_type => p_doc_type
4550: ,p_document_id => p_doc_header_id);
4551: END IF;
4552: d_pos := 40;
4553: IF (PO_LOG.d_stmt) THEN
4554: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4555: END IF;
4556: IF (x_return_status = FND_API.g_ret_sts_error) THEN
4557: RAISE FND_API.g_exc_error;
4550: ,p_document_id => p_doc_header_id);
4551: END IF;
4552: d_pos := 40;
4553: IF (PO_LOG.d_stmt) THEN
4554: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4555: END IF;
4556: IF (x_return_status = FND_API.g_ret_sts_error) THEN
4557: RAISE FND_API.g_exc_error;
4558: ELSIF (x_return_status = FND_API.g_ret_sts_unexp_error) THEN
4572: ,p_doc_type => p_doc_type
4573: ,p_doc_subtype => p_doc_subtype
4574: ,x_return_status => x_return_status);
4575: d_pos := 60;
4576: IF (PO_LOG.d_stmt) THEN
4577: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4578: END IF;
4579: IF (x_return_status = FND_API.g_ret_sts_error) THEN
4580: RAISE FND_API.g_exc_error;
4573: ,p_doc_subtype => p_doc_subtype
4574: ,x_return_status => x_return_status);
4575: d_pos := 60;
4576: IF (PO_LOG.d_stmt) THEN
4577: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4578: END IF;
4579: IF (x_return_status = FND_API.g_ret_sts_error) THEN
4580: RAISE FND_API.g_exc_error;
4581: ELSIF (x_return_status = FND_API.g_ret_sts_unexp_error) THEN
4606: ,x_cancel_req_flag_reset =>x_cancel_req_flag_reset
4607: ,x_is_encumbrance_error => x_is_encumbrance_error
4608: ,x_online_report_id => x_online_report_id);--bug#5055417
4609: d_pos := 80;
4610: IF (PO_LOG.d_stmt) THEN
4611: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4612: PO_LOG.stmt(d_module,d_pos,'x_approval_initiated',x_approval_initiated);
4613: END IF;
4614:
4607: ,x_is_encumbrance_error => x_is_encumbrance_error
4608: ,x_online_report_id => x_online_report_id);--bug#5055417
4609: d_pos := 80;
4610: IF (PO_LOG.d_stmt) THEN
4611: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4612: PO_LOG.stmt(d_module,d_pos,'x_approval_initiated',x_approval_initiated);
4613: END IF;
4614:
4615: IF (x_return_status = FND_API.g_ret_sts_error) THEN
4608: ,x_online_report_id => x_online_report_id);--bug#5055417
4609: d_pos := 80;
4610: IF (PO_LOG.d_stmt) THEN
4611: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
4612: PO_LOG.stmt(d_module,d_pos,'x_approval_initiated',x_approval_initiated);
4613: END IF;
4614:
4615: IF (x_return_status = FND_API.g_ret_sts_error) THEN
4616: RAISE FND_API.g_exc_error;
4617: ELSIF (x_return_status = FND_API.g_ret_sts_unexp_error) THEN
4618: RAISE FND_API.g_exc_unexpected_error;
4619: END IF;
4620:
4621: IF (PO_LOG.d_proc) THEN
4622: PO_LOG.proc_end(d_module);
4623: END IF;
4624: EXCEPTION
4625: WHEN FND_API.g_exc_error THEN
4618: RAISE FND_API.g_exc_unexpected_error;
4619: END IF;
4620:
4621: IF (PO_LOG.d_proc) THEN
4622: PO_LOG.proc_end(d_module);
4623: END IF;
4624: EXCEPTION
4625: WHEN FND_API.g_exc_error THEN
4626: ROLLBACK TO SAVEPOINT PROCESS_DOC_CONTROL_ACTION;
4634: END LOOP;
4635: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4636: ROLLBACK TO SAVEPOINT PROCESS_DOC_CONTROL_ACTION;
4637: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4638: IF PO_LOG.d_exc THEN
4639: PO_LOG.exc(d_module,d_pos,'Unexpected Error in ' || d_module);
4640: END IF;
4641: WHEN OTHERS THEN
4642: ROLLBACK TO SAVEPOINT PROCESS_DOC_CONTROL_ACTION;
4635: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4636: ROLLBACK TO SAVEPOINT PROCESS_DOC_CONTROL_ACTION;
4637: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4638: IF PO_LOG.d_exc THEN
4639: PO_LOG.exc(d_module,d_pos,'Unexpected Error in ' || d_module);
4640: END IF;
4641: WHEN OTHERS THEN
4642: ROLLBACK TO SAVEPOINT PROCESS_DOC_CONTROL_ACTION;
4643: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4641: WHEN OTHERS THEN
4642: ROLLBACK TO SAVEPOINT PROCESS_DOC_CONTROL_ACTION;
4643: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4644: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4645: IF PO_LOG.d_exc THEN
4646: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
4647: END IF;
4648: END process_doc_control_action;
4649: -------------------------------------------------------------------------------
4642: ROLLBACK TO SAVEPOINT PROCESS_DOC_CONTROL_ACTION;
4643: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4644: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4645: IF PO_LOG.d_exc THEN
4646: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
4647: END IF;
4648: END process_doc_control_action;
4649: -------------------------------------------------------------------------------
4650: --Start of Comments
4723: );
4724: l_dummy1 shipment_labor_expense_req_csr%ROWTYPE;
4725: l_dummy2 line_labor_expense_req_csr%ROWTYPE;
4726: BEGIN
4727: IF (PO_LOG.d_proc) THEN
4728: PO_LOG.proc_begin(d_module);
4729: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4730: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4731: END IF;
4724: l_dummy1 shipment_labor_expense_req_csr%ROWTYPE;
4725: l_dummy2 line_labor_expense_req_csr%ROWTYPE;
4726: BEGIN
4727: IF (PO_LOG.d_proc) THEN
4728: PO_LOG.proc_begin(d_module);
4729: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4730: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4731: END IF;
4732:
4725: l_dummy2 line_labor_expense_req_csr%ROWTYPE;
4726: BEGIN
4727: IF (PO_LOG.d_proc) THEN
4728: PO_LOG.proc_begin(d_module);
4729: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4730: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4731: END IF;
4732:
4733: IF(p_doc_level = PO_CORE_S.g_doc_level_LINE) THEN
4726: BEGIN
4727: IF (PO_LOG.d_proc) THEN
4728: PO_LOG.proc_begin(d_module);
4729: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4730: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4731: END IF;
4732:
4733: IF(p_doc_level = PO_CORE_S.g_doc_level_LINE) THEN
4734: l_po_line_id := p_doc_level_id;
4752: CLOSE line_labor_expense_req_csr;
4753: d_pos := 50;
4754: END IF;
4755:
4756: IF (PO_LOG.d_proc) THEN
4757: PO_LOG.proc_end(d_module,'l_has_labor_expense_req',l_has_labor_expense_req);
4758: PO_LOG.proc_end(d_module,'l_line_location_id',l_line_location_id);
4759: PO_LOG.proc_end(d_module,'l_po_line_id',l_po_line_id);
4760: PO_LOG.proc_end(d_module);
4753: d_pos := 50;
4754: END IF;
4755:
4756: IF (PO_LOG.d_proc) THEN
4757: PO_LOG.proc_end(d_module,'l_has_labor_expense_req',l_has_labor_expense_req);
4758: PO_LOG.proc_end(d_module,'l_line_location_id',l_line_location_id);
4759: PO_LOG.proc_end(d_module,'l_po_line_id',l_po_line_id);
4760: PO_LOG.proc_end(d_module);
4761: END IF;
4754: END IF;
4755:
4756: IF (PO_LOG.d_proc) THEN
4757: PO_LOG.proc_end(d_module,'l_has_labor_expense_req',l_has_labor_expense_req);
4758: PO_LOG.proc_end(d_module,'l_line_location_id',l_line_location_id);
4759: PO_LOG.proc_end(d_module,'l_po_line_id',l_po_line_id);
4760: PO_LOG.proc_end(d_module);
4761: END IF;
4762:
4755:
4756: IF (PO_LOG.d_proc) THEN
4757: PO_LOG.proc_end(d_module,'l_has_labor_expense_req',l_has_labor_expense_req);
4758: PO_LOG.proc_end(d_module,'l_line_location_id',l_line_location_id);
4759: PO_LOG.proc_end(d_module,'l_po_line_id',l_po_line_id);
4760: PO_LOG.proc_end(d_module);
4761: END IF;
4762:
4763: return (l_has_labor_expense_req);
4756: IF (PO_LOG.d_proc) THEN
4757: PO_LOG.proc_end(d_module,'l_has_labor_expense_req',l_has_labor_expense_req);
4758: PO_LOG.proc_end(d_module,'l_line_location_id',l_line_location_id);
4759: PO_LOG.proc_end(d_module,'l_po_line_id',l_po_line_id);
4760: PO_LOG.proc_end(d_module);
4761: END IF;
4762:
4763: return (l_has_labor_expense_req);
4764: EXCEPTION
4763: return (l_has_labor_expense_req);
4764: EXCEPTION
4765: WHEN OTHERS THEN
4766: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4767: IF PO_LOG.d_exc THEN
4768: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
4769: END IF;
4770: RAISE;
4771: END is_backing_req_labor_expense;
4764: EXCEPTION
4765: WHEN OTHERS THEN
4766: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4767: IF PO_LOG.d_exc THEN
4768: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
4769: END IF;
4770: RAISE;
4771: END is_backing_req_labor_expense;
4772: -----------------------------------------------------------------------------
4824: d_pos NUMBER;
4825: l_api_name CONSTANT VARCHAR2(30) := 'get_cancel_req_chkbox_attr';
4826: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.get_cancel_req_chkbox_attr';
4827: BEGIN
4828: IF (PO_LOG.d_proc) THEN
4829: PO_LOG.proc_begin(d_module);
4830: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4831: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4832: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4825: l_api_name CONSTANT VARCHAR2(30) := 'get_cancel_req_chkbox_attr';
4826: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.get_cancel_req_chkbox_attr';
4827: BEGIN
4828: IF (PO_LOG.d_proc) THEN
4829: PO_LOG.proc_begin(d_module);
4830: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4831: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4832: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4833: PO_LOG.proc_begin(d_module,'p_cancel_req_on_cancel_po',p_cancel_req_on_cancel_po);
4826: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.get_cancel_req_chkbox_attr';
4827: BEGIN
4828: IF (PO_LOG.d_proc) THEN
4829: PO_LOG.proc_begin(d_module);
4830: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4831: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4832: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4833: PO_LOG.proc_begin(d_module,'p_cancel_req_on_cancel_po',p_cancel_req_on_cancel_po);
4834: END IF;
4827: BEGIN
4828: IF (PO_LOG.d_proc) THEN
4829: PO_LOG.proc_begin(d_module);
4830: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4831: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4832: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4833: PO_LOG.proc_begin(d_module,'p_cancel_req_on_cancel_po',p_cancel_req_on_cancel_po);
4834: END IF;
4835: d_pos := 10;
4828: IF (PO_LOG.d_proc) THEN
4829: PO_LOG.proc_begin(d_module);
4830: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4831: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4832: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4833: PO_LOG.proc_begin(d_module,'p_cancel_req_on_cancel_po',p_cancel_req_on_cancel_po);
4834: END IF;
4835: d_pos := 10;
4836: --Initialise Out Variables
4829: PO_LOG.proc_begin(d_module);
4830: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4831: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4832: PO_LOG.proc_begin(d_module,'p_doc_subtype',p_doc_subtype);
4833: PO_LOG.proc_begin(d_module,'p_cancel_req_on_cancel_po',p_cancel_req_on_cancel_po);
4834: END IF;
4835: d_pos := 10;
4836: --Initialise Out Variables
4837: x_drop_ship_flag := 'N';
4885: END IF; --p_doc_level = 'LINE'
4886: END IF; --p_doc_subtype = 'STANDARD'
4887: END IF; --p_cancel_req_on_cancel_po = 'A'
4888:
4889: IF (PO_LOG.d_proc) THEN
4890: PO_LOG.proc_end(d_module,'x_drop_ship_flag',x_drop_ship_flag);
4891: PO_LOG.proc_end(d_module,'x_labor_expense_req_flag',x_labor_expense_req_flag);
4892: PO_LOG.proc_end(d_module,'x_svc_line_with_req_flag',x_svc_line_with_req_flag);
4893: PO_LOG.proc_end(d_module,'x_fps_line_ship_with_req_flag',x_fps_line_ship_with_req_flag);
4886: END IF; --p_doc_subtype = 'STANDARD'
4887: END IF; --p_cancel_req_on_cancel_po = 'A'
4888:
4889: IF (PO_LOG.d_proc) THEN
4890: PO_LOG.proc_end(d_module,'x_drop_ship_flag',x_drop_ship_flag);
4891: PO_LOG.proc_end(d_module,'x_labor_expense_req_flag',x_labor_expense_req_flag);
4892: PO_LOG.proc_end(d_module,'x_svc_line_with_req_flag',x_svc_line_with_req_flag);
4893: PO_LOG.proc_end(d_module,'x_fps_line_ship_with_req_flag',x_fps_line_ship_with_req_flag);
4894: PO_LOG.proc_end(d_module,'x_return_status',x_return_status);
4887: END IF; --p_cancel_req_on_cancel_po = 'A'
4888:
4889: IF (PO_LOG.d_proc) THEN
4890: PO_LOG.proc_end(d_module,'x_drop_ship_flag',x_drop_ship_flag);
4891: PO_LOG.proc_end(d_module,'x_labor_expense_req_flag',x_labor_expense_req_flag);
4892: PO_LOG.proc_end(d_module,'x_svc_line_with_req_flag',x_svc_line_with_req_flag);
4893: PO_LOG.proc_end(d_module,'x_fps_line_ship_with_req_flag',x_fps_line_ship_with_req_flag);
4894: PO_LOG.proc_end(d_module,'x_return_status',x_return_status);
4895: PO_LOG.proc_end(d_module);
4888:
4889: IF (PO_LOG.d_proc) THEN
4890: PO_LOG.proc_end(d_module,'x_drop_ship_flag',x_drop_ship_flag);
4891: PO_LOG.proc_end(d_module,'x_labor_expense_req_flag',x_labor_expense_req_flag);
4892: PO_LOG.proc_end(d_module,'x_svc_line_with_req_flag',x_svc_line_with_req_flag);
4893: PO_LOG.proc_end(d_module,'x_fps_line_ship_with_req_flag',x_fps_line_ship_with_req_flag);
4894: PO_LOG.proc_end(d_module,'x_return_status',x_return_status);
4895: PO_LOG.proc_end(d_module);
4896: END IF;
4889: IF (PO_LOG.d_proc) THEN
4890: PO_LOG.proc_end(d_module,'x_drop_ship_flag',x_drop_ship_flag);
4891: PO_LOG.proc_end(d_module,'x_labor_expense_req_flag',x_labor_expense_req_flag);
4892: PO_LOG.proc_end(d_module,'x_svc_line_with_req_flag',x_svc_line_with_req_flag);
4893: PO_LOG.proc_end(d_module,'x_fps_line_ship_with_req_flag',x_fps_line_ship_with_req_flag);
4894: PO_LOG.proc_end(d_module,'x_return_status',x_return_status);
4895: PO_LOG.proc_end(d_module);
4896: END IF;
4897:
4890: PO_LOG.proc_end(d_module,'x_drop_ship_flag',x_drop_ship_flag);
4891: PO_LOG.proc_end(d_module,'x_labor_expense_req_flag',x_labor_expense_req_flag);
4892: PO_LOG.proc_end(d_module,'x_svc_line_with_req_flag',x_svc_line_with_req_flag);
4893: PO_LOG.proc_end(d_module,'x_fps_line_ship_with_req_flag',x_fps_line_ship_with_req_flag);
4894: PO_LOG.proc_end(d_module,'x_return_status',x_return_status);
4895: PO_LOG.proc_end(d_module);
4896: END IF;
4897:
4898: EXCEPTION
4891: PO_LOG.proc_end(d_module,'x_labor_expense_req_flag',x_labor_expense_req_flag);
4892: PO_LOG.proc_end(d_module,'x_svc_line_with_req_flag',x_svc_line_with_req_flag);
4893: PO_LOG.proc_end(d_module,'x_fps_line_ship_with_req_flag',x_fps_line_ship_with_req_flag);
4894: PO_LOG.proc_end(d_module,'x_return_status',x_return_status);
4895: PO_LOG.proc_end(d_module);
4896: END IF;
4897:
4898: EXCEPTION
4899: WHEN PO_CORE_S.g_early_return_exc THEN
4896: END IF;
4897:
4898: EXCEPTION
4899: WHEN PO_CORE_S.g_early_return_exc THEN
4900: IF PO_LOG.d_stmt THEN
4901: PO_LOG.stmt(d_module,d_pos,'Early exit from ' || d_module);
4902: END IF;
4903: WHEN OTHERS THEN
4904: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4897:
4898: EXCEPTION
4899: WHEN PO_CORE_S.g_early_return_exc THEN
4900: IF PO_LOG.d_stmt THEN
4901: PO_LOG.stmt(d_module,d_pos,'Early exit from ' || d_module);
4902: END IF;
4903: WHEN OTHERS THEN
4904: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4905: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4902: END IF;
4903: WHEN OTHERS THEN
4904: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4905: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4906: IF PO_LOG.d_exc THEN
4907: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
4908: END IF;
4909: END get_cancel_req_chkbox_attr;
4910: ------------------------------------------------------------------------------
4903: WHEN OTHERS THEN
4904: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4905: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
4906: IF PO_LOG.d_exc THEN
4907: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
4908: END IF;
4909: END get_cancel_req_chkbox_attr;
4910: ------------------------------------------------------------------------------
4911: --Start of Comments
4968: d_pos NUMBER;
4969: l_api_name CONSTANT VARCHAR2(30) := 'get_valid_control_actions';
4970: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.get_valid_control_actions';
4971: BEGIN
4972: IF (PO_LOG.d_proc) THEN
4973: PO_LOG.proc_begin(d_module);
4974: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4975: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4976: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4969: l_api_name CONSTANT VARCHAR2(30) := 'get_valid_control_actions';
4970: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.get_valid_control_actions';
4971: BEGIN
4972: IF (PO_LOG.d_proc) THEN
4973: PO_LOG.proc_begin(d_module);
4974: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4975: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4976: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4977: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4970: d_module CONSTANT VARCHAR2(70) := 'po.plsql.PO_Document_Control_PVT.get_valid_control_actions';
4971: BEGIN
4972: IF (PO_LOG.d_proc) THEN
4973: PO_LOG.proc_begin(d_module);
4974: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4975: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4976: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4977: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4978: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4971: BEGIN
4972: IF (PO_LOG.d_proc) THEN
4973: PO_LOG.proc_begin(d_module);
4974: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4975: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4976: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4977: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4978: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4979: END IF;
4972: IF (PO_LOG.d_proc) THEN
4973: PO_LOG.proc_begin(d_module);
4974: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4975: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4976: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4977: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4978: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4979: END IF;
4980: --Initialisation of local variables
4973: PO_LOG.proc_begin(d_module);
4974: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4975: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4976: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4977: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4978: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4979: END IF;
4980: --Initialisation of local variables
4981: x_return_status := FND_API.g_ret_sts_success;
4974: PO_LOG.proc_begin(d_module,'p_mode',p_mode);
4975: PO_LOG.proc_begin(d_module,'p_doc_level',p_doc_level);
4976: PO_LOG.proc_begin(d_module,'p_doc_type',p_doc_type);
4977: PO_LOG.proc_begin(d_module,'p_doc_header_id',p_doc_header_id);
4978: PO_LOG.proc_begin(d_module,'p_doc_level_id',p_doc_level_id);
4979: END IF;
4980: --Initialisation of local variables
4981: x_return_status := FND_API.g_ret_sts_success;
4982: l_cons_trans_exist := 'N';
4993: FROM po_headers_all
4994: WHERE po_header_id = p_doc_header_id;
4995: END IF;
4996: d_pos := 20;
4997: IF (PO_LOG.d_stmt) THEN
4998: PO_LOG.stmt(d_module,d_pos,'l_agent_id',l_agent_id);
4999: PO_LOG.stmt(d_module,d_pos,'l_doc_subtype',l_doc_subtype);
5000: END IF;
5001: IF (p_doc_level = PO_CORE_S.g_doc_level_HEADER) THEN --header level
4994: WHERE po_header_id = p_doc_header_id;
4995: END IF;
4996: d_pos := 20;
4997: IF (PO_LOG.d_stmt) THEN
4998: PO_LOG.stmt(d_module,d_pos,'l_agent_id',l_agent_id);
4999: PO_LOG.stmt(d_module,d_pos,'l_doc_subtype',l_doc_subtype);
5000: END IF;
5001: IF (p_doc_level = PO_CORE_S.g_doc_level_HEADER) THEN --header level
5002: d_pos := 30;
4995: END IF;
4996: d_pos := 20;
4997: IF (PO_LOG.d_stmt) THEN
4998: PO_LOG.stmt(d_module,d_pos,'l_agent_id',l_agent_id);
4999: PO_LOG.stmt(d_module,d_pos,'l_doc_subtype',l_doc_subtype);
5000: END IF;
5001: IF (p_doc_level = PO_CORE_S.g_doc_level_HEADER) THEN --header level
5002: d_pos := 30;
5003: PO_DOCUMENT_CONTROL_PVT.get_header_actions
5017: FROM po_lines_merge_v --
5018: WHERE po_line_id = p_doc_level_id
5019: AND draft_id = p_draft_id;
5020:
5021: IF (PO_LOG.d_stmt) THEN
5022: PO_LOG.stmt(d_module,d_pos,'l_item_id',l_agent_id);
5023: END IF;
5024:
5025: PO_DOCUMENT_CONTROL_PVT.get_line_actions
5018: WHERE po_line_id = p_doc_level_id
5019: AND draft_id = p_draft_id;
5020:
5021: IF (PO_LOG.d_stmt) THEN
5022: PO_LOG.stmt(d_module,d_pos,'l_item_id',l_agent_id);
5023: END IF;
5024:
5025: PO_DOCUMENT_CONTROL_PVT.get_line_actions
5026: ( p_doc_subtype => l_doc_subtype
5044: , x_return_status => x_return_status
5045: , p_mode => l_mode);
5046:
5047: END IF;
5048: IF (PO_LOG.d_stmt) THEN
5049: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
5050: END IF;
5051: d_pos := 60;
5052:
5045: , p_mode => l_mode);
5046:
5047: END IF;
5048: IF (PO_LOG.d_stmt) THEN
5049: PO_LOG.stmt(d_module,d_pos,'x_return_status',x_return_status);
5050: END IF;
5051: d_pos := 60;
5052:
5053: IF (x_return_status = FND_API.g_ret_sts_success)then
5059: p_doc_header_id,
5060: l_item_id);
5061: END IF;
5062: d_pos := 70;
5063: IF (PO_LOG.d_stmt) THEN
5064: PO_LOG.stmt(d_module,d_pos,'l_cons_trans_exist',l_cons_trans_exist);
5065: END IF;
5066: --
5067: --Prevent cancel option for shipment if it is the only shipment on the
5060: l_item_id);
5061: END IF;
5062: d_pos := 70;
5063: IF (PO_LOG.d_stmt) THEN
5064: PO_LOG.stmt(d_module,d_pos,'l_cons_trans_exist',l_cons_trans_exist);
5065: END IF;
5066: --
5067: --Prevent cancel option for shipment if it is the only shipment on the
5068: --line that is not cancelled or finally closed.
5087: EXCEPTION
5088: WHEN NO_DATA_FOUND THEN
5089: --Current shipment is the only shipment on the line that is not cancelled or finally closed
5090: --OR there are no open, uncancelled shipments.
5091: IF PO_LOG.d_stmt THEN
5092: PO_LOG.stmt(d_module,d_pos,'Control Action cannot be performed on the shipment');
5093: END IF;
5094: l_ship_invalid_for_ctrl_actn := 'Y';
5095: END;
5088: WHEN NO_DATA_FOUND THEN
5089: --Current shipment is the only shipment on the line that is not cancelled or finally closed
5090: --OR there are no open, uncancelled shipments.
5091: IF PO_LOG.d_stmt THEN
5092: PO_LOG.stmt(d_module,d_pos,'Control Action cannot be performed on the shipment');
5093: END IF;
5094: l_ship_invalid_for_ctrl_actn := 'Y';
5095: END;
5096:
5100: FOR i IN l_valid_actions_tbl.first..l_valid_actions_tbl.last
5101: LOOP
5102: d_pos := 80;
5103: l_current_action := l_valid_actions_tbl(i);
5104: IF (PO_LOG.d_stmt) THEN
5105: PO_LOG.stmt(d_module,d_pos,'l_current_action',l_current_action);
5106: END IF;
5107: -- If consumption transaction exist we don't allow Cancel and Finally
5108: -- Close actions
5101: LOOP
5102: d_pos := 80;
5103: l_current_action := l_valid_actions_tbl(i);
5104: IF (PO_LOG.d_stmt) THEN
5105: PO_LOG.stmt(d_module,d_pos,'l_current_action',l_current_action);
5106: END IF;
5107: -- If consumption transaction exist we don't allow Cancel and Finally
5108: -- Close actions
5109: IF (l_cons_trans_exist = 'Y'
5124: x_valid_ctrl_ctn_tbl.extend;
5125: IF(l_mode = 'SUMMARY' AND l_current_action LIKE 'CANCEL%' ) THEN
5126: -- For Summary we Show Cancel Action as Cancel at all the Levels
5127: d_pos := 90;
5128: IF (PO_LOG.d_stmt) THEN
5129: PO_LOG.stmt(d_module,d_pos,l_current_action || 'is replaced by CANCEL for summary mode');
5130: END IF;
5131: x_valid_ctrl_ctn_tbl(l_index) := PO_DOCUMENT_ACTION_PVT.g_doc_action_CANCEL;
5132: ELSIF(l_mode = 'UPDATE' AND l_current_action = 'CANCEL PO') THEN
5125: IF(l_mode = 'SUMMARY' AND l_current_action LIKE 'CANCEL%' ) THEN
5126: -- For Summary we Show Cancel Action as Cancel at all the Levels
5127: d_pos := 90;
5128: IF (PO_LOG.d_stmt) THEN
5129: PO_LOG.stmt(d_module,d_pos,l_current_action || 'is replaced by CANCEL for summary mode');
5130: END IF;
5131: x_valid_ctrl_ctn_tbl(l_index) := PO_DOCUMENT_ACTION_PVT.g_doc_action_CANCEL;
5132: ELSIF(l_mode = 'UPDATE' AND l_current_action = 'CANCEL PO') THEN
5133:
5133:
5134: IF(p_doc_type = PO_CORE_S.g_doc_type_PO) THEN
5135: -- For Update mode we Show Cancel Action at Header as Cancel Order
5136: d_pos := 100;
5137: IF (PO_LOG.d_stmt) THEN
5138: PO_LOG.stmt(d_module,d_pos,l_current_action || 'is replaced by CANCEL ORDER for update mode');
5139: END IF;
5140: x_valid_ctrl_ctn_tbl(l_index) := 'CANCEL ORDER';
5141: ELSIF(p_doc_type = PO_CORE_S.g_doc_type_PA) THEN
5134: IF(p_doc_type = PO_CORE_S.g_doc_type_PO) THEN
5135: -- For Update mode we Show Cancel Action at Header as Cancel Order
5136: d_pos := 100;
5137: IF (PO_LOG.d_stmt) THEN
5138: PO_LOG.stmt(d_module,d_pos,l_current_action || 'is replaced by CANCEL ORDER for update mode');
5139: END IF;
5140: x_valid_ctrl_ctn_tbl(l_index) := 'CANCEL ORDER';
5141: ELSIF(p_doc_type = PO_CORE_S.g_doc_type_PA) THEN
5142: -- For Update mode we Show Cancel Action at Header as Cancel Agreement.
5140: x_valid_ctrl_ctn_tbl(l_index) := 'CANCEL ORDER';
5141: ELSIF(p_doc_type = PO_CORE_S.g_doc_type_PA) THEN
5142: -- For Update mode we Show Cancel Action at Header as Cancel Agreement.
5143: d_pos := 110;
5144: IF (PO_LOG.d_stmt) THEN
5145: PO_LOG.stmt(d_module,d_pos,l_current_action || 'is replaced by CANCEL AGREEMENT for update mode');
5146: END IF;
5147: x_valid_ctrl_ctn_tbl(l_index) := 'CANCEL AGREEMENT';
5148: END IF; -- (p_doc_type = 'PO')
5141: ELSIF(p_doc_type = PO_CORE_S.g_doc_type_PA) THEN
5142: -- For Update mode we Show Cancel Action at Header as Cancel Agreement.
5143: d_pos := 110;
5144: IF (PO_LOG.d_stmt) THEN
5145: PO_LOG.stmt(d_module,d_pos,l_current_action || 'is replaced by CANCEL AGREEMENT for update mode');
5146: END IF;
5147: x_valid_ctrl_ctn_tbl(l_index) := 'CANCEL AGREEMENT';
5148: END IF; -- (p_doc_type = 'PO')
5149: ELSE
5147: x_valid_ctrl_ctn_tbl(l_index) := 'CANCEL AGREEMENT';
5148: END IF; -- (p_doc_type = 'PO')
5149: ELSE
5150: d_pos := 120;
5151: IF (PO_LOG.d_stmt) THEN
5152: PO_LOG.stmt(d_module,d_pos,l_current_action || 'is directly placed');
5153: END IF;
5154: x_valid_ctrl_ctn_tbl(l_index) := l_valid_actions_tbl(i);
5155: END IF; --mode = 'SUMMARY' AND l_current_action LIKE 'CANCEL%'
5148: END IF; -- (p_doc_type = 'PO')
5149: ELSE
5150: d_pos := 120;
5151: IF (PO_LOG.d_stmt) THEN
5152: PO_LOG.stmt(d_module,d_pos,l_current_action || 'is directly placed');
5153: END IF;
5154: x_valid_ctrl_ctn_tbl(l_index) := l_valid_actions_tbl(i);
5155: END IF; --mode = 'SUMMARY' AND l_current_action LIKE 'CANCEL%'
5156: l_index := l_index+1;
5159: END LOOP;
5160:
5161: ELSIF (x_return_status = FND_API.g_ret_sts_error)then
5162: d_pos := 130;
5163: IF (PO_LOG.d_stmt) THEN
5164: PO_LOG.stmt(d_module,d_pos,'No Valid Control Action Found');
5165: END IF;
5166: ELSE
5167: d_pos := 140;
5160:
5161: ELSIF (x_return_status = FND_API.g_ret_sts_error)then
5162: d_pos := 130;
5163: IF (PO_LOG.d_stmt) THEN
5164: PO_LOG.stmt(d_module,d_pos,'No Valid Control Action Found');
5165: END IF;
5166: ELSE
5167: d_pos := 140;
5168: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5166: ELSE
5167: d_pos := 140;
5168: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5169: END IF; --x_return_status = FND_API.g_ret_sts_success
5170: IF (PO_LOG.d_proc) THEN
5171: PO_LOG.proc_end(d_module);
5172: END IF;
5173: EXCEPTION
5174: WHEN OTHERS THEN
5167: d_pos := 140;
5168: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5169: END IF; --x_return_status = FND_API.g_ret_sts_success
5170: IF (PO_LOG.d_proc) THEN
5171: PO_LOG.proc_end(d_module);
5172: END IF;
5173: EXCEPTION
5174: WHEN OTHERS THEN
5175: x_return_status := FND_API.g_ret_sts_unexp_error;
5173: EXCEPTION
5174: WHEN OTHERS THEN
5175: x_return_status := FND_API.g_ret_sts_unexp_error;
5176: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
5177: IF PO_LOG.d_exc THEN
5178: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
5179: END IF;
5180: END get_valid_control_actions;
5181:
5174: WHEN OTHERS THEN
5175: x_return_status := FND_API.g_ret_sts_unexp_error;
5176: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||':'||d_pos);
5177: IF PO_LOG.d_exc THEN
5178: PO_LOG.exc(d_module,d_pos,'Unhandled Exception in' || d_module);
5179: END IF;
5180: END get_valid_control_actions;
5181:
5182: --------------------------------------------------------------------------------