Add calc_meter_reqs to mip_quotation.pck.
Ensure that all calls to add_quote_reason use correct parameters (mip_quotation.pck). Change grant from 'CREATE ANY VIEW' to 'CREATE VIEW' in InstallMIP.sql following problems installing 'supporting objects' into MIP_TEST. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3989 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -6,6 +6,15 @@ CREATE OR REPLACE PACKAGE mip_enquiry IS
|
||||
-- Updates : 21 November 2007 - MM - added copy_enquiry function
|
||||
--
|
||||
|
||||
TYPE t_rec_meter_reqs IS RECORD(
|
||||
existing_metr_code meters.code%TYPE
|
||||
,qmax meters.qmax%TYPE
|
||||
,existing_mesc_code meters.mesc_code%TYPE
|
||||
,existing_mety_code meters.mety_code%TYPE
|
||||
,existing_prty_id meters.prty_id%TYPE
|
||||
,required_mesc_code meters.mesc_code%TYPE
|
||||
);
|
||||
|
||||
-- Public function and procedure declarations
|
||||
FUNCTION delete_enquiry(p_enquiryid IN NUMBER) RETURN BOOLEAN;
|
||||
FUNCTION get_enquiry_status(p_enquiryid IN NUMBER) RETURN VARCHAR2;
|
||||
@@ -50,9 +59,28 @@ CREATE OR REPLACE PACKAGE mip_enquiry IS
|
||||
,p_enqu_supp parties.id%TYPE) RETURN VARCHAR2;
|
||||
--
|
||||
|
||||
FUNCTION calc_meter_reqs(p_enty_code enquiry_types.code%TYPE
|
||||
,p_existing_mesc_code meters.mesc_code%TYPE
|
||||
,p_required_mesc_code meters.mesc_code%TYPE
|
||||
,p_existing_metr_code meters.code%TYPE
|
||||
,p_existing_mety_code meters.mety_code%TYPE
|
||||
,p_qmax meters.qmax%TYPE)
|
||||
RETURN t_rec_meter_reqs;
|
||||
|
||||
END mip_enquiry;
|
||||
/
|
||||
CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
PROCEDURE pl(p_in VARCHAR2
|
||||
,p_line IN NUMBER DEFAULT NULL) IS
|
||||
BEGIN
|
||||
NULL;
|
||||
/* $IF mip_debug_constants.debugging OR mip_debug_constants.enquiry
|
||||
$THEN*/
|
||||
mip_debug.pl(p_unit => $$PLSQL_UNIT
|
||||
,p_line => p_line
|
||||
,p_in => p_in);
|
||||
/* $END*/
|
||||
END pl;
|
||||
/*
|
||||
FUNCTION delete_enquiry
|
||||
- This function returns the status of the enquiry provided
|
||||
@@ -60,23 +88,24 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
%return boolean - whether the enquiry was deleted or not
|
||||
*/
|
||||
FUNCTION delete_enquiry(p_enquiryid IN NUMBER) RETURN BOOLEAN AS
|
||||
l_uri documents.uri%type;
|
||||
l_doc_id documents.id%type;
|
||||
l_count number := 0;
|
||||
CURSOR c_get_doc_id(cp_enq_id number) is
|
||||
select id
|
||||
from document_roles
|
||||
where enqu_id=cp_enq_id;
|
||||
CURSOR c_get_uri(cp_id number) is
|
||||
select uri
|
||||
from documents
|
||||
where id=cp_id;
|
||||
CURSOR c_get_document_files(cp_enq_id number) is
|
||||
select documents.uri
|
||||
from documents,document_roles
|
||||
where document_roles.enqu_id = cp_enq_id
|
||||
and documents.id = document_roles.docu_id;
|
||||
begin
|
||||
l_uri documents.uri%TYPE;
|
||||
l_doc_id documents.id%TYPE;
|
||||
l_count NUMBER := 0;
|
||||
CURSOR c_get_doc_id(cp_enq_id NUMBER) IS
|
||||
SELECT id
|
||||
FROM document_roles
|
||||
WHERE enqu_id = cp_enq_id;
|
||||
CURSOR c_get_uri(cp_id NUMBER) IS
|
||||
SELECT uri
|
||||
FROM documents
|
||||
WHERE id = cp_id;
|
||||
CURSOR c_get_document_files(cp_enq_id NUMBER) IS
|
||||
SELECT documents.uri
|
||||
FROM documents
|
||||
,document_roles
|
||||
WHERE document_roles.enqu_id = cp_enq_id
|
||||
AND documents.id = document_roles.docu_id;
|
||||
BEGIN
|
||||
--select count(*) into l_count from quotes where quotes.enqu_id=p_enquiryid;
|
||||
--if l_count > 0 then
|
||||
-- return false;
|
||||
@@ -95,15 +124,21 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
INTO l_uri;
|
||||
CLOSE c_get_uri;
|
||||
|
||||
delete enquiry_roles where enquiry_roles.enqu_id = p_enquiryid;
|
||||
delete enquiry_events where enquiry_events.enqu_id = p_enquiryid;
|
||||
DELETE enquiry_roles
|
||||
WHERE enquiry_roles.enqu_id = p_enquiryid;
|
||||
DELETE enquiry_events
|
||||
WHERE enquiry_events.enqu_id = p_enquiryid;
|
||||
FOR doc_rec IN c_get_document_files(p_enquiryid) LOOP
|
||||
delete wwv_flow_files where wwv_flow_files.name = doc_rec.uri;
|
||||
end loop;
|
||||
delete document_roles where document_roles.enqu_id = p_enquiryid;
|
||||
delete documents where documents.id = l_doc_id;
|
||||
delete enquiries where enquiries.id = p_enquiryid;
|
||||
return true;
|
||||
DELETE wwv_flow_files
|
||||
WHERE wwv_flow_files.NAME = doc_rec.uri;
|
||||
END LOOP;
|
||||
DELETE document_roles
|
||||
WHERE document_roles.enqu_id = p_enquiryid;
|
||||
DELETE documents
|
||||
WHERE documents.id = l_doc_id;
|
||||
DELETE enquiries
|
||||
WHERE enquiries.id = p_enquiryid;
|
||||
RETURN TRUE;
|
||||
END delete_enquiry;
|
||||
/*
|
||||
FUNCTION get_enquiry_status
|
||||
@@ -113,11 +148,11 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
*/
|
||||
FUNCTION get_enquiry_status(p_enquiryid IN NUMBER) RETURN VARCHAR2 AS
|
||||
-- cursor to get the current enquiry
|
||||
CURSOR c_get_enquiry_status(cp_enqu_id number) IS
|
||||
CURSOR c_get_enquiry_status(cp_enqu_id NUMBER) IS
|
||||
SELECT enst_code
|
||||
FROM v_current_enquiry_status
|
||||
WHERE enqu_id=cp_enqu_id;
|
||||
l_enqu_status varchar2(80);
|
||||
WHERE enqu_id = cp_enqu_id;
|
||||
l_enqu_status VARCHAR2(80);
|
||||
BEGIN
|
||||
IF NOT c_get_enquiry_status%ISOPEN THEN
|
||||
OPEN c_get_enquiry_status(p_enquiryid);
|
||||
@@ -126,7 +161,8 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
FETCH c_get_enquiry_status
|
||||
INTO l_enqu_status;
|
||||
CLOSE c_get_enquiry_status;
|
||||
return nvl(l_enqu_status,'');
|
||||
RETURN nvl(l_enqu_status
|
||||
,'');
|
||||
END get_enquiry_status;
|
||||
/*
|
||||
FUNCTION get_enquiry_role
|
||||
@@ -139,20 +175,22 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
FUNCTION get_enquiry_role(p_enquiryid IN NUMBER
|
||||
,p_rolecode IN VARCHAR2) RETURN NUMBER AS
|
||||
-- cursor to get the current enquiry
|
||||
CURSOR c_get_enquiry_role(cp_enqu_id number, cp_rolecode VARCHAR2) IS
|
||||
CURSOR c_get_enquiry_role(cp_enqu_id NUMBER, cp_rolecode VARCHAR2) IS
|
||||
SELECT prty_id
|
||||
FROM v_latest_rt_code_for_enro
|
||||
WHERE rt_code=cp_rolecode and enqu_id=cp_enqu_id;
|
||||
l_enqu_role_row number;
|
||||
WHERE rt_code = cp_rolecode
|
||||
AND enqu_id = cp_enqu_id;
|
||||
l_enqu_role_row NUMBER;
|
||||
BEGIN
|
||||
IF NOT c_get_enquiry_role%ISOPEN THEN
|
||||
OPEN c_get_enquiry_role(p_enquiryid, p_rolecode);
|
||||
OPEN c_get_enquiry_role(p_enquiryid
|
||||
,p_rolecode);
|
||||
END IF;
|
||||
|
||||
FETCH c_get_enquiry_role
|
||||
INTO l_enqu_role_row;
|
||||
CLOSE c_get_enquiry_role;
|
||||
return l_enqu_role_row;
|
||||
RETURN l_enqu_role_row;
|
||||
END get_enquiry_role;
|
||||
/*
|
||||
FUNCTION set_enquiry_role
|
||||
@@ -242,7 +280,7 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
(p_enquiryid
|
||||
,SYSDATE
|
||||
,p_eventcode
|
||||
,enev_seq.nextval);
|
||||
,enev_seq.NEXTVAL);
|
||||
|
||||
RETURN TRUE;
|
||||
--
|
||||
@@ -383,6 +421,113 @@ CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
|
||||
RETURN SQLERRM;
|
||||
END copy_enquiry;
|
||||
--
|
||||
FUNCTION calc_meter_reqs(p_enty_code enquiry_types.code%TYPE
|
||||
,p_existing_mesc_code meters.mesc_code%TYPE
|
||||
,p_required_mesc_code meters.mesc_code%TYPE
|
||||
,p_existing_metr_code meters.code%TYPE
|
||||
,p_existing_mety_code meters.mety_code%TYPE
|
||||
,p_qmax meters.qmax%TYPE)
|
||||
RETURN t_rec_meter_reqs IS
|
||||
l_dummy NUMBER;
|
||||
l_existing_meter_enquiry BOOLEAN;
|
||||
l_required_meter_enquiry BOOLEAN;
|
||||
l_rec_meter_reqs t_rec_meter_reqs;
|
||||
BEGIN
|
||||
pl('calc_meter_reqs:entry:' || p_enty_code || ':' ||
|
||||
p_existing_mesc_code || ':' || p_required_mesc_code || ':' ||
|
||||
p_existing_metr_code || ':' || p_qmax);
|
||||
-- is the enquiry one that uses an existing meter?
|
||||
BEGIN
|
||||
SELECT 1
|
||||
INTO l_dummy
|
||||
FROM data_item_roles
|
||||
WHERE field_name = 'EXISTING_METR_CODE'
|
||||
AND condition <> 'H'
|
||||
AND enty_code = p_enty_code;
|
||||
|
||||
l_existing_meter_enquiry := TRUE;
|
||||
EXCEPTION
|
||||
WHEN no_data_found THEN
|
||||
l_existing_meter_enquiry := FALSE;
|
||||
END;
|
||||
|
||||
BEGIN
|
||||
SELECT 1
|
||||
INTO l_dummy
|
||||
FROM data_item_roles
|
||||
WHERE field_name = 'QMAX'
|
||||
AND condition <> 'H'
|
||||
AND enty_code = p_enty_code;
|
||||
|
||||
l_required_meter_enquiry := TRUE;
|
||||
EXCEPTION
|
||||
WHEN no_data_found THEN
|
||||
l_required_meter_enquiry := FALSE;
|
||||
END;
|
||||
|
||||
-- Consider existing meter
|
||||
IF NOT l_existing_meter_enquiry THEN
|
||||
l_rec_meter_reqs.existing_metr_code := NULL;
|
||||
l_rec_meter_reqs.existing_mesc_code := NULL;
|
||||
l_rec_meter_reqs.existing_mety_code := NULL;
|
||||
ELSE
|
||||
-- Existing Meter Query
|
||||
-- if we have an existing meter model use the associated details
|
||||
IF nvl(p_existing_metr_code
|
||||
,'OTHER') <> 'OTHER' THEN
|
||||
SELECT code
|
||||
,CASE substr(mesc_code
|
||||
,1
|
||||
,1)
|
||||
WHEN 'U' THEN
|
||||
mesc_code
|
||||
ELSE
|
||||
'OTHER'
|
||||
END
|
||||
,mety_code
|
||||
,prty_id
|
||||
INTO l_rec_meter_reqs.existing_metr_code
|
||||
,l_rec_meter_reqs.existing_mesc_code
|
||||
,l_rec_meter_reqs.existing_mety_code
|
||||
,l_rec_meter_reqs.existing_prty_id
|
||||
FROM meters
|
||||
WHERE code = p_existing_metr_code;
|
||||
ELSE
|
||||
-- we don't have real model details, chose the 'OTHER' meter
|
||||
SELECT prty_id
|
||||
INTO l_rec_meter_reqs.existing_prty_id
|
||||
FROM meters
|
||||
WHERE code = 'OTHER';
|
||||
l_rec_meter_reqs.existing_metr_code := 'OTHER';
|
||||
l_rec_meter_reqs.existing_mety_code := p_existing_mety_code;
|
||||
l_rec_meter_reqs.existing_mesc_code := p_existing_mesc_code;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
-- consider required meter
|
||||
IF NOT l_required_meter_enquiry THEN
|
||||
l_rec_meter_reqs.qmax := NULL;
|
||||
l_rec_meter_reqs.required_mesc_code := NULL;
|
||||
l_rec_meter_reqs.required_mesc_code := p_required_mesc_code;
|
||||
ELSE
|
||||
IF nvl(l_rec_meter_reqs.required_mesc_code
|
||||
,'OTHER') <> 'OTHER' THEN
|
||||
l_rec_meter_reqs.qmax := round(mip_quotation.get_qmax_from_mesc(p_mesc_code => l_rec_meter_reqs.required_mesc_code)
|
||||
,3);
|
||||
ELSE
|
||||
l_rec_meter_reqs.required_mesc_code := nvl(p_required_mesc_code
|
||||
,'OTHER');
|
||||
l_rec_meter_reqs.qmax := p_qmax;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
pl('calc_meter_reqs:exit:' || l_rec_meter_reqs.existing_mesc_code || ':' ||
|
||||
l_rec_meter_reqs.required_mesc_code || ':' ||
|
||||
l_rec_meter_reqs.existing_metr_code || ':' || l_rec_meter_reqs.qmax);
|
||||
|
||||
RETURN l_rec_meter_reqs;
|
||||
|
||||
END calc_meter_reqs;
|
||||
|
||||
END mip_enquiry;
|
||||
/
|
||||
|
||||
@@ -123,6 +123,8 @@ CREATE OR REPLACE PACKAGE mip_quotation IS
|
||||
FUNCTION tripartite_agreement_message(p_rec IN mip_enquiries_helper.t_rec_enquiries)
|
||||
RETURN VARCHAR2;
|
||||
|
||||
FUNCTION get_qmax_from_mesc(p_mesc_code IN meter_size_codes.code%TYPE)
|
||||
RETURN meter_size_codes.qmax%TYPE;
|
||||
END mip_quotation;
|
||||
/
|
||||
CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
@@ -1309,7 +1311,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
|
||||
PROCEDURE add_quote_reason(p_enqu_id IN enquiries.id%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) IS
|
||||
BEGIN
|
||||
pl('add_quote_reason:' || p_enqu_id || ':' || p_reason
|
||||
,$$PLSQL_LINE);
|
||||
@@ -1524,7 +1526,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
AND p_enqu.required_svcp_code IN ('LP', 'MP') THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Site Survey is required for alteration (relocation or reposition) of an existing meter.');
|
||||
,'Site Survey is required for alteration (relocation or reposition) of an existing meter.',gc_external_reason);
|
||||
END IF; -- ALTERATION
|
||||
|
||||
IF p_enqu.enty_code IN ('EXCHANGE', 'STD EXCHANGE', 'CHANGE CAPACITY') THEN
|
||||
@@ -1544,13 +1546,13 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Site Survey is required for exchange of an existing ' ||
|
||||
l_svcpt_code || ' meter.');
|
||||
l_svcpt_code || ' meter.',gc_external_reason);
|
||||
ELSE
|
||||
-- Exchange, MP
|
||||
IF p_enqu.existing_mety_code <> 'DIAPHRAGM' THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Site Survey is required for exchange of an existing non-diaphragm meter.');
|
||||
,'Site Survey is required for exchange of an existing non-diaphragm meter.',gc_external_reason);
|
||||
ELSE
|
||||
-- Exchange, MP, Diaphragm
|
||||
l_required_mesc_code := p_enqu.required_mesc_code;
|
||||
@@ -1565,7 +1567,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Site Survey is required for exchange of diaphragm meter from size ' ||
|
||||
l_rec_metr_details.mesc_code || ' to ' ||
|
||||
l_required_mesc_code || '.');
|
||||
l_required_mesc_code || '.',gc_external_reason);
|
||||
END IF;
|
||||
END IF; -- DIAPHRAGM
|
||||
END IF; -- svcpt_code <> 'MP'
|
||||
@@ -1622,7 +1624,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
LOOP
|
||||
EXIT WHEN l_idx IS NULL;
|
||||
add_quote_reason(p_enqu_id => p_enqu_id
|
||||
,p_reason => l_tab_messages(l_idx));
|
||||
,p_reason => l_tab_messages(l_idx),p_internal_or_external=>gc_external_reason);
|
||||
l_idx := l_tab_messages.NEXT(l_idx);
|
||||
END LOOP;
|
||||
|
||||
@@ -1647,7 +1649,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Enquiry type is ''' ||
|
||||
get_enty_description(p_enqu.id) || '''.');
|
||||
get_enty_description(p_enqu.id) || '''.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
survey_required(p_enqu => p_enqu
|
||||
@@ -1656,51 +1658,51 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
IF p_enqu.twin_stream_required = 'YES' THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Twin stream required.');
|
||||
,'Twin stream required.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.bypass_required = 'YES' THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Bypass required.');
|
||||
,'Bypass required.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.required_metering_pressure > 21 THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Required metering pressure is greater than 21mbar.');
|
||||
,'Required metering pressure is greater than 21mbar.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.job_description IS NOT NULL THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Job Description field was entered.');
|
||||
,'Job Description field was entered.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.downstream_booster_or_compress = 'YES' THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Booster or compressor is present downstream of the meter module.');
|
||||
,'Booster or compressor is present downstream of the meter module.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.annual_quantity > 732 * 1000 THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Required Annual Quantity is in excess of 732MWh.');
|
||||
,'Required Annual Quantity is in excess of 732MWh.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.existing_convertor = 'YES'
|
||||
AND p_enqu.enty_code NOT IN ('REMOVE', 'STD REMOVE', 'ADVERSARIAL') THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Convertor is present.');
|
||||
,'Convertor is present.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.existing_logger = 'YES'
|
||||
AND p_enqu.enty_code IN ('EXCHANGE', 'STD EXCHANGE') THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Logger is present.');
|
||||
,'Logger is present.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.enty_code IN ('OFMAT')
|
||||
@@ -1710,7 +1712,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,1) <> 'U') THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'OFMAT request for a non-''U''-sized Diaphragm meter.');
|
||||
,'OFMAT request for a non-''U''-sized Diaphragm meter.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_enqu.enty_code IN ('OFMAT', 'EXCHANGE', 'STD EXCHANGE', 'REMOVE',
|
||||
@@ -1722,18 +1724,18 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,get_enty_description(p_enqu.enty_code) ||
|
||||
' request has insufficient details describing the existing meter.');
|
||||
' request has insufficient details describing the existing meter.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
-- check postcode
|
||||
IF NOT mip_regions.valid_postcode_format(p_enqu.install_postcode) THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Installation postcode is of an unrecognized format.');
|
||||
,'Installation postcode is of an unrecognized format.',gc_external_reason);
|
||||
ELSIF mip_regions.get_region_for_postcode(p_enqu.install_postcode) IS NULL THEN
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Unable to determine pricing region for given installation postcode.');
|
||||
,'Unable to determine pricing region for given installation postcode.',gc_external_reason);
|
||||
END IF;
|
||||
|
||||
IF p_manual_or_automatic_quote = gc_manual_quote THEN
|
||||
@@ -2131,9 +2133,9 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Site Survey is required for exchange of diaphragm meter from size ' ||
|
||||
l_existing_rec_metr_details.mesc_code || ' to ' ||
|
||||
l_required_mesc_code || '.');
|
||||
l_required_mesc_code || '.',gc_external_reason);
|
||||
ELSE
|
||||
add_quote_reason('Required meter size code is ' ||
|
||||
add_quote_reason(p_enqu.id,'Required meter size code is ' ||
|
||||
l_required_mesc_code
|
||||
,gc_internal_reason);
|
||||
pl('Required Meter Size Code=' || l_required_mesc_code
|
||||
@@ -2142,13 +2144,13 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
ELSE
|
||||
p_manual_or_automatic_quote := gc_manual_quote;
|
||||
add_quote_reason(p_enqu.id
|
||||
,'Site Survey is required for exchange of meter.');
|
||||
,'Site Survey is required for exchange of meter.',gc_external_reason);
|
||||
END IF;
|
||||
ELSE
|
||||
pl('required_mesc_code=' || p_enqu.required_mesc_code
|
||||
,$$PLSQL_UNIT);
|
||||
,$$PLSQL_LINE);
|
||||
pl('qmax=' || p_enqu.qmax
|
||||
,$$PLSQL_UNIT);
|
||||
,$$PLSQL_LINE);
|
||||
-- the user can only request meter sizes of:
|
||||
-- 'U' meter size code, these have associated Qmax values; OR
|
||||
-- 'OTHER' - the user didn't know the meter size code!
|
||||
@@ -3323,9 +3325,6 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
RAISE;
|
||||
END produce_quotes;
|
||||
|
||||
BEGIN
|
||||
-- Initialization
|
||||
pl('mip_quotation'
|
||||
,$$PLSQL_LINE);
|
||||
|
||||
END mip_quotation;
|
||||
/
|
||||
|
||||
@@ -3,7 +3,7 @@ connect &1/&2@&5 as sysdba
|
||||
drop user &3 cascade;
|
||||
|
||||
grant connect, resource to &3 identified by &4;
|
||||
grant create any view, create any directory to &3;
|
||||
grant create view, create any directory to &3;
|
||||
grant create library to &3;
|
||||
grant debug connect session, javauserpriv to &3;
|
||||
grant execute on dbms_sql to &3;
|
||||
|
||||
Reference in New Issue
Block a user