diff --git a/Modules/mip_quotation_document.pck b/Modules/mip_quotation_document.pck index 66cf7b3..f50d978 100644 --- a/Modules/mip_quotation_document.pck +++ b/Modules/mip_quotation_document.pck @@ -1444,6 +1444,8 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS l_indent number := 31.7; l_vertical_offset number := 30; l_font varchar2(40) := 'Arial'; --arial not daz + l_quote_row quotes%ROWTYPE; + l_enqu_row enquiries%ROWTYPE; CURSOR c_get_logo(cp_logo varchar2) IS SELECT blob_content FROM wwv_flow_files @@ -1456,10 +1458,6 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS SELECT blob_content FROM wwv_flow_files WHERE filename = cp_watermark; - CURSOR c_get_enty(cp_quid varchar2) IS - SELECT enty_code - FROM quote_items - WHERE qute_id = cp_quid and quit_type = 'LQI' ; begin IF NOT c_get_logo%ISOPEN THEN @@ -1480,12 +1478,10 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS FETCH c_get_watermark INTO l_watermark_blob; CLOSE c_get_watermark; - IF NOT c_get_enty%ISOPEN THEN - OPEN c_get_enty(p_quote_id); - END IF; - FETCH c_get_enty - INTO l_enty_code; - CLOSE c_get_enty; + + l_quote_row := get_quote_row(p_quote_id); + l_enqu_row := get_enquiry_row(l_quote_row.enqu_id); + l_enty_code := l_enqu_row.enty_code; --get the quote diagrams l_base_blob := get_drawing(p_quote_data.base_diagram); @@ -1496,7 +1492,8 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS --build the pages for the quote build_covering_letter(p_quote_data,l_font,l_indent,l_vertical_offset,l_logo_blob, l_signature_blob, l_watermark_blob);--1 build_costs_page(p_quote_data,l_font,l_indent,l_vertical_offset,l_watermark_blob); --2 - if l_enty_code = 'REMOVE' or l_enty_code = 'STD REMOVE' or l_enty_code = 'ADVERSARIAL' then + --only display the data logger caveat if the user has selected it + if (l_enty_code = 'REMOVE' or l_enty_code = 'STD REMOVE' or l_enty_code = 'ADVERSARIAL') and l_enqu_row.existing_logger = 'YES' then build_caveats_page(p_quote_data,l_font,l_indent,l_vertical_offset,l_watermark_blob, true); --3 else build_caveats_page(p_quote_data,l_font,l_indent,l_vertical_offset,l_watermark_blob, false); --3