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;