Addresses #376. Correct detection of a bypass_required reason.
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@4006 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -1526,7 +1526,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
AND p_enqu.required_svcp_code IN ('LP', 'MP') THEN
|
AND p_enqu.required_svcp_code IN ('LP', 'MP') THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Site Survey is required for alteration (relocation or reposition) of an existing meter.',gc_external_reason);
|
,'Site Survey is required for alteration (relocation or reposition) of an existing meter.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF; -- ALTERATION
|
END IF; -- ALTERATION
|
||||||
|
|
||||||
IF p_enqu.enty_code IN ('EXCHANGE', 'STD EXCHANGE', 'CHANGE CAPACITY') THEN
|
IF p_enqu.enty_code IN ('EXCHANGE', 'STD EXCHANGE', 'CHANGE CAPACITY') THEN
|
||||||
@@ -1546,13 +1547,15 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Site Survey is required for exchange of an existing ' ||
|
,'Site Survey is required for exchange of an existing ' ||
|
||||||
l_svcpt_code || ' meter.',gc_external_reason);
|
l_svcpt_code || ' meter.'
|
||||||
|
,gc_external_reason);
|
||||||
ELSE
|
ELSE
|
||||||
-- Exchange, MP
|
-- Exchange, MP
|
||||||
IF p_enqu.existing_mety_code <> 'DIAPHRAGM' THEN
|
IF p_enqu.existing_mety_code <> 'DIAPHRAGM' THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Site Survey is required for exchange of an existing non-diaphragm meter.',gc_external_reason);
|
,'Site Survey is required for exchange of an existing non-diaphragm meter.'
|
||||||
|
,gc_external_reason);
|
||||||
ELSE
|
ELSE
|
||||||
-- Exchange, MP, Diaphragm
|
-- Exchange, MP, Diaphragm
|
||||||
l_required_mesc_code := p_enqu.required_mesc_code;
|
l_required_mesc_code := p_enqu.required_mesc_code;
|
||||||
@@ -1567,7 +1570,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Site Survey is required for exchange of diaphragm meter from size ' ||
|
,'Site Survey is required for exchange of diaphragm meter from size ' ||
|
||||||
l_rec_metr_details.mesc_code || ' to ' ||
|
l_rec_metr_details.mesc_code || ' to ' ||
|
||||||
l_required_mesc_code || '.',gc_external_reason);
|
l_required_mesc_code || '.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
END IF; -- DIAPHRAGM
|
END IF; -- DIAPHRAGM
|
||||||
END IF; -- svcpt_code <> 'MP'
|
END IF; -- svcpt_code <> 'MP'
|
||||||
@@ -1624,7 +1628,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
LOOP
|
LOOP
|
||||||
EXIT WHEN l_idx IS NULL;
|
EXIT WHEN l_idx IS NULL;
|
||||||
add_quote_reason(p_enqu_id => p_enqu_id
|
add_quote_reason(p_enqu_id => p_enqu_id
|
||||||
,p_reason => l_tab_messages(l_idx),p_internal_or_external=>gc_external_reason);
|
,p_reason => l_tab_messages(l_idx)
|
||||||
|
,p_internal_or_external => gc_external_reason);
|
||||||
l_idx := l_tab_messages.NEXT(l_idx);
|
l_idx := l_tab_messages.NEXT(l_idx);
|
||||||
END LOOP;
|
END LOOP;
|
||||||
|
|
||||||
@@ -1640,6 +1645,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
|
|
||||||
PROCEDURE manual_or_automatic_quote(p_enqu IN t_enqu
|
PROCEDURE manual_or_automatic_quote(p_enqu IN t_enqu
|
||||||
,p_manual_or_automatic_quote OUT t_manual_or_automatic_quote) IS
|
,p_manual_or_automatic_quote OUT t_manual_or_automatic_quote) IS
|
||||||
|
l_dummy NUMBER;
|
||||||
BEGIN
|
BEGIN
|
||||||
pl('manual_or_automatic_quote'
|
pl('manual_or_automatic_quote'
|
||||||
,$$PLSQL_LINE);
|
,$$PLSQL_LINE);
|
||||||
@@ -1649,7 +1655,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Enquiry type is ''' ||
|
,'Enquiry type is ''' ||
|
||||||
get_enty_description(p_enqu.id) || '''.',gc_external_reason);
|
get_enty_description(p_enqu.id) || '''.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
survey_required(p_enqu => p_enqu
|
survey_required(p_enqu => p_enqu
|
||||||
@@ -1658,57 +1665,78 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
IF p_enqu.twin_stream_required = 'YES' THEN
|
IF p_enqu.twin_stream_required = 'YES' THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Twin stream required.',gc_external_reason);
|
,'Twin stream required.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.bypass_required = 'YES' THEN
|
IF p_enqu.bypass_required IS NOT NULL THEN
|
||||||
|
BEGIN
|
||||||
|
SELECT 1
|
||||||
|
INTO l_dummy
|
||||||
|
FROM bypass_reasons
|
||||||
|
WHERE description = p_enqu.bypass_required
|
||||||
|
AND code <> '1';
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Bypass required.',gc_external_reason);
|
,'Bypass required.'
|
||||||
|
,gc_external_reason);
|
||||||
|
EXCEPTION
|
||||||
|
WHEN no_data_found THEN
|
||||||
|
-- bypass reason 1
|
||||||
|
-- no action required
|
||||||
|
NULL;
|
||||||
|
END;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.required_metering_pressure > 21 THEN
|
IF p_enqu.required_metering_pressure > 21 THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Required metering pressure is greater than 21mbar.',gc_external_reason);
|
,'Required metering pressure is greater than 21mbar.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.convertor_required = 'YES' THEN
|
IF p_enqu.convertor_required = 'YES' THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Convertor required.',gc_external_reason);
|
,'Convertor required.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.job_description IS NOT NULL THEN
|
IF p_enqu.job_description IS NOT NULL THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Job Description field was entered.',gc_external_reason);
|
,'Job Description field was entered.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.downstream_booster_or_compress = 'YES' THEN
|
IF p_enqu.downstream_booster_or_compress = 'YES' THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Booster or compressor is present downstream of the meter module.',gc_external_reason);
|
,'Booster or compressor is present downstream of the meter module.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.annual_quantity > 732 * 1000 THEN
|
IF p_enqu.annual_quantity > 732 * 1000 THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Required Annual Quantity is in excess of 732MWh.',gc_external_reason);
|
,'Required Annual Quantity is in excess of 732MWh.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.existing_convertor = 'YES'
|
IF p_enqu.existing_convertor = 'YES'
|
||||||
AND p_enqu.enty_code NOT IN ('REMOVE', 'STD REMOVE', 'ADVERSARIAL') THEN
|
AND p_enqu.enty_code NOT IN ('REMOVE', 'STD REMOVE', 'ADVERSARIAL') THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Convertor is present.',gc_external_reason);
|
,'Convertor is present.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.existing_logger = 'YES'
|
IF p_enqu.existing_logger = 'YES'
|
||||||
AND p_enqu.enty_code IN ('EXCHANGE', 'STD EXCHANGE') THEN
|
AND p_enqu.enty_code IN ('EXCHANGE', 'STD EXCHANGE') THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Logger is present.',gc_external_reason);
|
,'Logger is present.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.enty_code IN ('OFMAT')
|
IF p_enqu.enty_code IN ('OFMAT')
|
||||||
@@ -1718,7 +1746,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
,1) <> 'U') THEN
|
,1) <> 'U') THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'OFMAT request for a non-''U''-sized Diaphragm meter.',gc_external_reason);
|
,'OFMAT request for a non-''U''-sized Diaphragm meter.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_enqu.enty_code IN ('OFMAT', 'EXCHANGE', 'STD EXCHANGE', 'REMOVE',
|
IF p_enqu.enty_code IN ('OFMAT', 'EXCHANGE', 'STD EXCHANGE', 'REMOVE',
|
||||||
@@ -1730,18 +1759,21 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,get_enty_description(p_enqu.enty_code) ||
|
,get_enty_description(p_enqu.enty_code) ||
|
||||||
' request has insufficient details describing the existing meter.',gc_external_reason);
|
' request has insufficient details describing the existing meter.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- check postcode
|
-- check postcode
|
||||||
IF NOT mip_regions.valid_postcode_format(p_enqu.install_postcode) THEN
|
IF NOT mip_regions.valid_postcode_format(p_enqu.install_postcode) THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Installation postcode is of an unrecognized format.',gc_external_reason);
|
,'Installation postcode is of an unrecognized format.'
|
||||||
|
,gc_external_reason);
|
||||||
ELSIF mip_regions.get_region_for_postcode(p_enqu.install_postcode) IS NULL THEN
|
ELSIF mip_regions.get_region_for_postcode(p_enqu.install_postcode) IS NULL THEN
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Unable to determine pricing region for given installation postcode.',gc_external_reason);
|
,'Unable to determine pricing region for given installation postcode.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF p_manual_or_automatic_quote = gc_manual_quote THEN
|
IF p_manual_or_automatic_quote = gc_manual_quote THEN
|
||||||
@@ -2139,9 +2171,11 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Site Survey is required for exchange of diaphragm meter from size ' ||
|
,'Site Survey is required for exchange of diaphragm meter from size ' ||
|
||||||
l_existing_rec_metr_details.mesc_code || ' to ' ||
|
l_existing_rec_metr_details.mesc_code || ' to ' ||
|
||||||
l_required_mesc_code || '.',gc_external_reason);
|
l_required_mesc_code || '.'
|
||||||
|
,gc_external_reason);
|
||||||
ELSE
|
ELSE
|
||||||
add_quote_reason(p_enqu.id,'Required meter size code is ' ||
|
add_quote_reason(p_enqu.id
|
||||||
|
,'Required meter size code is ' ||
|
||||||
l_required_mesc_code
|
l_required_mesc_code
|
||||||
,gc_internal_reason);
|
,gc_internal_reason);
|
||||||
pl('Required Meter Size Code=' || l_required_mesc_code
|
pl('Required Meter Size Code=' || l_required_mesc_code
|
||||||
@@ -2150,7 +2184,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
ELSE
|
ELSE
|
||||||
p_manual_or_automatic_quote := gc_manual_quote;
|
p_manual_or_automatic_quote := gc_manual_quote;
|
||||||
add_quote_reason(p_enqu.id
|
add_quote_reason(p_enqu.id
|
||||||
,'Site Survey is required for exchange of meter.',gc_external_reason);
|
,'Site Survey is required for exchange of meter.'
|
||||||
|
,gc_external_reason);
|
||||||
END IF;
|
END IF;
|
||||||
ELSE
|
ELSE
|
||||||
pl('required_mesc_code=' || p_enqu.required_mesc_code
|
pl('required_mesc_code=' || p_enqu.required_mesc_code
|
||||||
@@ -3331,6 +3366,5 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
|||||||
RAISE;
|
RAISE;
|
||||||
END produce_quotes;
|
END produce_quotes;
|
||||||
|
|
||||||
|
|
||||||
END mip_quotation;
|
END mip_quotation;
|
||||||
/
|
/
|
||||||
|
|||||||
Reference in New Issue
Block a user