BONS#62268 Toevoeging op rapport Factuur M)
svn path=/Customer/trunk/; revision=46658
This commit is contained in:
116
BONS/bons.sql
116
BONS/bons.sql
@@ -1,13 +1,23 @@
|
||||
-- Script containing customer specific configuration sql statements for bons
|
||||
-- (c) 2009 SG|facilitor bv
|
||||
-- $Revision$
|
||||
--
|
||||
-- $Id$
|
||||
--
|
||||
-- Support: +31 53 4800710
|
||||
-- Script containing customer specific sql statements for the FACILITOR database
|
||||
|
||||
set echo on
|
||||
DEFINE thisfile = 'BONS.SQL'
|
||||
DEFINE dbuser = '^BONS'
|
||||
|
||||
spool bons.lst
|
||||
SET ECHO ON
|
||||
SET DEFINE ON
|
||||
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
|
||||
WHENEVER SQLERROR EXIT;
|
||||
|
||||
SELECT adm.scriptspoolfile ('&dbuser', '&thisfile') AS fcltlogfile FROM DUAL;
|
||||
|
||||
WHENEVER SQLERROR CONTINUE;
|
||||
SPOOL &fcltlogfile
|
||||
SET DEFINE OFF
|
||||
|
||||
------ payload begin ------
|
||||
|
||||
CREATE OR REPLACE VIEW bons_v_rap_salaris_unit4
|
||||
(
|
||||
@@ -43,14 +53,98 @@ AS SELECT
|
||||
kosten
|
||||
FROM care_v_rap_salaris_b;
|
||||
|
||||
CREATE OR REPLACE VIEW CARE_V_RAP2_FACTUUR_UREN_M_V2
|
||||
(
|
||||
FCLT_X_PERIODE,
|
||||
FCLT_X_GEMEENTE,
|
||||
TARIEF,
|
||||
MELDING,
|
||||
BESCHIKKING,
|
||||
BESCHIKKING_OMSCHR,
|
||||
CLIENTNUMMER,
|
||||
BSN,
|
||||
ACHTERNAAM,
|
||||
VOORVOEGSELS,
|
||||
VOORLETTERS,
|
||||
GEBOORTEDATUM,
|
||||
GESLACHT,
|
||||
POSTCODE,
|
||||
HUISNUMMER,
|
||||
HUISNUMMERTOEVOEGING,
|
||||
JAAR,
|
||||
WEEK,
|
||||
PRODUCT,
|
||||
MINUTEN,
|
||||
MINUTEN_X_TARIEF,
|
||||
MEDEWERKER,
|
||||
PERSONEELSNUMMER_MDW
|
||||
)
|
||||
AS
|
||||
SELECT periode,
|
||||
gemeente,
|
||||
tarief,
|
||||
melding,
|
||||
MIN (beschikkingsnr),
|
||||
beschikking_omschr,
|
||||
MIN (client_nr),
|
||||
bsn_client,
|
||||
MIN (client_naam),
|
||||
MIN (client_tussenvoegsel),
|
||||
MIN (client_voorletters),
|
||||
MIN (client_geboortedatum),
|
||||
MIN (client_mv),
|
||||
MIN (client_postcode),
|
||||
SUBSTR (
|
||||
MIN (client_huisnr),
|
||||
1,
|
||||
DECODE (
|
||||
REGEXP_INSTR (MIN (client_huisnr), '[[:alpha:]]|[-]'),
|
||||
0, LENGTH (MIN (client_huisnr)),
|
||||
REGEXP_INSTR (MIN (client_huisnr), '[[:alpha:]]|[-]') - 1)),
|
||||
SUBSTR (
|
||||
MIN (client_huisnr),
|
||||
DECODE (REGEXP_INSTR (MIN (client_huisnr), '[[:alpha:]]|[-]'),
|
||||
0, LENGTH (MIN (client_huisnr)) + 1,
|
||||
REGEXP_INSTR (MIN (client_huisnr), '[[:alpha:]]|[-]'))),
|
||||
jaar,
|
||||
weeknr,
|
||||
DECODE (
|
||||
product,
|
||||
'HV1', TO_CHAR (COALESCE (MIN (gemeente_hv1_code), 1)),
|
||||
'HV2', TO_CHAR (COALESCE (MIN (gemeente_hv2_code), 2)),
|
||||
'HV3', TO_CHAR (COALESCE (MIN (gemeente_hv2_code), 2) + 1),
|
||||
''),
|
||||
ROUND (60 * SUM (week_uren_besteed)),
|
||||
ROUND (60 * SUM (week_uren_besteed)) * tarief,
|
||||
verzorger,
|
||||
nr_verzorger
|
||||
FROM care_v_gemeente_fact2_uren f
|
||||
GROUP BY periode,
|
||||
gemeente,
|
||||
tarief,
|
||||
melding,
|
||||
beschikkingsnr,
|
||||
beschikking_omschr,
|
||||
f.bsn_client,
|
||||
product,
|
||||
jaar,
|
||||
weeknr,
|
||||
verzorger,
|
||||
nr_verzorger;
|
||||
|
||||
------ payload end ------
|
||||
|
||||
BEGIN adm.systrackscriptId('$Id$', 0); END;
|
||||
/
|
||||
SET DEFINE OFF
|
||||
|
||||
BEGIN fac.registercustversion('BONS', 1); END;
|
||||
BEGIN
|
||||
adm.systrackscriptId (
|
||||
'$Id$',
|
||||
0);
|
||||
END;
|
||||
/
|
||||
|
||||
COMMIT;
|
||||
|
||||
spool off
|
||||
SET ECHO OFF
|
||||
SPOOL OFF
|
||||
SET DEFINE ON
|
||||
PROMPT Logfile of this upgrade is: &fcltlogfile
|
||||
Reference in New Issue
Block a user