Partial fix for #498 (SC7001) removed gap in description of works on cost page of quote, caveats now on one line for contact_sum, contract_sum_qa and also added contract_sum caveat to total cost on cost page. Still need to change code on datalogger caveat such that it looks up the enquiry to see if one was specified.
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@4794 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -132,6 +132,42 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
plpdf.SetCellMargin(l_cell_margin);
|
plpdf.SetCellMargin(l_cell_margin);
|
||||||
plpdf.SetLeftMargin(31.7);
|
plpdf.SetLeftMargin(31.7);
|
||||||
end print_caveats;
|
end print_caveats;
|
||||||
|
/*
|
||||||
|
PROCEDURE print_one_line_caveats
|
||||||
|
--Prints the supplied caveats to the current PLPDF page on one line
|
||||||
|
%param p_caveats - an array of caveat paragraphs to print
|
||||||
|
%param p_vertical_offset - how far down the page we start printing
|
||||||
|
%param p_horizontal_offset - how far across the page we start printing
|
||||||
|
%param p_line_spacing - the line spacing to use, defaults to 4
|
||||||
|
*/
|
||||||
|
procedure print_one_line_caveats(p_caveats in caveat_text,
|
||||||
|
p_vertical_offset in number,
|
||||||
|
p_horizontal_offset in number,
|
||||||
|
p_line_spacing in number :=4) is
|
||||||
|
l_caveats_counter number;
|
||||||
|
l_cell_margin number;
|
||||||
|
l_caveat_total_text varchar2(5000);
|
||||||
|
begin
|
||||||
|
--set up the screen so we can have our size 4 spacing
|
||||||
|
l_cell_margin:= plpdf.GetCellMargin;
|
||||||
|
plpdf.SetLeftMargin(33.7);
|
||||||
|
plpdf.SetCellMargin(-2);
|
||||||
|
plpdf.SetCurrentY(p_vertical_offset);
|
||||||
|
plpdf.SetCurrentX(p_horizontal_offset);
|
||||||
|
l_caveats_counter :=1;
|
||||||
|
l_caveat_total_text :='';
|
||||||
|
|
||||||
|
while p_caveats(l_caveats_counter) is not null
|
||||||
|
loop
|
||||||
|
l_caveat_total_text := l_caveat_total_text||' '||p_caveats(l_caveats_counter);
|
||||||
|
l_caveats_counter := l_caveats_counter +1;
|
||||||
|
end loop;
|
||||||
|
plpdf.PrintFlowingText(p_line_spacing, l_caveat_total_text);
|
||||||
|
plpdf.LineBreak;
|
||||||
|
--revert back to the original screen settings
|
||||||
|
plpdf.SetCellMargin(l_cell_margin);
|
||||||
|
plpdf.SetLeftMargin(31.7);
|
||||||
|
end print_one_line_caveats;
|
||||||
/*
|
/*
|
||||||
FUNCTION scale_image_dimensions
|
FUNCTION scale_image_dimensions
|
||||||
--The scale_image_dimensions provides the width and height of an image to
|
--The scale_image_dimensions provides the width and height of an image to
|
||||||
@@ -447,6 +483,9 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
--Additional Items
|
--Additional Items
|
||||||
l_add_item_row additional_items%ROWTYPE;
|
l_add_item_row additional_items%ROWTYPE;
|
||||||
l_works 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 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_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_addons varchar(300); --list of addons for the quote
|
l_addons varchar(300); --list of addons for the quote
|
||||||
l_housing_row housings%ROWTYPE;
|
l_housing_row housings%ROWTYPE;
|
||||||
l_base_row bases%ROWTYPE;
|
l_base_row bases%ROWTYPE;
|
||||||
@@ -524,11 +563,11 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
--Added code to check if lifing gear appears then set a flag to indicate
|
--Added code to check if lifing gear appears then set a flag to indicate
|
||||||
--that the lifing gear caveats should be displayed or not.
|
--that the lifing gear caveats should be displayed or not.
|
||||||
if quote_item_rec.adit_code = 'LIFTING GEAR' then
|
if quote_item_rec.adit_code = 'LIFTING GEAR' then
|
||||||
p_quote_data.show_lifting_gear := true;
|
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_description := l_add_item_row.description;
|
||||||
p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.selling_price;
|
p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.selling_price;
|
||||||
else
|
else
|
||||||
p_quote_data.show_lifting_gear := false;
|
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_description := l_add_item_row.description||' Materials cost';
|
||||||
p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.selling_price;
|
p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.selling_price;
|
||||||
end if;
|
end if;
|
||||||
@@ -537,8 +576,8 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
p_quote_data.quote_costs(l_counter).cost_description := l_add_item_row.description||' Delivery cost';
|
p_quote_data.quote_costs(l_counter).cost_description := l_add_item_row.description||' Delivery cost';
|
||||||
p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.delivery_price;
|
p_quote_data.quote_costs(l_counter).cost_price := quote_item_rec.delivery_price;
|
||||||
end if;
|
end if;
|
||||||
--set the list of add-ons for this quote, but don't add lifting gear
|
--set the list of add-ons for this quote, but don't add lifting gear or purging
|
||||||
if quote_item_rec.adit_code <> 'LIFTING GEAR' then
|
if quote_item_rec.adit_code <> 'LIFTING GEAR' and not quote_item_rec.adit_code is null then
|
||||||
l_addons := l_addons || ', '||l_add_item_row.description;
|
l_addons := l_addons || ', '||l_add_item_row.description;
|
||||||
end if;
|
end if;
|
||||||
when 'MQI' then --module item
|
when 'MQI' then --module item
|
||||||
@@ -643,12 +682,23 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
--
|
--
|
||||||
--add up all the addons and format the string
|
--add up all the addons and format the string
|
||||||
if l_addons is not null then
|
if l_addons is not null then
|
||||||
l_works(4) := 'Add-Ons: '|| ltrim(l_addons, ',');
|
l_works(4) := 'Add-Ons: '|| ltrim(l_addons, ',');
|
||||||
end if;
|
end if;
|
||||||
p_quote_data.quote_works := l_works;
|
--tidy up l_works so there are no blank entries
|
||||||
|
--create an l_works_tidy variable and copy all
|
||||||
--get caveats
|
--non null array entries into it
|
||||||
|
l_works_counter := l_works.first;
|
||||||
|
l_works_tidy_counter := 1;
|
||||||
|
loop
|
||||||
|
exit when l_works_counter is null;
|
||||||
|
if not l_works(l_works_counter) is null then
|
||||||
|
l_works_tidy(l_works_tidy_counter):=l_works(l_works_counter);
|
||||||
|
l_works_tidy_counter := l_works_tidy_counter +1;
|
||||||
|
end if;
|
||||||
|
l_works_counter := l_works.next(l_works_counter);
|
||||||
|
end loop;
|
||||||
|
p_quote_data.quote_works := l_works_tidy;
|
||||||
|
|
||||||
end set_quote_items_data;
|
end set_quote_items_data;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -939,7 +989,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
l_works_counter := p_quote_data.quote_works.first;
|
l_works_counter := p_quote_data.quote_works.first;
|
||||||
loop
|
loop
|
||||||
exit when l_works_counter is null;
|
exit when l_works_counter is null;
|
||||||
if p_quote_data.quote_works(l_works_counter) is not null then
|
if not p_quote_data.quote_works(l_works_counter) is null then
|
||||||
plpdf.PrintText(p_indent,l_vertical_offset_for_works+(l_works_counter*4), p_quote_data.quote_works(l_works_counter));
|
plpdf.PrintText(p_indent,l_vertical_offset_for_works+(l_works_counter*4), p_quote_data.quote_works(l_works_counter));
|
||||||
l_caveat_desc_works_offset := l_vertical_offset_for_works+(l_works_counter*4);
|
l_caveat_desc_works_offset := l_vertical_offset_for_works+(l_works_counter*4);
|
||||||
end if;
|
end if;
|
||||||
@@ -947,7 +997,6 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
end loop;
|
end loop;
|
||||||
-- DESC_WORK caveat here
|
-- DESC_WORK caveat here
|
||||||
if p_quote_data.caveat_desc_works is not null then
|
if p_quote_data.caveat_desc_works is not null then
|
||||||
-- print_caveats(p_quote_data.caveat_desc_works, l_vertical_offset_for_works+(l_works_counter*4));
|
|
||||||
print_caveats(p_quote_data.caveat_desc_works, l_caveat_desc_works_offset+1);
|
print_caveats(p_quote_data.caveat_desc_works, l_caveat_desc_works_offset+1);
|
||||||
end if;
|
end if;
|
||||||
plpdf.SetPrintFont(p_font,null,10); --unset bold
|
plpdf.SetPrintFont(p_font,null,10); --unset bold
|
||||||
@@ -964,9 +1013,10 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
plpdf.PrintText(85,p_vertical_offset+114,'<27>'||to_char(p_quote_data.total_cost,'FM999999D90'));
|
plpdf.PrintText(85,p_vertical_offset+114,'<27>'||to_char(p_quote_data.total_cost,'FM999999D90'));
|
||||||
--end if;
|
--end if;
|
||||||
l_ybefore := plpdf.GetCurrentY;
|
l_ybefore := plpdf.GetCurrentY;
|
||||||
|
|
||||||
-- CONT_SUM caveat here
|
-- CONT_SUM caveat here
|
||||||
if p_quote_data.caveat_cont_sum is not null then
|
if p_quote_data.caveat_cont_sum is not null then
|
||||||
print_caveats(p_quote_data.caveat_cont_sum, p_vertical_offset+115,4,1);
|
print_one_line_caveats(p_quote_data.caveat_cont_sum, p_vertical_offset+111,plpdf.GetCurrentY+4,4);
|
||||||
end if;
|
end if;
|
||||||
l_vertical_offset_for_costs := l_vertical_offset_for_costs+(plpdf.GetCurrentY-l_ybefore);
|
l_vertical_offset_for_costs := l_vertical_offset_for_costs+(plpdf.GetCurrentY-l_ybefore);
|
||||||
plpdf.SetPrintFont(p_font,null,10); --unset bold
|
plpdf.SetPrintFont(p_font,null,10); --unset bold
|
||||||
@@ -983,12 +1033,11 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
l_cost_totals_offset := l_vertical_offset_for_costs+l_cost_line_counter*4;
|
l_cost_totals_offset := l_vertical_offset_for_costs+l_cost_line_counter*4;
|
||||||
plpdf.DrawLine(p_indent,l_cost_totals_offset+2,185,l_cost_totals_offset+2);
|
plpdf.DrawLine(p_indent,l_cost_totals_offset+2,185,l_cost_totals_offset+2);
|
||||||
plpdf.PrintText(p_indent,l_cost_totals_offset+6,'Total costs:');
|
plpdf.PrintText(p_indent,l_cost_totals_offset+6,'Total costs:');
|
||||||
--only show the lifing gear caveat if we give a price for lifting gear
|
|
||||||
--if p_quote_data.show_lifting_gear = true then
|
|
||||||
-- plpdf.PrintText(120,l_cost_totals_offset+6,'<27>'||to_char(p_quote_data.total_cost,'FM999999D90')||' excluding lifting gear if required');
|
|
||||||
--else
|
|
||||||
plpdf.PrintText(120,l_cost_totals_offset+6,'<27>'||to_char(p_quote_data.total_cost,'FM999999D90'));
|
plpdf.PrintText(120,l_cost_totals_offset+6,'<27>'||to_char(p_quote_data.total_cost,'FM999999D90'));
|
||||||
--end if;
|
-- CONT_SUM caveat here
|
||||||
|
if p_quote_data.caveat_cont_sum is not null then
|
||||||
|
print_one_line_caveats(p_quote_data.caveat_cont_sum, l_cost_totals_offset+2.8,plpdf.GetCurrentY,4);
|
||||||
|
end if;
|
||||||
end build_costs_page;
|
end build_costs_page;
|
||||||
/*
|
/*
|
||||||
PROCEDURE build_caveats_page
|
PROCEDURE build_caveats_page
|
||||||
@@ -1336,17 +1385,13 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
|||||||
plpdf.SetPrintFont(p_font,null,10); --unset bold
|
plpdf.SetPrintFont(p_font,null,10); --unset bold
|
||||||
plpdf.PrintText(p_indent,p_vertical_offset+62,'Contract sum (excluding V.A.T): ');
|
plpdf.PrintText(p_indent,p_vertical_offset+62,'Contract sum (excluding V.A.T): ');
|
||||||
plpdf.SetPrintFont(p_font,'B',10); --set bold
|
plpdf.SetPrintFont(p_font,'B',10); --set bold
|
||||||
--only show the lifing gear caveat if we give a price for lifting gear
|
|
||||||
--if p_quote_data.show_lifting_gear = true then
|
|
||||||
-- plpdf.PrintText(85,p_vertical_offset+62,'<27>'||p_quote_data.total_cost||' excluding lifting gear if required.');
|
|
||||||
--else
|
|
||||||
plpdf.PrintText(85,p_vertical_offset+62,'<27>'||p_quote_data.total_cost);
|
plpdf.PrintText(85,p_vertical_offset+62,'<27>'||p_quote_data.total_cost);
|
||||||
-- end if;
|
|
||||||
plpdf.SetCurrentY(66);
|
plpdf.SetCurrentY(66);
|
||||||
l_ybefore := plpdf.GetCurrentY;
|
l_ybefore := plpdf.GetCurrentY;
|
||||||
-- CONT_SUM_QA caveat here
|
-- CONT_SUM_QA caveat here
|
||||||
if p_quote_data.caveat_cont_sum_qa is not null then
|
if p_quote_data.caveat_cont_sum_qa is not null then
|
||||||
print_caveats(p_quote_data.caveat_cont_sum_qa, p_vertical_offset+63,4,1);
|
--print_caveats(p_quote_data.caveat_cont_sum_qa, p_vertical_offset+63,4,1);
|
||||||
|
print_one_line_caveats(p_quote_data.caveat_cont_sum_qa, p_vertical_offset+59,plpdf.GetCurrentY+40,4);
|
||||||
end if;
|
end if;
|
||||||
l_vertical_offset := l_vertical_offset+(plpdf.GetCurrentY-l_ybefore);
|
l_vertical_offset := l_vertical_offset+(plpdf.GetCurrentY-l_ybefore);
|
||||||
plpdf.SetPrintFont(p_font,null,10); --unset bold
|
plpdf.SetPrintFont(p_font,null,10); --unset bold
|
||||||
|
|||||||
Reference in New Issue
Block a user