Address #303 - removed <br> from friendly constraint messages.
Amend Qmax values defined within MESC.ctl Fix bulk_load errors related to loading drawings through MIP_FILES Amend mip_quotation to produce labour costs where meter size or service pressure is not a cost constraint. Amend mip_quotation email messages. Perform additional compilations during install to account for dependency links. Make meter dimensions optional (mip.tab) git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3721 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -127,22 +127,20 @@ END mip_quotation;
|
||||
/
|
||||
CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
|
||||
-- PROCEDURE email_aq_generated(p_enqu_id IN enquiries.id%TYPE);
|
||||
PROCEDURE email_quotes_available(p_enqu_id IN enquiries.id%TYPE);
|
||||
PROCEDURE email_rfq_submitted(p_enqu_id IN enquiries.id%TYPE);
|
||||
-- PROCEDURE email_request_for_mq(p_enqu_id IN enquiries.id%TYPE);
|
||||
PROCEDURE email_agent_aq_available(p_enqu_id IN enquiries.id%TYPE);
|
||||
PROCEDURE email_agent_quote_acceptance(p_enqu_id enquiries.id%TYPE);
|
||||
PROCEDURE email_agent_mq_available(p_enqu_id enquiries.id%TYPE);
|
||||
|
||||
PROCEDURE email_iu_quote_acceptance(p_enqu_id enquiries.id%TYPE);
|
||||
|
||||
PROCEDURE email_support(p_subject IN VARCHAR2
|
||||
,p_enqu_id IN enquiries.id%TYPE);
|
||||
|
||||
SUBTYPE t_internal_or_external IS VARCHAR2(8);
|
||||
|
||||
gc_internal_reason CONSTANT t_internal_or_external := 'INTERNAL';
|
||||
gc_external_reason CONSTANT t_internal_or_external := 'EXTERNAL';
|
||||
|
||||
SUBTYPE t_manual_or_automatic_quote IS VARCHAR2(2);
|
||||
|
||||
SUBTYPE t_enqu IS enquiries%ROWTYPE;
|
||||
|
||||
gc_manual_quote CONSTANT t_manual_or_automatic_quote := 'MQ';
|
||||
gc_automatic_quote CONSTANT t_manual_or_automatic_quote := 'AQ';
|
||||
|
||||
@@ -150,6 +148,16 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
g_email_html_body CLOB;
|
||||
gc_newline CONSTANT CHAR(2) DEFAULT chr(10) || chr(13);
|
||||
|
||||
SUBTYPE t_enqu IS enquiries%ROWTYPE;
|
||||
|
||||
SUBTYPE t_email_reason IS VARCHAR2(80);
|
||||
|
||||
gc_agent_rmq_notification t_email_reason := 'AGENT_RMQ_NOTIFICATION';
|
||||
gc_agent_qa_notification t_email_reason := 'AGENT_QA_NOTIFICATION';
|
||||
gc_agent_mqa_notification t_email_reason := 'AGENT_MQA_NOTIFICATION';
|
||||
gc_internal_qa_notification t_email_reason := 'INTERNAL_QA_NOTIFICATION';
|
||||
gc_internal_rmq_notification t_email_reason := 'AGENT_RMQ_NOTIFICATION';
|
||||
|
||||
TYPE t_rec_additional_costs IS RECORD(
|
||||
adit_code additional_items.code%TYPE
|
||||
,svcpt_code service_pressure_types.code%TYPE
|
||||
@@ -237,6 +245,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
,p_owner_prty_id IN parties.id%TYPE DEFAULT NULL
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE) IS
|
||||
l_enqu_id enquiries.id%TYPE;
|
||||
BEGIN
|
||||
add_quote_event(p_qute_id => p_qute_id
|
||||
,p_qust_code => 'ACCEPTED'
|
||||
@@ -253,6 +262,15 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
,p_prty_id => p_prty_id
|
||||
,p_rt_code => 'Q SUBACC'
|
||||
,p_start_date => p_event_date);
|
||||
|
||||
SELECT enqu_id
|
||||
INTO l_enqu_id
|
||||
FROM quotes
|
||||
WHERE id = p_qute_id;
|
||||
|
||||
email_agent_quote_acceptance(p_enqu_id => l_enqu_id);
|
||||
email_iu_quote_acceptance(p_enqu_id => l_enqu_id);
|
||||
|
||||
END accept_quote;
|
||||
|
||||
PROCEDURE reject_quote(p_qute_id IN quotes.id%TYPE
|
||||
@@ -431,6 +449,8 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
END start_quote;
|
||||
|
||||
PROCEDURE make_quote_available(p_qute_id IN quotes.id%TYPE) IS
|
||||
l_qute_type quotes.qute_type%TYPE;
|
||||
l_enqu_id enquiries.id%TYPE;
|
||||
BEGIN
|
||||
pl('make_quote_available');
|
||||
|
||||
@@ -438,6 +458,19 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
,p_qust_code => 'AV'
|
||||
,p_event_date => SYSDATE);
|
||||
|
||||
SELECT qute_type
|
||||
,enqu_id
|
||||
INTO l_qute_type
|
||||
,l_enqu_id
|
||||
FROM quotes
|
||||
WHERE id = p_qute_id;
|
||||
|
||||
IF l_qute_type = 'MQ' THEN
|
||||
email_agent_mq_available(l_enqu_id);
|
||||
ELSE
|
||||
email_agent_aq_available(l_enqu_id);
|
||||
END IF;
|
||||
|
||||
END make_quote_available;
|
||||
|
||||
PROCEDURE mark_enquiry_submitted(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
@@ -448,7 +481,6 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
,p_enst_code => 'SUBMITTED'
|
||||
,p_event_date => SYSDATE);
|
||||
|
||||
email_rfq_submitted(p_enqu_id);
|
||||
END mark_enquiry_submitted;
|
||||
|
||||
PROCEDURE mark_enquiry_quoted(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
@@ -459,8 +491,6 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
,p_enst_code => 'QUOTED'
|
||||
,p_event_date => SYSDATE);
|
||||
|
||||
email_quotes_available(p_enqu_id);
|
||||
|
||||
END mark_enquiry_quoted;
|
||||
|
||||
PROCEDURE mark_enquiry_invalid(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
@@ -723,162 +753,19 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
|
||||
END produce_reasoning_summary;
|
||||
|
||||
/* PROCEDURE email_aq_generated(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
PROCEDURE email_to_agent(p_enqu_id IN enquiries.id%TYPE
|
||||
,p_email_reason IN t_email_reason) IS
|
||||
l_agent_prty_id parties.id%TYPE;
|
||||
l_agent_comt_code contact_mechanism_types.code%TYPE;
|
||||
l_agent_comt_description contact_mechanism_types.description%TYPE;
|
||||
l_agent_contact_value contact_mechanisms.contact_value%TYPE;
|
||||
l_email_subject VARCHAR2(240);
|
||||
l_email_recipient VARCHAR2(240);
|
||||
l_agent_first_name parties.first_name%TYPE;
|
||||
l_agent_last_name parties.last_name%TYPE;
|
||||
BEGIN
|
||||
open_body;
|
||||
|
||||
al('Quotations produced in response to Enquiry refererence: ' ||
|
||||
p_enqu_id || ' (' || get_enty_description(p_enqu_id) || ')');
|
||||
|
||||
FOR l_qute IN (SELECT id
|
||||
FROM quotes
|
||||
,v_quote_details v
|
||||
WHERE enqu_id = p_enqu_id
|
||||
AND v.quote_id = id
|
||||
ORDER BY total_cost) LOOP
|
||||
|
||||
produce_quote_summary(l_qute.id);
|
||||
|
||||
al(' ');
|
||||
END LOOP;
|
||||
|
||||
produce_reasoning_summary(p_enqu_id);
|
||||
|
||||
close_body;
|
||||
|
||||
mip_email.send_email_clob(p_recipient => get_automatic_quote_recipient
|
||||
,p_body => g_email_plain_body
|
||||
,p_body_html => g_email_html_body
|
||||
,p_subject => get_system_name ||
|
||||
': Notification of generation of automatic quotes for Enquiry reference: ' ||
|
||||
p_enqu_id);
|
||||
END email_aq_generated;*/
|
||||
|
||||
PROCEDURE email_quotes_available(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
l_agent_comt_code enquiries.agent_comt_code%TYPE;
|
||||
l_agent_contact_value enquiries.agent_contact_value%TYPE;
|
||||
l_email_recipient system_configuration.VALUE%TYPE;
|
||||
l_email_subject VARCHAR2(240);
|
||||
l_agent_first_name parties.first_name%TYPE;
|
||||
l_agent_last_name parties.last_name%TYPE;
|
||||
l_agent_prty_id parties.id%TYPE;
|
||||
l_date_submitted DATE;
|
||||
BEGIN
|
||||
pl('email_quotes_available');
|
||||
open_body;
|
||||
|
||||
SELECT agent_comt_code
|
||||
,agent_contact_value
|
||||
,event_date
|
||||
INTO l_agent_comt_code
|
||||
,l_agent_contact_value
|
||||
,l_date_submitted
|
||||
FROM enquiries
|
||||
,enquiry_events
|
||||
WHERE enquiries.id = p_enqu_id
|
||||
AND enquiry_events.enqu_id = enquiries.id
|
||||
AND enquiry_events.enst_code = 'SUBMITTED';
|
||||
|
||||
l_agent_prty_id := mip_enquiry.get_enquiry_role(p_enquiryid => p_enqu_id
|
||||
,p_rolecode => 'ENQ OWN');
|
||||
|
||||
SELECT first_name
|
||||
,last_name
|
||||
INTO l_agent_first_name
|
||||
,l_agent_last_name
|
||||
FROM parties
|
||||
WHERE id = l_agent_prty_id;
|
||||
|
||||
IF l_agent_comt_code = 'EMAIL' THEN
|
||||
l_email_recipient := l_agent_contact_value;
|
||||
l_email_subject := get_system_name ||
|
||||
': Confirmation of availability of quotation(s)';
|
||||
al('Confirmation of availability of quotation.');
|
||||
al(' ');
|
||||
al('Thank you for using ' || get_system_name ||
|
||||
' online. Your quotation(s) are now available.');
|
||||
al(' ');
|
||||
al('Enquiry refererence: ' || p_enqu_id || ' (' ||
|
||||
get_enty_description(p_enqu_id) || ')');
|
||||
al('Request made on: ' ||
|
||||
to_char(l_date_submitted
|
||||
,'ddth Month YYYY HH24:MI:SS'));
|
||||
al(' ');
|
||||
ELSE
|
||||
l_email_recipient := get_automatic_quote_recipient;
|
||||
l_email_subject := get_system_name ||
|
||||
': Confirmation of availability of quotation(s), Agent requires notification.';
|
||||
|
||||
al('Enquiry refererence: ' || p_enqu_id || ' (' ||
|
||||
get_enty_description(p_enqu_id) || ')');
|
||||
al('Request made on: ' ||
|
||||
to_char(l_date_submitted
|
||||
,'ddth Month YYYY HH24:MI:SS'));
|
||||
al(' ');
|
||||
al('The Agent, ' || l_agent_first_name || ' ' || l_agent_last_name ||
|
||||
' has requested that they be contacted via ' || l_agent_comt_code || '(' ||
|
||||
l_agent_contact_value || ')');
|
||||
END IF;
|
||||
al(' ');
|
||||
al('The following quotations are available:');
|
||||
|
||||
FOR l_qute IN (SELECT id
|
||||
FROM quotes
|
||||
,v_quote_details v
|
||||
,v_current_quote_status s
|
||||
WHERE enqu_id = p_enqu_id
|
||||
AND v.quote_id = id
|
||||
AND s.qute_id = id
|
||||
AND s.qust_code = 'AV'
|
||||
ORDER BY total_cost) LOOP
|
||||
|
||||
produce_quote_summary(l_qute.id);
|
||||
|
||||
al(' ');
|
||||
END LOOP;
|
||||
|
||||
close_body;
|
||||
|
||||
BEGIN
|
||||
mip_email.send_email_clob(p_recipient => l_email_recipient
|
||||
,p_body => g_email_plain_body
|
||||
,p_body_html => g_email_html_body
|
||||
,p_subject => l_email_subject);
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
pl('mip_email.send_email_clob returned ' || SQLERRM);
|
||||
END;
|
||||
|
||||
pl('email_quotes_available:exit');
|
||||
|
||||
END email_quotes_available;
|
||||
|
||||
PROCEDURE email_rfq_submitted(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
l_agent_comt_code enquiries.agent_comt_code%TYPE;
|
||||
l_agent_contact_value enquiries.agent_contact_value%TYPE;
|
||||
l_email_recipient system_configuration.VALUE%TYPE;
|
||||
l_email_subject VARCHAR2(240);
|
||||
l_agent_first_name parties.first_name%TYPE;
|
||||
l_agent_last_name parties.last_name%TYPE;
|
||||
l_agent_prty_id parties.id%TYPE;
|
||||
l_date_submitted DATE;
|
||||
BEGIN
|
||||
pl('email_rfq_submitted');
|
||||
|
||||
open_body;
|
||||
|
||||
SELECT agent_comt_code
|
||||
,agent_contact_value
|
||||
,event_date
|
||||
INTO l_agent_comt_code
|
||||
,l_agent_contact_value
|
||||
,l_date_submitted
|
||||
FROM enquiries
|
||||
,enquiry_events
|
||||
WHERE enquiries.id = p_enqu_id
|
||||
AND enquiry_events.enqu_id = enquiries.id
|
||||
AND enquiry_events.enst_code = 'SUBMITTED';
|
||||
|
||||
pl('email_to_agent:enter:p_enqu_id=' || p_enqu_id ||
|
||||
', p_email_reason=' || p_email_reason);
|
||||
BEGIN
|
||||
l_agent_prty_id := mip_enquiry.get_enquiry_role(p_enquiryid => p_enqu_id
|
||||
,p_rolecode => 'ENQ OWN');
|
||||
@@ -888,55 +775,143 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
RAISE;
|
||||
END;
|
||||
|
||||
BEGIN
|
||||
SELECT agent_comt_code
|
||||
,comt.description
|
||||
,agent_contact_value
|
||||
INTO l_agent_comt_code
|
||||
,l_agent_comt_description
|
||||
,l_agent_contact_value
|
||||
FROM enquiries
|
||||
,contact_mechanism_types comt
|
||||
WHERE enquiries.id = p_enqu_id
|
||||
AND comt.code = enquiries.agent_comt_code;
|
||||
|
||||
open_body;
|
||||
|
||||
IF l_agent_comt_code = 'EMAIL' THEN
|
||||
l_email_recipient := l_agent_contact_value;
|
||||
ELSE
|
||||
l_email_recipient := get_automatic_quote_recipient;
|
||||
SELECT first_name
|
||||
,last_name
|
||||
INTO l_agent_first_name
|
||||
,l_agent_last_name
|
||||
FROM parties
|
||||
WHERE id = l_agent_prty_id;
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
pl('Error finding agent - prty_id=' || l_agent_prty_id);
|
||||
END;
|
||||
|
||||
IF l_agent_comt_code = 'EMAIL' THEN
|
||||
l_email_recipient := l_agent_contact_value;
|
||||
l_email_subject := get_system_name ||
|
||||
': Confirmation of Request for Quotation';
|
||||
al('Confirmation of Request for Quotation');
|
||||
al(' ');
|
||||
al('Thank you for using ' || get_system_name ||
|
||||
' online. Your request for quotation has been received.');
|
||||
al(' ');
|
||||
al('Enquiry Refererence Number: ' || p_enqu_id || ' (' ||
|
||||
get_enty_description(p_enqu_id) || ')');
|
||||
al('Request made on: ' ||
|
||||
to_char(l_date_submitted
|
||||
,'ddth Month YYYY HH24:MI:SS'));
|
||||
al(' ');
|
||||
al('You should receive notification of your quotation(s) within 6 days.');
|
||||
al(' ');
|
||||
al('Should notification of your quotation(s) not arrive after 6 days, then please phone us on ' ||
|
||||
get_customer_support_telephone ||
|
||||
'. Be prepared to quote the Enquiry Reference Number.');
|
||||
ELSE
|
||||
l_email_recipient := get_automatic_quote_recipient;
|
||||
l_email_subject := get_system_name ||
|
||||
': Confirmation of Request for Quotation, Agent requires notification.';
|
||||
|
||||
al('Enquiry Refererence Number: ' || p_enqu_id || ' (' ||
|
||||
get_enty_description(p_enqu_id) || ')');
|
||||
al('Request made on: ' ||
|
||||
to_char(l_date_submitted
|
||||
,'ddth Month YYYY HH24:MI:SS'));
|
||||
al(' ');
|
||||
al('The Agent, ' || l_agent_first_name || ' ' || l_agent_last_name ||
|
||||
' has requested that they be contacted via ' || l_agent_comt_code || '(' ||
|
||||
l_agent_contact_value || ')');
|
||||
' has requested that they be contacted via ' ||
|
||||
l_agent_comt_description || '(' || l_agent_contact_value || ')');
|
||||
al(' ');
|
||||
al('The information to be passed on is:');
|
||||
al(' ');
|
||||
END IF;
|
||||
|
||||
IF p_email_reason = gc_agent_qa_notification THEN
|
||||
l_email_subject := get_system_name || ': Quote Acceptance';
|
||||
al('Dear Sir/Madam,');
|
||||
al(' ');
|
||||
al('Enquiry reference number: ' || p_enqu_id);
|
||||
al(' ');
|
||||
al('Thank you for accepting National Grid Metering<6E>s quotation using the Online I&C Quotations System. We will acknowledge your acceptance and provide you with a planning letter within the agreed timescales for the work type involved. ');
|
||||
al(' ');
|
||||
al('Please use the Enquiry reference number at the top of this email on any future correspondence relating to this request.');
|
||||
al(' ');
|
||||
al('For further information or clarity, please do not hesitate to get in contact');
|
||||
al(' ');
|
||||
al('Regards');
|
||||
al(' ');
|
||||
al('The I&C Non Standard Team');
|
||||
al('National Grid Metering');
|
||||
al('Abbotts Lane');
|
||||
al('Coventry');
|
||||
al('CV1 4AY');
|
||||
al(' ');
|
||||
al('Phone: 02476 286 322');
|
||||
al('Fax: 02476 286 044');
|
||||
al('Email: ic.nonstandard1@uk.ngrid.com');
|
||||
ELSIF p_email_reason = gc_agent_rmq_notification THEN
|
||||
l_email_subject := get_system_name || ': Request for Manual Quote';
|
||||
al('Dear Sir/Madam,');
|
||||
al(' ');
|
||||
al('Enquiry reference number: ' || p_enqu_id);
|
||||
al(' ');
|
||||
al('Thank you for requesting a quotation using the National Grid Metering Online I&C Quotations System. There are no automatic quotations available for this request, and a manual quotation will be prepared and uploaded to the website within the agreed timescales for the work type involved. We will notify you when this quotation is ready for your consideration.');
|
||||
al(' ');
|
||||
al('Please use the Enquiry reference number at the top of this email on any future correspondence relating to this request.');
|
||||
al(' ');
|
||||
al('Regards');
|
||||
al(' ');
|
||||
al('The I&C Non Standard Team');
|
||||
al('National Grid Metering');
|
||||
al('Abbotts Lane');
|
||||
al('Coventry');
|
||||
al('CV1 4AY');
|
||||
al(' ');
|
||||
al('Phone: 02476 286 322');
|
||||
al('Fax: 02476 286 044');
|
||||
al('Email: ic.nonstandard1@uk.ngrid.com');
|
||||
ELSIF p_email_reason = gc_agent_mqa_notification THEN
|
||||
l_email_subject := get_system_name || ': Manual Quote Available';
|
||||
al('Dear Sir/Madam,');
|
||||
al(' ');
|
||||
al('Enquiry reference number: ' || p_enqu_id);
|
||||
al(' ');
|
||||
al('Your quotation is now ready to view on the National Grid Metering I&C Online Quotation System.');
|
||||
al(' ');
|
||||
al('Please note that this quotation is valid for 90 days from the date specified in the quotation. To accept this quotation, please submit a work request via IX, complete the acceptance form on the quotation letter, or click the accept button on the Online I&C quotations system. Please note that this quotation is valid for 90 days from the date specified in the quotation.');
|
||||
al(' ');
|
||||
al('Please use the Enquiry reference number at the top of this email on any future correspondence relating to this request.');
|
||||
al(' ');
|
||||
al('Regards');
|
||||
al(' ');
|
||||
al('The I&C Non Standard Team');
|
||||
al('National Grid Metering');
|
||||
al('Abbotts Lane');
|
||||
al('Coventry');
|
||||
al('CV1 4AY');
|
||||
al(' ');
|
||||
al('Phone: 02476 286 322');
|
||||
al('Fax: 02476 286 044');
|
||||
al('Email: ic.nonstandard1@uk.ngrid.com');
|
||||
ELSIF p_email_reason = gc_agent_qa_notification THEN
|
||||
l_email_subject := get_system_name || ': Automatic Quote Available';
|
||||
al('Dear Sir/Madam,');
|
||||
al(' ');
|
||||
al('Enquiry reference number: ' || p_enqu_id);
|
||||
al(' ');
|
||||
al('Thank you for using the National Grid Metering Online I&C quotations system. Your enquiry has generated an automatic quotation. To accept this quotation; either submit a work request via IX, complete the acceptance form on the quotation letter, or click the accept button on the Online I&C quotations system. Please note that this quotation is valid for 90 days from the date specified in the quotation.');
|
||||
al(' ');
|
||||
al('The following quotations are available:');
|
||||
|
||||
FOR l_qute IN (SELECT id
|
||||
FROM quotes
|
||||
,v_quote_details v
|
||||
,v_current_quote_status s
|
||||
WHERE enqu_id = p_enqu_id
|
||||
AND v.quote_id = id
|
||||
AND s.qute_id = id
|
||||
AND s.qust_code = 'AV'
|
||||
ORDER BY total_cost) LOOP
|
||||
|
||||
produce_quote_summary(l_qute.id);
|
||||
|
||||
al(' ');
|
||||
END LOOP;
|
||||
|
||||
al('Please use the Enquiry reference number at the top of this email on any future correspondence relating to this request.');
|
||||
al(' ');
|
||||
al('Regards');
|
||||
al(' ');
|
||||
al('The I&C Non Standard Team');
|
||||
al('National Grid Metering');
|
||||
al('Abbotts Lane');
|
||||
al('Coventry');
|
||||
al('CV1 4AY');
|
||||
al(' ');
|
||||
al('Phone: 02476 286 322');
|
||||
al('Fax: 02476 286 044');
|
||||
al('Email: ic.nonstandard1@uk.ngrid.com');
|
||||
END IF;
|
||||
close_body;
|
||||
|
||||
BEGIN
|
||||
@@ -947,62 +922,131 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
pl('mip_email.send_email_clob returned ' || SQLERRM);
|
||||
RAISE;
|
||||
END;
|
||||
END email_rfq_submitted;
|
||||
pl('email_to_agent:exit');
|
||||
END email_to_agent;
|
||||
|
||||
PROCEDURE email_request_for_mq(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
l_system_name system_configuration.VALUE%TYPE := get_system_name;
|
||||
l_quote_row quotes%ROWTYPE;
|
||||
PROCEDURE email_to_internal_users(p_enqu_id IN enquiries.id%TYPE
|
||||
,p_email_reason IN t_email_reason) IS
|
||||
l_email_subject VARCHAR2(240);
|
||||
l_email_recipient VARCHAR2(240);
|
||||
l_qute_id quotes.id%TYPE;
|
||||
BEGIN
|
||||
pl('email_request_for_mq');
|
||||
|
||||
SELECT *
|
||||
INTO l_quote_row
|
||||
FROM quotes
|
||||
WHERE enqu_id = p_enqu_id;
|
||||
|
||||
pl('email_internal_users:entry:p_enqu_id=' || p_enqu_id ||
|
||||
', p_email_reason=' || p_email_reason);
|
||||
open_body;
|
||||
|
||||
al('This email has been produced in response to Enquiry Refererence Number: ' ||
|
||||
p_enqu_id || ' (' || get_enty_description(p_enqu_id) || ')');
|
||||
|
||||
al(' ');
|
||||
al(l_system_name ||
|
||||
' was unable to produce an automatic quote for this Enquiry, therefore a ' ||
|
||||
'Manual Quote is to be completed against Quote Reference Number: ' ||
|
||||
l_quote_row.id);
|
||||
al('This quote will be valid from ' ||
|
||||
to_char(l_quote_row.valid_from
|
||||
,'ddth Month YYYY') || ' to ' ||
|
||||
to_char(l_quote_row.valid_until
|
||||
,'ddth Month YYYY'));
|
||||
al(' ');
|
||||
al('Current Service Level Agreements dictate that a manual quote be provided within 6 days');
|
||||
|
||||
al('Data Entered:');
|
||||
|
||||
al('Enquiry type: ' || get_enty_description(p_enqu_id));
|
||||
|
||||
produce_enquiry_entry_details(p_enqu_id);
|
||||
|
||||
produce_reasoning_summary(p_enqu_id);
|
||||
|
||||
IF p_email_reason = gc_internal_qa_notification THEN
|
||||
l_email_subject := get_system_name ||
|
||||
': Quote Acceptance Notification';
|
||||
al('Hi team,');
|
||||
al(' ');
|
||||
al('Enquiry reference number: ' || p_enqu_id);
|
||||
al(' ');
|
||||
al('Please process this enquiry, as the quotation has been accepted.');
|
||||
al(' ');
|
||||
|
||||
SELECT qute_id
|
||||
INTO l_qute_id
|
||||
FROM quote_events quev
|
||||
,quotes qute
|
||||
WHERE qute.enqu_id = p_enqu_id
|
||||
AND quev.qute_id = qute.id
|
||||
AND quev.qust_code = 'ACCEPTED';
|
||||
|
||||
produce_enquiry_entry_details(p_enqu_id);
|
||||
produce_quote_summary(l_qute_id);
|
||||
|
||||
al(' ');
|
||||
al('Regards');
|
||||
al(' ');
|
||||
al('I&C Online Quotations System');
|
||||
ELSIF p_email_reason = gc_internal_rmq_notification THEN
|
||||
l_email_subject := get_system_name ||
|
||||
': Request For Manual Quotation Notification';
|
||||
al('Hi team,');
|
||||
al(' ');
|
||||
al('Enquiry reference number: ' || p_enqu_id);
|
||||
al(' ');
|
||||
al('Please provide a manual quotation as the I&C Online Quotation System was unable to generate an automatic quote.');
|
||||
al(' ');
|
||||
|
||||
SELECT qute_id
|
||||
INTO l_qute_id
|
||||
FROM quote_events quev
|
||||
,quotes qute
|
||||
WHERE qute.enqu_id = p_enqu_id
|
||||
AND quev.qute_id = qute.id
|
||||
AND quev.qust_code = 'INP';
|
||||
|
||||
produce_enquiry_entry_details(p_enqu_id);
|
||||
produce_reasoning_summary(p_enqu_id);
|
||||
|
||||
al(' ');
|
||||
al('Regards');
|
||||
al(' ');
|
||||
al('I&C Online Quotations System');
|
||||
END IF;
|
||||
close_body;
|
||||
|
||||
BEGIN
|
||||
mip_email.send_email_clob(p_recipient => get_manual_quote_recipient
|
||||
mip_email.send_email_clob(p_recipient => l_email_recipient
|
||||
,p_body => g_email_plain_body
|
||||
,p_body_html => g_email_html_body
|
||||
,p_subject => l_system_name ||
|
||||
': Request for a Manual Quote for Enquiry Reference Number: ' ||
|
||||
p_enqu_id);
|
||||
,p_subject => l_email_subject);
|
||||
EXCEPTION
|
||||
WHEN OTHERS THEN
|
||||
pl('mip_email.send_email_clob returned ' || SQLERRM);
|
||||
END;
|
||||
pl('email_internal_users:exit');
|
||||
END email_to_internal_users;
|
||||
|
||||
PROCEDURE email_agent_aq_available(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
BEGIN
|
||||
pl('email_agent_aq_available:entry');
|
||||
|
||||
END email_request_for_mq;
|
||||
email_to_agent(p_enqu_id => p_enqu_id
|
||||
,p_email_reason => gc_agent_qa_notification);
|
||||
|
||||
pl('email_agent_aq_available:exit');
|
||||
END email_agent_aq_available;
|
||||
|
||||
PROCEDURE email_agent_mq_available(p_enqu_id enquiries.id%TYPE) IS
|
||||
BEGIN
|
||||
email_to_agent(p_enqu_id => p_enqu_id
|
||||
,p_email_reason => gc_agent_mqa_notification);
|
||||
END email_agent_mq_available;
|
||||
|
||||
PROCEDURE email_agent_request_for_mq(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
l_system_name system_configuration.VALUE%TYPE := get_system_name;
|
||||
l_quote_row quotes%ROWTYPE;
|
||||
BEGIN
|
||||
pl('email_request_for_mq:enter');
|
||||
|
||||
email_to_agent(p_enqu_id => p_enqu_id
|
||||
,p_email_reason => gc_agent_rmq_notification);
|
||||
|
||||
email_to_internal_users(p_enqu_id => p_enqu_id
|
||||
,p_email_reason => gc_internal_rmq_notification);
|
||||
|
||||
pl('email_request_for_mq:exit');
|
||||
END email_agent_request_for_mq;
|
||||
|
||||
PROCEDURE email_agent_quote_acceptance(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
BEGIN
|
||||
email_to_agent(p_enqu_id => p_enqu_id
|
||||
,p_email_reason => gc_agent_qa_notification);
|
||||
END email_agent_quote_acceptance;
|
||||
|
||||
PROCEDURE email_iu_quote_acceptance(p_enqu_id enquiries.id%TYPE) IS
|
||||
BEGIN
|
||||
email_to_internal_users(p_enqu_id
|
||||
,gc_internal_qa_notification);
|
||||
END email_iu_quote_acceptance;
|
||||
|
||||
PROCEDURE email_iu_request_for_mq(p_enqu_id enquiries.id%TYPE) IS
|
||||
BEGIN
|
||||
email_to_internal_users(p_enqu_id
|
||||
,gc_internal_rmq_notification);
|
||||
END email_iu_request_for_mq;
|
||||
|
||||
PROCEDURE email_support(p_subject IN VARCHAR2
|
||||
,p_enqu_id IN enquiries.id%TYPE) IS
|
||||
@@ -1050,8 +1094,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,p_rfq_prty_id => p_rfq_prty_id
|
||||
,p_owner_prty_id => p_owner_prty_id);
|
||||
|
||||
email_request_for_mq(p_enqu_id => p_enqu_id);
|
||||
|
||||
email_agent_request_for_mq(p_enqu_id => p_enqu_id);
|
||||
email_iu_request_for_mq(p_enqu_id => p_enqu_id);
|
||||
END request_manual_quote;
|
||||
|
||||
PROCEDURE ready_for_quote(p_enqu_id IN enquiries.id%TYPE
|
||||
@@ -1225,7 +1269,6 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
|
||||
PROCEDURE survey_required(p_enqu IN t_enqu
|
||||
,p_manual_or_automatic_quote IN OUT t_manual_or_automatic_quote) IS
|
||||
l_svcpt_code service_pressure_types.code%TYPE;
|
||||
l_existing_meter_size_code meter_size_codes.code%TYPE;
|
||||
l_required_meter_size_code meter_size_codes.code%TYPE;
|
||||
BEGIN
|
||||
@@ -1578,8 +1621,15 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,l_rec_costs.svcpt_code
|
||||
FROM (SELECT decode(regi_code
|
||||
,p_regi_code
|
||||
,0
|
||||
,1) * 100 + decode(cost.svcpt_code
|
||||
,NULL
|
||||
,1
|
||||
,0) * 10 +
|
||||
decode(cost.mesc_code
|
||||
,NULL
|
||||
,1
|
||||
,999) AS accuracy
|
||||
,0) AS accuracy
|
||||
,enty_code
|
||||
,mety_code
|
||||
,cost.svcpt_code
|
||||
@@ -1593,13 +1643,11 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,service_pressures svcp
|
||||
WHERE SYSDATE BETWEEN cost.effective_from AND cost.effective_to
|
||||
AND (regi_code = p_regi_code OR regi_code IS NULL)
|
||||
AND cost.svcpt_code = svcp.svcpt_code
|
||||
AND cost.svcpt_code(+) = svcp.svcpt_code
|
||||
AND enty_code = p_enty_code
|
||||
AND mety_code = p_mety_code
|
||||
AND ((svcp.code = p_svcp_code) OR
|
||||
(svcp.code IS NULL AND p_svcp_code IS NULL))
|
||||
AND ((mesc_code = p_mesc_code) OR
|
||||
(mesc_code IS NULL AND p_mesc_code IS NULL))
|
||||
AND svcp.code = p_svcp_code
|
||||
AND ((cost.mesc_code = p_mesc_code) OR (mesc_code IS NULL))
|
||||
ORDER BY 1)
|
||||
WHERE rownum < 2;
|
||||
|
||||
@@ -2802,7 +2850,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,p_manual_or_automatic_quote => l_manual_or_automatic_quote);
|
||||
IF l_manual_or_automatic_quote = gc_automatic_quote THEN
|
||||
mark_enquiry_quoted(p_enqu_id);
|
||||
email_quotes_available(p_enqu_id);
|
||||
email_agent_aq_available(p_enqu_id);
|
||||
ELSE
|
||||
request_manual_quote(p_enqu_id => l_enqu.id
|
||||
,p_rfq_prty_id => p_rfq_prty_id
|
||||
|
||||
Reference in New Issue
Block a user