Addressed #363, assertion error and/or ORA-06502 errors during the quote generation caused by missing Required Meter Size or Qmax in the submitted enquiry.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3975 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
hardya
2008-03-12 17:56:39 +00:00
parent dfcd9f4b40
commit 8ee044c2dd
3 changed files with 51 additions and 25 deletions

View File

@@ -1308,22 +1308,30 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
END return_mandatory_messages;
PROCEDURE add_quote_reason(p_enqu_id IN enquiries.id%TYPE
,p_reason IN quote_reasoning.reason%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
BEGIN
pl('add_quote_reason:' || p_enqu_id || ':' || p_reason
,$$PLSQL_LINE);
INSERT INTO quote_reasoning
(enqu_id
,reason
,internal_or_external
,id)
VALUES
(p_enqu_id
,p_reason
,p_internal_or_external
,qure_seq.NEXTVAL);
BEGIN
INSERT INTO quote_reasoning
(enqu_id
,reason
,internal_or_external
,id)
VALUES
(p_enqu_id
,substr(p_reason
,1
,239)
,p_internal_or_external
,qure_seq.NEXTVAL);
EXCEPTION
WHEN OTHERS THEN
pl('add_quote_reason:' || SQLERRM
,$$PLSQL_LINE);
RAISE;
END;
END add_quote_reason;
FUNCTION get_u_meter_size(p_qmax IN NUMBER)
@@ -2068,7 +2076,9 @@ 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 ' ||
add_quote_reason(p_enqu.id
,'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
@@ -2088,7 +2098,19 @@ 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
l_required_qmax := p_enqu.qmax;
pl('Existing LP Diaphragm - no restriction'
,$$PLSQL_LINE);
pl('Required Meter Size' || p_enqu.required_mesc_code
,$$PLSQL_LINE);
pl('Required Qmax' || p_enqu.qmax
,$$PLSQL_LINE);
IF p_enqu.required_mesc_code IS NOT NULL
AND p_enqu.required_mesc_code <> 'OTHER' THEN
l_required_qmax := get_qmax_from_mesc(p_enqu.required_mesc_code);
ELSE
l_required_qmax := p_enqu.qmax;
END IF;
ELSIF p_enqu.required_svcp_code = 'MP'
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
-- can quote for specific meter size
@@ -2123,6 +2145,10 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
,'Site Survey is required for exchange of meter.');
END IF;
ELSE
pl('required_mesc_code=' || p_enqu.required_mesc_code
,$$PLSQL_UNIT);
pl('qmax=' || p_enqu.qmax
,$$PLSQL_UNIT);
-- 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!