Address #484 - Qmax not saving
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@4754 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -16,7 +16,7 @@ CREATE OR REPLACE PACKAGE mip_enquiry IS
|
||||
|
||||
-- Public function and procedure declarations
|
||||
FUNCTION enquiry_has_quotes(p_enquiryid IN NUMBER) RETURN BOOLEAN;
|
||||
|
||||
|
||||
FUNCTION can_enquiry_be_deleted(p_enquiryid IN NUMBER) RETURN BOOLEAN;
|
||||
|
||||
FUNCTION get_enquiry_status(p_enquiryid IN NUMBER) RETURN VARCHAR2;
|
||||
@@ -118,8 +118,8 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
-- cursor to get the current enquiry
|
||||
CURSOR c_count_all_quotes(cp_enqu_id NUMBER) IS
|
||||
SELECT COUNT(id)
|
||||
FROM quotes
|
||||
WHERE enqu_id = cp_enqu_id;
|
||||
FROM quotes
|
||||
WHERE enqu_id = cp_enqu_id;
|
||||
l_quotes_num NUMBER := 0;
|
||||
BEGIN
|
||||
IF NOT c_count_all_quotes%ISOPEN THEN
|
||||
@@ -629,16 +629,18 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
,p_existing_mesc_code meters.mesc_code%TYPE
|
||||
,p_required_mesc_code meters.mesc_code%TYPE
|
||||
,p_existing_metr_code meters.code%TYPE) RETURN BOOLEAN IS
|
||||
l_return BOOLEAN := TRUE;
|
||||
l_required_mesc_enquiry BOOLEAN;
|
||||
l_existing_mesc_enquiry BOOLEAN;
|
||||
l_dummy NUMBER;
|
||||
l_return BOOLEAN := TRUE;
|
||||
l_existing_qmax BOOLEAN;
|
||||
l_required_qmax BOOLEAN;
|
||||
l_dummy NUMBER;
|
||||
BEGIN
|
||||
|
||||
pl('show_qmax:entry:' || p_enty_code || ':' || p_existing_metr_code || ':' ||
|
||||
p_existing_mesc_code || ':' || p_required_mesc_code
|
||||
,$$PLSQL_LINE);
|
||||
|
||||
IF p_enty_code IS NOT NULL THEN
|
||||
-- is Qmax set to be hidden?
|
||||
BEGIN
|
||||
SELECT NULL
|
||||
INTO l_dummy
|
||||
@@ -658,61 +660,40 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
END;
|
||||
|
||||
IF l_return THEN
|
||||
BEGIN
|
||||
SELECT NULL
|
||||
INTO l_dummy
|
||||
FROM data_item_roles
|
||||
WHERE enty_code = p_enty_code
|
||||
AND field_name = 'REQUIRED_MESC_CODE'
|
||||
AND substr(condition
|
||||
,1
|
||||
,1) <> 'H';
|
||||
|
||||
l_required_mesc_enquiry := TRUE;
|
||||
EXCEPTION
|
||||
WHEN no_data_found THEN
|
||||
pl('show_qmax:NOT A REQUIRED MESC ENQUIRY'
|
||||
,$$PLSQL_LINE);
|
||||
l_required_mesc_enquiry := FALSE;
|
||||
END;
|
||||
|
||||
IF l_required_mesc_enquiry
|
||||
AND (nvl(p_required_mesc_code
|
||||
,'OTHER') <> 'OTHER') THEN
|
||||
pl('show_qmax:REQUIRED MESC NOT OTHER'
|
||||
,$$PLSQL_LINE);
|
||||
l_return := FALSE;
|
||||
IF p_enty_code IN
|
||||
('OFMAT', 'REMOVE', 'STD REMOVE', 'ADVERSARIAL', 'ADDON') THEN
|
||||
l_existing_qmax := TRUE;
|
||||
ELSE
|
||||
BEGIN
|
||||
SELECT NULL
|
||||
INTO l_dummy
|
||||
FROM data_item_roles
|
||||
WHERE enty_code = p_enty_code
|
||||
AND field_name = 'EXISTING_MESC_CODE'
|
||||
AND substr(condition
|
||||
,1
|
||||
,1) <> 'H';
|
||||
l_existing_mesc_enquiry := TRUE;
|
||||
EXCEPTION
|
||||
WHEN no_data_found THEN
|
||||
pl('show_qmax:NOT EXISTING MESC ENQUIRY'
|
||||
,$$PLSQL_LINE);
|
||||
l_existing_mesc_enquiry := FALSE;
|
||||
END;
|
||||
|
||||
IF l_existing_mesc_enquiry
|
||||
AND ((nvl(p_existing_metr_code
|
||||
,'OTHER') <> 'OTHER') OR
|
||||
(nvl(p_existing_metr_code
|
||||
,'OTHER') = 'OTHER' AND
|
||||
nvl(p_existing_mesc_code
|
||||
,'OTHER') <> 'OTHER')) THEN
|
||||
pl('show_qmax:EXISTING METR OR MESC NOT OTHER'
|
||||
l_required_qmax := TRUE;
|
||||
END IF;
|
||||
|
||||
IF l_existing_qmax THEN
|
||||
IF (nvl(p_existing_metr_code
|
||||
,'OTHER') <> 'OTHER') THEN
|
||||
pl('show_qmax:EXISTING_METR_CODE SPECIFIED');
|
||||
l_return := FALSE;
|
||||
ELSIF
|
||||
|
||||
(nvl(p_existing_metr_code
|
||||
,'OTHER') = 'OTHER' AND
|
||||
nvl(p_existing_mesc_code
|
||||
,'OTHER') <> 'OTHER') THEN
|
||||
pl('show_qmax:EXISTING_MESC SPECIFIED'
|
||||
,$$PLSQL_LINE);
|
||||
l_return := FALSE;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
IF l_required_qmax
|
||||
AND (nvl(p_required_mesc_code
|
||||
,'OTHER') <> 'OTHER') THEN
|
||||
pl('show_qmax:REQUIRED_MESC SPECIFIED'
|
||||
,$$PLSQL_LINE);
|
||||
l_return := FALSE;
|
||||
|
||||
END IF;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
pl('show_qmax:exit:' || CASE l_return WHEN TRUE THEN 'TRUE' ELSE
|
||||
'FALSE' END
|
||||
|
||||
Reference in New Issue
Block a user