Changes made to support Bulk Load.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3255 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
hardya
2008-01-15 18:45:58 +00:00
parent 7365f2a567
commit 13c9c0ca97
54 changed files with 18856 additions and 16715 deletions

View File

@@ -28,6 +28,41 @@ CREATE OR REPLACE PACKAGE mip_quotation IS
%param p_id the id of the enquiry to be checked
*/
PROCEDURE produce_quotes(p_id IN enquiries.id%TYPE);
/** Accept a quote
%param p_qute_id id of the quote to be accepted
%param p_description optional description to be recorded with the event
%param p_event_date optional date for this event (defaults to now)
*/
PROCEDURE accept_quote(p_qute_id IN quotes.id%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE);
/** Reject a quote
%param p_qute_id id of the quote to be rejected
%param p_description optional description to be recorded with the event
%param p_event_date optional date for this event (defaults to now)
*/
PROCEDURE reject_quote(p_qute_id IN quotes.id%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE);
/** Reject all quotes associated with enquiry
%param p_enqu_id id of the enquiry for qhich all quotes are to be rejected
%param p_description optional description to be recorded with the event
%param p_event_date optional date for this event (defaults to now)
*/
PROCEDURE reject_all_quotes(p_enqu_id IN enquiries.id%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE);
/** Select a quote for detailed quotation
%param p_qute_id id of the quote to be selected
%param p_description optional description to be recorded with the event
%param p_event_date optional date for this event (defaults to now)
*/
PROCEDURE select_quote(p_qute_id IN quotes.id%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE);
END mip_quotation;
/
CREATE OR REPLACE PACKAGE BODY mip_quotation IS
@@ -53,6 +88,71 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
,cost_price costs.cost_price%TYPE
,delivery_cost costs.delivery_cost%TYPE);
PROCEDURE add_quote_event(p_qute_id IN quotes.id%TYPE
,p_qust_code quote_statuses.code%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date DATE DEFAULT SYSDATE) IS
BEGIN
NULL; --IF p_qust_code = 'ACCEPTED' THEN;
END add_quote_event;
PROCEDURE accept_quote(p_qute_id IN quotes.id%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE) IS
BEGIN
add_quote_event(p_qute_id => p_qute_id
,p_qust_code => 'ACCEPTED'
,p_event_date => p_event_date
,p_description => p_description);
END accept_quote;
PROCEDURE reject_quote(p_qute_id IN quotes.id%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE) IS
BEGIN
add_quote_event(p_qute_id => p_qute_id
,p_qust_code => 'REJECTED'
,p_event_date => p_event_date
,p_description => p_description);
END reject_quote;
PROCEDURE reject_all_quotes(p_enqu_id IN enquiries.id%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE) IS
BEGIN
FOR l_rec IN (SELECT id
FROM quotes
WHERE enqu_id = p_enqu_id) LOOP
add_quote_event(p_qute_id => l_rec.id
,p_qust_code => 'REJECTED'
,p_event_date => p_event_date
,p_description => p_description);
END LOOP;
END reject_all_quotes;
PROCEDURE select_quote(p_qute_id IN quotes.id%TYPE
,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE) IS
BEGIN
add_quote_event(p_qute_id => p_qute_id
,p_qust_code => 'SELECTED'
,p_event_date => p_event_date
,p_description => p_description);
FOR l_rec IN (SELECT id
FROM quotes
WHERE enqu_id = (SELECT enqu_id
FROM quotes
WHERE id = p_qute_id)
AND id <> p_qute_id) LOOP
add_quote_event(p_qute_id => l_rec.id
,p_qust_code => 'SELREJ'
,p_event_date => p_event_date);
END LOOP;
END select_quote;
PROCEDURE request_manual_quote(p_enqu_id IN enquiries.id%TYPE) IS
l_qute_id quotes.id%TYPE;
BEGIN
@@ -576,8 +676,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
AND modu.outlet_pressure =
p_enqu.required_metering_pressure
AND metr.code = modu.metr_code
AND metr.qmax >= p_enqu.qmax
) LOOP
AND metr.qmax >= p_enqu.qmax) LOOP
l_this_is_automatic_quote := TRUE;
add_quote_reason(p_enqu.id
,p_reason => 'Considering module : ' ||