Initial changes to mip_quotation.pck and mip_bulk_load.pck to support PhaseII purging requirements.
New attributes added to Schema/ext_cost.pdc, Data/BulkLoad/BULK_LOAD.xls (as exported through Data/BulkLoad/MATERIAL_COSTS.csv). Changes to views V_AICO.vw and V_QUOTE_DETAILS.vw to recognize the new attributes and to stop PURGING being excluded from details. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@12526 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@ CREATE OR REPLACE PACKAGE mip_quotation_document IS
|
||||
width NUMBER
|
||||
,height NUMBER);
|
||||
TYPE cost_line IS RECORD(
|
||||
cost_description VARCHAR2(80)
|
||||
cost_description VARCHAR2(160)
|
||||
,cost_price NUMBER);
|
||||
|
||||
TYPE address IS VARRAY(7) OF VARCHAR2(160);
|
||||
@@ -230,6 +230,11 @@ END mip_quotation_document;
|
||||
/
|
||||
CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
|
||||
TYPE t_rec_font_details IS RECORD(
|
||||
fontname VARCHAR2(80)
|
||||
,fontsize NUMBER
|
||||
,fontstyle VARCHAR2(80));
|
||||
|
||||
PROCEDURE pl(p_in IN VARCHAR2
|
||||
,p_line IN NUMBER DEFAULT NULL) IS
|
||||
BEGIN
|
||||
@@ -240,6 +245,113 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
$END NULL;
|
||||
END pl;
|
||||
|
||||
FUNCTION get_current_font_details RETURN t_rec_font_details IS
|
||||
l_rec_font_details t_rec_font_details;
|
||||
BEGIN
|
||||
l_rec_font_details.fontname := plpdf.getprintfontname;
|
||||
l_rec_font_details.fontsize := plpdf.getprintfontsize;
|
||||
l_rec_font_details.fontstyle := plpdf.getprintfontstyle;
|
||||
END get_current_font_details;
|
||||
|
||||
PROCEDURE print_costs(p_description IN VARCHAR2
|
||||
,p_description_width IN NUMBER DEFAULT 80
|
||||
,p_cost IN NUMBER DEFAULT NULL
|
||||
,p_border IN VARCHAR2 DEFAULT '0') IS
|
||||
l_row_data plpdf_type.t_row_datas;
|
||||
l_row_width plpdf_type.t_row_widths;
|
||||
l_row_align plpdf_type.t_row_aligns;
|
||||
l_row_border plpdf_type.t_row_borders;
|
||||
l_row_maxline plpdf_type.t_row_maxlines;
|
||||
l_row_style plpdf_type.t_row_styles;
|
||||
BEGIN
|
||||
l_row_data(1) := p_description;
|
||||
IF p_cost IS NOT NULL THEN
|
||||
l_row_data(2) := '<27>';
|
||||
l_row_data(3) := TO_CHAR(p_cost
|
||||
,'FM999G990D00');
|
||||
END IF;
|
||||
l_row_width(1) := p_description_width;
|
||||
l_row_width(2) := 12;
|
||||
l_row_width(3) := 30;
|
||||
|
||||
l_row_align(1) := 'L';
|
||||
l_row_align(2) := 'R';
|
||||
l_row_align(3) := 'R';
|
||||
|
||||
l_row_border(1) := p_border;
|
||||
l_row_border(2) := p_border;
|
||||
l_row_border(3) := p_border;
|
||||
|
||||
plpdf.row_print2(p_data => l_row_data -- plpdf_type.t_row_datas: Data shown in the cells
|
||||
,p_width => l_row_width -- plpdf_type.t_row_widths: Width of the cells
|
||||
,p_align => l_row_align -- plpdf_type.t_row_aligns: Alignment of the cells
|
||||
,p_border => l_row_border
|
||||
,p_style => l_row_style
|
||||
,p_maxline => l_row_maxline
|
||||
,p_h => 4 --number default 5: Height of the cells
|
||||
,p_fill => 0 --number default 0: Fill
|
||||
--o 0: no fill
|
||||
--o 1: fill with current fill color
|
||||
,p_min_height => 0 --number default 0: Minimal height of row, 0 means not USE this parameter
|
||||
-- ,p_clipping => 0 --number default 1: Clipping text
|
||||
--o 0: no clipping
|
||||
--o 1: clipping
|
||||
);
|
||||
END print_costs;
|
||||
|
||||
PROCEDURE print_works(p_description IN VARCHAR2
|
||||
,p_description_width IN NUMBER DEFAULT 80
|
||||
,p_work IN VARCHAR2 DEFAULT NULL
|
||||
,p_border IN VARCHAR2 DEFAULT '0') IS
|
||||
l_row_data plpdf_type.t_row_datas;
|
||||
l_row_width plpdf_type.t_row_widths;
|
||||
l_row_align plpdf_type.t_row_aligns;
|
||||
l_row_border plpdf_type.t_row_borders;
|
||||
l_row_maxline plpdf_type.t_row_maxlines;
|
||||
l_row_style plpdf_type.t_row_styles;
|
||||
|
||||
l_rec_font_details t_rec_font_details;
|
||||
BEGIN
|
||||
|
||||
l_rec_font_details := get_current_font_details;
|
||||
|
||||
plpdf.setprintfont(p_family => l_rec_font_details.fontname
|
||||
,p_style => 'B'
|
||||
,p_size => l_rec_font_details.fontsize);
|
||||
|
||||
l_row_data(1) := p_description;
|
||||
IF p_work IS NOT NULL THEN
|
||||
l_row_data(2) := p_work;
|
||||
END IF;
|
||||
l_row_width(1) := p_description_width;
|
||||
l_row_width(2) := 0;
|
||||
|
||||
l_row_align(1) := 'L';
|
||||
l_row_align(2) := 'L';
|
||||
|
||||
l_row_border(1) := p_border;
|
||||
l_row_border(2) := p_border;
|
||||
l_row_border(3) := p_border;
|
||||
|
||||
plpdf.row_print2(p_data => l_row_data -- plpdf_type.t_row_datas: Data shown in the cells
|
||||
,p_width => l_row_width -- plpdf_type.t_row_widths: Width of the cells
|
||||
,p_align => l_row_align -- plpdf_type.t_row_aligns: Alignment of the cells
|
||||
,p_border => l_row_border
|
||||
,p_style => l_row_style
|
||||
,p_maxline => l_row_maxline
|
||||
,p_h => 4 --number default 5: Height of the cells
|
||||
,p_fill => 0 --number default 0: Fill
|
||||
--o 0: no fill
|
||||
--o 1: fill with current fill color
|
||||
,p_min_height => 0 --number default 0: Minimal height of row, 0 means not USE this parameter
|
||||
-- ,p_clipping => 0 --number default 1: Clipping text
|
||||
--o 0: no clipping
|
||||
--o 1: clipping
|
||||
);
|
||||
plpdf.setprintfont(p_family => l_rec_font_details.fontname
|
||||
,p_style => l_rec_font_details.fontstyle
|
||||
,p_size => l_rec_font_details.fontsize);
|
||||
END print_works;
|
||||
/*
|
||||
function get_meter_type_code_desc
|
||||
--recives a meter code and returns the corresponding meter type description
|
||||
@@ -620,13 +732,13 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
|
||||
BEGIN
|
||||
|
||||
SELECT SUM(selling_price + nvl(delivery_price
|
||||
,0))
|
||||
SELECT SUM(nvl(selling_price
|
||||
,0) + nvl(delivery_price
|
||||
,0))
|
||||
INTO l_quote_total_cost
|
||||
FROM quote_items
|
||||
WHERE qute_id = p_quoteid
|
||||
AND NOT
|
||||
(quit_type = 'AQI' AND adit_code IN ('LIFTING GEAR', 'PURGING'));
|
||||
AND NOT (quit_type = 'AQI' AND adit_code IN ('LIFTING GEAR'));
|
||||
|
||||
RETURN l_quote_total_cost;
|
||||
END get_total_cost;
|
||||
@@ -794,21 +906,28 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
--Get costs
|
||||
l_add_item_row := get_additional_item(quote_item_rec.adit_code);
|
||||
--only show the lifting gear/purging description, not the materials bit
|
||||
IF quote_item_rec.adit_code = 'LIFTING GEAR' or quote_item_rec.adit_code ='PURGING' THEN
|
||||
--If AH's build quote items has left the cost as null then the additional item
|
||||
--must be costed on time and materials (as part of purging changes '09)
|
||||
IF quote_item_rec.adit_code = 'LIFTING GEAR' THEN
|
||||
IF quote_item_rec.selling_price IS NULL THEN
|
||||
p_quote_data.quote_costs(l_counter).cost_description := l_add_item_row.description||' (if required)(On Time and Materials Basis)';
|
||||
p_quote_data.quote_costs(l_counter).cost_description := l_add_item_row.description ||
|
||||
' (if required)(On Time and Materials Basis)';
|
||||
ELSE
|
||||
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;
|
||||
END IF;
|
||||
ELSE
|
||||
IF quote_item_rec.adit_code <> 'AMR' THEN
|
||||
ELSIF quote_item_rec.adit_code = 'PURGING' THEN
|
||||
--If AH's build quote items has left the cost as null then the additional item
|
||||
--must be costed on time and materials (as part of purging changes '09)
|
||||
IF quote_item_rec.selling_price IS NULL THEN
|
||||
p_quote_data.quote_costs(l_counter).cost_description := l_add_item_row.description ||
|
||||
' Materials cost';
|
||||
' (On Time and Materials Basis)';
|
||||
ELSE
|
||||
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;
|
||||
END IF;
|
||||
ELSIF 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;
|
||||
IF NOT (quote_item_rec.delivery_price IS NULL) THEN
|
||||
l_counter := l_counter + 1;
|
||||
@@ -1003,30 +1122,35 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
--The caveats
|
||||
CURSOR c_get_caveats(cp_enty_code VARCHAR2, cp_mety_code VARCHAR2, cp_svcpt_code VARCHAR2, cp_quoteid NUMBER) IS
|
||||
SELECT t.*
|
||||
FROM caveat_texts t, quote_items qi
|
||||
FROM caveat_texts t
|
||||
,quote_items qi
|
||||
WHERE t.enty_code = cp_enty_code
|
||||
AND t.mety_code = cp_mety_code
|
||||
AND t.svcpt_code = cp_svcpt_code
|
||||
AND qi.qute_id = cp_quoteid
|
||||
and qi.adit_code is null
|
||||
and t.adit_code is null
|
||||
union
|
||||
AND qi.adit_code IS NULL
|
||||
AND t.adit_code IS NULL
|
||||
UNION
|
||||
SELECT t.*
|
||||
FROM caveat_texts t, quote_items qi
|
||||
FROM caveat_texts t
|
||||
,quote_items qi
|
||||
WHERE t.enty_code = cp_enty_code
|
||||
AND t.mety_code = cp_mety_code
|
||||
AND t.svcpt_code = cp_svcpt_code
|
||||
AND qi.qute_id = cp_quoteid
|
||||
and qi.adit_code is not null
|
||||
and t.adit_code is not null
|
||||
AND qi.adit_code IS NOT NULL
|
||||
AND t.adit_code IS NOT NULL
|
||||
AND t.adit_code = qi.adit_code
|
||||
AND REGEXP_LIKE(DECODE(qi.selling_price, NULL, 'NULL', qi.selling_price),t.condition)
|
||||
AND regexp_like(decode(qi.selling_price
|
||||
,NULL
|
||||
,'NULL'
|
||||
,qi.selling_price)
|
||||
,t.condition)
|
||||
ORDER BY 1
|
||||
,2
|
||||
,3
|
||||
,4
|
||||
,5
|
||||
;
|
||||
,5;
|
||||
--Agent Name
|
||||
l_agent_first_name VARCHAR2(80);
|
||||
l_agent_last_name VARCHAR2(80);
|
||||
@@ -1142,11 +1266,11 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
--description of works caveat point
|
||||
l_quote_data.caveat_cont_sum_qa(l_csqa_counter) := rec.text;
|
||||
l_csqa_counter := l_csqa_counter + 1;
|
||||
END CASE;
|
||||
--need to add in the condition to determine if the additional item should be
|
||||
--displayed or not here(ish)
|
||||
|
||||
END LOOP;
|
||||
END CASE;
|
||||
--need to add in the condition to determine if the additional item should be
|
||||
--displayed or not here(ish)
|
||||
|
||||
END LOOP;
|
||||
--phew, lets return all that lovely data we captured then...
|
||||
RETURN l_quote_data;
|
||||
END get_detailed_quote_data;
|
||||
@@ -1460,6 +1584,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
plpdf.printtext(p_indent
|
||||
,p_vertical_offset + 48
|
||||
,'Full Description of Works to be carried out by National Grid Metering:');
|
||||
|
||||
plpdf.setprintfont(p_font
|
||||
,'B'
|
||||
,10); --set bold
|
||||
@@ -1476,6 +1601,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
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
|
||||
@@ -1490,22 +1616,24 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
plpdf.setprintfont(p_font
|
||||
,'B'
|
||||
,10); --set bold
|
||||
|
||||
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 + 114
|
||||
,'Contract sum (excluding V.A.T): ');
|
||||
plpdf.setprintfont(p_font
|
||||
,'B'
|
||||
,10); --set bold
|
||||
plpdf.printtext(85
|
||||
,p_vertical_offset + 114
|
||||
,'#' || TO_CHAR(p_quote_data.total_cost
|
||||
,'FM999999D90'));
|
||||
|
||||
/*
|
||||
plpdf.printtext(p_indent
|
||||
,p_vertical_offset + 114
|
||||
,'Contract sum (excluding V.A.T): ');
|
||||
plpdf.printtext(85
|
||||
,p_vertical_offset + 114
|
||||
,print_cost_aligned(p_quote_data.total_cost));
|
||||
-- ,'<EFBFBD>' || TO_CHAR(p_quote_data.total_cost
|
||||
-- ,'FM999999D90'));
|
||||
*/
|
||||
l_ybefore := plpdf.getcurrenty;
|
||||
|
||||
-- CONT_SUM caveat here
|
||||
@@ -1520,13 +1648,25 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
plpdf.setprintfont(p_font
|
||||
,NULL
|
||||
,10); --unset bold
|
||||
plpdf.printtext(p_indent
|
||||
,plpdf.getcurrenty + 4
|
||||
,'Analysis of Costs (all costs exclude V.A.T)');
|
||||
plpdf.setcurrenty(p_vertical_offset + 114);
|
||||
print_costs(p_description => 'Contract sum (excluding V.A.T):'
|
||||
,p_cost => p_quote_data.total_cost);
|
||||
|
||||
plpdf.linebreak(20); -- line break, height is 20
|
||||
print_costs(p_description => 'Analysis of Costs (all costs exclude V.A.T)');
|
||||
|
||||
/* plpdf.printtext(p_indent
|
||||
,plpdf.getcurrenty + 4
|
||||
,'Analysis of Costs (all costs exclude V.A.T)');
|
||||
*/
|
||||
plpdf.setprintfont(p_font
|
||||
,'B'
|
||||
,10); --set bold
|
||||
|
||||
plpdf.linebreak(20); -- line break, height is 20
|
||||
|
||||
--plpdf.setcurrenty( l_vertical_offset_for_costs + 4);
|
||||
/*
|
||||
l_cost_line_counter := 1;
|
||||
WHILE p_quote_data.quote_costs(l_cost_line_counter)
|
||||
.cost_description IS NOT NULL LOOP
|
||||
@@ -1535,27 +1675,58 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
l_cost_line_counter * 4
|
||||
, p_quote_data.quote_costs(l_cost_line_counter)
|
||||
.cost_description);
|
||||
plpdf.printtext(120
|
||||
,l_vertical_offset_for_costs +
|
||||
l_cost_line_counter * 4
|
||||
,'#' || TO_CHAR(p_quote_data.quote_costs(l_cost_line_counter)
|
||||
.cost_price
|
||||
,'FM999999D90'));
|
||||
-- some items do not show a cost value
|
||||
IF p_quote_data.quote_costs(l_cost_line_counter)
|
||||
.cost_price IS NOT NULL THEN
|
||||
plpdf.printtext(120
|
||||
,l_vertical_offset_for_costs +
|
||||
l_cost_line_counter * 4
|
||||
,print_cost_aligned(p_quote_data.quote_costs(l_cost_line_counter)
|
||||
.cost_price));
|
||||
-- '<27>' || TO_CHAR(p_quote_data.quote_costs(l_cost_line_counter)
|
||||
-- .cost_price
|
||||
-- ,'FM999,999D90'));
|
||||
plpdf.setprintfont(p_font
|
||||
,'B'
|
||||
,10);
|
||||
END IF;
|
||||
l_cost_line_counter := l_cost_line_counter + 1;
|
||||
END LOOP;
|
||||
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);
|
||||
*/
|
||||
|
||||
l_cost_line_counter := 1;
|
||||
WHILE p_quote_data.quote_costs(l_cost_line_counter)
|
||||
.cost_description IS NOT NULL LOOP
|
||||
|
||||
print_costs(p_description => p_quote_data.quote_costs(l_cost_line_counter)
|
||||
.cost_description
|
||||
,p_cost => p_quote_data.quote_costs(l_cost_line_counter)
|
||||
.cost_price);
|
||||
|
||||
l_cost_line_counter := l_cost_line_counter + 1;
|
||||
|
||||
END LOOP;
|
||||
|
||||
/* 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);
|
||||
*/
|
||||
print_costs(p_description => 'Total costs:'
|
||||
,p_cost => p_quote_data.total_cost
|
||||
,p_border => 'T');
|
||||
/*
|
||||
plpdf.printtext(p_indent
|
||||
,l_cost_totals_offset + 6
|
||||
,'Total costs:');
|
||||
plpdf.printtext(120
|
||||
,l_cost_totals_offset + 6
|
||||
,'#' || TO_CHAR(p_quote_data.total_cost
|
||||
,'FM999999D90'));
|
||||
,print_cost_aligned(p_quote_data.total_cost));
|
||||
-- ,'<EFBFBD>' || TO_CHAR(p_quote_data.total_cost
|
||||
-- ,'FM999999D90'));
|
||||
*/
|
||||
-- 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
|
||||
@@ -1655,21 +1826,30 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
plpdf.setprintfont(p_font
|
||||
,NULL
|
||||
,10); --unset bold
|
||||
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'));
|
||||
|
||||
plpdf.linebreak;
|
||||
print_costs(p_description => 'Liquidated Damages (sum per day)(excluding V.A.T):'
|
||||
,p_description_width => 100
|
||||
,p_cost => p_quote_data.liquid_damage_day);
|
||||
print_costs(p_description => 'Liquidated Damages (monetary cap)(excluding V.A.T):'
|
||||
,p_description_width => 100
|
||||
,p_cost => p_quote_data.liquid_damage_cap);
|
||||
/* plpdf.printtext(p_indent
|
||||
,p_vertical_offset + 230
|
||||
,'Liquidated Damages (sum per day)(excluding V.A.T):');
|
||||
plpdf.printtext(130
|
||||
,p_vertical_offset + 230
|
||||
,print_cost_aligned(p_quote_data.liquid_damage_day));
|
||||
-- ,'<EFBFBD>' || 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
|
||||
,print_cost_aligned(p_quote_data.liquid_damage_cap));
|
||||
-- ,'<27>' || TO_CHAR(p_quote_data.liquid_damage_cap
|
||||
-- ,'FM999999D90'));
|
||||
*/
|
||||
END build_caveats_page;
|
||||
/*
|
||||
PROCEDURE build_drawings_page
|
||||
@@ -2754,7 +2934,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation_document IS
|
||||
,10); --set bold
|
||||
plpdf.printtext(85
|
||||
,p_vertical_offset + 62
|
||||
,'#' || TO_CHAR(p_quote_data.total_cost
|
||||
,'<EFBFBD>' || TO_CHAR(p_quote_data.total_cost
|
||||
,'FM999999D90'));
|
||||
plpdf.setcurrenty(66);
|
||||
l_ybefore := plpdf.getcurrenty;
|
||||
|
||||
Reference in New Issue
Block a user