Add module Qmax to bulk load process and quotation generation.
Add tripartite_agreement_message to mip_quotation.pck (supported by mip_tripartite.pck). Produces a message when enquiry does not meet tripartite requirements. Removed extraneous role types for Seed/prtp.ctl and Seed/rt.ctl. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3497 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -116,8 +116,13 @@ CREATE OR REPLACE PACKAGE mip_quotation IS
|
||||
|
||||
PROCEDURE lapse_quotes_job;
|
||||
|
||||
/*TESTING ONLY*/
|
||||
PROCEDURE email_request_for_mq(p_enqu_id IN enquiries.id%TYPE);
|
||||
/** Return a message if the Tripartite agreement is broached
|
||||
%param p_rec record containing enquiry details to be checked
|
||||
%return message is the agreement was broached
|
||||
*/
|
||||
FUNCTION tripartite_agreement_message(p_rec IN mip_enquiries_helper.t_rec_enquiries)
|
||||
RETURN VARCHAR2;
|
||||
|
||||
END mip_quotation;
|
||||
/
|
||||
CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
@@ -440,8 +445,8 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
pl('mark_enquiry_submitted');
|
||||
|
||||
add_enquiry_event(p_enqu_id => p_enqu_id
|
||||
,p_enst_code => 'SUBMITTED'
|
||||
,p_event_date => SYSDATE);
|
||||
,p_enst_code => 'SUBMITTED'
|
||||
,p_event_date => SYSDATE);
|
||||
|
||||
email_rfq_submitted(p_enqu_id);
|
||||
END mark_enquiry_submitted;
|
||||
@@ -449,10 +454,10 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
PROCEDURE mark_enquiry_quoted(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
BEGIN
|
||||
pl('mark_enquiry_quoted');
|
||||
|
||||
|
||||
add_enquiry_event(p_enqu_id => p_enqu_id
|
||||
,p_enst_code => 'QUOTED'
|
||||
,p_event_date => SYSDATE);
|
||||
,p_enst_code => 'QUOTED'
|
||||
,p_event_date => SYSDATE);
|
||||
|
||||
email_quotes_available(p_enqu_id);
|
||||
|
||||
@@ -461,10 +466,10 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
PROCEDURE mark_enquiry_invalid(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
BEGIN
|
||||
pl('mark_enquiry_invalid');
|
||||
|
||||
|
||||
add_enquiry_event(p_enqu_id => p_enqu_id
|
||||
,p_enst_code => 'INVALID'
|
||||
,p_event_date => SYSDATE);
|
||||
,p_enst_code => 'INVALID'
|
||||
,p_event_date => SYSDATE);
|
||||
END mark_enquiry_invalid;
|
||||
|
||||
FUNCTION get_system_configuration_value(p_parameter IN system_configuration.parameter%TYPE)
|
||||
@@ -1260,6 +1265,38 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
|
||||
END survey_required;
|
||||
|
||||
FUNCTION tripartite_agreement_message(p_rec IN mip_enquiries_helper.t_rec_enquiries)
|
||||
RETURN VARCHAR2 IS
|
||||
l_tab_messages mip_tripartite.t_tab_messages;
|
||||
l_return VARCHAR2(4000);
|
||||
l_valid BOOLEAN;
|
||||
l_idx INTEGER;
|
||||
BEGIN
|
||||
|
||||
pl('tripartite_agreement_message');
|
||||
|
||||
l_valid := mip_tripartite.valid_enquiry(p_rec => p_rec
|
||||
,p_tab_messages => l_tab_messages);
|
||||
|
||||
-- processing an enquiry that has not passed the tripartite agreement
|
||||
-- infers a processing error
|
||||
IF NOT l_valid THEN
|
||||
l_idx := l_tab_messages.FIRST;
|
||||
LOOP
|
||||
EXIT WHEN l_idx IS NULL;
|
||||
l_return := l_return || l_tab_messages(l_idx) || ',';
|
||||
l_idx := l_tab_messages.NEXT(l_idx);
|
||||
END LOOP;
|
||||
-- remove the trailing comma
|
||||
l_return := substr(l_return
|
||||
,1
|
||||
,length(l_return) - 1);
|
||||
END IF;
|
||||
|
||||
RETURN l_return;
|
||||
|
||||
END tripartite_agreement_message;
|
||||
|
||||
FUNCTION tripartite_agreement_satisfied(p_enqu_id IN enquiries.id%TYPE)
|
||||
RETURN BOOLEAN IS
|
||||
l_tab_messages mip_tripartite.t_tab_messages;
|
||||
@@ -1631,6 +1668,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,modu.hou_code AS hou_code
|
||||
,modu.inlet_orientation AS modu_inlet_orientation
|
||||
,modu.outlet_orientation AS modu_outlet_orientation
|
||||
,modu.qmax
|
||||
,NULL AS hou_selling_price
|
||||
,NULL AS hou_cost_price
|
||||
,NULL AS hou_delivery_cost
|
||||
@@ -1640,11 +1678,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,NULL AS bas_delivery_cost
|
||||
,metr.code AS metr_code
|
||||
,metr.qnom
|
||||
,metr.qmax
|
||||
,metr.qmax AS metr_qmax
|
||||
,metr.qmin
|
||||
,metr.selling_price AS metr_selling_price
|
||||
,metr.cost_price AS metr_cost_price
|
||||
,metr.delivery_cost AS metr_delivery_cost
|
||||
,metr.mety_code
|
||||
,NULL AS laco_mety_code
|
||||
,NULL AS laco_svcpt_code
|
||||
@@ -1676,6 +1711,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,modu.metr_code
|
||||
,modu.hou_code
|
||||
,modu.bas_code
|
||||
,modu.qmax
|
||||
,svcp_code
|
||||
,outlet_pressure
|
||||
,cnor_i.description AS inlet_orientation
|
||||
@@ -1713,34 +1749,13 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
|
||||
,metr.qmin
|
||||
,metr.qnom
|
||||
,metr.mety_code
|
||||
,selling_price
|
||||
,cost_price
|
||||
,delivery_cost
|
||||
FROM meters metr
|
||||
,(SELECT metr_code
|
||||
,selling_price
|
||||
,cost_price
|
||||
,delivery_cost
|
||||
FROM (SELECT row_number() over(PARTITION BY metr_code ORDER BY(decode(regi_code, l_regi_code, 1, 999))) AS accuracy
|
||||
,metr_code
|
||||
,selling_price
|
||||
,cost_price
|
||||
,delivery_cost
|
||||
,ROWID
|
||||
FROM v_meco cost
|
||||
WHERE SYSDATE BETWEEN
|
||||
cost.effective_from AND
|
||||
cost.effective_to
|
||||
AND (regi_code =
|
||||
l_regi_code OR
|
||||
regi_code IS NULL))
|
||||
WHERE accuracy <= 1) cost
|
||||
WHERE metr.code = cost.metr_code(+)) metr
|
||||
FROM meters metr
|
||||
) metr
|
||||
WHERE modu.svcp_code = p_enqu.required_svcp_code
|
||||
AND modu.outlet_pressure =
|
||||
p_enqu.required_metering_pressure
|
||||
AND metr.code = modu.metr_code
|
||||
AND metr.qmax >= p_enqu.qmax) LOOP
|
||||
AND modu.qmax >= p_enqu.qmax) LOOP
|
||||
l_this_is_automatic_quote := TRUE;
|
||||
add_quote_reason(p_enqu.id
|
||||
,p_reason => 'Considering module : ' ||
|
||||
|
||||
Reference in New Issue
Block a user