-- Customer specific once-script ARAI.
--
-- (c) 2013 SG|facilitor bv 
-- $Revision$ 
-- $Id$
--
-- Support: +31 53 4800700

SET ECHO ON
SPOOL arai14.lst
SET DEFINE OFF

------------------------------------------------------------------------------------------------------------------------------------------
---- RTM Energie: PV als aparte grafiek

CREATE OR REPLACE VIEW arai_v_graph_zon_nu
AS SELECT * FROM DUAL;

CREATE OR REPLACE VIEW arai_v_graph_zon_today
AS SELECT * FROM DUAL;

-- Barchart zon-nu
INSERT INTO fac_usrgraph (fac_usrgraph_view_name, fac_usrgraph_type, fac_usrgraph_orderby, fac_usrgraph_maxrows, fac_usrgraph_options)
VALUES ('arai_v_graph_zon_nu', 1, 'VOLGORDE', 10, NULL);
INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_energie',35,'Zonne-energie (kW)', 180, 18, 'fac_usrgraph.asp?usrgraph_key=' || MAX(fac_usrgraph_key), 300 FROM fac_usrgraph;
INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url)
SELECT 'rtm_energie',37,NULL, 180, 5, '..\..\cust\arai\html\rtm_empty.html' FROM dual;


-- Linechart zon-today
INSERT INTO fac_usrgraph (fac_usrgraph_view_name, fac_usrgraph_type, fac_usrgraph_orderby, fac_usrgraph_maxrows, fac_usrgraph_options)
VALUES ('arai_v_graph_zon_today', 4, 'FCLT_XAS_', NULL, '{seriesColors: [''orange''] , axes: {yaxis: {min: 0}} }');
INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_energie',77,NULL, 180, 18, 'fac_usrgraph.asp?usrgraph_key=' || MAX(fac_usrgraph_key), 300 FROM fac_usrgraph;

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url)
SELECT 'rtm_energie',78,NULL, 180, 5, '..\..\cust\arai\html\rtm_empty.html' FROM dual;

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url)
SELECT 'rtm_energie',12,NULL, 90, 18, '..\..\cust\arai\html\rtm_energie_zon.html' FROM dual;
INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url)
SELECT 'rtm_energie',13,NULL, 90, 15, '..\..\cust\arai\html\rtm_empty.html' FROM dual;


------------------------------------------------------------------------------------------------------------------------------------------
---- RTM Klachten


-- Eerst ff enkele dummy views...

CREATE OR REPLACE VIEW arai_v_graph_kl_maand
AS SELECT * FROM DUAL;

CREATE OR REPLACE VIEW arai_v_graph_kl_dag
AS SELECT * FROM DUAL;

CREATE OR REPLACE VIEW arai_v_graph_kl_uur
AS SELECT * FROM DUAL;

CREATE OR REPLACE VIEW arai_v_graph_kl_open_lev
AS SELECT * FROM DUAL;

CREATE OR REPLACE VIEW arai_v_graph_kl_event
AS SELECT * FROM DUAL;

CREATE OR REPLACE VIEW arai_v_graph_kl_lev
AS SELECT * FROM DUAL;



-- RIJ 1: ALGEMEEN, per maand, per dag, per uur.

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_klachten', 10, '', 25, 99, '..\..\cust\arai\html\rtm_empty.html', NULL FROM dual;

INSERT INTO fac_usrgraph (fac_usrgraph_view_name, fac_usrgraph_type, fac_usrgraph_orderby, fac_usrgraph_maxrows, fac_usrgraph_options)
VALUES ('arai_v_graph_kl_maand', 4, 'VOLGORDE', 12, '{seriesColors: [''blue'', ''red'', ''black''] , axes: {yaxis: {min: 0}}}');

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_klachten',20,'Klachten afgelopen maanden', 200, 30, 'fac_usrgraph.asp?usrgraph_key=' || MAX(fac_usrgraph_key), 60 FROM fac_usrgraph;

INSERT INTO fac_usrgraph (fac_usrgraph_view_name, fac_usrgraph_type, fac_usrgraph_orderby, fac_usrgraph_maxrows, fac_usrgraph_options)
VALUES ('arai_v_graph_kl_dag', 4, 'VOLGORDE', 7, '{seriesColors: [''blue'', ''red'', ''black''] , axes: {yaxis: {min: 0}}}');

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_klachten',30,'Klachten afgelopen dagen', 200, 30, 'fac_usrgraph.asp?usrgraph_key=' || MAX(fac_usrgraph_key), 60 FROM fac_usrgraph;

INSERT INTO fac_usrgraph (fac_usrgraph_view_name, fac_usrgraph_type, fac_usrgraph_orderby, fac_usrgraph_maxrows, fac_usrgraph_options)
VALUES ('arai_v_graph_kl_uur', 4, 'VOLGORDE', 24, '{seriesColors: [''blue'', ''red'', ''black''] , axes: {yaxis: {min: 0}}}');

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_klachten',40,'Klachten afgelopen uren', 200, 30, 'fac_usrgraph.asp?usrgraph_key=' || MAX(fac_usrgraph_key), 60 FROM fac_usrgraph;

-- RIJ 2: SLA: Openstaande per leverancier, op tijd/te laat , ....

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_klachten', 100, '', 25, 99, '..\..\cust\arai\html\rtm_empty.html', NULL FROM dual;

INSERT INTO fac_usrgraph (fac_usrgraph_view_name, fac_usrgraph_type, fac_usrgraph_orderby, fac_usrgraph_maxrows, fac_usrgraph_options)
VALUES ('arai_v_graph_kl_event', 1, 'VOLGORDE', 10, '{seriesColors: [''blue'', ''red'', ''black''] , axes: {yaxis: {min: 0}}}');

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_klachten',110,'Klachten per event afgelopen jaar', 250, 30, 'fac_usrgraph.asp?usrgraph_key=' || MAX(fac_usrgraph_key), 60 FROM fac_usrgraph;

INSERT INTO fac_usrgraph (fac_usrgraph_view_name, fac_usrgraph_type, fac_usrgraph_orderby, fac_usrgraph_maxrows, fac_usrgraph_options)
VALUES ('arai_v_graph_kl_lev', 1, 'VOLGORDE', 10, '{seriesColors: [''blue'', ''red'', ''black''] , axes: {yaxis: {min: 0}}}');

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_klachten',120,'Klachten per leverancier afgelopen jaar', 250, 30, 'fac_usrgraph.asp?usrgraph_key=' || MAX(fac_usrgraph_key), 60 FROM fac_usrgraph;

INSERT INTO fac_usrgraph (fac_usrgraph_view_name, fac_usrgraph_type, fac_usrgraph_orderby, fac_usrgraph_maxrows, fac_usrgraph_options)
VALUES ('arai_v_graph_kl_open_lev', 1, 'VOLGORDE', 10, '{seriesColors: [''blue'', ''red'', ''black''] , axes: {yaxis: {min: 0}}}');

INSERT INTO fac_widget (fac_widget_groep, fac_widget_volgnr, fac_widget_title, fac_widget_height, fac_widget_width, fac_widget_url, fac_widget_refreshtime)
SELECT 'rtm_klachten',130,'Openstaande klachten per leverancier', 250, 30, 'fac_usrgraph.asp?usrgraph_key=' || MAX(fac_usrgraph_key), 60 FROM fac_usrgraph;


BEGIN adm.systrackscriptId('$Id$'); END;
/

commit;

SPOOL OFF

@arai.sql
