Ensure that we have a required_qmax for 'exchanges' not affected by 'one-U-step' rules (mip_quotation.pck).
Tidy-up debug messages from MIP_FILES.pck. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3940 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -53,12 +53,12 @@ CREATE OR REPLACE PACKAGE BODY mip_files AS
|
||||
|
||||
BEGIN
|
||||
|
||||
pl('is_file_over_size_limit:' || p_uri);
|
||||
pl('is_file_over_size_limit:entry:' || p_uri);
|
||||
SELECT doc_size
|
||||
INTO l_file_size
|
||||
FROM wwv_flow_files
|
||||
WHERE NAME = p_uri;
|
||||
pl('l_file_size:' || l_file_size);
|
||||
pl('is_file_over_size_limit:exit:' || l_file_size);
|
||||
RETURN(l_file_size > 3 * 1024 * 1024);
|
||||
|
||||
END is_file_over_size_limit;
|
||||
@@ -270,8 +270,7 @@ CREATE OR REPLACE PACKAGE BODY mip_files AS
|
||||
l_doc_id NUMBER;
|
||||
l_success BOOLEAN;
|
||||
BEGIN
|
||||
pl('set_file_association, p_uri=' || p_uri || ', p_drwg_code=' ||
|
||||
p_drwg_code);
|
||||
pl('set_file_association:entry:'|| p_uri || ':'||p_docu_type||':'||p_doro_type);
|
||||
--reference it in the documents table
|
||||
INSERT INTO documents
|
||||
(uri
|
||||
@@ -319,7 +318,6 @@ CREATE OR REPLACE PACKAGE BODY mip_files AS
|
||||
,p_description
|
||||
,doev_seq.NEXTVAL);
|
||||
|
||||
pl('check_file_sizes');
|
||||
IF p_rt_code = 'ENQUIRY SUPPORTING DOC'
|
||||
AND NOT p_enqu_id IS NULL THEN
|
||||
IF (are_files_over_size_limit(p_enqu_id) OR
|
||||
@@ -327,13 +325,13 @@ CREATE OR REPLACE PACKAGE BODY mip_files AS
|
||||
l_success := delete_file(l_doc_id
|
||||
,'REMOVED SIZE'
|
||||
,'webMIP determined the file or files to be too big');
|
||||
pl('returning false');
|
||||
pl('set_file_association:exit:false');
|
||||
RETURN FALSE;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
--if it works then return true
|
||||
pl('returning true');
|
||||
pl('set_file_association:exit:true');
|
||||
RETURN TRUE;
|
||||
END set_file_association;
|
||||
/*
|
||||
|
||||
@@ -2046,38 +2046,17 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
IF p_enqu.enty_code IN ('INSTALL', 'STD INSTALL') THEN
|
||||
add_quote_reason(p_enqu.id
|
||||
,p_reason => 'Attempting an automatic installation quote for ' ||
|
||||
p_enqu.id || '.' || ' Required SVCP ' ||
|
||||
p_enqu.required_svcp_code ||
|
||||
', REQUESTED_MESC_CODE=' ||
|
||||
p_enqu.required_mesc_code || ', QMAX=' ||
|
||||
p_enqu.qmax || ', Outlet Pressure=' ||
|
||||
p_enqu.required_metering_pressure || '.'
|
||||
p_enqu.id || '.'
|
||||
,p_internal_or_external => gc_internal_reason);
|
||||
ELSIF p_enqu.enty_code IN ('EXCHANGE', 'STD EXCHANGE') THEN
|
||||
add_quote_reason(p_enqu.id
|
||||
,p_reason => 'Attempting an automatic exchange quote for ' ||
|
||||
p_enqu.id || '.' || ' Required SVCP ' ||
|
||||
p_enqu.required_svcp_code ||
|
||||
', REQUESTED_MESC_CODE=' ||
|
||||
p_enqu.required_mesc_code || ', QMAX=' ||
|
||||
p_enqu.qmax || ', Outlet Pressure=' ||
|
||||
p_enqu.required_metering_pressure || '.' ||
|
||||
'Existing meter was a ' ||
|
||||
p_enqu.existing_mesc_code || ' ' ||
|
||||
p_enqu.existing_mety_code
|
||||
p_enqu.id || '.'
|
||||
,p_internal_or_external => gc_internal_reason);
|
||||
ELSIF p_enqu.enty_code IN ('CHANGE CAPACITY') THEN
|
||||
add_quote_reason(p_enqu.id
|
||||
,p_reason => 'Attempting an automatic change capacity quote for ' ||
|
||||
p_enqu.id || '.' || ' Required SVCP ' ||
|
||||
p_enqu.required_svcp_code ||
|
||||
', REQUESTED_MESC_CODE=' ||
|
||||
p_enqu.required_mesc_code || ', QMAX=' ||
|
||||
p_enqu.qmax || ', Outlet Pressure=' ||
|
||||
p_enqu.required_metering_pressure || '.' ||
|
||||
'Existing meter was a ' ||
|
||||
p_enqu.existing_mesc_code || ' ' ||
|
||||
p_enqu.existing_mety_code
|
||||
p_enqu.id || '.'
|
||||
,p_internal_or_external => gc_internal_reason);
|
||||
END IF;
|
||||
|
||||
@@ -2089,6 +2068,15 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
l_existing_rec_metr_details.mety_code || ':' ||
|
||||
l_existing_rec_metr_details.prty_id
|
||||
,$$PLSQL_LINE);
|
||||
add_quote_reason('Existing meter details. Meter model is ' ||
|
||||
nvl(l_existing_rec_metr_details.code
|
||||
,'UNKNOWN') || ', meter size code is ' ||
|
||||
nvl(l_existing_rec_metr_details.mesc_code
|
||||
,'UNKNOWN') || ', meter type is ' ||
|
||||
nvl(l_existing_rec_metr_details.mety_code
|
||||
,'UNKNOWN')
|
||||
,gc_internal_reason);
|
||||
|
||||
-- Need to follow the 'site survey' rule:
|
||||
-- All exchanges require a site survey UNLESS
|
||||
-- the service pressure is LP and the existing meter is a Diaphragm; OR
|
||||
@@ -2100,7 +2088,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
IF p_enqu.required_svcp_code = 'LP'
|
||||
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
|
||||
-- no restrictions
|
||||
NULL;
|
||||
l_required_qmax := p_enqu.qmax;
|
||||
ELSIF p_enqu.required_svcp_code = 'MP'
|
||||
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
|
||||
-- can quote for specific meter size
|
||||
@@ -2122,6 +2110,12 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,'Site Survey is required for exchange of diaphragm meter from size ' ||
|
||||
l_existing_rec_metr_details.mesc_code || ' to ' ||
|
||||
l_required_mesc_code || '.');
|
||||
ELSE
|
||||
add_quote_reason('Required meter size code is ' ||
|
||||
l_required_mesc_code
|
||||
,gc_internal_reason);
|
||||
pl('Required Meter Size Code=' || l_required_mesc_code
|
||||
,$$PLSQL_LINE);
|
||||
END IF;
|
||||
ELSE
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
@@ -2146,12 +2140,18 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
|
||||
IF NOT p_manual_or_automatic_quote = gc_manual_quote THEN
|
||||
|
||||
cout_assert.istrue(NOT (l_required_mesc_code IS NULL AND
|
||||
l_required_qmax IS NULL)
|
||||
,p_message => 'EITHER required_mesc_code must be null OR required_qmax must be null');
|
||||
cout_assert.istrue(NOT (l_required_mesc_code IS NOT NULL AND
|
||||
l_required_qmax IS NOT NULL)
|
||||
,p_message => 'EITHER required_mesc_code must be null OR required_qmax must be null');
|
||||
cout_assert.istrue((l_required_mesc_code IS NULL AND
|
||||
l_required_qmax IS NOT NULL) OR
|
||||
(l_required_mesc_code IS NOT NULL AND
|
||||
l_required_qmax IS NULL)
|
||||
,p_message => 'EITHER l_required_mesc_code must be null OR l_required_qmax must be null');
|
||||
|
||||
pl('Looking for modules to match the following: Service Pressure ' ||
|
||||
p_enqu.required_svcp_code || ', Outlet Pressure ' ||
|
||||
p_enqu.required_metering_pressure || CASE l_required_mesc_code WHEN NULL THEN
|
||||
'and required Qmax ' || l_required_qmax ELSE
|
||||
'and required Meter Size Code ' || l_required_mesc_code
|
||||
END || '.');
|
||||
|
||||
FOR l_rec_module IN (SELECT modu.code AS modu_code
|
||||
,modu.selling_price AS modu_selling_price
|
||||
@@ -2752,7 +2752,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
l_additional_costs t_rec_additional_costs;
|
||||
l_existing_rec_metr_details t_rec_metr_details;
|
||||
BEGIN
|
||||
pl('produce_labour_only_quotes'
|
||||
pl('produce_labour_only_quotes:entry:' || p_enqu.id || ':' ||
|
||||
p_enqu.enty_code
|
||||
,$$PLSQL_LINE);
|
||||
cout_assert.istrue(p_enqu.enty_code IN
|
||||
('REMOVE', 'STD REMOVE', 'ADVERSARIAL', 'OFMAT',
|
||||
@@ -2763,21 +2764,22 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
cout_assert.isnotnull(l_regi_code
|
||||
,'Attempted to produce quote for enquiry for a installation postcode (' ||
|
||||
p_enqu.install_postcode || ') without a region.');
|
||||
add_quote_reason(p_enqu.id
|
||||
,p_reason => 'Attempting an automatic labour quote for ' ||
|
||||
p_enqu.id || '.' || 'Enquiry Code=' ||
|
||||
p_enqu.enty_code || ', SVCP ' ||
|
||||
p_enqu.required_svcp_code ||
|
||||
', Meter Type Code=' ||
|
||||
p_enqu.existing_mety_code ||
|
||||
', Meter Size Code=' ||
|
||||
p_enqu.existing_mesc_code || '.'
|
||||
,p_internal_or_external => gc_internal_reason);
|
||||
|
||||
l_this_is_automatic_quote := TRUE;
|
||||
|
||||
l_existing_rec_metr_details := get_existing_metr_details(p_enqu);
|
||||
|
||||
add_quote_reason(p_enqu.id
|
||||
,p_reason => 'Attempting an automatic labour quote for ' ||
|
||||
p_enqu.id || '.' || 'Enquiry Code=' ||
|
||||
p_enqu.enty_code || ', SVCP ' ||
|
||||
p_enqu.required_svcp_code ||
|
||||
', Meter Type Code=' ||
|
||||
l_existing_rec_metr_details.mety_code ||
|
||||
', Meter Size Code=' ||
|
||||
l_existing_rec_metr_details.mesc_code || '.'
|
||||
,p_internal_or_external => gc_internal_reason);
|
||||
|
||||
l_labour_costs := get_laco(p_enty_code => p_enqu.enty_code
|
||||
,p_regi_code => l_regi_code
|
||||
,p_mety_code => l_existing_rec_metr_details.mety_code
|
||||
|
||||
Reference in New Issue
Block a user