diff --git a/Modules/mip_quotation_document.pck b/Modules/mip_quotation_document.pck index 4d1473d..60aad79 100644 --- a/Modules/mip_quotation_document.pck +++ b/Modules/mip_quotation_document.pck @@ -611,7 +611,9 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS l_works(2) := 'Service Pressure: '|| l_service_pressure; -- --add up all the addons and format the string - l_works(4) := 'Add-Ons: '|| ltrim(l_addons, ','); + if l_addons is not null then + l_works(4) := 'Add-Ons: '|| ltrim(l_addons, ','); + end if; p_quote_data.quote_works := l_works; --get caveats @@ -879,11 +881,13 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS plpdf.SetPrintFont(p_font,'U',10); --set underline plpdf.PrintText(p_indent,p_vertical_offset+48,'Full Description of Works to be carried out by National Grid Metering:'); plpdf.SetPrintFont(p_font,'B',10); --set bold - l_works_counter := 1; - while p_quote_data.quote_works(l_works_counter) is not null - loop - plpdf.PrintText(p_indent,l_vertical_offset_for_works+(l_works_counter*4), p_quote_data.quote_works(l_works_counter)); - l_works_counter := l_works_counter +1; + l_works_counter := p_quote_data.quote_works.first; + loop + exit when l_works_counter is null; + if p_quote_data.quote_works(l_works_counter) is not null then + plpdf.PrintText(p_indent,l_vertical_offset_for_works+(l_works_counter*4), p_quote_data.quote_works(l_works_counter)); + l_works_counter := p_quote_data.quote_works.next(l_works_counter); + end if; end loop; -- DESC_WORK caveat here if p_quote_data.caveat_desc_works is not null then