From 1e79598e1835388ea5ece13c0bde6eed753a3a39 Mon Sep 17 00:00:00 2001 From: PriestJ Date: Tue, 15 Apr 2008 16:45:39 +0000 Subject: [PATCH] Fix for #503(SC2023) removed AMR from cost breakdown, had to add an extra routine to tidy up the cost list as the code is quiting as soon as a blank cost is found as AMR is often in the middle the pdf was only displaying the first few cost items and when the spot where AMR would have been was reached the code exited. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@4798 248e525c-4dfb-0310-94bc-949c084e9493 --- Modules/mip_quotation_document.pck | 33 ++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/Modules/mip_quotation_document.pck b/Modules/mip_quotation_document.pck index 43d103f..08978fe 100644 --- a/Modules/mip_quotation_document.pck +++ b/Modules/mip_quotation_document.pck @@ -486,6 +486,9 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS l_works_counter number; l_works_tidy works := works(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null); --list of works for the quote l_works_tidy_counter number; + l_costs_counter number; + l_costs_tidy costs := costs(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null); + l_quote_cost_tidy_counter number; l_addons varchar(300); --list of addons for the quote l_housing_row housings%ROWTYPE; l_base_row bases%ROWTYPE; @@ -558,18 +561,15 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS when 'AQI' then --add-on item --Get costs l_add_item_row := get_additional_item(quote_item_rec.adit_code); - --AH now has a routine that sets the lifting gear or not so some code - --that duplicated that process has now been changed. - --Added code to check if lifing gear appears then set a flag to indicate - --that the lifing gear caveats should be displayed or not. + --only show the lifting gears description, not the materials bit if quote_item_rec.adit_code = 'LIFTING GEAR' then - p_quote_data.show_lifting_gear := true; p_quote_data.quote_costs(l_counter).cost_description := l_add_item_row.description; p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.selling_price; - else - p_quote_data.show_lifting_gear := false; - p_quote_data.quote_costs(l_counter).cost_description := l_add_item_row.description||' Materials cost'; - p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.selling_price; + else + if quote_item_rec.adit_code <> 'AMR' then + p_quote_data.quote_costs(l_counter).cost_description := l_add_item_row.description||' Materials cost'; + p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.selling_price; + end if; end if; if not(quote_item_rec.delivery_price is null) then l_counter:=l_counter +1; @@ -698,6 +698,21 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS l_works_counter := l_works.next(l_works_counter); end loop; p_quote_data.quote_works := l_works_tidy; + --tidy up quote costs + -- + -- + l_costs_counter := p_quote_data.quote_costs.first; + l_quote_cost_tidy_counter := 1; + loop + exit when l_costs_counter is null; + if not p_quote_data.quote_costs(l_costs_counter).cost_description is null then + l_costs_tidy(l_quote_cost_tidy_counter):=p_quote_data.quote_costs(l_costs_counter); + l_quote_cost_tidy_counter := l_quote_cost_tidy_counter +1; + end if; + l_costs_counter := p_quote_data.quote_costs.next(l_costs_counter); + end loop; + p_quote_data.quote_costs := l_costs_tidy; + end set_quote_items_data;