diff --git a/Modules/mip_quotation_document.pck b/Modules/mip_quotation_document.pck index d72a307..7c37c1c 100644 --- a/Modules/mip_quotation_document.pck +++ b/Modules/mip_quotation_document.pck @@ -577,7 +577,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS --get existing meter if appropriate if quote_item_rec.enty_code is not null then if quote_item_rec.enty_code <>'INSTALL' and quote_item_rec.enty_code <>'STD INSTALL' then - l_works(5) := 'Existing Meter Type: '|| p_enqu_row.existing_mesc_code ||' '||p_enqu_row.existing_mety_code||', '|| p_enqu_row.existing_meter_model ||', MSN: '||p_enqu_row.existing_meter_serial_no ; + l_works(5) := 'Existing Meter Type: '|| p_enqu_row.existing_mesc_code ||' '||p_enqu_row.existing_mety_code||', MSN: '||p_enqu_row.existing_meter_serial_no ; end if; --if it's not an install or exchange get the existing meter type (will overwrite --current value if already set in the code above) @@ -872,11 +872,12 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS */ PROCEDURE build_costs_page(p_quote_data in quote_data, p_font in varchar2, p_indent in number, p_vertical_offset in number,p_watermark_blob blob) is l_cost_line_counter number; - l_vertical_offset_for_costs number := p_vertical_offset+110; + l_vertical_offset_for_costs number := p_vertical_offset+126; l_works_counter number; l_vertical_offset_for_works number := p_vertical_offset+52; l_cost_totals_offset number; --used to position the cost totals after the cost line items - + l_caveat_desc_works_offset number; --used to position caveat_desc_works as running calculation in + --function parameter causes error on pdf begin --Page 2 plpdf.NewPage; @@ -905,27 +906,30 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS 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_caveat_desc_works_offset := l_vertical_offset_for_works+(l_works_counter*4); end if; l_works_counter := p_quote_data.quote_works.next(l_works_counter); end loop; -- DESC_WORK caveat here 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_vertical_offset_for_works+(l_works_counter*4)); + print_caveats(p_quote_data.caveat_desc_works, l_caveat_desc_works_offset+1); + end if; plpdf.SetPrintFont(p_font,null,10); --unset bold - plpdf.PrintText(p_indent,p_vertical_offset+90, 'Indicative Lead Time from Acceptance to Physical Commencement: '); + plpdf.PrintText(p_indent,p_vertical_offset+106, 'Indicative Lead Time from Acceptance to Physical Commencement: '); plpdf.SetPrintFont(p_font,'B',10); --set bold - plpdf.PrintText(140,p_vertical_offset+90, p_quote_data.lead_time||' working days'); + plpdf.PrintText(140,p_vertical_offset+106, p_quote_data.lead_time||' working days'); plpdf.SetPrintFont(p_font,null,10); --unset bold - plpdf.PrintText(p_indent,p_vertical_offset+98,'Contract sum (excluding V.A.T): '); + plpdf.PrintText(p_indent,p_vertical_offset+114,'Contract sum (excluding V.A.T): '); plpdf.SetPrintFont(p_font,'B',10); --set bold - plpdf.PrintText(85,p_vertical_offset+98,'£'||to_char(p_quote_data.total_cost,'FM999999D90')); + plpdf.PrintText(85,p_vertical_offset+114,'£'||to_char(p_quote_data.total_cost,'FM999999D90')); -- CONT_SUM caveat here if p_quote_data.caveat_cont_sum is not null then - print_caveats(p_quote_data.caveat_cont_sum, p_vertical_offset+102); + print_caveats(p_quote_data.caveat_cont_sum, p_vertical_offset+118); end if; plpdf.SetPrintFont(p_font,null,10); --unset bold - plpdf.PrintText(p_indent,p_vertical_offset+106,'Analysis of Costs (all costs exclude V.A.T)'); + plpdf.PrintText(p_indent,p_vertical_offset+122,'Analysis of Costs (all costs exclude V.A.T)'); plpdf.SetPrintFont(p_font,'B',10); --set bold l_cost_line_counter:=1; while p_quote_data.quote_costs(l_cost_line_counter).cost_description is not null @@ -982,10 +986,10 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS --the caveats will be looped in so the positioning of the the following items will --need to be dynamic (see the quote costs code above for an example) plpdf.SetPrintFont(p_font,null,10); --unset bold - plpdf.PrintText(p_indent,p_vertical_offset+200,'Liquidated Damages (sum per day)(excluding V.A.T):'); - plpdf.PrintText(130,p_vertical_offset+200,'£'||to_char(p_quote_data.liquid_damage_day,'FM999999D90')); - plpdf.PrintText(p_indent,p_vertical_offset+208,'Liquidated Damages (monetary cap)(excluding V.A.T):'); - plpdf.PrintText(130,p_vertical_offset+208,'£'||to_char(p_quote_data.liquid_damage_cap,'FM999999D90')); + plpdf.PrintText(p_indent,p_vertical_offset+230,'Liquidated Damages (sum per day)(excluding V.A.T):'); + plpdf.PrintText(130,p_vertical_offset+230,'£'||to_char(p_quote_data.liquid_damage_day,'FM999999D90')); + plpdf.PrintText(p_indent,p_vertical_offset+238,'Liquidated Damages (monetary cap)(excluding V.A.T):'); + plpdf.PrintText(130,p_vertical_offset+238,'£'||to_char(p_quote_data.liquid_damage_cap,'FM999999D90')); end build_caveats_page; /* @@ -1139,15 +1143,27 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS plpdf.PrintCell(30,6,'ECV Outlet (u)',1,0,'C',0); plpdf.PrintCell(40,6,'Consumer Outlet (c)',1,1,'C',0); plpdf.SetPrintFont(p_font,null,10); --set back to plain - plpdf.PrintCell(90,6,'Design Minimum Pressure (DMP)',1,0,'L',0); - plpdf.PrintCell(30,6,'19 mbar',1,0,'C',0); - plpdf.PrintCell(40,6,'15 mbar',1,1,'C',0); - plpdf.PrintCell(90,6,'Lowest Operating Pressure (LOP)',1,0,'L',0); - plpdf.PrintCell(30,6,'25 mbar',1,0,'C',0); - plpdf.PrintCell(40,6,'21 mbar',1,1,'C',0); - plpdf.PrintCell(90,6,'Pressure Tier',1,0,'L',0); - plpdf.PrintCell(30,6,'75 mbar',1,0,'C',0); - plpdf.PrintCell(40,6,'21 mbar',1,1,'C',0); + if p_quote_data.svcpt_code = 'LP' then + plpdf.PrintCell(90,6,'Design Minimum Pressure (DMP)',1,0,'L',0); + plpdf.PrintCell(30,6,'19 mbar',1,0,'C',0); + plpdf.PrintCell(40,6,'15 mbar',1,1,'C',0); + plpdf.PrintCell(90,6,'Lowest Operating Pressure (LOP)',1,0,'L',0); + plpdf.PrintCell(30,6,'25 mbar',1,0,'C',0); + plpdf.PrintCell(40,6,'21 mbar',1,1,'C',0); + plpdf.PrintCell(90,6,'Pressure Tier',1,0,'L',0); + plpdf.PrintCell(30,6,'75 mbar',1,0,'C',0); + plpdf.PrintCell(40,6,'21 mbar',1,1,'C',0); + else --for MP + plpdf.PrintCell(90,6,'Design Minimum Pressure (DMP)',1,0,'L',0); + plpdf.PrintCell(30,6,'270 mbar',1,0,'C',0); + plpdf.PrintCell(40,6,'21 mbar',1,1,'C',0); + plpdf.PrintCell(90,6,'Lowest Operating Pressure (LOP)',1,0,'L',0); + plpdf.PrintCell(30,6,'270 mbar',1,0,'C',0); + plpdf.PrintCell(40,6,'21 mbar',1,1,'C',0); + plpdf.PrintCell(90,6,'Pressure Tier',1,0,'L',0); + plpdf.PrintCell(30,6,'2000 mbar',1,0,'C',0); + plpdf.PrintCell(40,6,'21 mbar',1,1,'C',0); + end if; --table 2 plpdf.SetCurrentXY(p_indent,p_vertical_offset+60); plpdf.SetPrintFont(p_font,'B',10); --set to bold