Files
mip/Modules/get_quote_items.fnc
andrew.hardy a645a35335 Modify additional item cost routines in mip_bulk_load.pck and mip_quotation.pck to make use of enquiry type as a cost parameter. Matching changes to the BULK_LOAD.xls spreadsheet.
Change get_quote_items.fnc to return the descriptions of additional items instead of the 'code'.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@12542 248e525c-4dfb-0310-94bc-949c084e9493
2009-09-08 10:58:39 +00:00

33 lines
936 B
Plaintext

CREATE OR REPLACE FUNCTION get_quote_items(p_quote_id IN NUMBER)
RETURN VARCHAR2 IS
ret_items VARCHAR2(250);
first_item BOOLEAN := TRUE;
BEGIN
--blank string
ret_items := '';
FOR cur_item IN (SELECT adit.description
FROM quote_items quit
JOIN additional_items adit ON (adit.code =
quit.adit_code)
WHERE quit.qute_id = p_quote_id
AND quit.adit_code IS NOT NULL
ORDER BY description) LOOP
IF first_item THEN
ret_items := cur_item.description;
first_item := FALSE;
ELSE
--add a seperator
ret_items := ret_items || ', ' || cur_item.description;
END IF;
END LOOP;
RETURN(ret_items);
EXCEPTION
WHEN OTHERS THEN
--return an empty string just in case
RETURN(NULL);
END get_quote_items;
/