Addressed #363, assertion error and/or ORA-06502 errors during the quote generation caused by missing Required Meter Size or Qmax in the submitted enquiry.
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3975 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -4,18 +4,18 @@ CREATE OR REPLACE PACKAGE mip_debug IS
|
|||||||
-- Created : 06/03/2008 09:07:01
|
-- Created : 06/03/2008 09:07:01
|
||||||
-- Purpose : provide debug output functionality
|
-- Purpose : provide debug output functionality
|
||||||
|
|
||||||
PROCEDURE pl(p_unit IN VARCHAR
|
PROCEDURE pl(p_unit IN VARCHAR2
|
||||||
,p_in VARCHAR2
|
,p_in VARCHAR2
|
||||||
,p_line IN NUMBER DEFAULT NULL);
|
,p_line IN NUMBER DEFAULT NULL);
|
||||||
END mip_debug;
|
END mip_debug;
|
||||||
/
|
/
|
||||||
CREATE OR REPLACE PACKAGE BODY mip_debug IS
|
CREATE OR REPLACE PACKAGE BODY mip_debug IS
|
||||||
|
|
||||||
PROCEDURE pl(p_unit IN VARCHAR
|
PROCEDURE pl(p_unit IN VARCHAR2
|
||||||
,p_in VARCHAR2
|
,p_in VARCHAR2
|
||||||
,p_line IN NUMBER DEFAULT NULL) IS
|
,p_line IN NUMBER DEFAULT NULL) IS
|
||||||
l_fh utl_file.file_type;
|
l_fh utl_file.file_type;
|
||||||
l_output VARCHAR2(400);
|
l_output VARCHAR2(4000);
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
dbms_application_info.set_module(p_unit
|
dbms_application_info.set_module(p_unit
|
||||||
|
|||||||
@@ -24,10 +24,11 @@ CREATE OR REPLACE PACKAGE BODY mip_helper_special_cases IS
|
|||||||
,p_field_name => 'INSTALL_SUB_BUILDING'
|
,p_field_name => 'INSTALL_SUB_BUILDING'
|
||||||
,p_error_message => 'At least one of Building or Sub-Building must be completed.');
|
,p_error_message => 'At least one of Building or Sub-Building must be completed.');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- O-M2
|
-- O-M2
|
||||||
IF p_rec.enty_code IN ('STD INSTALL', 'STD EXCHANGE') THEN
|
IF p_rec.enty_code IN ('STD INSTALL', 'STD EXCHANGE') THEN
|
||||||
IF p_rec.required_mesc_code = 'OTHER' THEN
|
IF (p_rec.required_mesc_code IS NULL OR
|
||||||
|
p_rec.required_mesc_code = 'OTHER') THEN
|
||||||
IF p_rec.qmax IS NULL THEN
|
IF p_rec.qmax IS NULL THEN
|
||||||
mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks
|
mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks
|
||||||
,p_field_name => 'QMAX'
|
,p_field_name => 'QMAX'
|
||||||
@@ -35,14 +36,13 @@ CREATE OR REPLACE PACKAGE BODY mip_helper_special_cases IS
|
|||||||
END IF;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- O-M3
|
-- O-M3
|
||||||
IF p_rec.enty_code IN
|
IF p_rec.enty_code IN
|
||||||
('INSTALL', 'OFMAT', 'REMOVE', 'ADVERSARIAL', 'ALTERATION',
|
('INSTALL', 'OFMAT', 'REMOVE', 'ADVERSARIAL', 'ALTERATION',
|
||||||
'CHANGE CAPACITY', 'ADDON', 'OTHER')
|
'CHANGE CAPACITY', 'ADDON', 'OTHER')
|
||||||
AND p_rec.required_svcp_code = 'IP'
|
AND p_rec.required_svcp_code = 'IP'
|
||||||
AND
|
AND (p_rec.required_ip_details IS NULL) THEN
|
||||||
(p_rec.required_ip_details IS NULL) THEN
|
|
||||||
mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks
|
mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks
|
||||||
,p_field_name => 'REQUIRED_SVCP_CODE'
|
,p_field_name => 'REQUIRED_SVCP_CODE'
|
||||||
,p_error_message => 'Required IP Details must be completed when a Service Pressure of ''IP'' is requested.');
|
,p_error_message => 'Required IP Details must be completed when a Service Pressure of ''IP'' is requested.');
|
||||||
@@ -50,7 +50,7 @@ CREATE OR REPLACE PACKAGE BODY mip_helper_special_cases IS
|
|||||||
,p_field_name => 'REQUIRED_IP_DETAILS'
|
,p_field_name => 'REQUIRED_IP_DETAILS'
|
||||||
,p_error_message => 'Required IP Details must be completed when a Service Pressure of ''IP'' is requested.');
|
,p_error_message => 'Required IP Details must be completed when a Service Pressure of ''IP'' is requested.');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- O-M4
|
-- O-M4
|
||||||
IF p_rec.enty_code IN ('INSTALL', 'STD INSTALL')
|
IF p_rec.enty_code IN ('INSTALL', 'STD INSTALL')
|
||||||
AND (p_rec.mprn IS NULL AND p_rec.mprn_alt IS NULL) THEN
|
AND (p_rec.mprn IS NULL AND p_rec.mprn_alt IS NULL) THEN
|
||||||
@@ -61,11 +61,11 @@ CREATE OR REPLACE PACKAGE BODY mip_helper_special_cases IS
|
|||||||
,p_field_name => 'MPRN_ALT'
|
,p_field_name => 'MPRN_ALT'
|
||||||
,p_error_message => 'Either MPRN or Additional Information must be completed.');
|
,p_error_message => 'Either MPRN or Additional Information must be completed.');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- O-M5
|
-- O-M5
|
||||||
-- Tripartite Agreement and AMR -- this is a specific example of the Tripartite and addons
|
-- Tripartite Agreement and AMR -- this is a specific example of the Tripartite and addons
|
||||||
-- This is handled through the mip_tripartite.addon functionality
|
-- This is handled through the mip_tripartite.addon functionality
|
||||||
|
|
||||||
-- O-M6
|
-- O-M6
|
||||||
IF p_rec.enty_code IN ('OFMAT', 'EXCHANGE', 'STD EXCHANGE', 'REMOVE',
|
IF p_rec.enty_code IN ('OFMAT', 'EXCHANGE', 'STD EXCHANGE', 'REMOVE',
|
||||||
'STD REMOVE', 'ADVERSARIAL', 'CHANGE CAPACITY')
|
'STD REMOVE', 'ADVERSARIAL', 'CHANGE CAPACITY')
|
||||||
|
|||||||
@@ -1308,22 +1308,30 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
END return_mandatory_messages;
|
END return_mandatory_messages;
|
||||||
|
|
||||||
PROCEDURE add_quote_reason(p_enqu_id IN enquiries.id%TYPE
|
PROCEDURE add_quote_reason(p_enqu_id IN enquiries.id%TYPE
|
||||||
,p_reason IN quote_reasoning.reason%TYPE
|
,p_reason IN VARCHAR2 --quote_reasoning.reason%TYPE
|
||||||
,p_internal_or_external IN quote_reasoning.internal_or_external%TYPE DEFAULT gc_external_reason) IS
|
,p_internal_or_external IN quote_reasoning.internal_or_external%TYPE DEFAULT gc_external_reason) IS
|
||||||
BEGIN
|
BEGIN
|
||||||
pl('add_quote_reason:' || p_enqu_id || ':' || p_reason
|
pl('add_quote_reason:' || p_enqu_id || ':' || p_reason
|
||||||
,$$PLSQL_LINE);
|
,$$PLSQL_LINE);
|
||||||
INSERT INTO quote_reasoning
|
BEGIN
|
||||||
(enqu_id
|
INSERT INTO quote_reasoning
|
||||||
,reason
|
(enqu_id
|
||||||
,internal_or_external
|
,reason
|
||||||
,id)
|
,internal_or_external
|
||||||
VALUES
|
,id)
|
||||||
(p_enqu_id
|
VALUES
|
||||||
,p_reason
|
(p_enqu_id
|
||||||
,p_internal_or_external
|
,substr(p_reason
|
||||||
,qure_seq.NEXTVAL);
|
,1
|
||||||
|
,239)
|
||||||
|
,p_internal_or_external
|
||||||
|
,qure_seq.NEXTVAL);
|
||||||
|
EXCEPTION
|
||||||
|
WHEN OTHERS THEN
|
||||||
|
pl('add_quote_reason:' || SQLERRM
|
||||||
|
,$$PLSQL_LINE);
|
||||||
|
RAISE;
|
||||||
|
END;
|
||||||
END add_quote_reason;
|
END add_quote_reason;
|
||||||
|
|
||||||
FUNCTION get_u_meter_size(p_qmax IN NUMBER)
|
FUNCTION get_u_meter_size(p_qmax IN NUMBER)
|
||||||
@@ -2068,7 +2076,9 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
l_existing_rec_metr_details.mety_code || ':' ||
|
l_existing_rec_metr_details.mety_code || ':' ||
|
||||||
l_existing_rec_metr_details.prty_id
|
l_existing_rec_metr_details.prty_id
|
||||||
,$$PLSQL_LINE);
|
,$$PLSQL_LINE);
|
||||||
add_quote_reason('Existing meter details. Meter model is ' ||
|
|
||||||
|
add_quote_reason(p_enqu.id
|
||||||
|
,'Existing meter details. Meter model is ' ||
|
||||||
nvl(l_existing_rec_metr_details.code
|
nvl(l_existing_rec_metr_details.code
|
||||||
,'UNKNOWN') || ', meter size code is ' ||
|
,'UNKNOWN') || ', meter size code is ' ||
|
||||||
nvl(l_existing_rec_metr_details.mesc_code
|
nvl(l_existing_rec_metr_details.mesc_code
|
||||||
@@ -2088,7 +2098,19 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
IF p_enqu.required_svcp_code = 'LP'
|
IF p_enqu.required_svcp_code = 'LP'
|
||||||
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
|
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
|
||||||
-- no restrictions
|
-- no restrictions
|
||||||
l_required_qmax := p_enqu.qmax;
|
pl('Existing LP Diaphragm - no restriction'
|
||||||
|
,$$PLSQL_LINE);
|
||||||
|
pl('Required Meter Size' || p_enqu.required_mesc_code
|
||||||
|
,$$PLSQL_LINE);
|
||||||
|
pl('Required Qmax' || p_enqu.qmax
|
||||||
|
,$$PLSQL_LINE);
|
||||||
|
IF p_enqu.required_mesc_code IS NOT NULL
|
||||||
|
AND p_enqu.required_mesc_code <> 'OTHER' THEN
|
||||||
|
l_required_qmax := get_qmax_from_mesc(p_enqu.required_mesc_code);
|
||||||
|
ELSE
|
||||||
|
l_required_qmax := p_enqu.qmax;
|
||||||
|
END IF;
|
||||||
|
|
||||||
ELSIF p_enqu.required_svcp_code = 'MP'
|
ELSIF p_enqu.required_svcp_code = 'MP'
|
||||||
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
|
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
|
||||||
-- can quote for specific meter size
|
-- can quote for specific meter size
|
||||||
@@ -2123,6 +2145,10 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
,'Site Survey is required for exchange of meter.');
|
,'Site Survey is required for exchange of meter.');
|
||||||
END IF;
|
END IF;
|
||||||
ELSE
|
ELSE
|
||||||
|
pl('required_mesc_code=' || p_enqu.required_mesc_code
|
||||||
|
,$$PLSQL_UNIT);
|
||||||
|
pl('qmax=' || p_enqu.qmax
|
||||||
|
,$$PLSQL_UNIT);
|
||||||
-- the user can only request meter sizes of:
|
-- the user can only request meter sizes of:
|
||||||
-- 'U' meter size code, these have associated Qmax values; OR
|
-- 'U' meter size code, these have associated Qmax values; OR
|
||||||
-- 'OTHER' - the user didn't know the meter size code!
|
-- 'OTHER' - the user didn't know the meter size code!
|
||||||
|
|||||||
Reference in New Issue
Block a user