v20200227
authorKilian Saffran <ksaffran@dks.lu>
Thu, 27 Feb 2020 16:17:04 +0000 (17:17 +0100)
committerKilian Saffran <ksaffran@dks.lu>
Thu, 27 Feb 2020 16:17:04 +0000 (17:17 +0100)
42 files changed:
.gitignore
backoffice/api/lib/session.pm
backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf [deleted file]
backoffice/data/reports/pot/pot_period.tt
backoffice/js/.DS_Store [deleted file]
backoffice/js/request.js
backoffice/tmp/sql.log [new file with mode: 0644]
dev/db/diff_db.sh
dev/db/livedbupdate.sql
dev/db/potlu_db.demo.columns.live.txt [deleted file]
dev/db/potlu_db.demo.tables.live.txt [deleted file]
dev/db/potlu_db.newcompanyschema.pg.schema.sql-e [deleted file]
dev/db/potlu_db.portanova.columns.live.txt [deleted file]
dev/db/potlu_db.portanova.pg.schema.sql
dev/db/potlu_db.portanova.tables.live.txt [deleted file]
dev/db/potlu_db.public.columns.live.txt [deleted file]
dev/db/potlu_db.public.columns.local.txt [deleted file]
dev/db/potlu_db.public.pg.data.sql
dev/db/potlu_db.public.pg.full.sql
dev/db/potlu_db.public.pg.schema.sql
dev/db/potlu_db.public.tables.live.txt [deleted file]
dev/db/potlu_db.public.tables.local.txt [deleted file]
dev/db/potlu_db.refschema.columns.local.txt [deleted file]
dev/db/potlu_db.refschema.tables.local.txt [deleted file]
dev/db/potlu_db.test.columns.live.txt [deleted file]
dev/db/potlu_db.test.tables.live.txt [deleted file]
dev/db/potlu_db.test2.columns.live.txt [deleted file]
dev/db/potlu_db.test2.tables.live.txt [deleted file]
dev/db/reinstallschema.sh [new file with mode: 0644]
dev/db/update.demo.columns.txt [deleted file]
dev/db/update.demo.tables.txt [deleted file]
dev/db/update.portanova.columns.txt [deleted file]
dev/db/update.portanova.tables.txt [deleted file]
dev/db/update.public.columns.txt
dev/db/update.test.columns.txt [deleted file]
dev/db/update.test.tables.txt [deleted file]
dev/db/update.test2.columns.txt [deleted file]
dev/db/update.test2.tables.txt [deleted file]
dev/db/users.sql [new file with mode: 0644]
dev/diff_files.sh
dev/sourcefiles.local.txt
dev/sourcefiles.remote.txt

index 2ff3f33..7644a2c 100644 (file)
@@ -1,2 +1,5 @@
 backoffice/api/lib/perl5
+backoffice/data/output/pot
+backoffice/data/tmp
+
 
index 0bbd878..c45b497 100644 (file)
@@ -23,11 +23,13 @@ sub checklogin(){
   my $self = shift;
   my $login = shift;
   my $password = shift;
+  
+  my $pwd = sha256_hex($password);
+  my $ret->{messagetype} ='w3-red';
   # open FILE,">>tmp/sql.log";
   # print FILE "pwd: $password\n";
+  # print FILE "pwd: $pwd\n";
   # close(FILE);
-  my $pwd = sha256_hex($password);
-  my $ret->{messagetype} ='w3-red';
   # my $newsid = undef;
   $login = lc($login);
   $login =~ s/^\s+//;
diff --git a/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf b/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf
deleted file mode 100644 (file)
index c8c38f6..0000000
Binary files a/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf and /dev/null differ
index 4d77306..931d87e 100644 (file)
@@ -76,27 +76,46 @@ tfoot { display:table-footer-group }
       <th>Totaux</th></tr>
     </thead>
     <tbody>
-      [% lastidstaff = 0 %]
-      [% firstrow = 1 %]
-      [% weektotals = ""%]
+      
+      [% wdk = 0 %]
       [% FOREACH pw = periodweek.execute(id_reportperiod,wl.weekident) %]
-        [% IF lastidstaff != pw.id_staff %]
-          [% IF firstrow == 0 %]
-            [% weektotals %]
-            <tr/>
+        [% IF wdk == 0 %]
+          <tr><td>[% pw.surname %]<br/>[% pw.prename %]</td>
+        [% END %]
+        [% WHILE pw.daydate != wd.$wdk and wdk < 7 %]
+          <td colspan="2">&nbsp;</td>
+          [% wdk = wdk + 1 %]
+        [% END %]
+        [% #IF pw.daydate == wd.$wdk %]
+        [% IF wdk < 7 %]
+        [% IF pw.timestart1%]
+              <td class="datavalues">
+              [% pw.timestart1 %]-[% pw.timeend1 %]<br/>
+              [% IF pw.timestart2 %][% pw.timestart2 %]-[% pw.timeend2 %]<br/>[% END %]
+              [% IF pw.timepause %]P: [% pw.timepause %][% END %]</td>
+              <td class="datavalues">
+                [% IF pw.workhours %]T: [% pw.workhours %]<br/>[%END %]
+                [% IF pw.recuperationhours %]R: [% pw.recuperationhours %]<br/>[%END %]
+                [% IF pw.vacancyhours %]C: [% pw.vacancyhours %]<br/>[%END %]
+                [% IF pw.vacancyhours %]J: [% pw.dayhours %][%END %]
+              </td>
           [% ELSE %]
-            [% firstrow = 0 %]
+          <td colspan="2">&nbsp;</td>
+          [% END %]  
+          [% END %]
+          [% wdk = wdk + 1 %]
+          [% IF wdk >= 7 %]
+          <td class="datavalues">
+            [% IF pw.week_workhours && pw.week_workhours != "00:00" %]T: [% pw.week_workhours %]<br/>[%END %]
+            [% IF pw.week_recuperationhours && pw.week_recuperationhours != "00:00" %]R: [% pw.week_recuperationhours %]<br/>[%END %]
+            [% IF pw.week_vacancyhours && pw.week_vacancyhours != "00:00"  %]C: [% pw.week_vacancyhours %]<br/>[%END %]
+            [% IF pw.week_totalhours && pw.week_totalhours != "00:00"  %]S: [% pw.week_totalhours %]<br/>[%END %]
+            [% IF pw.week_diffhours && pw.week_diffhours != "00:00"  %]D: [% pw.week_diffhours %][%END %]
+            [% wdk = 0 %]
+          </td></tr>
           [% END %]
-          <tr>
-          <td>[% pw.surname %]<br/>[% pw.prename %]</td>
-          [% lastidstaff = pw.id_staff %]
-        [% END %]
-        <td class="datavalues">[% pw.timestart1 %]-[% pw.timeend1 %]<br/>[% pw.timestart2 %]-[% pw.timeend2 %]<br/>P: [% pw.timepause %]</td>
-        <td class="datavalues">T: [% pw.workhours %]<br/>R: [% pw.recuperationhours %]<br/>C: [% pw.vacancyhours %]<br/>J: [% pw.dayhours %]</td>
-        [% weektotals = "<td class=\"datavalues\">T: ${pw.week_workhours}<br/>R: ${pw.week_recuperationhours}<br/>C: ${pw.week_vacancyhours}<br/>S: ${pw.week_totalhours}<br/>D: ${pw.week_diffhours}</td>" %]
       [% END %]
-      [% weektotals %]
-      </tr>
+      
     </tbody>
   </table>
   <div class="page-break"></div>
diff --git a/backoffice/js/.DS_Store b/backoffice/js/.DS_Store
deleted file mode 100644 (file)
index 5008ddf..0000000
Binary files a/backoffice/js/.DS_Store and /dev/null differ
index ade4cb8..801b206 100644 (file)
@@ -61,6 +61,7 @@ var req = {
     if (method.toUpperCase() == 'GET'){
       sendurl = sendurl + '?' + rdata;
     }
+    console.log(sendurl + '?' + rdata);
     request.open(method.toUpperCase(), sendurl, true);
     request.onload = function(){
       if (request.status >= 200 && request.status <= 400){
diff --git a/backoffice/tmp/sql.log b/backoffice/tmp/sql.log
new file mode 100644 (file)
index 0000000..24c582a
--- /dev/null
@@ -0,0 +1,7 @@
+pwd: fb1ia1ka
+pwd: 0ecf731e2426a8a469f06e9f4a3bcbed6f8071d9d3e3ef7ef5fd9165021e27ec
+$VAR1 = {
+          '0' => {
+                   'checklogin' => 'B9GPFgP2iJpHQUZYwUy4enrhzxtDZWcqWJ6sPLlX'
+                 }
+        };
index 0a9bab5..f060d70 100644 (file)
@@ -38,41 +38,41 @@ diff ${CALLDIR}'/'${DBNAME}'.public.columns.live.txt' ${CALLDIR}'/'${DBNAME}'.pu
 cat ${CALLDIR}'/update.public.columns.txt' | awk -F"|" '{ print "ALTER TABLE "$1"."$2" ADD COLUMN "$4" "$5";"}' >> ${CALLDIR}'/livedbupdate.sql'
 
 
-#3. check all userschema tables not installed
-DBHOST="localhost"
-psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -t -F ";" -c "select tb.table_name,tb.table_type from information_schema.tables tb join information_schema.schemata sc 
-on (tb.table_schema=sc.schema_name and sc.schema_name in ('"${REFUSERSCHEMA}"'))
-order by tb.table_type,tb.table_schema,tb.table_name;" | sort | sed  -e 's/\s//g' >  ${CALLDIR}'/'${DBNAME}'.refschema.tables.local.txt'
+# #3. check all userschema tables not installed
+DBHOST="localhost"
+psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -t -F ";" -c "select tb.table_name,tb.table_type from information_schema.tables tb join information_schema.schemata sc 
+on (tb.table_schema=sc.schema_name and sc.schema_name in ('"${REFUSERSCHEMA}"'))
+order by tb.table_type,tb.table_schema,tb.table_name;" | sort | sed  -e 's/\s//g' >  ${CALLDIR}'/'${DBNAME}'.refschema.tables.local.txt'
 
-#4. check all userschema columns not installed
-DBHOST="localhost"
-psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -t -F ";" -c "select tb.table_name,tb.table_type, col.column_name,col.data_type from information_schema.tables tb
-join information_schema.columns col on (tb.table_schema=col.table_Schema and tb.table_name=col.table_name)
-where tb.table_schema='"${REFUSERSCHEMA}"' order by tb.table_name,tb.table_type,col.column_name; " | sort | sed  -e 's/\s//g' >  ${CALLDIR}'/'${DBNAME}'.refschema.columns.local.txt'
+# #4. check all userschema columns not installed
+DBHOST="localhost"
+psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -t -F ";" -c "select tb.table_name,tb.table_type, col.column_name,col.data_type from information_schema.tables tb
+join information_schema.columns col on (tb.table_schema=col.table_Schema and tb.table_name=col.table_name)
+where tb.table_schema='"${REFUSERSCHEMA}"' order by tb.table_name,tb.table_type,col.column_name; " | sort | sed  -e 's/\s//g' >  ${CALLDIR}'/'${DBNAME}'.refschema.columns.local.txt'
 
 #TODO change to LIVE
 DBHOST="localhost"
 USCHEMA=(`psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -0 -t -c "select schema_name from information_schema.schemata where schema_owner='${DBUSER}';"`)
 
-for sc in "${USCHEMA[@]}"
-do
-  echo "check schema "$sc
-  export CSCHEMA=$sc
-  #tables
-  psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -t -F ";" -c "select tb.table_name,tb.table_type from information_schema.tables tb join information_schema.schemata sc 
-on (tb.table_schema=sc.schema_name and sc.schema_name in ('"$sc"'))
-order by tb.table_type,tb.table_schema,tb.table_name;" | sort | sed  -e 's/\s//g' >  ${CALLDIR}'/'${DBNAME}'.'$sc'.tables.live.txt'
-
-  diff ${CALLDIR}'/'${DBNAME}'.'$sc'.tables.live.txt' ${CALLDIR}'/'${DBNAME}'.refschema.tables.local.txt' | grep -e "^>.*|BASETABLE" | sed  -e 's/'${REFUSERSCHEMA}'/'$sc'/g' | sed -e 's/>\ //g;' > ${CALLDIR}'/update.'$sc'.tables.txt'
-  cat ${CALLDIR}'/update.'$sc'.tables.txt' | awk -F"|" '{ print "CREATE TABLE "$CSCHEMA"."$1"();"}' >> ${CALLDIR}'/livedbupdate.sql'
-  #columns
-  psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -t -F ";" -c "select tb.table_name,tb.table_type, col.column_name,col.data_type from information_schema.tables tb
-join information_schema.columns col on (tb.table_schema=col.table_schema and tb.table_name=col.table_name)
-where tb.table_schema='"$sc"' order by tb.table_name,tb.table_type,col.column_name; " | sort | sed  -e 's/\s//g' >  ${CALLDIR}'/'${DBNAME}'.'$sc'.columns.live.txt'
+for sc in "${USCHEMA[@]}"
+do
+  echo "check schema "$sc
+  export CSCHEMA=$sc
+  #tables
+  psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -t -F ";" -c "select tb.table_name,tb.table_type from information_schema.tables tb join information_schema.schemata sc 
+on (tb.table_schema=sc.schema_name and sc.schema_name in ('"$sc"'))
+order by tb.table_type,tb.table_schema,tb.table_name;" | sort | sed  -e 's/\s//g' >  ${CALLDIR}'/'${DBNAME}'.'$sc'.tables.live.txt'
+
+  diff ${CALLDIR}'/'${DBNAME}'.'$sc'.tables.live.txt' ${CALLDIR}'/'${DBNAME}'.refschema.tables.local.txt' | grep -e "^>.*|BASETABLE" | sed  -e 's/'${REFUSERSCHEMA}'/'$sc'/g' | sed -e 's/>\ //g;' > ${CALLDIR}'/update.'$sc'.tables.txt'
+  cat ${CALLDIR}'/update.'$sc'.tables.txt' | awk -F"|" '{ print "CREATE TABLE "$CSCHEMA"."$1"();"}' >> ${CALLDIR}'/livedbupdate.sql'
+  #columns
+  psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -t -F ";" -c "select tb.table_name,tb.table_type, col.column_name,col.data_type from information_schema.tables tb
+join information_schema.columns col on (tb.table_schema=col.table_schema and tb.table_name=col.table_name)
+where tb.table_schema='"$sc"' order by tb.table_name,tb.table_type,col.column_name; " | sort | sed  -e 's/\s//g' >  ${CALLDIR}'/'${DBNAME}'.'$sc'.columns.live.txt'
   
-  diff ${CALLDIR}'/'${DBNAME}'.'$sc'.columns.live.txt' ${CALLDIR}'/'${DBNAME}'.refschema.columns.local.txt' | grep -e "^>.*|BASETABLE|" | sed  -e 's/'${REFUSERSCHEMA}'/'$sc'/g' | sed -e 's/>\ //g;' > ${CALLDIR}'/update.'$sc'.columns.txt'
-  cat ${CALLDIR}'/update.'$sc'.columns.txt' | awk -F"|" '{ print "ALTER TABLE "$CSCHEMA"."$1" ADD COLUMN "$3" "$4";"}' >> ${CALLDIR}'/livedbupdate.sql'
-done
+  diff ${CALLDIR}'/'${DBNAME}'.'$sc'.columns.live.txt' ${CALLDIR}'/'${DBNAME}'.refschema.columns.local.txt' | grep -e "^>.*|BASETABLE|" | sed  -e 's/'${REFUSERSCHEMA}'/'$sc'/g' | sed -e 's/>\ //g;' > ${CALLDIR}'/update.'$sc'.columns.txt'
+  cat ${CALLDIR}'/update.'$sc'.columns.txt' | awk -F"|" '{ print "ALTER TABLE "$CSCHEMA"."$1" ADD COLUMN "$3" "$4";"}' >> ${CALLDIR}'/livedbupdate.sql'
+done
 export CSCHEMA=
 #views to reinstall
 # for cc in "${BTCOL[@]}"
index fa3080e..2230fba 100644 (file)
@@ -1,117 +1,6 @@
 
-ALTER TABLE public.users ADD COLUMN id_company integer;
-ALTER TABLE public.users ADD COLUMN id_usergroups json;
-ALTER TABLE public.users ADD COLUMN job text;
-ALTER TABLE public.users ADD COLUMN phone text;
-ALTER TABLE public.users ADD COLUMN prename text;
-ALTER TABLE public.users ADD COLUMN surname text;
-CREATE TABLE reportperiod|BASETABLE.reportperiod();
-CREATE TABLE sites|BASETABLE.sites();
-CREATE TABLE staffcontract|BASETABLE.staffcontract();
-CREATE TABLE staffgroups|BASETABLE.staffgroups();
-CREATE TABLE stafftimetracks|BASETABLE.stafftimetracks();
-CREATE TABLE staffvacancy|BASETABLE.staffvacancy();
-CREATE TABLE staffvacancyyear|BASETABLE.staffvacancyyear();
-CREATE TABLE staffworkplan|BASETABLE.staffworkplan();
-CREATE TABLE workplans|BASETABLE.workplans();
-CREATE TABLE worktypes|BASETABLE.worktypes();
-ALTER TABLE reportperiod|BASETABLE|enddate|date.reportperiod ADD COLUMN enddate date;
-ALTER TABLE reportperiod|BASETABLE|id|integer.reportperiod ADD COLUMN id integer;
-ALTER TABLE reportperiod|BASETABLE|periodname|text.reportperiod ADD COLUMN periodname text;
-ALTER TABLE reportperiod|BASETABLE|startdate|date.reportperiod ADD COLUMN startdate date;
-ALTER TABLE sites|BASETABLE|address|text.sites ADD COLUMN address text;
-ALTER TABLE sites|BASETABLE|city|text.sites ADD COLUMN city text;
-ALTER TABLE sites|BASETABLE|country|text.sites ADD COLUMN country text;
-ALTER TABLE sites|BASETABLE|created|timestampwithouttimezone.sites ADD COLUMN created timestampwithouttimezone;
-ALTER TABLE sites|BASETABLE|id|integer.sites ADD COLUMN id integer;
-ALTER TABLE sites|BASETABLE|id_timetracker|integer.sites ADD COLUMN id_timetracker integer;
-ALTER TABLE sites|BASETABLE|modified|timestampwithouttimezone.sites ADD COLUMN modified timestampwithouttimezone;
-ALTER TABLE sites|BASETABLE|sitename|text.sites ADD COLUMN sitename text;
-ALTER TABLE sites|BASETABLE|timeclockhost|text.sites ADD COLUMN timeclockhost text;
-ALTER TABLE sites|BASETABLE|zip|text.sites ADD COLUMN zip text;
-ALTER TABLE staff|BASETABLE|birthdate|date.staff ADD COLUMN birthdate date;
-ALTER TABLE staff|BASETABLE|entrydate|date.staff ADD COLUMN entrydate date;
-ALTER TABLE staff|BASETABLE|job|text.staff ADD COLUMN job text;
-ALTER TABLE staff|BASETABLE|leavedate|date.staff ADD COLUMN leavedate date;
-ALTER TABLE staff|BASETABLE|staffnumber|text.staff ADD COLUMN staffnumber text;
-ALTER TABLE staffcontract|BASETABLE|id|integer.staffcontract ADD COLUMN id integer;
-ALTER TABLE staffcontract|BASETABLE|id_staffgroup|integer.staffcontract ADD COLUMN id_staffgroup integer;
-ALTER TABLE staffcontract|BASETABLE|id_staff|integer.staffcontract ADD COLUMN id_staff integer;
-ALTER TABLE staffcontract|BASETABLE|monthhours|numeric.staffcontract ADD COLUMN monthhours numeric;
-ALTER TABLE staffcontract|BASETABLE|startdate|date.staffcontract ADD COLUMN startdate date;
-ALTER TABLE staffcontract|BASETABLE|weekhours|numeric.staffcontract ADD COLUMN weekhours numeric;
-ALTER TABLE staffgroups|BASETABLE|groupcolor|text.staffgroups ADD COLUMN groupcolor text;
-ALTER TABLE staffgroups|BASETABLE|groupname|text.staffgroups ADD COLUMN groupname text;
-ALTER TABLE staffgroups|BASETABLE|id|integer.staffgroups ADD COLUMN id integer;
-ALTER TABLE stafftimetracks|BASETABLE|created|timestampwithouttimezone.stafftimetracks ADD COLUMN created timestampwithouttimezone;
-ALTER TABLE stafftimetracks|BASETABLE|id|bigint.stafftimetracks ADD COLUMN id bigint;
-ALTER TABLE stafftimetracks|BASETABLE|id_staff|integer.stafftimetracks ADD COLUMN id_staff integer;
-ALTER TABLE stafftimetracks|BASETABLE|modified|timestampwithouttimezone.stafftimetracks ADD COLUMN modified timestampwithouttimezone;
-ALTER TABLE stafftimetracks|BASETABLE|stamp_in|timestampwithouttimezone.stafftimetracks ADD COLUMN stamp_in timestampwithouttimezone;
-ALTER TABLE stafftimetracks|BASETABLE|stamp_out|timestampwithouttimezone.stafftimetracks ADD COLUMN stamp_out timestampwithouttimezone;
-ALTER TABLE stafftimetracks|BASETABLE|tracktype|text.stafftimetracks ADD COLUMN tracktype text;
-ALTER TABLE staffvacancy|BASETABLE|dayhours|timewithouttimezone.staffvacancy ADD COLUMN dayhours timewithouttimezone;
-ALTER TABLE staffvacancy|BASETABLE|enddate|date.staffvacancy ADD COLUMN enddate date;
-ALTER TABLE staffvacancy|BASETABLE|id|integer.staffvacancy ADD COLUMN id integer;
-ALTER TABLE staffvacancy|BASETABLE|id_staff|integer.staffvacancy ADD COLUMN id_staff integer;
-ALTER TABLE staffvacancy|BASETABLE|note|text.staffvacancy ADD COLUMN note text;
-ALTER TABLE staffvacancy|BASETABLE|startdate|date.staffvacancy ADD COLUMN startdate date;
-ALTER TABLE staffvacancy|BASETABLE|vacancytype|text.staffvacancy ADD COLUMN vacancytype text;
-ALTER TABLE staffvacancy|BASETABLE|validated|boolean.staffvacancy ADD COLUMN validated boolean;
-ALTER TABLE staffvacancyyear|BASETABLE|days|numeric.staffvacancyyear ADD COLUMN days numeric;
-ALTER TABLE staffvacancyyear|BASETABLE|hours|numeric.staffvacancyyear ADD COLUMN hours numeric;
-ALTER TABLE staffvacancyyear|BASETABLE|id|integer.staffvacancyyear ADD COLUMN id integer;
-ALTER TABLE staffvacancyyear|BASETABLE|id_staff|integer.staffvacancyyear ADD COLUMN id_staff integer;
-ALTER TABLE staffvacancyyear|BASETABLE|vyear|integer.staffvacancyyear ADD COLUMN vyear integer;
-ALTER TABLE staffworkplan|BASETABLE|daydate|date.staffworkplan ADD COLUMN daydate date;
-ALTER TABLE staffworkplan|BASETABLE|id|bigint.staffworkplan ADD COLUMN id bigint;
-ALTER TABLE staffworkplan|BASETABLE|id_staff|integer.staffworkplan ADD COLUMN id_staff integer;
-ALTER TABLE staffworkplan|BASETABLE|timeend1|timewithouttimezone.staffworkplan ADD COLUMN timeend1 timewithouttimezone;
-ALTER TABLE staffworkplan|BASETABLE|timeend2|timewithouttimezone.staffworkplan ADD COLUMN timeend2 timewithouttimezone;
-ALTER TABLE staffworkplan|BASETABLE|timepause|timewithouttimezone.staffworkplan ADD COLUMN timepause timewithouttimezone;
-ALTER TABLE staffworkplan|BASETABLE|timestart1|timewithouttimezone.staffworkplan ADD COLUMN timestart1 timewithouttimezone;
-ALTER TABLE staffworkplan|BASETABLE|timestart2|timewithouttimezone.staffworkplan ADD COLUMN timestart2 timewithouttimezone;
-ALTER TABLE staffworkplan|BASETABLE|vacancyhours|timewithouttimezone.staffworkplan ADD COLUMN vacancyhours timewithouttimezone;
-ALTER TABLE staffworkplan|BASETABLE|vacancytype|text.staffworkplan ADD COLUMN vacancytype text;
-ALTER TABLE workplans|BASETABLE|fri_timeend1|timewithouttimezone.workplans ADD COLUMN fri_timeend1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|fri_timeend2|timewithouttimezone.workplans ADD COLUMN fri_timeend2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|fri_timepause|timewithouttimezone.workplans ADD COLUMN fri_timepause timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|fri_timestart1|timewithouttimezone.workplans ADD COLUMN fri_timestart1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|fri_timestart2|timewithouttimezone.workplans ADD COLUMN fri_timestart2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|id|integer.workplans ADD COLUMN id integer;
-ALTER TABLE workplans|BASETABLE|mon_timeend1|timewithouttimezone.workplans ADD COLUMN mon_timeend1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|mon_timeend2|timewithouttimezone.workplans ADD COLUMN mon_timeend2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|mon_timepause|timewithouttimezone.workplans ADD COLUMN mon_timepause timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|mon_timestart1|timewithouttimezone.workplans ADD COLUMN mon_timestart1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|mon_timestart2|timewithouttimezone.workplans ADD COLUMN mon_timestart2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sat_timeend1|timewithouttimezone.workplans ADD COLUMN sat_timeend1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sat_timeend2|timewithouttimezone.workplans ADD COLUMN sat_timeend2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sat_timepause|timewithouttimezone.workplans ADD COLUMN sat_timepause timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sat_timestart1|timewithouttimezone.workplans ADD COLUMN sat_timestart1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sat_timestart2|timewithouttimezone.workplans ADD COLUMN sat_timestart2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sun_timeend1|timewithouttimezone.workplans ADD COLUMN sun_timeend1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sun_timeend2|timewithouttimezone.workplans ADD COLUMN sun_timeend2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sun_timepause|timewithouttimezone.workplans ADD COLUMN sun_timepause timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sun_timestart1|timewithouttimezone.workplans ADD COLUMN sun_timestart1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|sun_timestart2|timewithouttimezone.workplans ADD COLUMN sun_timestart2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|thu_timeend1|timewithouttimezone.workplans ADD COLUMN thu_timeend1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|thu_timeend2|timewithouttimezone.workplans ADD COLUMN thu_timeend2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|thu_timepause|timewithouttimezone.workplans ADD COLUMN thu_timepause timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|thu_timestart1|timewithouttimezone.workplans ADD COLUMN thu_timestart1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|thu_timestart2|timewithouttimezone.workplans ADD COLUMN thu_timestart2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|tue_timeend1|timewithouttimezone.workplans ADD COLUMN tue_timeend1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|tue_timeend2|timewithouttimezone.workplans ADD COLUMN tue_timeend2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|tue_timepause|timewithouttimezone.workplans ADD COLUMN tue_timepause timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|tue_timestart1|timewithouttimezone.workplans ADD COLUMN tue_timestart1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|tue_timestart2|timewithouttimezone.workplans ADD COLUMN tue_timestart2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|wed_timeend1|timewithouttimezone.workplans ADD COLUMN wed_timeend1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|wed_timeend2|timewithouttimezone.workplans ADD COLUMN wed_timeend2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|wed_timepause|timewithouttimezone.workplans ADD COLUMN wed_timepause timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|wed_timestart1|timewithouttimezone.workplans ADD COLUMN wed_timestart1 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|wed_timestart2|timewithouttimezone.workplans ADD COLUMN wed_timestart2 timewithouttimezone;
-ALTER TABLE workplans|BASETABLE|workplan|text.workplans ADD COLUMN workplan text;
-ALTER TABLE worktypes|BASETABLE|id|integer.worktypes ADD COLUMN id integer;
-ALTER TABLE worktypes|BASETABLE|isfreetime|boolean.worktypes ADD COLUMN isfreetime boolean;
-ALTER TABLE worktypes|BASETABLE|isworktime|boolean.worktypes ADD COLUMN isworktime boolean;
-ALTER TABLE worktypes|BASETABLE|typecolor|text.worktypes ADD COLUMN typecolor text;
-ALTER TABLE worktypes|BASETABLE|worktype|text.worktypes ADD COLUMN worktype text;
+ALTER TABLE public.apps ADD COLUMN id_usergroups json;
+ALTER TABLE public.companies ADD COLUMN reportperiodlength integer;
+ALTER TABLE public.companies ADD COLUMN reportperiodstart date;
+ALTER TABLE public.companies ADD COLUMN reportperiodunit text;
+ALTER TABLE public.users ADD COLUMN id_usergroup integer;
diff --git a/dev/db/potlu_db.demo.columns.live.txt b/dev/db/potlu_db.demo.columns.live.txt
deleted file mode 100644 (file)
index 2c71c0c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-staff|BASETABLE|fingerprint|text
-staff|BASETABLE|id|integer
-staff|BASETABLE|id_user|integer
-staff|BASETABLE|pincde|text
-staff|BASETABLE|prename|text
-staff|BASETABLE|staffident|text
-staff|BASETABLE|stations|json
-staff|BASETABLE|surname|text
-stations|BASETABLE|address|text
-stations|BASETABLE|city|text
-stations|BASETABLE|country|text
-stations|BASETABLE|hostname|text
-stations|BASETABLE|id|integer
-stations|BASETABLE|installdate|date
-stations|BASETABLE|isactive|boolean
-stations|BASETABLE|plz|text
-stations|BASETABLE|station|text
-timetrackuser|BASETABLE|id|bigint
-timetrackuser|BASETABLE|id_staff|integer
-timetrackuser|BASETABLE|stamp_in|timestampwithouttimezone
-timetrackuser|BASETABLE|stamp_out|timestampwithouttimezone
diff --git a/dev/db/potlu_db.demo.tables.live.txt b/dev/db/potlu_db.demo.tables.live.txt
deleted file mode 100644 (file)
index 94dbf2b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-staff|BASETABLE
-stations|BASETABLE
-timetrackuser|BASETABLE
diff --git a/dev/db/potlu_db.newcompanyschema.pg.schema.sql-e b/dev/db/potlu_db.newcompanyschema.pg.schema.sql-e
deleted file mode 100644 (file)
index 28b37cf..0000000
+++ /dev/null
@@ -1,1349 +0,0 @@
-
-
-
-
-CREATE SCHEMA %%NEWSCHEMA%%;
-
-
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.defaultweekworkplan (
-    id integer NOT NULL,
-    id_staff integer,
-    startdate date,
-    mon json,
-    tue json,
-    wed json,
-    thu json,
-    fri json,
-    sat json,
-    sun json
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.defaultweekworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.defaultweekworkplan_id_seq OWNED BY %%NEWSCHEMA%%.defaultweekworkplan.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.defaultworkplan (
-    id bigint NOT NULL,
-    id_staff integer,
-    daydate date,
-    plannedtimes json,
-    vacancytimes json,
-    presencetimes json
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.defaultworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.defaultworkplan_id_seq OWNED BY %%NEWSCHEMA%%.defaultworkplan.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.reportperiod (
-    id integer NOT NULL,
-    periodname text,
-    startdate date,
-    enddate date
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.reportperiod_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.reportperiod_id_seq OWNED BY %%NEWSCHEMA%%.reportperiod.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.sites (
-    id integer NOT NULL,
-    sitename text,
-    address text,
-    zip text,
-    city text,
-    country text,
-    id_timetracker integer,
-    created timestamp without time zone DEFAULT now(),
-    modified timestamp without time zone DEFAULT now(),
-    timeclockhost text
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.sites_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.sites_id_seq OWNED BY %%NEWSCHEMA%%.sites.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.staff (
-    id integer NOT NULL,
-    staffnumber text,
-    surname text,
-    prename text,
-    job text,
-    birthdate date,
-    entrydate date,
-    leavedate date
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.staff_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.staff_id_seq OWNED BY %%NEWSCHEMA%%.staff.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.staffgroups (
-    id integer NOT NULL,
-    groupname text,
-    groupcolor text
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.staffgroups_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.staffgroups_id_seq OWNED BY %%NEWSCHEMA%%.staffgroups.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.staffperiodbase (
-    id integer NOT NULL,
-    id_staff integer,
-    startdate date,
-    monthhours numeric,
-    weekhours numeric
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.staffperiodbase_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.staffperiodbase_id_seq OWNED BY %%NEWSCHEMA%%.staffperiodbase.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.stafftimetracks (
-    id bigint NOT NULL,
-    id_staff integer,
-    stamp_in timestamp without time zone,
-    stamp_out timestamp without time zone,
-    tracktype text,
-    created timestamp without time zone DEFAULT now(),
-    modified timestamp without time zone DEFAULT now()
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.stafftimetracks_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.stafftimetracks_id_seq OWNED BY %%NEWSCHEMA%%.stafftimetracks.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.staffvacancy (
-    id integer NOT NULL,
-    id_staff integer,
-    startdate date,
-    enddate date,
-    vacancytype text,
-    dayhours time without time zone,
-    note text,
-    validated boolean
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.staffvacancy_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.staffvacancy_id_seq OWNED BY %%NEWSCHEMA%%.staffvacancy.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.staffvacancyyear (
-    id integer NOT NULL,
-    id_staff integer,
-    vyear integer,
-    hours numeric,
-    days numeric
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.staffvacancyyear_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.staffvacancyyear_id_seq OWNED BY %%NEWSCHEMA%%.staffvacancyyear.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.staffworkplan (
-    id bigint NOT NULL,
-    id_staff integer,
-    daydate date,
-    timestart1 time without time zone,
-    timeend1 time without time zone,
-    timestart2 time without time zone,
-    timeend2 time without time zone,
-    timepause time without time zone,
-    vacancyhours time without time zone,
-    vacancytype text
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.staffworkplan_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.staffworkplan_id_seq OWNED BY %%NEWSCHEMA%%.staffworkplan.id;
-
-
-
-CREATE VIEW %%NEWSCHEMA%%.vw_reportperiodlist AS
- SELECT reportperiod.id,
-    reportperiod.periodname,
-    reportperiod.startdate,
-    reportperiod.enddate
-   FROM %%NEWSCHEMA%%.reportperiod;
-
-
-
-CREATE VIEW %%NEWSCHEMA%%.vw_stafflist AS
- SELECT staff.id,
-    staff.staffnumber,
-    staff.surname,
-    staff.prename,
-    staff.job,
-    staff.birthdate,
-    staff.entrydate,
-    staff.leavedate,
-    ((staff.surname || ' '::text) || staff.prename) AS dspname
-   FROM %%NEWSCHEMA%%.staff;
-
-
-
-CREATE VIEW %%NEWSCHEMA%%.vw_staffplanned_dayweektotals AS
- SELECT stw2.calweek,
-    stw2.caldate AS dates,
-    stw2.id_staff,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS mon_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_pause,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS mon_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS tue_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_pause,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS tue_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS wed_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_pause,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS wed_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS thu_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_pause,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS thu_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS fri_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_pause,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS fri_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS sat_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_pause,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS sat_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS sun_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_pause,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS sun_timetotal,
-    to_char(sum(((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)), 'HH24:MI'::text) AS week_timetotal
-   FROM ( SELECT staffworkplan.daydate,
-            date_part('week'::text, staffworkplan.daydate) AS calweek,
-            (date_trunc('week'::text, (staffworkplan.daydate)::timestamp with time zone))::date AS caldate,
-            date_part('isodow'::text, staffworkplan.daydate) AS isodow,
-            staffworkplan.id,
-            staffworkplan.id_staff,
-            staffworkplan.timestart1,
-            staffworkplan.timeend1,
-                CASE
-                    WHEN (staffworkplan.timestart1 > staffworkplan.timeend1) THEN ('24:00:00'::time without time zone - ((staffworkplan.timestart1 - staffworkplan.timeend1))::time without time zone)
-                    ELSE (staffworkplan.timeend1 - staffworkplan.timestart1)
-                END AS time1,
-            staffworkplan.timestart2,
-            staffworkplan.timeend2,
-                CASE
-                    WHEN (staffworkplan.timestart2 > staffworkplan.timeend2) THEN ('24:00:00'::time without time zone - ((staffworkplan.timestart2 - staffworkplan.timeend2))::time without time zone)
-                    ELSE (staffworkplan.timeend2 - staffworkplan.timestart2)
-                END AS time2,
-            staffworkplan.timepause
-           FROM %%NEWSCHEMA%%.staffworkplan) stw2
-  GROUP BY stw2.calweek, stw2.caldate, stw2.id_staff;
-
-
-
-CREATE VIEW %%NEWSCHEMA%%.vw_staffworkplan_weekly AS
- SELECT stw2.calweek,
-    to_char((stw2.caldate)::timestamp with time zone, 'YYYY'::text) AS calyear,
-    stw2.caldate AS weekbegin,
-    public.getdateslist(stw2.caldate, 7) AS dates,
-    stw2.id_staff,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS mon_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_pause,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN to_char((stw2.vacancyhours)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS mon_vacancyhours,
-    max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN stw2.vacancytype
-            ELSE NULL::text
-        END) AS mon_vacancytype,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (1)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS mon_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS tue_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_pause,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN to_char((stw2.vacancyhours)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS tue_vacancyhours,
-    max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN stw2.vacancytype
-            ELSE NULL::text
-        END) AS tue_vacancytype,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (2)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS tue_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS wed_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_pause,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN to_char((stw2.vacancyhours)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS wed_vacancyhours,
-    max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN stw2.vacancytype
-            ELSE NULL::text
-        END) AS wed_vacancytype,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (3)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS wed_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS thu_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_pause,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN to_char((stw2.vacancyhours)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS thu_vacancyhours,
-    max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN stw2.vacancytype
-            ELSE NULL::text
-        END) AS thu_vacancytype,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (4)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS thu_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS fri_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_pause,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN to_char((stw2.vacancyhours)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS fri_vacancyhours,
-    max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN stw2.vacancytype
-            ELSE NULL::text
-        END) AS fri_vacancytype,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (5)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS fri_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS sat_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_pause,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN to_char((stw2.vacancyhours)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sat_vacancyhours,
-    max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN stw2.vacancytype
-            ELSE NULL::text
-        END) AS sat_vacancytype,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (6)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS sat_timetotal,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN stw2.id
-            ELSE NULL::bigint
-        END) AS sun_id,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timestart1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_start1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timeend1)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_end1,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timestart2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_start2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timeend2)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_end2,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.timepause)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_pause,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN to_char((stw2.vacancyhours)::interval, 'HH24:MI'::text)
-            ELSE NULL::text
-        END) AS sun_vacancyhours,
-    max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN stw2.vacancytype
-            ELSE NULL::text
-        END) AS sun_vacancytype,
-    to_char(max(
-        CASE
-            WHEN (stw2.isodow = (7)::double precision) THEN ((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)
-            ELSE NULL::interval
-        END), 'HH24:MI'::text) AS sun_timetotal,
-    to_char(sum(((stw2.time1 + stw2.time2) - (stw2.timepause)::interval)), 'HH24:MI'::text) AS week_timetotal
-   FROM ( SELECT staffworkplan.daydate,
-            date_part('week'::text, staffworkplan.daydate) AS calweek,
-            (date_trunc('week'::text, (staffworkplan.daydate)::timestamp with time zone))::date AS caldate,
-            date_part('isodow'::text, staffworkplan.daydate) AS isodow,
-            staffworkplan.id,
-            staffworkplan.id_staff,
-            staffworkplan.timestart1,
-            staffworkplan.timeend1,
-            staffworkplan.vacancyhours,
-            staffworkplan.vacancytype,
-                CASE
-                    WHEN (staffworkplan.timestart1 > staffworkplan.timeend1) THEN ('24:00:00'::time without time zone - ((staffworkplan.timestart1 - staffworkplan.timeend1))::time without time zone)
-                    ELSE (staffworkplan.timeend1 - staffworkplan.timestart1)
-                END AS time1,
-            staffworkplan.timestart2,
-            staffworkplan.timeend2,
-                CASE
-                    WHEN (staffworkplan.timestart2 > staffworkplan.timeend2) THEN ('24:00:00'::time without time zone - ((staffworkplan.timestart2 - staffworkplan.timeend2))::time without time zone)
-                    ELSE (staffworkplan.timeend2 - staffworkplan.timestart2)
-                END AS time2,
-            staffworkplan.timepause
-           FROM %%NEWSCHEMA%%.staffworkplan) stw2
-  GROUP BY stw2.calweek, stw2.caldate, stw2.id_staff;
-
-
-
-CREATE VIEW %%NEWSCHEMA%%.vw_staffworkplanlist AS
- SELECT st.id AS id_staff,
-    ((st.surname || ' '::text) || st.prename) AS staffname,
-    (((((('Semaine '::text || sp_dwt.calweek) || '<br/>('::text) || to_char((sp_dwt.weekbegin)::timestamp with time zone, 'DD.MM.YYYY'::text)) || ' - '::text) || to_char((date((sp_dwt.weekbegin + '7 days'::interval)))::timestamp with time zone, 'DD.MM.YYYY'::text)) || ')'::text) AS calweek,
-    sp_dwt.week_timetotal,
-    sp_dwt.weekbegin AS weekstart,
-    date((sp_dwt.weekbegin + '7 days'::interval)) AS weekend,
-    to_char(((((((
-        CASE
-            WHEN (sp_dwt.mon_vacancytype = 'ill'::text) THEN COALESCE((sp_dwt.mon_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END +
-        CASE
-            WHEN (sp_dwt.tue_vacancytype = 'ill'::text) THEN COALESCE((sp_dwt.tue_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.wed_vacancytype = 'ill'::text) THEN COALESCE((sp_dwt.wed_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.thu_vacancytype = 'ill'::text) THEN COALESCE((sp_dwt.thu_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.fri_vacancytype = 'ill'::text) THEN COALESCE((sp_dwt.fri_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.sat_vacancytype = 'ill'::text) THEN COALESCE((sp_dwt.sat_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.sun_vacancytype = 'ill'::text) THEN COALESCE((sp_dwt.sun_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END), 'HH24:MI'::text) AS weekvacancy_times_ill,
-    to_char(((((((
-        CASE
-            WHEN (sp_dwt.mon_vacancytype <> 'ill'::text) THEN COALESCE((sp_dwt.mon_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END +
-        CASE
-            WHEN (sp_dwt.tue_vacancytype <> 'ill'::text) THEN COALESCE((sp_dwt.tue_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.wed_vacancytype <> 'ill'::text) THEN COALESCE((sp_dwt.wed_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.thu_vacancytype <> 'ill'::text) THEN COALESCE((sp_dwt.thu_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.fri_vacancytype <> 'ill'::text) THEN COALESCE((sp_dwt.fri_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.sat_vacancytype <> 'ill'::text) THEN COALESCE((sp_dwt.sat_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END) +
-        CASE
-            WHEN (sp_dwt.sun_vacancytype <> 'ill'::text) THEN COALESCE((sp_dwt.sun_vacancyhours)::interval, '00:00:00'::interval)
-            ELSE '00:00:00'::interval
-        END), 'HH24:MI'::text) AS weekvacancy_times,
-    ((((((
-        CASE
-            WHEN (sp_dwt.mon_vacancytype = 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.mon_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.mon_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END +
-        CASE
-            WHEN (sp_dwt.tue_vacancytype = 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.tue_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.tue_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.wed_vacancytype = 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.wed_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.wed_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.thu_vacancytype = 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.thu_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.thu_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.fri_vacancytype = 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.fri_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.fri_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.sat_vacancytype = 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.sat_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.sat_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.sun_vacancytype = 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.sun_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.sun_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) AS weekvacancy_minutes_ill,
-    ((((((
-        CASE
-            WHEN (sp_dwt.mon_vacancytype <> 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.mon_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.mon_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END +
-        CASE
-            WHEN (sp_dwt.tue_vacancytype <> 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.tue_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.tue_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.wed_vacancytype <> 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.wed_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.wed_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.thu_vacancytype <> 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.thu_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.thu_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.fri_vacancytype <> 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.fri_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.fri_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.sat_vacancytype <> 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.sat_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.sat_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) +
-        CASE
-            WHEN (sp_dwt.sun_vacancytype <> 'ill'::text) THEN COALESCE(((to_number("left"(sp_dwt.sun_vacancyhours, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.sun_vacancyhours, 2), '99'::text)), (0)::numeric)
-            ELSE (0)::numeric
-        END) AS weekvacancy_minutes,
-    ((to_number("left"(sp_dwt.week_timetotal, 2), '99'::text) * (60)::numeric) + to_number("right"(sp_dwt.week_timetotal, 2), '99'::text)) AS weekminutes,
-    sp_dwt.mon_id,
-    sp_dwt.weekbegin AS mon_date,
-    ((COALESCE(((to_char((sp_dwt.mon_start1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((sp_dwt.mon_end1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((sp_dwt.mon_start2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((sp_dwt.mon_end2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE(((('<br/>CongĂ© '::text || sp_dwt.mon_vacancytype) || ': '::text) || to_char((sp_dwt.mon_vacancyhours)::interval, 'HH24:MI'::text)), ''::text)) AS dspmontimes,
-    sp_dwt.mon_timetotal,
-    sp_dwt.tue_id,
-    date((sp_dwt.weekbegin + '1 day'::interval)) AS tue_date,
-    ((COALESCE(((to_char((sp_dwt.tue_start1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((sp_dwt.tue_end1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((sp_dwt.tue_start2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((sp_dwt.tue_end2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE(((('<br/>CongĂ© '::text || sp_dwt.tue_vacancytype) || ': '::text) || to_char((sp_dwt.tue_vacancyhours)::interval, 'HH24:MI'::text)), ''::text)) AS dsptuetimes,
-    sp_dwt.tue_timetotal,
-    sp_dwt.wed_id,
-    date((sp_dwt.weekbegin + '2 days'::interval)) AS wed_date,
-    ((COALESCE(((to_char((sp_dwt.wed_start1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((sp_dwt.wed_end1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((sp_dwt.wed_start2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((sp_dwt.wed_end2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE(((('<br/>CongĂ© '::text || sp_dwt.wed_vacancytype) || ': '::text) || to_char((sp_dwt.wed_vacancyhours)::interval, 'HH24:MI'::text)), ''::text)) AS dspwedtimes,
-    sp_dwt.wed_timetotal,
-    sp_dwt.thu_id,
-    date((sp_dwt.weekbegin + '3 days'::interval)) AS thu_date,
-    ((COALESCE(((to_char((sp_dwt.thu_start1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((sp_dwt.thu_end1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((sp_dwt.thu_start2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((sp_dwt.thu_end2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE(((('<br/>CongĂ© '::text || sp_dwt.thu_vacancytype) || ': '::text) || to_char((sp_dwt.thu_vacancyhours)::interval, 'HH24:MI'::text)), ''::text)) AS dspthutimes,
-    sp_dwt.thu_timetotal,
-    sp_dwt.fri_id,
-    date((sp_dwt.weekbegin + '4 days'::interval)) AS fri_date,
-    ((COALESCE(((to_char((sp_dwt.fri_start1)::interval, 'HH24:MI'::text) || ' -'::text) || to_char((sp_dwt.fri_end1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((sp_dwt.fri_start2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((sp_dwt.fri_end2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE(((('<br/>CongĂ© '::text || sp_dwt.fri_vacancytype) || ': '::text) || to_char((sp_dwt.fri_vacancyhours)::interval, 'HH24:MI'::text)), ''::text)) AS dspfritimes,
-    sp_dwt.fri_timetotal,
-    sp_dwt.sat_id,
-    date((sp_dwt.weekbegin + '5 days'::interval)) AS sat_date,
-    ((COALESCE(((to_char((sp_dwt.sat_start1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((sp_dwt.sat_end1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((sp_dwt.sat_start2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((sp_dwt.sat_end2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE(((('<br/>CongĂ© '::text || sp_dwt.sat_vacancytype) || ': '::text) || to_char((sp_dwt.sat_vacancyhours)::interval, 'HH24:MI'::text)), ''::text)) AS dspsattimes,
-    sp_dwt.sat_timetotal,
-    sp_dwt.sun_id,
-    date((sp_dwt.weekbegin + '6 days'::interval)) AS sun_date,
-    ((COALESCE(((to_char((sp_dwt.sun_start1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((sp_dwt.sun_end1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((sp_dwt.sun_start2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((sp_dwt.sun_end2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE(((('<br/>CongĂ© '::text || sp_dwt.sun_vacancytype) || ': '::text) || to_char((sp_dwt.sun_vacancyhours)::interval, 'HH24:MI'::text)), ''::text)) AS dspsuntimes,
-    sp_dwt.sun_timetotal
-   FROM (%%NEWSCHEMA%%.vw_staffworkplan_weekly sp_dwt
-     LEFT JOIN %%NEWSCHEMA%%.staff st ON ((sp_dwt.id_staff = st.id)))
-  ORDER BY sp_dwt.calweek;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.workplans (
-    id integer NOT NULL,
-    workplan text,
-    mon_timestart1 time without time zone,
-    mon_timeend1 time without time zone,
-    mon_timestart2 time without time zone,
-    mon_timeend2 time without time zone,
-    mon_timepause time without time zone,
-    tue_timestart1 time without time zone,
-    tue_timeend1 time without time zone,
-    tue_timestart2 time without time zone,
-    tue_timeend2 time without time zone,
-    tue_timepause time without time zone,
-    wed_timestart1 time without time zone,
-    wed_timeend1 time without time zone,
-    wed_timestart2 time without time zone,
-    wed_timeend2 time without time zone,
-    wed_timepause time without time zone,
-    thu_timestart1 time without time zone,
-    thu_timeend1 time without time zone,
-    thu_timestart2 time without time zone,
-    thu_timeend2 time without time zone,
-    thu_timepause time without time zone,
-    fri_timestart1 time without time zone,
-    fri_timeend1 time without time zone,
-    fri_timestart2 time without time zone,
-    fri_timeend2 time without time zone,
-    fri_timepause time without time zone,
-    sat_timestart1 time without time zone,
-    sat_timeend1 time without time zone,
-    sat_timestart2 time without time zone,
-    sat_timeend2 time without time zone,
-    sat_timepause time without time zone,
-    sun_timestart1 time without time zone,
-    sun_timeend1 time without time zone,
-    sun_timestart2 time without time zone,
-    sun_timeend2 time without time zone,
-    sun_timepause time without time zone
-);
-
-
-
-CREATE VIEW %%NEWSCHEMA%%.vw_workplanlist AS
- SELECT workplans.id,
-    workplans.workplan
-   FROM %%NEWSCHEMA%%.workplans;
-
-
-
-CREATE VIEW %%NEWSCHEMA%%.vw_workplans AS
- SELECT workplans.id,
-    workplans.workplan,
-    ((COALESCE(((to_char((workplans.mon_timestart1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((workplans.mon_timeend1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((workplans.mon_timestart2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((workplans.mon_timeend2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE((('<br/>'::text || 'Pause: '::text) || to_char((workplans.mon_timepause)::interval, 'HH24:MI'::text)), ''::text)) AS dspmontimes,
-    ((COALESCE(((to_char((workplans.tue_timestart1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((workplans.tue_timeend1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((workplans.tue_timestart2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((workplans.tue_timeend2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE((('<br/>'::text || 'Pause: '::text) || to_char((workplans.tue_timepause)::interval, 'HH24:MI'::text)), ''::text)) AS dsptuetimes,
-    ((COALESCE(((to_char((workplans.wed_timestart1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((workplans.wed_timeend1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((workplans.wed_timestart2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((workplans.wed_timeend2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE((('<br/>'::text || 'Pause: '::text) || to_char((workplans.wed_timepause)::interval, 'HH24:MI'::text)), ''::text)) AS dspwedtimes,
-    ((COALESCE(((to_char((workplans.thu_timestart1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((workplans.thu_timeend1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((workplans.thu_timestart2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((workplans.thu_timeend2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE((('<br/>'::text || 'Pause: '::text) || to_char((workplans.thu_timepause)::interval, 'HH24:MI'::text)), ''::text)) AS dspthutimes,
-    ((COALESCE(((to_char((workplans.fri_timestart1)::interval, 'HH24:MI'::text) || ' -'::text) || to_char((workplans.fri_timeend1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((workplans.fri_timestart2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((workplans.fri_timeend2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE((('<br/>'::text || 'Pause: '::text) || to_char((workplans.fri_timepause)::interval, 'HH24:MI'::text)), ''::text)) AS dspfritimes,
-    ((COALESCE(((to_char((workplans.sat_timestart1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((workplans.sat_timeend1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((workplans.sat_timestart2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((workplans.sat_timeend2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE((('<br/>'::text || 'Pause: '::text) || to_char((workplans.sat_timepause)::interval, 'HH24:MI'::text)), ''::text)) AS dspsattimes,
-    ((COALESCE(((to_char((workplans.sun_timestart1)::interval, 'HH24:MI'::text) || ' - '::text) || to_char((workplans.sun_timeend1)::interval, 'HH24:MI'::text)), ''::text) || COALESCE(((('<br/>'::text || to_char((workplans.sun_timestart2)::interval, 'HH24:MI'::text)) || ' - '::text) || to_char((workplans.sun_timeend2)::interval, 'HH24:MI'::text)), ''::text)) || COALESCE((('<br/>'::text || 'Pause: '::text) || to_char((workplans.sun_timepause)::interval, 'HH24:MI'::text)), ''::text)) AS dspsuntimes
-   FROM %%NEWSCHEMA%%.workplans;
-
-
-
-CREATE VIEW %%NEWSCHEMA%%.vw_workplansdata AS
- SELECT workplans.id,
-    workplans.workplan,
-    to_char((workplans.mon_timestart1)::interval, 'HH24:MI'::text) AS mon_timestart1,
-    to_char((workplans.mon_timeend1)::interval, 'HH24:MI'::text) AS mon_timeend1,
-    to_char((workplans.mon_timestart2)::interval, 'HH24:MI'::text) AS mon_timestart2,
-    to_char((workplans.mon_timeend2)::interval, 'HH24:MI'::text) AS mon_timeend2,
-    to_char((workplans.mon_timepause)::interval, 'HH24:MI'::text) AS mon_timepause,
-    to_char((workplans.tue_timestart1)::interval, 'HH24:MI'::text) AS tue_timestart1,
-    to_char((workplans.tue_timeend1)::interval, 'HH24:MI'::text) AS tue_timeend1,
-    to_char((workplans.tue_timestart2)::interval, 'HH24:MI'::text) AS tue_timestart2,
-    to_char((workplans.tue_timeend2)::interval, 'HH24:MI'::text) AS tue_timeend2,
-    to_char((workplans.tue_timepause)::interval, 'HH24:MI'::text) AS tue_timepause,
-    to_char((workplans.wed_timestart1)::interval, 'HH24:MI'::text) AS wed_timestart1,
-    to_char((workplans.wed_timeend1)::interval, 'HH24:MI'::text) AS wed_timeend1,
-    to_char((workplans.wed_timestart2)::interval, 'HH24:MI'::text) AS wed_timestart2,
-    to_char((workplans.wed_timeend2)::interval, 'HH24:MI'::text) AS wed_timeend2,
-    to_char((workplans.wed_timepause)::interval, 'HH24:MI'::text) AS wed_timepause,
-    to_char((workplans.thu_timestart1)::interval, 'HH24:MI'::text) AS thu_timestart1,
-    to_char((workplans.thu_timeend1)::interval, 'HH24:MI'::text) AS thu_timeend1,
-    to_char((workplans.thu_timestart2)::interval, 'HH24:MI'::text) AS thu_timestart2,
-    to_char((workplans.thu_timeend2)::interval, 'HH24:MI'::text) AS thu_timeend2,
-    to_char((workplans.thu_timepause)::interval, 'HH24:MI'::text) AS thu_timepause,
-    to_char((workplans.fri_timestart1)::interval, 'HH24:MI'::text) AS fri_timestart1,
-    to_char((workplans.fri_timeend1)::interval, 'HH24:MI'::text) AS fri_timeend1,
-    to_char((workplans.fri_timestart2)::interval, 'HH24:MI'::text) AS fri_timestart2,
-    to_char((workplans.fri_timeend2)::interval, 'HH24:MI'::text) AS fri_timeend2,
-    to_char((workplans.fri_timepause)::interval, 'HH24:MI'::text) AS fri_timepause,
-    to_char((workplans.sat_timestart1)::interval, 'HH24:MI'::text) AS sat_timestart1,
-    to_char((workplans.sat_timeend1)::interval, 'HH24:MI'::text) AS sat_timeend1,
-    to_char((workplans.sat_timestart2)::interval, 'HH24:MI'::text) AS sat_timestart2,
-    to_char((workplans.sat_timeend2)::interval, 'HH24:MI'::text) AS sat_timeend2,
-    to_char((workplans.sat_timepause)::interval, 'HH24:MI'::text) AS sat_timepause,
-    to_char((workplans.sun_timestart1)::interval, 'HH24:MI'::text) AS sun_timestart1,
-    to_char((workplans.sun_timeend1)::interval, 'HH24:MI'::text) AS sun_timeend1,
-    to_char((workplans.sun_timestart2)::interval, 'HH24:MI'::text) AS sun_timestart2,
-    to_char((workplans.sun_timeend2)::interval, 'HH24:MI'::text) AS sun_timeend2,
-    to_char((workplans.sun_timepause)::interval, 'HH24:MI'::text) AS sun_timepause
-   FROM %%NEWSCHEMA%%.workplans;
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.workplans_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.workplans_id_seq OWNED BY %%NEWSCHEMA%%.workplans.id;
-
-
-
-CREATE TABLE %%NEWSCHEMA%%.worktypes (
-    id integer NOT NULL,
-    worktype text,
-    isworktime boolean,
-    isfreetime boolean,
-    typecolor text
-);
-
-
-
-CREATE SEQUENCE %%NEWSCHEMA%%.worktypes_id_seq
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-
-ALTER SEQUENCE %%NEWSCHEMA%%.worktypes_id_seq OWNED BY %%NEWSCHEMA%%.worktypes.id;
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultweekworkplan ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.defaultweekworkplan_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultworkplan ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.defaultworkplan_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.reportperiod ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.reportperiod_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.sites ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.sites_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staff ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.staff_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffgroups ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.staffgroups_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffperiodbase ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.staffperiodbase_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.stafftimetracks ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.stafftimetracks_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffvacancy ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.staffvacancy_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffvacancyyear ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.staffvacancyyear_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffworkplan ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.staffworkplan_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.workplans ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.workplans_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.worktypes ALTER COLUMN id SET DEFAULT nextval('%%NEWSCHEMA%%.worktypes_id_seq'::regclass);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultweekworkplan
-    ADD CONSTRAINT defaultweekworkplan_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.defaultworkplan
-    ADD CONSTRAINT defaultworkplan_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.reportperiod
-    ADD CONSTRAINT reportperiod_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.sites
-    ADD CONSTRAINT sites_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staff
-    ADD CONSTRAINT staff_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffgroups
-    ADD CONSTRAINT staffgroups_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffperiodbase
-    ADD CONSTRAINT staffperiodbase_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.stafftimetracks
-    ADD CONSTRAINT stafftimetracks_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffvacancy
-    ADD CONSTRAINT staffvacancy_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffvacancyyear
-    ADD CONSTRAINT staffvacancyyear_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.staffworkplan
-    ADD CONSTRAINT staffworkplan_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.workplans
-    ADD CONSTRAINT workplans_pkey PRIMARY KEY (id);
-
-
-
-ALTER TABLE ONLY %%NEWSCHEMA%%.worktypes
-    ADD CONSTRAINT worktypes_pkey PRIMARY KEY (id);
-
-
-
-CREATE TRIGGER trg_upd_%%NEWSCHEMA%%_weekhours BEFORE UPDATE OF weekhours ON %%NEWSCHEMA%%.staffperiodbase FOR EACH ROW EXECUTE PROCEDURE public.trg_update_monthhours();
-
-
-
diff --git a/dev/db/potlu_db.portanova.columns.live.txt b/dev/db/potlu_db.portanova.columns.live.txt
deleted file mode 100644 (file)
index 4be0aaa..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-
-reportperiod|BASETABLE|enddate|date
-reportperiod|BASETABLE|id|integer
-reportperiod|BASETABLE|periodname|text
-reportperiod|BASETABLE|startdate|date
-sites|BASETABLE|address|text
-sites|BASETABLE|city|text
-sites|BASETABLE|country|text
-sites|BASETABLE|created|timestampwithouttimezone
-sites|BASETABLE|id|integer
-sites|BASETABLE|id_timetracker|integer
-sites|BASETABLE|modified|timestampwithouttimezone
-sites|BASETABLE|sitename|text
-sites|BASETABLE|timeclockhost|text
-sites|BASETABLE|zip|text
-staff|BASETABLE|birthdate|date
-staff|BASETABLE|entrydate|date
-staff|BASETABLE|id|integer
-staff|BASETABLE|job|text
-staff|BASETABLE|leavedate|date
-staff|BASETABLE|prename|text
-staff|BASETABLE|staffnumber|text
-staff|BASETABLE|surname|text
-staffcontract|BASETABLE|id|integer
-staffcontract|BASETABLE|id_staffgroup|integer
-staffcontract|BASETABLE|id_staff|integer
-staffcontract|BASETABLE|monthhours|numeric
-staffcontract|BASETABLE|startdate|date
-staffcontract|BASETABLE|weekhours|numeric
-staffgroups|BASETABLE|groupcolor|text
-staffgroups|BASETABLE|groupname|text
-staffgroups|BASETABLE|id|integer
-stafftimetracks|BASETABLE|created|timestampwithouttimezone
-stafftimetracks|BASETABLE|id|bigint
-stafftimetracks|BASETABLE|id_staff|integer
-stafftimetracks|BASETABLE|modified|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_in|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_out|timestampwithouttimezone
-stafftimetracks|BASETABLE|tracktype|text
-staffvacancy|BASETABLE|dayhours|timewithouttimezone
-staffvacancy|BASETABLE|enddate|date
-staffvacancy|BASETABLE|id|integer
-staffvacancy|BASETABLE|id_staff|integer
-staffvacancy|BASETABLE|note|text
-staffvacancy|BASETABLE|startdate|date
-staffvacancy|BASETABLE|vacancytype|text
-staffvacancy|BASETABLE|validated|boolean
-staffvacancyyear|BASETABLE|days|numeric
-staffvacancyyear|BASETABLE|hours|numeric
-staffvacancyyear|BASETABLE|id|integer
-staffvacancyyear|BASETABLE|id_staff|integer
-staffvacancyyear|BASETABLE|vyear|integer
-staffworkplan|BASETABLE|daydate|date
-staffworkplan|BASETABLE|id|bigint
-staffworkplan|BASETABLE|id_staff|integer
-staffworkplan|BASETABLE|timeend1|timewithouttimezone
-staffworkplan|BASETABLE|timeend2|timewithouttimezone
-staffworkplan|BASETABLE|timepause|timewithouttimezone
-staffworkplan|BASETABLE|timestart1|timewithouttimezone
-staffworkplan|BASETABLE|timestart2|timewithouttimezone
-staffworkplan|BASETABLE|vacancyhours|timewithouttimezone
-staffworkplan|BASETABLE|vacancytype|text
-vw_reportperiodlist|VIEW|enddate|date
-vw_reportperiodlist|VIEW|id|integer
-vw_reportperiodlist|VIEW|periodname|text
-vw_reportperiodlist|VIEW|startdate|date
-vw_staffcontractdata|VIEW|id|integer
-vw_staffcontractdata|VIEW|id_staffgroup|integer
-vw_staffcontractdata|VIEW|id_staff|integer
-vw_staffcontractdata|VIEW|monthhours|numeric
-vw_staffcontractdata|VIEW|startdate|date
-vw_staffcontractdata|VIEW|weekhours|numeric
-vw_staffcontractlist|VIEW|groupcolor|text
-vw_staffcontractlist|VIEW|groupname|text
-vw_staffcontractlist|VIEW|id|integer
-vw_staffcontractlist|VIEW|id_staffgroup|integer
-vw_staffcontractlist|VIEW|id_staff|integer
-vw_staffcontractlist|VIEW|monthhours|numeric
-vw_staffcontractlist|VIEW|startdate|date
-vw_staffcontractlist|VIEW|weekhours|numeric
-vw_staffdata|VIEW|birthdate|date
-vw_staffdata|VIEW|entrydate|date
-vw_staffdata|VIEW|id|integer
-vw_staffdata|VIEW|job|text
-vw_staffdata|VIEW|leavedate|date
-vw_staffdata|VIEW|prename|text
-vw_staffdata|VIEW|staffnumber|text
-vw_staffdata|VIEW|surname|text
-vw_staffgroupsdata|VIEW|groupcolor|text
-vw_staffgroupsdata|VIEW|groupname|text
-vw_staffgroupsdata|VIEW|id|integer
-vw_staffgroupslist|VIEW|groupcolor|text
-vw_staffgroupslist|VIEW|groupname|text
-vw_staffgroupslist|VIEW|id|integer
-vw_stafflist|VIEW|birthdate|date
-vw_stafflist|VIEW|dspname|text
-vw_stafflist|VIEW|entrydate|date
-vw_stafflist|VIEW|id|integer
-vw_stafflist|VIEW|job|text
-vw_stafflist|VIEW|leavedate|date
-vw_stafflist|VIEW|prename|text
-vw_stafflist|VIEW|staffnumber|text
-vw_stafflist|VIEW|surname|text
-vw_staffplanned_dayweektotals|VIEW|calweek|doubleprecision
-vw_staffplanned_dayweektotals|VIEW|dates|date
-vw_staffplanned_dayweektotals|VIEW|fri_end1|text
-vw_staffplanned_dayweektotals|VIEW|fri_end2|text
-vw_staffplanned_dayweektotals|VIEW|fri_id|bigint
-vw_staffplanned_dayweektotals|VIEW|fri_pause|text
-vw_staffplanned_dayweektotals|VIEW|fri_start1|text
-vw_staffplanned_dayweektotals|VIEW|fri_start2|text
-vw_staffplanned_dayweektotals|VIEW|fri_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|id_staff|integer
-vw_staffplanned_dayweektotals|VIEW|mon_end1|text
-vw_staffplanned_dayweektotals|VIEW|mon_end2|text
-vw_staffplanned_dayweektotals|VIEW|mon_id|bigint
-vw_staffplanned_dayweektotals|VIEW|mon_pause|text
-vw_staffplanned_dayweektotals|VIEW|mon_start1|text
-vw_staffplanned_dayweektotals|VIEW|mon_start2|text
-vw_staffplanned_dayweektotals|VIEW|mon_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|sat_end1|text
-vw_staffplanned_dayweektotals|VIEW|sat_end2|text
-vw_staffplanned_dayweektotals|VIEW|sat_id|bigint
-vw_staffplanned_dayweektotals|VIEW|sat_pause|text
-vw_staffplanned_dayweektotals|VIEW|sat_start1|text
-vw_staffplanned_dayweektotals|VIEW|sat_start2|text
-vw_staffplanned_dayweektotals|VIEW|sat_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|sun_end1|text
-vw_staffplanned_dayweektotals|VIEW|sun_end2|text
-vw_staffplanned_dayweektotals|VIEW|sun_id|bigint
-vw_staffplanned_dayweektotals|VIEW|sun_pause|text
-vw_staffplanned_dayweektotals|VIEW|sun_start1|text
-vw_staffplanned_dayweektotals|VIEW|sun_start2|text
-vw_staffplanned_dayweektotals|VIEW|sun_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|thu_end1|text
-vw_staffplanned_dayweektotals|VIEW|thu_end2|text
-vw_staffplanned_dayweektotals|VIEW|thu_id|bigint
-vw_staffplanned_dayweektotals|VIEW|thu_pause|text
-vw_staffplanned_dayweektotals|VIEW|thu_start1|text
-vw_staffplanned_dayweektotals|VIEW|thu_start2|text
-vw_staffplanned_dayweektotals|VIEW|thu_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|tue_end1|text
-vw_staffplanned_dayweektotals|VIEW|tue_end2|text
-vw_staffplanned_dayweektotals|VIEW|tue_id|bigint
-vw_staffplanned_dayweektotals|VIEW|tue_pause|text
-vw_staffplanned_dayweektotals|VIEW|tue_start1|text
-vw_staffplanned_dayweektotals|VIEW|tue_start2|text
-vw_staffplanned_dayweektotals|VIEW|tue_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|wed_end1|text
-vw_staffplanned_dayweektotals|VIEW|wed_end2|text
-vw_staffplanned_dayweektotals|VIEW|wed_id|bigint
-vw_staffplanned_dayweektotals|VIEW|wed_pause|text
-vw_staffplanned_dayweektotals|VIEW|wed_start1|text
-vw_staffplanned_dayweektotals|VIEW|wed_start2|text
-vw_staffplanned_dayweektotals|VIEW|wed_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|week_timetotal|text
-vw_staffworkplanlist|VIEW|calweek|integer
-vw_staffworkplanlist|VIEW|calyear|text
-vw_staffworkplanlist|VIEW|dspcalweek|text
-vw_staffworkplanlist|VIEW|dspfritimes|text
-vw_staffworkplanlist|VIEW|dspmontimes|text
-vw_staffworkplanlist|VIEW|dspsattimes|text
-vw_staffworkplanlist|VIEW|dspsuntimes|text
-vw_staffworkplanlist|VIEW|dspthutimes|text
-vw_staffworkplanlist|VIEW|dsptuetimes|text
-vw_staffworkplanlist|VIEW|dspwedtimes|text
-vw_staffworkplanlist|VIEW|fri_date|date
-vw_staffworkplanlist|VIEW|fri_id|bigint
-vw_staffworkplanlist|VIEW|fri_timetotal|text
-vw_staffworkplanlist|VIEW|id_staff|integer
-vw_staffworkplanlist|VIEW|mon_date|date
-vw_staffworkplanlist|VIEW|mon_id|bigint
-vw_staffworkplanlist|VIEW|mon_timetotal|text
-vw_staffworkplanlist|VIEW|sat_date|date
-vw_staffworkplanlist|VIEW|sat_id|bigint
-vw_staffworkplanlist|VIEW|sat_timetotal|text
-vw_staffworkplanlist|VIEW|staffname|text
-vw_staffworkplanlist|VIEW|sun_date|date
-vw_staffworkplanlist|VIEW|sun_id|bigint
-vw_staffworkplanlist|VIEW|sun_timetotal|text
-vw_staffworkplanlist|VIEW|thu_date|date
-vw_staffworkplanlist|VIEW|thu_id|bigint
-vw_staffworkplanlist|VIEW|thu_timetotal|text
-vw_staffworkplanlist|VIEW|tue_date|date
-vw_staffworkplanlist|VIEW|tue_id|bigint
-vw_staffworkplanlist|VIEW|tue_timetotal|text
-vw_staffworkplanlist|VIEW|wed_date|date
-vw_staffworkplanlist|VIEW|wed_id|bigint
-vw_staffworkplanlist|VIEW|wed_timetotal|text
-vw_staffworkplanlist|VIEW|weekend|date
-vw_staffworkplanlist|VIEW|weekminutes|numeric
-vw_staffworkplanlist|VIEW|weekstart|date
-vw_staffworkplanlist|VIEW|week_timetotal|text
-vw_staffworkplanlist|VIEW|weekvacancy_minutes_ill|numeric
-vw_staffworkplanlist|VIEW|weekvacancy_minutes|numeric
-vw_staffworkplanlist|VIEW|weekvacancy_times_ill|text
-vw_staffworkplanlist|VIEW|weekvacancy_times|text
-vw_staffworkplan_weekly|VIEW|calweek|doubleprecision
-vw_staffworkplan_weekly|VIEW|calyear|text
-vw_staffworkplan_weekly|VIEW|dates|text
-vw_staffworkplan_weekly|VIEW|fri_id|bigint
-vw_staffworkplan_weekly|VIEW|fri_timeend1|text
-vw_staffworkplan_weekly|VIEW|fri_timeend2|text
-vw_staffworkplan_weekly|VIEW|fri_timepause|text
-vw_staffworkplan_weekly|VIEW|fri_timestart1|text
-vw_staffworkplan_weekly|VIEW|fri_timestart2|text
-vw_staffworkplan_weekly|VIEW|fri_timetotal|text
-vw_staffworkplan_weekly|VIEW|fri_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|fri_vacancytype|text
-vw_staffworkplan_weekly|VIEW|id_staff|integer
-vw_staffworkplan_weekly|VIEW|mon_id|bigint
-vw_staffworkplan_weekly|VIEW|mon_timeend1|text
-vw_staffworkplan_weekly|VIEW|mon_timeend2|text
-vw_staffworkplan_weekly|VIEW|mon_timepause|text
-vw_staffworkplan_weekly|VIEW|mon_timestart1|text
-vw_staffworkplan_weekly|VIEW|mon_timestart2|text
-vw_staffworkplan_weekly|VIEW|mon_timetotal|text
-vw_staffworkplan_weekly|VIEW|mon_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|mon_vacancytype|text
-vw_staffworkplan_weekly|VIEW|sat_id|bigint
-vw_staffworkplan_weekly|VIEW|sat_timeend1|text
-vw_staffworkplan_weekly|VIEW|sat_timeend2|text
-vw_staffworkplan_weekly|VIEW|sat_timepause|text
-vw_staffworkplan_weekly|VIEW|sat_timestart1|text
-vw_staffworkplan_weekly|VIEW|sat_timestart2|text
-vw_staffworkplan_weekly|VIEW|sat_timetotal|text
-vw_staffworkplan_weekly|VIEW|sat_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|sat_vacancytype|text
-vw_staffworkplan_weekly|VIEW|sun_id|bigint
-vw_staffworkplan_weekly|VIEW|sun_timeend1|text
-vw_staffworkplan_weekly|VIEW|sun_timeend2|text
-vw_staffworkplan_weekly|VIEW|sun_timepause|text
-vw_staffworkplan_weekly|VIEW|sun_timestart1|text
-vw_staffworkplan_weekly|VIEW|sun_timestart2|text
-vw_staffworkplan_weekly|VIEW|sun_timetotal|text
-vw_staffworkplan_weekly|VIEW|sun_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|sun_vacancytype|text
-vw_staffworkplan_weekly|VIEW|thu_id|bigint
-vw_staffworkplan_weekly|VIEW|thu_timeend1|text
-vw_staffworkplan_weekly|VIEW|thu_timeend2|text
-vw_staffworkplan_weekly|VIEW|thu_timepause|text
-vw_staffworkplan_weekly|VIEW|thu_timestart1|text
-vw_staffworkplan_weekly|VIEW|thu_timestart2|text
-vw_staffworkplan_weekly|VIEW|thu_timetotal|text
-vw_staffworkplan_weekly|VIEW|thu_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|thu_vacancytype|text
-vw_staffworkplan_weekly|VIEW|tue_id|bigint
-vw_staffworkplan_weekly|VIEW|tue_timeend1|text
-vw_staffworkplan_weekly|VIEW|tue_timeend2|text
-vw_staffworkplan_weekly|VIEW|tue_timepause|text
-vw_staffworkplan_weekly|VIEW|tue_timestart1|text
-vw_staffworkplan_weekly|VIEW|tue_timestart2|text
-vw_staffworkplan_weekly|VIEW|tue_timetotal|text
-vw_staffworkplan_weekly|VIEW|tue_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|tue_vacancytype|text
-vw_staffworkplan_weekly|VIEW|wed_id|bigint
-vw_staffworkplan_weekly|VIEW|wed_timeend1|text
-vw_staffworkplan_weekly|VIEW|wed_timeend2|text
-vw_staffworkplan_weekly|VIEW|wed_timepause|text
-vw_staffworkplan_weekly|VIEW|wed_timestart1|text
-vw_staffworkplan_weekly|VIEW|wed_timestart2|text
-vw_staffworkplan_weekly|VIEW|wed_timetotal|text
-vw_staffworkplan_weekly|VIEW|wed_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|wed_vacancytype|text
-vw_staffworkplan_weekly|VIEW|weekbegin|date
-vw_staffworkplan_weekly|VIEW|week_timetotal|text
-vw_workplanlist|VIEW|id|integer
-vw_workplanlist|VIEW|workplan|text
-vw_workplansdata|VIEW|fri_timeend1|text
-vw_workplansdata|VIEW|fri_timeend2|text
-vw_workplansdata|VIEW|fri_timepause|text
-vw_workplansdata|VIEW|fri_timestart1|text
-vw_workplansdata|VIEW|fri_timestart2|text
-vw_workplansdata|VIEW|id|integer
-vw_workplansdata|VIEW|mon_timeend1|text
-vw_workplansdata|VIEW|mon_timeend2|text
-vw_workplansdata|VIEW|mon_timepause|text
-vw_workplansdata|VIEW|mon_timestart1|text
-vw_workplansdata|VIEW|mon_timestart2|text
-vw_workplansdata|VIEW|sat_timeend1|text
-vw_workplansdata|VIEW|sat_timeend2|text
-vw_workplansdata|VIEW|sat_timepause|text
-vw_workplansdata|VIEW|sat_timestart1|text
-vw_workplansdata|VIEW|sat_timestart2|text
-vw_workplansdata|VIEW|sun_timeend1|text
-vw_workplansdata|VIEW|sun_timeend2|text
-vw_workplansdata|VIEW|sun_timepause|text
-vw_workplansdata|VIEW|sun_timestart1|text
-vw_workplansdata|VIEW|sun_timestart2|text
-vw_workplansdata|VIEW|thu_timeend1|text
-vw_workplansdata|VIEW|thu_timeend2|text
-vw_workplansdata|VIEW|thu_timepause|text
-vw_workplansdata|VIEW|thu_timestart1|text
-vw_workplansdata|VIEW|thu_timestart2|text
-vw_workplansdata|VIEW|tue_timeend1|text
-vw_workplansdata|VIEW|tue_timeend2|text
-vw_workplansdata|VIEW|tue_timepause|text
-vw_workplansdata|VIEW|tue_timestart1|text
-vw_workplansdata|VIEW|tue_timestart2|text
-vw_workplansdata|VIEW|wed_timeend1|text
-vw_workplansdata|VIEW|wed_timeend2|text
-vw_workplansdata|VIEW|wed_timepause|text
-vw_workplansdata|VIEW|wed_timestart1|text
-vw_workplansdata|VIEW|wed_timestart2|text
-vw_workplansdata|VIEW|workplan|text
-vw_workplans|VIEW|dspfritimes|text
-vw_workplans|VIEW|dspmontimes|text
-vw_workplans|VIEW|dspsattimes|text
-vw_workplans|VIEW|dspsuntimes|text
-vw_workplans|VIEW|dspthutimes|text
-vw_workplans|VIEW|dsptuetimes|text
-vw_workplans|VIEW|dspwedtimes|text
-vw_workplans|VIEW|id|integer
-vw_workplans|VIEW|workplan|text
-workplans|BASETABLE|fri_timeend1|timewithouttimezone
-workplans|BASETABLE|fri_timeend2|timewithouttimezone
-workplans|BASETABLE|fri_timepause|timewithouttimezone
-workplans|BASETABLE|fri_timestart1|timewithouttimezone
-workplans|BASETABLE|fri_timestart2|timewithouttimezone
-workplans|BASETABLE|id|integer
-workplans|BASETABLE|mon_timeend1|timewithouttimezone
-workplans|BASETABLE|mon_timeend2|timewithouttimezone
-workplans|BASETABLE|mon_timepause|timewithouttimezone
-workplans|BASETABLE|mon_timestart1|timewithouttimezone
-workplans|BASETABLE|mon_timestart2|timewithouttimezone
-workplans|BASETABLE|sat_timeend1|timewithouttimezone
-workplans|BASETABLE|sat_timeend2|timewithouttimezone
-workplans|BASETABLE|sat_timepause|timewithouttimezone
-workplans|BASETABLE|sat_timestart1|timewithouttimezone
-workplans|BASETABLE|sat_timestart2|timewithouttimezone
-workplans|BASETABLE|sun_timeend1|timewithouttimezone
-workplans|BASETABLE|sun_timeend2|timewithouttimezone
-workplans|BASETABLE|sun_timepause|timewithouttimezone
-workplans|BASETABLE|sun_timestart1|timewithouttimezone
-workplans|BASETABLE|sun_timestart2|timewithouttimezone
-workplans|BASETABLE|thu_timeend1|timewithouttimezone
-workplans|BASETABLE|thu_timeend2|timewithouttimezone
-workplans|BASETABLE|thu_timepause|timewithouttimezone
-workplans|BASETABLE|thu_timestart1|timewithouttimezone
-workplans|BASETABLE|thu_timestart2|timewithouttimezone
-workplans|BASETABLE|tue_timeend1|timewithouttimezone
-workplans|BASETABLE|tue_timeend2|timewithouttimezone
-workplans|BASETABLE|tue_timepause|timewithouttimezone
-workplans|BASETABLE|tue_timestart1|timewithouttimezone
-workplans|BASETABLE|tue_timestart2|timewithouttimezone
-workplans|BASETABLE|wed_timeend1|timewithouttimezone
-workplans|BASETABLE|wed_timeend2|timewithouttimezone
-workplans|BASETABLE|wed_timepause|timewithouttimezone
-workplans|BASETABLE|wed_timestart1|timewithouttimezone
-workplans|BASETABLE|wed_timestart2|timewithouttimezone
-workplans|BASETABLE|workplan|text
-worktypes|BASETABLE|id|integer
-worktypes|BASETABLE|isfreetime|boolean
-worktypes|BASETABLE|isworktime|boolean
-worktypes|BASETABLE|typecolor|text
-worktypes|BASETABLE|worktype|text
index 6bf7a55..c9390ab 100644 (file)
@@ -29,26 +29,26 @@ CREATE SCHEMA portanova;
 
 CREATE FUNCTION portanova.add_reportperiod() RETURNS integer
     LANGUAGE plpgsql
-    AS $$\r
-declare\r
-       rpstart date;\r
-       rpend date;\r
-       rplength int4;\r
-       rpparentid int4;\r
-       rpunit text;\r
-       r_stgrps record;\r
-       rpsql text;\r
-       newperiodid int4;\r
-begin\r
+    AS $$
+declare
+       rpstart date;
+       rpend date;
+       rplength int4;
+       rpparentid int4;
+       rpunit text;
+       r_stgrps record;
+       rpsql text;
+       newperiodid int4;
+begin
        select reportperiodunit,reportperiodlength,reportperiodstart into rpunit,rplength,rpstart from public.companies where schemata='portanova';     
-       select case when max(enddate) is null then rpstart else date(max(enddate) + interval '1 day') end into rpstart from portanova.reportperiod;\r
-       execute 'select date(date(''' || rpstart || ''') + interval ''' || rplength || ' ' || rpunit || 's'' -  interval ''1 day'' );' into rpend;\r
-       select max(id) into rpparentid from portanova.reportperiod;\r
+       select case when max(enddate) is null then rpstart else date(max(enddate) + interval '1 day') end into rpstart from portanova.reportperiod;
+       execute 'select date(date(''' || rpstart || ''') + interval ''' || rplength || ' ' || rpunit || 's'' -  interval ''1 day'' );' into rpend;
+       select max(id) into rpparentid from portanova.reportperiod;
        --raise notice 'ADD NEW PERIOD: %->%',rpstart,rpend;
-       INSERT INTO portanova.reportperiod (startdate, enddate, id_parentreportperiod) VALUES(rpstart,rpend,rpparentid) returning id into newperiodid;\r
-       perform portanova.update_all_staff_in_period(newperiodid);\r
-       return newperiodid;\r
-end;\r
+       INSERT INTO portanova.reportperiod (startdate, enddate, id_parentreportperiod) VALUES(rpstart,rpend,rpparentid) returning id into newperiodid;
+       perform portanova.update_all_staff_in_period(newperiodid);
+       return newperiodid;
+end;
 $$;
 
 
@@ -58,20 +58,20 @@ $$;
 
 CREATE FUNCTION portanova.getperiod_staffcontract(pid integer) RETURNS TABLE(id integer, id_staff integer, startdate date, enddate date, weekhours interval, weekdays integer, id_workplan integer, defaultfreedays json)
     LANGUAGE plpgsql
-    AS $$\r
- declare\r
-       pstart date;\r
-       pend date;\r
- begin\r
-        select prd.startdate as prdstart,prd.enddate as prdend into pstart,pend from portanova.reportperiod prd where prd.id=pid;\r
- return QUERY\r
-select sc.id,sc.id_staff,\r
-case when sc.startdate < pstart then pstart else sc.startdate end as startdate,\r
-case when sc.enddate is null then pend when sc.enddate >  pend then pend else sc.enddate end as enddate,\r
-sc.weekhours,sc.weekdays,sc.id_workplan,sc.defaultfreedays \r
-from portanova.staffcontract sc where sc.startdate<= pend and (sc.enddate is null or sc.enddate >= pstart) \r
-order by sc.id_staff,sc.startdate,sc.enddate; \r
-END;  \r
+    AS $$
+ declare
+       pstart date;
+       pend date;
+ begin
+        select prd.startdate as prdstart,prd.enddate as prdend into pstart,pend from portanova.reportperiod prd where prd.id=pid;
+ return QUERY
+select sc.id,sc.id_staff,
+case when sc.startdate < pstart then pstart else sc.startdate end as startdate,
+case when sc.enddate is null then pend when sc.enddate >  pend then pend else sc.enddate end as enddate,
+sc.weekhours,sc.weekdays,sc.id_workplan,sc.defaultfreedays 
+from portanova.staffcontract sc where sc.startdate<= pend and (sc.enddate is null or sc.enddate >= pstart) 
+order by sc.id_staff,sc.startdate,sc.enddate; 
+END;  
 $$;
 
 
@@ -81,14 +81,14 @@ $$;
 
 CREATE FUNCTION portanova.getperiod_staffcontract(pstart date, pend date) RETURNS TABLE(id integer, id_staff integer, startdate date, enddate date, weekhours interval, weekdays integer, id_workplan integer)
     LANGUAGE plpgsql
-    AS $$\r
- BEGIN\r
- return QUERY\r
-select id,id_staff,case when startdate < pstart then pstart else startdate end as startdate,case when enddate is null then pend when enddate >  pend then pend else enddate end as enddate,\r
-weekdays,\r
-id_workplan,\r
-weekhours  from portanova.staffcontract where startdate<= pend and (enddate is null or enddate >= pstart) order by id_staff,startdate,enddate; \r
-END;  \r
+    AS $$
+ BEGIN
+ return QUERY
+select id,id_staff,case when startdate < pstart then pstart else startdate end as startdate,case when enddate is null then pend when enddate >  pend then pend else enddate end as enddate,
+weekdays,
+id_workplan,
+weekhours  from portanova.staffcontract where startdate<= pend and (enddate is null or enddate >= pstart) order by id_staff,startdate,enddate; 
+END;  
 $$;
 
 
@@ -98,20 +98,20 @@ $$;
 
 CREATE FUNCTION portanova.onchange_reportperiod(pid_period integer) RETURNS boolean
     LANGUAGE plpgsql
-    AS $$\r
-declare\r
-       prdstart date;\r
-       prdend date;\r
-       strec record;\r
-begin\r
-       select startdate,enddate into prdstart,prdend from portanova.reportperiod where id=pid_period;\r
-       for strec in select id_staff,startdate,enddate from portanova.staffcontract where startdate <= prdend and (enddate is null or enddate >= prdstart) group by id_staff\r
+    AS $$
+declare
+       prdstart date;
+       prdend date;
+       strec record;
+begin
+       select startdate,enddate into prdstart,prdend from portanova.reportperiod where id=pid_period;
+       for strec in select id_staff,startdate,enddate from portanova.staffcontract where startdate <= prdend and (enddate is null or enddate >= prdstart) group by id_staff
        loop
-               --raise notice 'Start Update period % staffworkplan for % from % to %',pid_period,strec.id_staff,strec.startdate,strec.enddate;\r
-               perform portanova.update_staffworkplan(pid_period,strec.id_staff);\r
-       end loop;\r
-       return true;\r
-end;\r
+               --raise notice 'Start Update period % staffworkplan for % from % to %',pid_period,strec.id_staff,strec.startdate,strec.enddate;
+               perform portanova.update_staffworkplan(pid_period,strec.id_staff);
+       end loop;
+       return true;
+end;
 $$;
 
 
@@ -121,16 +121,16 @@ $$;
 
 CREATE FUNCTION portanova.refresh_periods() RETURNS boolean
     LANGUAGE plpgsql
-    AS $$\r
-       declare \r
-               prds record;\r
-    begin\r
-           for prds in select id from portanova.reportperiod order by startdate,enddate\r
-           loop\r
-               perform portanova.update_all_staff_in_period(prds.id);\r
-           end loop;\r
-           RETURN true;\r
-    END;\r
+    AS $$
+       declare 
+               prds record;
+    begin
+           for prds in select id from portanova.reportperiod order by startdate,enddate
+           loop
+               perform portanova.update_all_staff_in_period(prds.id);
+           end loop;
+           RETURN true;
+    END;
 $$;
 
 
@@ -140,52 +140,52 @@ $$;
 
 CREATE FUNCTION portanova.set_periodday_sums(pid_periodday bigint) RETURNS bigint
     LANGUAGE plpgsql
-    AS $$\r
-declare\r
-       stw record;\r
-       dt1 interval := '00:00:00'::interval;\r
-       dt2 interval := '00:00:00'::interval;\r
-       dp interval := '00:00:00'::interval;\r
-       cworkhours interval := '00:00:00'::interval;\r
-       cvacancyhours interval := '00:00:00'::interval;\r
-       crecuperationhours interval := '00:00:00'::interval;\r
-       cdayhours interval := '00:00:00'::interval;\r
-       cinterruptionhours interval := '00:00:00'::interval; \r
-begin \r
-       \r
-       select * into stw from portanova.staffreportperioddays where id=pid_periodday;\r
-       if stw.timestart1 is not null and stw.timeend1 is not null then\r
-               dt1 := stw.timeend1-stw.timestart1;\r
-       end if;\r
-       if stw.timestart2 is not null and stw.timeend2 is not null then\r
-               dt2 := stw.timeend2-stw.timestart2;\r
-       end if;\r
-       if stw.timepause is not null then \r
-               dp := stw.timepause;\r
-       end if;\r
-       cworkhours := (dt1+dt2)-dp;\r
-       if (dt1 > '00:00:00'::interval and dt2 > '00:00:00'::interval) then\r
-               cinterruptionhours := stw.timestart2 -stw.timeend1;\r
-       end if;\r
-       if stw.vacancyhours is not null then\r
-               if stw.vacancyhours <= stw.contracthours then\r
-                       cvacancyhours := stw.vacancyhours;\r
-               else \r
-                       cvacancyhours := stw.contracthours;\r
-               end if;\r
-       end if;\r
-       if stw.recuperationhours is not null then\r
-               if stw.recuperationhours <= stw.contracthours then\r
-                       crecuperationhours := stw.recuperationhours;\r
-               else \r
-                       crecuperationhours := stw.contracthours;\r
-               end if;\r
-       end if;\r
-       cdayhours := cworkhours+cvacancyhours+crecuperationhours;\r
-       \r
-       update portanova.staffreportperioddays set workhours=cworkhours,interruptionhours=cinterruptionhours,dayhours=cdayhours,vacancyhours=cvacancyhours,recuperationhours=crecuperationhours where id=pid_periodday;\r
-       return pid_periodday;\r
-end;\r
+    AS $$
+declare
+       stw record;
+       dt1 interval := '00:00:00'::interval;
+       dt2 interval := '00:00:00'::interval;
+       dp interval := '00:00:00'::interval;
+       cworkhours interval := '00:00:00'::interval;
+       cvacancyhours interval := '00:00:00'::interval;
+       crecuperationhours interval := '00:00:00'::interval;
+       cdayhours interval := '00:00:00'::interval;
+       cinterruptionhours interval := '00:00:00'::interval; 
+begin 
+       
+       select * into stw from portanova.staffreportperioddays where id=pid_periodday;
+       if stw.timestart1 is not null and stw.timeend1 is not null then
+               dt1 := stw.timeend1-stw.timestart1;
+       end if;
+       if stw.timestart2 is not null and stw.timeend2 is not null then
+               dt2 := stw.timeend2-stw.timestart2;
+       end if;
+       if stw.timepause is not null then 
+               dp := stw.timepause;
+       end if;
+       cworkhours := (dt1+dt2)-dp;
+       if (dt1 > '00:00:00'::interval and dt2 > '00:00:00'::interval) then
+               cinterruptionhours := stw.timestart2 -stw.timeend1;
+       end if;
+       if stw.vacancyhours is not null then
+               if stw.vacancyhours <= stw.contracthours then
+                       cvacancyhours := stw.vacancyhours;
+               else 
+                       cvacancyhours := stw.contracthours;
+               end if;
+       end if;
+       if stw.recuperationhours is not null then
+               if stw.recuperationhours <= stw.contracthours then
+                       crecuperationhours := stw.recuperationhours;
+               else 
+                       crecuperationhours := stw.contracthours;
+               end if;
+       end if;
+       cdayhours := cworkhours+cvacancyhours+crecuperationhours;
+       
+       update portanova.staffreportperioddays set workhours=cworkhours,interruptionhours=cinterruptionhours,dayhours=cdayhours,vacancyhours=cvacancyhours,recuperationhours=crecuperationhours where id=pid_periodday;
+       return pid_periodday;
+end;
 $$;
 
 
@@ -195,31 +195,31 @@ $$;
 
 CREATE FUNCTION portanova.set_staffperiod_sums(pid_period integer, pid_staff integer) RETURNS boolean
     LANGUAGE plpgsql
-    AS $$\r
-       declare\r
-               weekrec record;\r
-       BEGIN\r
-               for weekrec in select id_staff,id_reportperiod,\r
-sum(contracthours) as contracthours,\r
-sum(workhours) as workhours, \r
-sum(vacancyhours) as vacancyhours,\r
-sum(recuperationhours) as recuperationhours,\r
-sum(diffhours) as hoursdiff,\r
-sum(totalhours) as totalhours\r
-from portanova.staffreportperiodweeks where id_staff=pid_staff and id_reportperiod=pid_period group by id_reportperiod,id_staff\r
-               loop\r
-                       update portanova.staffreportperiod set contracthours=weekrec.contracthours,\r
-                                       workhours=weekrec.workhours,\r
-                                       vacancyhours=weekrec.vacancyhours,\r
-                                       recuperationhours=weekrec.recuperationhours,\r
-                                       hoursdiff=weekrec.hoursdiff,\r
-                                       totalhours=weekrec.totalhours\r
-                       where id_staff=pid_staff  and id_reportperiod=pid_period;\r
-               end loop;\r
-               --set periodstaffdata (based on periodweeks)\r
-               --set nextperiodsdata(based on)\r
-               return true;\r
-       END;\r
+    AS $$
+       declare
+               weekrec record;
+       BEGIN
+               for weekrec in select id_staff,id_reportperiod,
+sum(contracthours) as contracthours,
+sum(workhours) as workhours, 
+sum(vacancyhours) as vacancyhours,
+sum(recuperationhours) as recuperationhours,
+sum(diffhours) as hoursdiff,
+sum(totalhours) as totalhours
+from portanova.staffreportperiodweeks where id_staff=pid_staff and id_reportperiod=pid_period group by id_reportperiod,id_staff
+               loop
+                       update portanova.staffreportperiod set contracthours=weekrec.contracthours,
+                                       workhours=weekrec.workhours,
+                                       vacancyhours=weekrec.vacancyhours,
+                                       recuperationhours=weekrec.recuperationhours,
+                                       hoursdiff=weekrec.hoursdiff,
+                                       totalhours=weekrec.totalhours
+                       where id_staff=pid_staff  and id_reportperiod=pid_period;
+               end loop;
+               --set periodstaffdata (based on periodweeks)
+               --set nextperiodsdata(based on)
+               return true;
+       END;
 $$;
 
 
@@ -382,17 +382,17 @@ $$;
 
 CREATE FUNCTION portanova.update_all_staff_in_period(pid_period integer) RETURNS boolean
     LANGUAGE plpgsql
-    AS $$\r
-       declare\r
-               staffrec record;\r
-               staffreportid int4;\r
-       BEGIN\r
-               for staffrec in select id_staff from portanova.getperiod_staffcontract(pid_period) group by id_staff\r
-               loop\r
-                       perform portanova.update_staff_in_period(pid_period,staffrec.id_staff);\r
-               end loop;\r
-               return true;\r
-       END;\r
+    AS $$
+       declare
+               staffrec record;
+               staffreportid int4;
+       BEGIN
+               for staffrec in select id_staff from portanova.getperiod_staffcontract(pid_period) group by id_staff
+               loop
+                       perform portanova.update_staff_in_period(pid_period,staffrec.id_staff);
+               end loop;
+               return true;
+       END;
 $$;
 
 
@@ -402,17 +402,17 @@ $$;
 
 CREATE FUNCTION portanova.update_staff_in_period(pid_period integer, pid_staff integer) RETURNS boolean
     LANGUAGE plpgsql
-    AS $$\r
-       declare\r
-               staffreportid int4;\r
-       BEGIN\r
-                       insert into portanova.staffreportperiod (id_reportperiod,id_staff) values (pid_period,pid_staff) \r
-                       on conflict on constraint uniq_staffreportperiod_cal do nothing returning id into staffreportid;\r
+    AS $$
+       declare
+               staffreportid int4;
+       BEGIN
+                       insert into portanova.staffreportperiod (id_reportperiod,id_staff) values (pid_period,pid_staff) 
+                       on conflict on constraint uniq_staffreportperiod_cal do nothing returning id into staffreportid;
                        perform portanova.set_stafftoperioddays(pid_period,pid_staff);
                        perform portanova.set_stafftoperiodweeks(pid_period,pid_staff);
-                       perform portanova.set_staffperiod_sums(pid_period,pid_staff);\r
-               return true;\r
-       END;\r
+                       perform portanova.set_staffperiod_sums(pid_period,pid_staff);
+               return true;
+       END;
 $$;
 
 
@@ -444,21 +444,21 @@ $$;
 
 CREATE FUNCTION portanova.update_staffweeksums(pid_staffworkplan bigint) RETURNS void
     LANGUAGE plpgsql
-    AS $$\r
-declare\r
-       wkpl_record record;\r
-       wkpltt time without time zone := '00:00:00'::interval;\r
-begin\r
-       select \r
-               case WHEN timestart1 > timeend1 THEN '24:00:00'::time without time zone - (timestart1 - timeend1)::time without time zone ELSE timeend1 - timestart1 END AS time1,\r
-               CASE WHEN timestart2 > timeend2 THEN '24:00:00'::time without time zone - (timestart2 - timeend2)::time without time zone ELSE timeend2 - timestart2 END AS time2,\r
-           timepause\r
-           into wkpl_record\r
-               from portanova.staffworkplan where id= pid_staffworkplan;\r
-       \r
-       wkpltt := wkpl_record.time1 + wkpl_record.time2 - wkpl_record.timepause::interval;\r
-       update portanova.staffworkplan set totaltime=wkpltt where id=pid_staffworkplan; \r
-end;\r
+    AS $$
+declare
+       wkpl_record record;
+       wkpltt time without time zone := '00:00:00'::interval;
+begin
+       select 
+               case WHEN timestart1 > timeend1 THEN '24:00:00'::time without time zone - (timestart1 - timeend1)::time without time zone ELSE timeend1 - timestart1 END AS time1,
+               CASE WHEN timestart2 > timeend2 THEN '24:00:00'::time without time zone - (timestart2 - timeend2)::time without time zone ELSE timeend2 - timestart2 END AS time2,
+           timepause
+           into wkpl_record
+               from portanova.staffworkplan where id= pid_staffworkplan;
+       
+       wkpltt := wkpl_record.time1 + wkpl_record.time2 - wkpl_record.timepause::interval;
+       update portanova.staffworkplan set totaltime=wkpltt where id=pid_staffworkplan; 
+end;
 $$;
 
 
@@ -559,20 +559,20 @@ $$;
 
 CREATE FUNCTION portanova.zzold_onchange_reportperiod(pid_period integer) RETURNS boolean
     LANGUAGE plpgsql
-    AS $$\r
-declare\r
-       prdstart date;\r
-       prdend date;\r
-       strec record;\r
-begin\r
-       select startdate,enddate into prdstart,prdend from portanova.reportperiod where id=pid_period;\r
-       for strec in select id_staff,startdate,enddate from portanova.staffcontract where startdate <= prdend and (enddate is null or enddate >= prdstart) group by id_staff\r
+    AS $$
+declare
+       prdstart date;
+       prdend date;
+       strec record;
+begin
+       select startdate,enddate into prdstart,prdend from portanova.reportperiod where id=pid_period;
+       for strec in select id_staff,startdate,enddate from portanova.staffcontract where startdate <= prdend and (enddate is null or enddate >= prdstart) group by id_staff
        loop
-               raise notice 'Start Update period % staffworkplan for % from % to %',pid_period,strec.id_staff,strec.startdate,strec.enddate;\r
-               perform portanova.update_staffworkplan(pid_period,strec.id_staff);\r
-       end loop;\r
-       return true;\r
-end;\r
+               raise notice 'Start Update period % staffworkplan for % from % to %',pid_period,strec.id_staff,strec.startdate,strec.enddate;
+               perform portanova.update_staffworkplan(pid_period,strec.id_staff);
+       end loop;
+       return true;
+end;
 $$;
 
 
@@ -582,24 +582,24 @@ $$;
 
 CREATE FUNCTION portanova.zzold_set_staffperiod(pid_period integer) RETURNS boolean
     LANGUAGE plpgsql
-    AS $$\r
-       declare\r
-               periodstart date;\r
-               periodend date;\r
-               staffrec record;\r
-               staffreportid int4;\r
-       BEGIN\r
-               select startdate,enddate into periodstart,periodend from portanova.reportperiod where id= pid_period;\r
-               for staffrec in select id_staff from portanova.staffcontract  where (enddate >= periodstart or (enddate is null and startdate <= periodend)) group by id_staff\r
-               loop\r
-                       insert into portanova.staffreportperiod (id_reportperiod,id_staff) values (pid_period,staffrec.id_staff) \r
-                       on conflict on constraint uniq_staffreportperiod_cal do nothing returning id into staffreportid;\r
+    AS $$
+       declare
+               periodstart date;
+               periodend date;
+               staffrec record;
+               staffreportid int4;
+       BEGIN
+               select startdate,enddate into periodstart,periodend from portanova.reportperiod where id= pid_period;
+               for staffrec in select id_staff from portanova.staffcontract  where (enddate >= periodstart or (enddate is null and startdate <= periodend)) group by id_staff
+               loop
+                       insert into portanova.staffreportperiod (id_reportperiod,id_staff) values (pid_period,staffrec.id_staff) 
+                       on conflict on constraint uniq_staffreportperiod_cal do nothing returning id into staffreportid;
                        raise notice 'staffreport ID: %',staffreportid;
                        perform portanova.set_staffperioddays(pid_period,staffrec.id_staff);
-                       perform portanova.set_staffperiodweeks(pid_period,staffrec.id_staff);\r
-               end loop;\r
-               return true;\r
-       END;\r
+                       perform portanova.set_staffperiodweeks(pid_period,staffrec.id_staff);
+               end loop;
+               return true;
+       END;
 $$;
 
 
@@ -625,7 +625,7 @@ CREATE TABLE portanova.reportperiod (
 --
 
 CREATE SEQUENCE portanova.reportperiod_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -667,7 +667,7 @@ CREATE TABLE portanova.staff (
 --
 
 CREATE SEQUENCE portanova.staff_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -717,7 +717,7 @@ CREATE TABLE portanova.staffgroups (
 --
 
 CREATE SEQUENCE portanova.staffgroups_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -737,7 +737,7 @@ ALTER SEQUENCE portanova.staffgroups_id_seq OWNED BY portanova.staffgroups.id;
 --
 
 CREATE SEQUENCE portanova.staffperiodbase_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -776,7 +776,7 @@ CREATE TABLE portanova.staffreportperiod (
 --
 
 CREATE SEQUENCE portanova.staffreportperiod_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -863,7 +863,7 @@ CREATE TABLE portanova.staffvacancy (
 --
 
 CREATE SEQUENCE portanova.staffvacancy_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -883,7 +883,7 @@ ALTER SEQUENCE portanova.staffvacancy_id_seq OWNED BY portanova.staffvacancy.id;
 --
 
 CREATE SEQUENCE portanova.staffweeksums_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -933,7 +933,7 @@ CREATE TABLE portanova.vacancydays (
 --
 
 CREATE SEQUENCE portanova.vacancydays_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -1356,7 +1356,7 @@ CREATE VIEW portanova.vw_worktimeslist AS
 --
 
 CREATE SEQUENCE portanova.workplandays_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -1376,7 +1376,7 @@ ALTER SEQUENCE portanova.workplandays_id_seq OWNED BY portanova.workplandays.id;
 --
 
 CREATE SEQUENCE portanova.workplans_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -1396,7 +1396,7 @@ ALTER SEQUENCE portanova.workplans_id_seq OWNED BY portanova.workplans.id;
 --
 
 CREATE SEQUENCE portanova.worktimes_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
@@ -1416,7 +1416,7 @@ ALTER SEQUENCE portanova.worktimes_id_seq OWNED BY portanova.worktimes.id;
 --
 
 CREATE SEQUENCE portanova.worktypes_id_seq
-    AS integer
+
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
diff --git a/dev/db/potlu_db.portanova.tables.live.txt b/dev/db/potlu_db.portanova.tables.live.txt
deleted file mode 100644 (file)
index 3a72c19..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-reportperiod|BASETABLE
-sites|BASETABLE
-staff|BASETABLE
-staffcontract|BASETABLE
-staffgroups|BASETABLE
-stafftimetracks|BASETABLE
-staffvacancy|BASETABLE
-staffvacancyyear|BASETABLE
-staffworkplan|BASETABLE
-vw_reportperiodlist|VIEW
-vw_staffcontractdata|VIEW
-vw_staffcontractlist|VIEW
-vw_staffdata|VIEW
-vw_staffgroupsdata|VIEW
-vw_staffgroupslist|VIEW
-vw_stafflist|VIEW
-vw_staffplanned_dayweektotals|VIEW
-vw_staffworkplanlist|VIEW
-vw_staffworkplan_weekly|VIEW
-vw_workplanlist|VIEW
-vw_workplansdata|VIEW
-vw_workplans|VIEW
-workplans|BASETABLE
-worktypes|BASETABLE
diff --git a/dev/db/potlu_db.public.columns.live.txt b/dev/db/potlu_db.public.columns.live.txt
deleted file mode 100644 (file)
index 7037732..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-
-public|apps|BASETABLE|app|text
-public|apps|BASETABLE|description|text
-public|apps|BASETABLE|icon|text
-public|apps|BASETABLE|id|integer
-public|apps|BASETABLE|id_usergroup|integer
-public|apps|BASETABLE|menutype|text
-public|apps|BASETABLE|name|text
-public|apps|BASETABLE|sort|integer
-public|companies|BASETABLE|address|text
-public|companies|BASETABLE|city|text
-public|companies|BASETABLE|company|text
-public|companies|BASETABLE|comregister|text
-public|companies|BASETABLE|country|text
-public|companies|BASETABLE|email|text
-public|companies|BASETABLE|id|integer
-public|companies|BASETABLE|schemata2|json
-public|companies|BASETABLE|schemata|text
-public|companies|BASETABLE|socialtype|text
-public|companies|BASETABLE|tradetype|text
-public|companies|BASETABLE|validated|boolean
-public|companies|BASETABLE|vatnumber|text
-public|companies|BASETABLE|vatvalidated|boolean
-public|companies|BASETABLE|zip|text
-public|maillayouts|BASETABLE|id|integer
-public|maillayouts|BASETABLE|layoutname|text
-public|maillayouts|BASETABLE|mailtemplate|text
-public|mailtemplates|BASETABLE|emaildatasql|text
-public|mailtemplates|BASETABLE|emailtext|text
-public|mailtemplates|BASETABLE|id|integer
-public|mailtemplates|BASETABLE|id_maillayout|integer
-public|mailtemplates|BASETABLE|mailfrom|text
-public|mailtemplates|BASETABLE|mailsubject|text
-public|mailtemplates|BASETABLE|templatename|text
-public|members|BASETABLE|id_company|integer
-public|members|BASETABLE|id|integer
-public|members|BASETABLE|id_user|bigint
-public|members|BASETABLE|job|text
-public|members|BASETABLE|phone|text
-public|members|BASETABLE|prename|text
-public|members|BASETABLE|surname|text
-public|sessions|BASETABLE|created|timestampwithouttimezone
-public|sessions|BASETABLE|id|bigint
-public|sessions|BASETABLE|idsession|text
-public|sessions|BASETABLE|id_user|bigint
-public|sessions|BASETABLE|remote_addr|text
-public|sessions|BASETABLE|user_agent|text
-public|usergroups|BASETABLE|groupname|text
-public|usergroups|BASETABLE|id|integer
-public|usergroups|BASETABLE|isdefault|boolean
-public|usergroups|BASETABLE|usergroup|text
-public|useringroups|BASETABLE|id_group|bigint
-public|useringroups|BASETABLE|id|integer
-public|useringroups|BASETABLE|id_user|bigint
-public|users|BASETABLE|blocked|boolean
-public|users|BASETABLE|created|timestampwithouttimezone
-public|users|BASETABLE|id|integer
-public|users|BASETABLE|regcode|text
-public|users|BASETABLE|schemaaccess|json
-public|users|BASETABLE|username|text
-public|users|BASETABLE|userpassword|text
-public|users|BASETABLE|vcode|text
-public|vw_companiesdata|VIEW|address|text
-public|vw_companiesdata|VIEW|city|text
-public|vw_companiesdata|VIEW|company|text
-public|vw_companiesdata|VIEW|comregister|text
-public|vw_companiesdata|VIEW|country|text
-public|vw_companiesdata|VIEW|email|text
-public|vw_companiesdata|VIEW|id|integer
-public|vw_companiesdata|VIEW|schemata2|json
-public|vw_companiesdata|VIEW|schemata|text
-public|vw_companiesdata|VIEW|socialtype|text
-public|vw_companiesdata|VIEW|tradetype|text
-public|vw_companiesdata|VIEW|validated|boolean
-public|vw_companiesdata|VIEW|vatnumber|text
-public|vw_companiesdata|VIEW|vatvalidated|boolean
-public|vw_companiesdata|VIEW|zip|text
-public|vw_companieslist|VIEW|address|text
-public|vw_companieslist|VIEW|city|text
-public|vw_companieslist|VIEW|company|text
-public|vw_companieslist|VIEW|comregister|text
-public|vw_companieslist|VIEW|country|text
-public|vw_companieslist|VIEW|email|text
-public|vw_companieslist|VIEW|id|integer
-public|vw_companieslist|VIEW|schemata2|json
-public|vw_companieslist|VIEW|schemata|text
-public|vw_companieslist|VIEW|socialtype|text
-public|vw_companieslist|VIEW|tradetype|text
-public|vw_companieslist|VIEW|validated|boolean
-public|vw_companieslist|VIEW|vatnumber|text
-public|vw_companieslist|VIEW|vatvalidated|boolean
-public|vw_companieslist|VIEW|zip|text
-public|vw_memberdata|VIEW|id_company|integer
-public|vw_memberdata|VIEW|id|integer
-public|vw_memberdata|VIEW|id_user|bigint
-public|vw_memberdata|VIEW|job|text
-public|vw_memberdata|VIEW|phone|text
-public|vw_memberdata|VIEW|prename|text
-public|vw_memberdata|VIEW|surname|text
-public|vw_userdata|VIEW|id|integer
-public|vw_userdata|VIEW|username|text
-public|vw_userlist|VIEW|blocked|boolean
-public|vw_userlist|VIEW|company|text
-public|vw_userlist|VIEW|group_ids|text
-public|vw_userlist|VIEW|id_company|integer
-public|vw_userlist|VIEW|id|integer
-public|vw_userlist|VIEW|id_member|integer
-public|vw_userlist|VIEW|prename|text
-public|vw_userlist|VIEW|surname|text
-public|vw_userlist|VIEW|username|text
diff --git a/dev/db/potlu_db.public.columns.local.txt b/dev/db/potlu_db.public.columns.local.txt
deleted file mode 100644 (file)
index a50977d..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-
-public|apps|BASETABLE|app|text
-public|apps|BASETABLE|description|text
-public|apps|BASETABLE|icon|text
-public|apps|BASETABLE|id|integer
-public|apps|BASETABLE|id_usergroup|integer
-public|apps|BASETABLE|menutype|text
-public|apps|BASETABLE|name|text
-public|apps|BASETABLE|sort|integer
-public|companies|BASETABLE|address|text
-public|companies|BASETABLE|city|text
-public|companies|BASETABLE|company|text
-public|companies|BASETABLE|comregister|text
-public|companies|BASETABLE|country|text
-public|companies|BASETABLE|email|text
-public|companies|BASETABLE|id|integer
-public|companies|BASETABLE|schemata2|json
-public|companies|BASETABLE|schemata|text
-public|companies|BASETABLE|socialtype|text
-public|companies|BASETABLE|tradetype|text
-public|companies|BASETABLE|validated|boolean
-public|companies|BASETABLE|vatnumber|text
-public|companies|BASETABLE|vatvalidated|boolean
-public|companies|BASETABLE|zip|text
-public|maillayouts|BASETABLE|id|integer
-public|maillayouts|BASETABLE|layoutname|text
-public|maillayouts|BASETABLE|mailtemplate|text
-public|mailtemplates|BASETABLE|emaildatasql|text
-public|mailtemplates|BASETABLE|emailtext|text
-public|mailtemplates|BASETABLE|id|integer
-public|mailtemplates|BASETABLE|id_maillayout|integer
-public|mailtemplates|BASETABLE|mailfrom|text
-public|mailtemplates|BASETABLE|mailsubject|text
-public|mailtemplates|BASETABLE|templatename|text
-public|sessions|BASETABLE|created|timestampwithouttimezone
-public|sessions|BASETABLE|id|bigint
-public|sessions|BASETABLE|idsession|text
-public|sessions|BASETABLE|id_user|bigint
-public|sessions|BASETABLE|remote_addr|text
-public|sessions|BASETABLE|user_agent|text
-public|usergroups|BASETABLE|groupname|text
-public|usergroups|BASETABLE|id|integer
-public|usergroups|BASETABLE|isdefault|boolean
-public|usergroups|BASETABLE|usergroup|text
-public|users|BASETABLE|blocked|boolean
-public|users|BASETABLE|created|timestampwithouttimezone
-public|users|BASETABLE|id_company|integer
-public|users|BASETABLE|id|integer
-public|users|BASETABLE|id_usergroups|json
-public|users|BASETABLE|job|text
-public|users|BASETABLE|phone|text
-public|users|BASETABLE|prename|text
-public|users|BASETABLE|regcode|text
-public|users|BASETABLE|schemaaccess|json
-public|users|BASETABLE|surname|text
-public|users|BASETABLE|username|text
-public|users|BASETABLE|userpassword|text
-public|users|BASETABLE|vcode|text
-public|vw_companiesdata|VIEW|address|text
-public|vw_companiesdata|VIEW|city|text
-public|vw_companiesdata|VIEW|company|text
-public|vw_companiesdata|VIEW|comregister|text
-public|vw_companiesdata|VIEW|country|text
-public|vw_companiesdata|VIEW|email|text
-public|vw_companiesdata|VIEW|id|integer
-public|vw_companiesdata|VIEW|schemata2|json
-public|vw_companiesdata|VIEW|schemata|text
-public|vw_companiesdata|VIEW|socialtype|text
-public|vw_companiesdata|VIEW|tradetype|text
-public|vw_companiesdata|VIEW|validated|boolean
-public|vw_companiesdata|VIEW|vatnumber|text
-public|vw_companiesdata|VIEW|vatvalidated|boolean
-public|vw_companiesdata|VIEW|zip|text
-public|vw_companieslist|VIEW|address|text
-public|vw_companieslist|VIEW|city|text
-public|vw_companieslist|VIEW|company|text
-public|vw_companieslist|VIEW|comregister|text
-public|vw_companieslist|VIEW|country|text
-public|vw_companieslist|VIEW|email|text
-public|vw_companieslist|VIEW|id|integer
-public|vw_companieslist|VIEW|schemata2|json
-public|vw_companieslist|VIEW|schemata|text
-public|vw_companieslist|VIEW|socialtype|text
-public|vw_companieslist|VIEW|tradetype|text
-public|vw_companieslist|VIEW|validated|boolean
-public|vw_companieslist|VIEW|vatnumber|text
-public|vw_companieslist|VIEW|vatvalidated|boolean
-public|vw_companieslist|VIEW|zip|text
-public|vw_schemata|VIEW|schemaname|charactervarying
-public|vw_usergroupslist|VIEW|groupname|text
-public|vw_usergroupslist|VIEW|id|integer
-public|vw_usergroupslist|VIEW|isdefault|boolean
-public|vw_usergroupslist|VIEW|usergroup|text
-public|vw_usersdata|VIEW|blocked|boolean
-public|vw_usersdata|VIEW|created|timestampwithouttimezone
-public|vw_usersdata|VIEW|id_company|integer
-public|vw_usersdata|VIEW|id|integer
-public|vw_usersdata|VIEW|id_usergroups|json
-public|vw_usersdata|VIEW|job|text
-public|vw_usersdata|VIEW|phone|text
-public|vw_usersdata|VIEW|prename|text
-public|vw_usersdata|VIEW|regcode|text
-public|vw_usersdata|VIEW|schemaaccess|json
-public|vw_usersdata|VIEW|surname|text
-public|vw_usersdata|VIEW|username|text
-public|vw_usersdata|VIEW|userpassword|text
-public|vw_usersdata|VIEW|vcode|text
-public|vw_userslist|VIEW|blocked|boolean
-public|vw_userslist|VIEW|company|text
-public|vw_userslist|VIEW|id_company|integer
-public|vw_userslist|VIEW|id|integer
-public|vw_userslist|VIEW|job|text
-public|vw_userslist|VIEW|phone|text
-public|vw_userslist|VIEW|prename|text
-public|vw_userslist|VIEW|schemaaccess|text
-public|vw_userslist|VIEW|surname|text
-public|vw_userslist|VIEW|usergroups|text
-public|vw_userslist|VIEW|username|text
index ce23147..229ae39 100644 (file)
@@ -22,30 +22,32 @@ SET row_security = off;
 
 INSERT INTO public.usergroups (id, usergroup, isdefault, groupname) VALUES (1, 'superadmin', NULL, 'SuperAdmin');
 INSERT INTO public.usergroups (id, usergroup, isdefault, groupname) VALUES (2, 'admin', NULL, 'Admin');
-INSERT INTO public.usergroups (id, usergroup, isdefault, groupname) VALUES (4, 'site', NULL, 'Site');
 INSERT INTO public.usergroups (id, usergroup, isdefault, groupname) VALUES (5, 'user', true, 'Utilisateur');
 INSERT INTO public.usergroups (id, usergroup, isdefault, groupname) VALUES (3, 'manager', NULL, 'GĂ©rant');
+INSERT INTO public.usergroups (id, usergroup, isdefault, groupname) VALUES (4, 'teamleader', NULL, 'Responsable');
 
 
 --
 -- Data for Name: apps; Type: TABLE DATA; Schema: public; Owner: -
 --
 
-INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) VALUES (8, 'timetrackers', 'Pointeuses', 'Pointeuses', NULL, 'cube.svg', 7, 'schema');
-INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) VALUES (10, 'sites', 'Sites', 'Sites', NULL, 'cube.svg', 6, 'schema');
-INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) VALUES (4, 'profile', 'Profil', 'mes coordonnĂ©es', 5, 'user.svg', 9, 'global');
-INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) VALUES (5, 'users', 'Utilisateurs', 'utilisateurs', 2, 'group.svg', 11, 'global');
-INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) VALUES (7, 'staff', 'EmployĂ©(e)s', 'employĂ©(e)s', 3, 'group.svg', 4, 'schema');
-INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) VALUES (9, 'planning', 'Planning', 'POT', 3, 'poticon.svg', 5, 'schema');
-INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) VALUES (6, 'companies', 'Entreprise', 'entreprise', 2, 'cube.svg', 10, 'global');
-INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) VALUES (11, 'workplans', 'Plans de travail', 'plans (modèles)', 3, 'calendar.svg', 8, 'schema');
+INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) VALUES (10, 'sites', 'Sites', 'Sites', NULL, 'cube.svg', 6, 'schema', NULL);
+INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) VALUES (8, 'timetrackers', 'Pointeuses', 'Pointeuses', NULL, 'cube.svg', 7, 'schema', NULL);
+INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) VALUES (5, 'users', 'Utilisateurs', 'utilisateurs', 2, 'group.svg', 11, 'global', '["2","3","4","5"]');
+INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) VALUES (6, 'companies', 'Entreprise', 'entreprise', 2, 'cube.svg', 10, 'global', '["2","3"]');
+INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) VALUES (7, 'staff', 'SalairiĂ©s', 'SalariĂ©s', 3, 'group.svg', 4, 'schema', '["2","3"]');
+INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) VALUES (11, 'workplans', 'Plans de travail', 'POT (modèles)', 3, 'calendar.svg', 8, 'schema', '["2","3","4"]');
+INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) VALUES (4, 'profile', 'Profil', 'Profil', 5, 'user.svg', 9, 'global', '["2","3","4","5"]');
+INSERT INTO public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) VALUES (9, 'periods', 'Planning', 'PĂ©riode(s) de rĂ©fĂ©rence', 3, 'poticon.svg', 5, 'schema', '["2","3","4"]');
 
 
 --
 -- Data for Name: companies; Type: TABLE DATA; Schema: public; Owner: -
 --
 
-INSERT INTO public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email, socialtype, vatvalidated) VALUES (1, 'DKS', '8b, rue du Moulin', '6914', 'Roodt-sur-Syre', 'Luxemburg', NULL, NULL, NULL, 'portanova', NULL, NULL, 'support@dks.lu', 's.Ă  r.l.', NULL);
+INSERT INTO public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email, socialtype, vatvalidated, reportperiodunit, reportperiodlength, reportperiodstart) VALUES (25, 'test', '4, rue Principale', '3770', 'TĂ©tange', 'Luxemburg', NULL, NULL, NULL, 'test', NULL, NULL, 'kilian@saffran.lu', 's.Ă  r.l.', NULL, NULL, NULL, NULL);
+INSERT INTO public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email, socialtype, vatvalidated, reportperiodunit, reportperiodlength, reportperiodstart) VALUES (26, 'TEST2', '8b, rue du Moulin', '6914', 'Roodt-sur-Syre', 'Luxemburg', NULL, NULL, NULL, 'test2', NULL, NULL, 'support@dks.lu', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email, socialtype, vatvalidated, reportperiodunit, reportperiodlength, reportperiodstart) VALUES (1, 'Portanova', 'rue de la faĂ¯encerie', NULL, 'Luxembourg', 'Luxemburg', NULL, NULL, NULL, 'portanova', NULL, NULL, 'support@dks.lu', 's.Ă  r.l.', NULL, 'week', 8, '2019-12-30');
 
 
 --
@@ -156,39 +158,41 @@ pot.lu Support-Team<br>
 -- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: -
 --
 
-INSERT INTO public.users (id, userpassword, created, blocked, username, regcode, vcode, schemaaccess, id_usergroups, surname, prename, phone, job, id_company) VALUES (2, 'f7252754a4cb7391d966316351b3501bce81fee9bc0b71807ddf61281a27821e', '2019-12-20 11:03:08.757357', NULL, 'kilian@saffran.lu', NULL, NULL, '["portanova"]', '["5"]', 'Saffran', 'Kilian', '691504574', NULL, 1);
-INSERT INTO public.users (id, userpassword, created, blocked, username, regcode, vcode, schemaaccess, id_usergroups, surname, prename, phone, job, id_company) VALUES (1, '228c27a646f18ce069bc2b8ef091a03c46cd51557e5b5ac90abc05c4f635b3ba', '2019-10-10 17:12:11.934747', NULL, 'kilian.saffran@gmail.com', NULL, '6tgfkew', '["portanova"]', '["2","5","3"]', 'Saffran', 'Kilian', '+352691504574', 'GĂ©rant', 1);
+INSERT INTO public.users (id, userpassword, created, blocked, username, regcode, vcode, schemaaccess, id_usergroups, surname, prename, phone, job, id_company, id_usergroup) VALUES (1, '0ecf731e2426a8a469f06e9f4a3bcbed6f8071d9d3e3ef7ef5fd9165021e27ec', '2019-10-10 17:12:11.934747', NULL, 'kilian.saffran@gmail.com', NULL, '6tgfkew', '["test","portanova"]', '["2","5","3","4"]', 'Saffran', 'Kilian', '+352691504574', 'GĂ©rant', 1, 2);
+INSERT INTO public.users (id, userpassword, created, blocked, username, regcode, vcode, schemaaccess, id_usergroups, surname, prename, phone, job, id_company, id_usergroup) VALUES (2, 'f7252754a4cb7391d966316351b3501bce81fee9bc0b71807ddf61281a27821e', '2019-12-20 11:03:08.757357', NULL, 'kilian@saffran.lu', NULL, NULL, '["portanova"]', '["5"]', 'Saffran', 'Kilian', '691504574', NULL, 1, 5);
+INSERT INTO public.users (id, userpassword, created, blocked, username, regcode, vcode, schemaaccess, id_usergroups, surname, prename, phone, job, id_company, id_usergroup) VALUES (4, 'ad3d14273d47ed24f6d62e3f8c64032e946d9e9d5965364a81e15d12a69cf2ce', '2019-12-29 16:53:19.68549', NULL, 'ksaffran@dks.lu', NULL, NULL, '["portanova"]', '["3","5"]', 'Saffran', 'Kilian', NULL, NULL, 1, 3);
 
 
 --
 -- Data for Name: sessions; Type: TABLE DATA; Schema: public; Owner: -
 --
 
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (228, 'yQVWb3gmfQZbXhdgiexW1O2suUpzBlL02xM3qTgw', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', '2001:7e8:cc73:de00:a812:ebc7:72cb:2146', '2020-01-09 06:41:48.639525');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (229, 'OE2TqV8VRjYZmkSXr7qjQW4TVR8zvjJ9OCT4nRP5', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', '::1', '2020-01-09 10:37:54.604655');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (111, 'uWpnqxhEFJt2MZxMoLSz4ZAZoc3ZJnu3aKhq8oVD', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '2001:7e8:cc73:de00:213c:73ba:ffa7:842b', '2019-12-05 19:16:43.969105');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (112, 'mUmGFzD4kPLyhHfJO9TDOGfCtsVAEefRYrotRRo1', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '2001:7e8:cc73:de00:7946:65e2:f587:8b74', '2019-12-06 07:02:23.094765');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (113, 'HaDg0Eh9nIk7lftrHDtQpaKiLWL66VoEWRKMmSLz', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '::1', '2019-12-09 11:33:13.202044');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (114, 'aSli1lR9B0ETjICf7IFjVxhphLd8dhRdZ2mRd4RE', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362', '::1', '2019-12-10 15:55:53.526432');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (175, 'NjxbJc50MGk8kV9dH2G33mhWV5e4PTns3KuCMptp', 1, 'Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Mobile Safari/537.36', '::1', '2020-01-02 09:36:12.19675');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (176, 'd62Z9Se8i1QM2Zhx6JZz8TWz9eXvIlXMiPBhyGgG', 1, 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1', '::1', '2020-01-02 09:36:47.868479');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (232, 'EPjQ6DLhLgmxsW0euSnHhxOmC2iMrKlWpvCmYetA', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', '192.168.178.23', '2020-01-10 08:38:40.58899');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (178, 'yC6li3gqsuF9nPacybvBUPwzz3SoIyx71ui9nppF', 1, 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', '::1', '2020-01-02 09:49:11.956938');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (122, 'Sp2D9CvtdjQHaxLPkEXgqSMSveIJwQde56I5y3oC', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '2001:7e8:cc73:de00:d970:312a:d5d:db83', '2019-12-12 07:06:51.913155');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (124, 'NUTU0TkWd81oxH4ig52WCA3HzccA3bmHW5sMPCyT', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36', '::1', '2019-12-15 11:44:06.485589');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (198, 'dC237zuzY7HYOGvbFem5LeVuQ3XFRxSU0LOXa8nZ', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', '2001:7e8:cc73:de00:24c6:9f1e:3054:64dd', '2020-01-08 08:36:54.781554');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (93, '5P7159lXg8xY83Iu7eZC3hj3Oi6x29jXOhPKg0yn', 1, 'Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36', '::1', '2019-12-04 14:58:48.993651');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (258, 's7C63JpbiZV34B1obie1a6JUnUaSJXl1VNYPndQv', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', '::1', '2020-01-16 09:02:49.520835');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (98, '9UisAitYaoxdqtBaWUI37R04CiBlFxcp0STuCOZRU', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '::1', '2019-12-05 07:34:07.997426');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (99, 'v6wZ65qozoWn5P32q4wg16224TcOAM1VJnLFj1UJ', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '192.168.178.23', '2019-12-05 07:35:01.756219');
 INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (160, 'pMEnznbOdbCeLbtKUwxgVbn2PNVzrF0HhvVHIWmL', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36', '::1', '2019-12-20 12:48:16.464228');
-INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (161, 'fvhUhEhy8bRQnrZd1I0oVdAwntMj86Xdr5Yzz6Yy', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', '::1', '2019-12-22 09:58:14.675553');
-
-
---
--- Data for Name: zzold_members; Type: TABLE DATA; Schema: public; Owner: -
---
-
-INSERT INTO public.zzold_members (id, surname, prename, phone, id_user, id_company, job) VALUES (1, 'Saffran', 'Kilian', NULL, 1, 1, NULL);
-
-
---
--- Data for Name: zzold_useringroups; Type: TABLE DATA; Schema: public; Owner: -
---
-
-INSERT INTO public.zzold_useringroups (id, id_user, id_group) VALUES (1, 1, 1);
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (162, 'RRiSGkElRtLTCs3lkdYpQNZDnxKJ2wOJdXrJ7WVO', 1, '192.168.178.23', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', '2019-12-24 10:59:50.644045');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (163, 'BlvRAYUeX78wr2OhPvWU5TrsNAmsooAQzWy0Ki4x', 1, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', '2001:7e8:cc73:de00:f4f8:d2a7:1c8:2664', '2019-12-24 11:00:44.808971');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (279, 'U9ksV3dLzsxjylgOx5WK5lPitIiU8nrSmBb8veJU', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36 Edg/79.0.309.71', '::1', '2020-02-04 08:32:56.845626');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (281, 'zdaOUZfTtPkLpOQYYPGqzViSKLTgtMWTPXxAMCj6', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', '::1', '2020-02-05 10:18:52.389333');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (283, 'qCTq7PB9Ml539u6mdEoTGensJglVwc8MER3CxvC9', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36', '::1', '2020-02-10 09:03:25.356532');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (286, 'WeNOQHFuxR7KfY1DAK8nkMgCAc7JQ6EDaihRQNcd', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.100 Safari/537.36', '::1', '2020-02-14 18:56:34.030027');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (299, 'UgTmbOQeAFpuAAPqP7CGP22KXtsWMglxn4JoIqt9', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36', '::1', '2020-02-24 11:53:27.013773');
+INSERT INTO public.sessions (id, idsession, id_user, user_agent, remote_addr, created) VALUES (301, '0947l9NXchB8bZJx7UKHuBpazWGacjx2is0trEgu', 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36', '::1', '2020-02-26 11:26:44.355966');
 
 
 --
@@ -202,7 +206,7 @@ SELECT pg_catalog.setval('public.apps_id_seq', 11, true);
 -- Name: companies_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
 --
 
-SELECT pg_catalog.setval('public.companies_id_seq', 24, true);
+SELECT pg_catalog.setval('public.companies_id_seq', 26, true);
 
 
 --
@@ -219,18 +223,11 @@ SELECT pg_catalog.setval('public.maillayouts_id_seq', 1, true);
 SELECT pg_catalog.setval('public.mailtemplates_id_seq', 7, true);
 
 
---
--- Name: members_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
---
-
-SELECT pg_catalog.setval('public.members_id_seq', 1, false);
-
-
 --
 -- Name: sessions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
 --
 
-SELECT pg_catalog.setval('public.sessions_id_seq', 161, true);
+SELECT pg_catalog.setval('public.sessions_id_seq', 301, true);
 
 
 --
@@ -240,18 +237,11 @@ SELECT pg_catalog.setval('public.sessions_id_seq', 161, true);
 SELECT pg_catalog.setval('public.usergroups_id_seq', 4, true);
 
 
---
--- Name: useringroups_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
---
-
-SELECT pg_catalog.setval('public.useringroups_id_seq', 1, true);
-
-
 --
 -- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
 --
 
-SELECT pg_catalog.setval('public.users_id_seq', 2, true);
+SELECT pg_catalog.setval('public.users_id_seq', 4, true);
 
 
 --
index c3750ed..32f6bec 100644 (file)
@@ -109,17 +109,16 @@ ALTER FUNCTION public.getmondays(vyear integer) OWNER TO potlu_user;
 -- Name: getsession(text, text, text); Type: FUNCTION; Schema: public; Owner: potlu_user
 --
 
-CREATE FUNCTION public.getsession(vidsession text, vremoteaddr text, vuseragent text) RETURNS TABLE(idsession text, id integer, username text, usergroups text, userschemata text)
+CREATE FUNCTION public.getsession(vidsession text, vremoteaddr text, vuseragent text) RETURNS TABLE(idsession text, id integer, username text, usergroup text)
     LANGUAGE plpgsql
-    AS $$\r
- BEGIN\r
- return QUERY select se.idsession,us.id,us.username,string_agg(distinct(ugrp.usergroup),',') as usergroups,json_array_elements_text(us.schemaaccess) as userschemata from sessions se 
+    AS $$
+ BEGIN
+ return QUERY select se.idsession,us.id,us.username,ugrp.usergroup from sessions se 
 join users us on (us.id=se.id_user)
-left join (SELECT users.id,json_array_elements_text(users.id_usergroups) AS id_usergroup FROM users) ugs on (us.id=ugs.id)
-left join usergroups ugrp on (ugrp.id=ugs.id)
+left join usergroups ugrp on (ugrp.id=us.id_usergroup)
 where se.idsession= vidsession and se.remote_addr= vremoteaddr and se.user_agent= vuseragent and 
-us.blocked is null group by se.id,us.id;\r
- END;  \r
+us.blocked is null group by se.id,us.id,ugrp.id;
+ END;  
 $$;
 
 
@@ -159,6 +158,25 @@ $$;
 
 ALTER FUNCTION public.getweeks(vyear integer) OWNER TO potlu_user;
 
+--
+-- Name: getweeksbydaterange(date, date); Type: FUNCTION; Schema: public; Owner: potlu_user
+--
+
+CREATE FUNCTION public.getweeksbydaterange(datefrom date, dateto date) RETURNS TABLE(calyear integer, calweek integer, weekstart date, weekend date)
+    LANGUAGE plpgsql
+    AS $$
+ BEGIN
+ return QUERY select date_part('isoyear',daydate)::int as calyear,date_part('week',daydate)::int4 as calweek,date(date_trunc('week',daydate)) as weekstart , date(date_trunc('week',daydate) + interval '6 days') as weekend 
+from
+(select datefrom + s*'1 day'::interval as daydate from 
+(select * from generate_series(0,dateto - datefrom )s)x ) d group by calyear,calweek,weekstart,weekend order by weekstart,weekend;
+
+ END;  
+$$;
+
+
+ALTER FUNCTION public.getweeksbydaterange(datefrom date, dateto date) OWNER TO potlu_user;
+
 --
 -- Name: random_string(integer); Type: FUNCTION; Schema: public; Owner: potlu_user
 --
@@ -178,6 +196,31 @@ $$;
 
 ALTER FUNCTION public.random_string(vlength integer) OWNER TO potlu_user;
 
+--
+-- Name: staffworplan_contracthours(text, integer); Type: FUNCTION; Schema: public; Owner: potlu_user
+--
+
+CREATE FUNCTION public.staffworplan_contracthours(vschemaname text, vcontractid integer) RETURNS void
+    LANGUAGE plpgsql
+    AS $$\r
+declare\r
+       cur_contracthours TEXT;\r
+       cur_startdate date;\r
+       cur_enddate date;\r
+       cur_id_staff int4;\r
+ BEGIN\r
+       execute 'select startdate,enddate,id_staff,to_char(to_timestamp((round(weekhours/weekdays,3)) * 60), ''MI:SS:00'')   from ' || vschemaname || '.staffcontract where id=' || vcontractid || ';' into cur_startdate,cur_enddate,cur_id_staff,cur_contracthours;\r
+       if cur_enddate is null then\r
+               execute 'update ' || vschemaname || '.staffworkplan SET contracthours='''||  cur_contracthours || ''' WHERE id_staff=' || cur_id_staff || ' and daydate>=date(''' || to_char(cur_startdate,'YYYY-MM-DD') || ''');';  \r
+       else \r
+               execute 'update ' || vschemaname || '.staffworkplan SET contracthours='''||  cur_contracthours || ''' WHERE id_staff=' || cur_id_staff || ' and daydate between date(''' || to_char(cur_startdate,'YYYY-MM-DD') || ''') and date(''' || to_char(cur_enddate,'YYYY-MM-DD') || ''');';\r
+       end if;\r
+ END;  \r
+$$;
+
+
+ALTER FUNCTION public.staffworplan_contracthours(vschemaname text, vcontractid integer) OWNER TO potlu_user;
+
 --
 -- Name: trg_update_basemonthhours(); Type: FUNCTION; Schema: public; Owner: potlu_user
 --
@@ -246,6 +289,31 @@ $$;
 
 ALTER FUNCTION public.trg_update_monthlyhours() OWNER TO potlu_user;
 
+--
+-- Name: weekvacancy(text, double precision, integer); Type: FUNCTION; Schema: public; Owner: potlu_user
+--
+
+CREATE FUNCTION public.weekvacancy(vschema text, vcalweek double precision, vidstaff integer) RETURNS text
+    LANGUAGE plpgsql
+    AS $$\r
+ declare \r
+       vret text;\r
+    xsql text;\r
+ begin\r
+        xsql := 'select ''{"vacancy":{'' || string_agg(''"'' || id_vacancytype || ''":'' || row_to_json(weekvacancy),'','') || ''}}'' from (\r
+select  vk.id_vacancytype,sum(vk.vacancyhours) as vacancyhours,vt.vacancyname,vt.color,vt.isworktime from portanova.staffworkplan vk\r
+\r
+join ' || vschema || '.vacancytypes vt on (vt.id=vk.id_vacancytype)\r
+where date_part(''week'', daydate)= ' || vcalweek  || ' and id_staff= ' || vidstaff || ' group by vk.id_vacancytype,vt.vacancyname,vt.color,vt.isworktime) weekvacancy;';\r
+       --raise notice '%s',xsql;\r
+       execute xsql into vret;\r
+return vret;\r
+END;  \r
+$$;
+
+
+ALTER FUNCTION public.weekvacancy(vschema text, vcalweek double precision, vidstaff integer) OWNER TO potlu_user;
+
 SET default_tablespace = '';
 
 SET default_with_oids = false;
@@ -262,7 +330,8 @@ CREATE TABLE public.apps (
     id_usergroup integer,
     icon text,
     sort integer,
-    menutype text
+    menutype text,
+    id_usergroups json
 );
 
 
@@ -309,7 +378,10 @@ CREATE TABLE public.companies (
     schemata2 json,
     email text,
     socialtype text,
-    vatvalidated boolean
+    vatvalidated boolean,
+    reportperiodunit text,
+    reportperiodlength integer,
+    reportperiodstart date
 );
 
 
@@ -411,45 +483,6 @@ ALTER TABLE public.mailtemplates_id_seq OWNER TO potlu_user;
 ALTER SEQUENCE public.mailtemplates_id_seq OWNED BY public.mailtemplates.id;
 
 
---
--- Name: zzold_members; Type: TABLE; Schema: public; Owner: potlu_user
---
-
-CREATE TABLE public.zzold_members (
-    id integer NOT NULL,
-    surname text,
-    prename text,
-    phone text,
-    id_user bigint,
-    id_company integer,
-    job text
-);
-
-
-ALTER TABLE public.zzold_members OWNER TO potlu_user;
-
---
--- Name: members_id_seq; Type: SEQUENCE; Schema: public; Owner: potlu_user
---
-
-CREATE SEQUENCE public.members_id_seq
-    AS integer
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-ALTER TABLE public.members_id_seq OWNER TO potlu_user;
-
---
--- Name: members_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: potlu_user
---
-
-ALTER SEQUENCE public.members_id_seq OWNED BY public.zzold_members.id;
-
-
 --
 -- Name: sessions; Type: TABLE; Schema: public; Owner: potlu_user
 --
@@ -523,41 +556,6 @@ ALTER TABLE public.usergroups_id_seq OWNER TO potlu_user;
 ALTER SEQUENCE public.usergroups_id_seq OWNED BY public.usergroups.id;
 
 
---
--- Name: zzold_useringroups; Type: TABLE; Schema: public; Owner: potlu_user
---
-
-CREATE TABLE public.zzold_useringroups (
-    id integer NOT NULL,
-    id_user bigint,
-    id_group bigint
-);
-
-
-ALTER TABLE public.zzold_useringroups OWNER TO potlu_user;
-
---
--- Name: useringroups_id_seq; Type: SEQUENCE; Schema: public; Owner: potlu_user
---
-
-CREATE SEQUENCE public.useringroups_id_seq
-    AS integer
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
-ALTER TABLE public.useringroups_id_seq OWNER TO potlu_user;
-
---
--- Name: useringroups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: potlu_user
---
-
-ALTER SEQUENCE public.useringroups_id_seq OWNED BY public.zzold_useringroups.id;
-
-
 --
 -- Name: users; Type: TABLE; Schema: public; Owner: potlu_user
 --
@@ -576,7 +574,8 @@ CREATE TABLE public.users (
     prename text,
     phone text,
     job text,
-    id_company integer
+    id_company integer,
+    id_usergroup integer
 );
 
 
@@ -623,7 +622,10 @@ CREATE VIEW public.vw_companiesdata AS
     companies.schemata2,
     companies.email,
     companies.socialtype,
-    companies.vatvalidated
+    companies.vatvalidated,
+    companies.reportperiodlength,
+    companies.reportperiodstart,
+    companies.reportperiodunit
    FROM public.companies;
 
 
@@ -648,7 +650,10 @@ CREATE VIEW public.vw_companieslist AS
     companies.schemata2,
     companies.email,
     companies.socialtype,
-    companies.vatvalidated
+    companies.vatvalidated,
+    companies.reportperiodlength,
+    companies.reportperiodstart,
+    companies.reportperiodunit
    FROM public.companies;
 
 
@@ -659,9 +664,11 @@ ALTER TABLE public.vw_companieslist OWNER TO potlu_user;
 --
 
 CREATE VIEW public.vw_schemata AS
- SELECT schemata.schema_name AS schemaname
-   FROM information_schema.schemata
-  WHERE ((schemata.schema_owner)::text = 'potlu_user'::text);
+ SELECT sct.schema_name AS schemaname,
+    cp.company
+   FROM (information_schema.schemata sct
+     JOIN public.companies cp ON (((sct.schema_name)::text = cp.schemata)))
+  WHERE (((sct.schema_owner)::text = 'potlu_user'::text) AND ((sct.schema_name)::text <> 'public'::text));
 
 
 ALTER TABLE public.vw_schemata OWNER TO potlu_user;
@@ -680,6 +687,18 @@ CREATE VIEW public.vw_usergroupslist AS
 
 ALTER TABLE public.vw_usergroupslist OWNER TO potlu_user;
 
+--
+-- Name: vw_userschemaaccess; Type: VIEW; Schema: public; Owner: potlu_user
+--
+
+CREATE VIEW public.vw_userschemaaccess AS
+ SELECT users.id,
+    json_array_elements_text(users.schemaaccess) AS schemaaccess
+   FROM public.users;
+
+
+ALTER TABLE public.vw_userschemaaccess OWNER TO potlu_user;
+
 --
 -- Name: vw_usersdata; Type: VIEW; Schema: public; Owner: potlu_user
 --
@@ -693,7 +712,7 @@ CREATE VIEW public.vw_usersdata AS
     users.regcode,
     users.vcode,
     users.schemaaccess,
-    users.id_usergroups,
+    users.id_usergroup,
     users.surname,
     users.prename,
     users.phone,
@@ -720,7 +739,8 @@ SELECT
     NULL::text AS job,
     NULL::integer AS id_company,
     NULL::text AS company,
-    NULL::text AS usergroups;
+    NULL::text AS groupname,
+    NULL::integer AS id_usergroup;
 
 
 ALTER TABLE public.vw_userslist OWNER TO potlu_user;
@@ -774,33 +794,19 @@ ALTER TABLE ONLY public.usergroups ALTER COLUMN id SET DEFAULT nextval('public.u
 ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
 
 
---
--- Name: zzold_members id; Type: DEFAULT; Schema: public; Owner: potlu_user
---
-
-ALTER TABLE ONLY public.zzold_members ALTER COLUMN id SET DEFAULT nextval('public.members_id_seq'::regclass);
-
-
---
--- Name: zzold_useringroups id; Type: DEFAULT; Schema: public; Owner: potlu_user
---
-
-ALTER TABLE ONLY public.zzold_useringroups ALTER COLUMN id SET DEFAULT nextval('public.useringroups_id_seq'::regclass);
-
-
 --
 -- Data for Name: apps; Type: TABLE DATA; Schema: public; Owner: potlu_user
 --
 
-COPY public.apps (id, app, description, name, id_usergroup, icon, sort, menutype) FROM stdin;
-8      timetrackers    Pointeuses      Pointeuses      \N      cube.svg        7       schema
-10     sites   Sites   Sites   \N      cube.svg        6       schema
-4      profile Profil  mes coordonnĂ©es        5       user.svg        9       global
-5      users   Utilisateurs    utilisateurs    2       group.svg       11      global
-7      staff   EmployĂ©(e)s    employĂ©(e)s    3       group.svg       4       schema
-9      planning        Planning        POT     3       poticon.svg     5       schema
-6      companies       Entreprise      entreprise      2       cube.svg        10      global
-11     workplans       Plans de travail        plans (modèles)        3       calendar.svg    8       schema
+COPY public.apps (id, app, description, name, id_usergroup, icon, sort, menutype, id_usergroups) FROM stdin;
+10     sites   Sites   Sites   \N      cube.svg        6       schema  \N
+8      timetrackers    Pointeuses      Pointeuses      \N      cube.svg        7       schema  \N
+5      users   Utilisateurs    utilisateurs    2       group.svg       11      global  ["2","3","4","5"]
+6      companies       Entreprise      entreprise      2       cube.svg        10      global  ["2","3"]
+7      staff   SalairiĂ©s      SalariĂ©s       3       group.svg       4       schema  ["2","3"]
+11     workplans       Plans de travail        POT (modèles)  3       calendar.svg    8       schema  ["2","3","4"]
+4      profile Profil  Profil  5       user.svg        9       global  ["2","3","4","5"]
+9      periods Planning        PĂ©riode(s) de rĂ©fĂ©rence      3       poticon.svg     5       schema  ["2","3","4"]
 \.
 
 
@@ -808,8 +814,10 @@ COPY public.apps (id, app, description, name, id_usergroup, icon, sort, menutype
 -- Data for Name: companies; Type: TABLE DATA; Schema: public; Owner: potlu_user
 --
 
-COPY public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email, socialtype, vatvalidated) FROM stdin;
-1      DKS     8b, rue du Moulin       6914    Roodt-sur-Syre  Luxemburg       \N      \N      \N      portanova       \N      \N      support@dks.lu  s.Ă  r.l.       \N
+COPY public.companies (id, company, address, zip, city, country, tradetype, comregister, vatnumber, schemata, validated, schemata2, email, socialtype, vatvalidated, reportperiodunit, reportperiodlength, reportperiodstart) FROM stdin;
+25     test    4, rue Principale       3770    TĂ©tange        Luxemburg       \N      \N      \N      test    \N      \N      kilian@saffran.lu       s.Ă  r.l.       \N      \N      \N      \N
+26     TEST2   8b, rue du Moulin       6914    Roodt-sur-Syre  Luxemburg       \N      \N      \N      test2   \N      \N      support@dks.lu  \N      \N      \N      \N      \N
+1      Portanova       rue de la faĂ¯encerie   \N      Luxembourg      Luxemburg       \N      \N      \N      portanova       \N      \N      support@dks.lu  s.Ă  r.l.       \N      week    8       2019-12-30
 \.
 
 
@@ -842,17 +850,32 @@ COPY public.mailtemplates (id, templatename, emailtext, emaildatasql, mailfrom,
 --
 
 COPY public.sessions (id, idsession, id_user, user_agent, remote_addr, created) FROM stdin;
+228    yQVWb3gmfQZbXhdgiexW1O2suUpzBlL02xM3qTgw        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36       2001:7e8:cc73:de00:a812:ebc7:72cb:2146  2020-01-09 06:41:48.639525
+229    OE2TqV8VRjYZmkSXr7qjQW4TVR8zvjJ9OCT4nRP5        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36      ::1     2020-01-09 10:37:54.604655
 111    uWpnqxhEFJt2MZxMoLSz4ZAZoc3ZJnu3aKhq8oVD        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       2001:7e8:cc73:de00:213c:73ba:ffa7:842b  2019-12-05 19:16:43.969105
 112    mUmGFzD4kPLyhHfJO9TDOGfCtsVAEefRYrotRRo1        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       2001:7e8:cc73:de00:7946:65e2:f587:8b74  2019-12-06 07:02:23.094765
 113    HaDg0Eh9nIk7lftrHDtQpaKiLWL66VoEWRKMmSLz        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36     ::1     2019-12-09 11:33:13.202044
 114    aSli1lR9B0ETjICf7IFjVxhphLd8dhRdZ2mRd4RE        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18362       ::1     2019-12-10 15:55:53.526432
+175    NjxbJc50MGk8kV9dH2G33mhWV5e4PTns3KuCMptp        1       Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Mobile Safari/537.36 ::1     2020-01-02 09:36:12.19675
+176    d62Z9Se8i1QM2Zhx6JZz8TWz9eXvIlXMiPBhyGgG        1       Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1        ::1     2020-01-02 09:36:47.868479
+232    EPjQ6DLhLgmxsW0euSnHhxOmC2iMrKlWpvCmYetA        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36       192.168.178.23  2020-01-10 08:38:40.58899
+178    yC6li3gqsuF9nPacybvBUPwzz3SoIyx71ui9nppF        1       Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1 ::1     2020-01-02 09:49:11.956938
 122    Sp2D9CvtdjQHaxLPkEXgqSMSveIJwQde56I5y3oC        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       2001:7e8:cc73:de00:d970:312a:d5d:db83   2019-12-12 07:06:51.913155
 124    NUTU0TkWd81oxH4ig52WCA3HzccA3bmHW5sMPCyT        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36        ::1     2019-12-15 11:44:06.485589
+198    dC237zuzY7HYOGvbFem5LeVuQ3XFRxSU0LOXa8nZ        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36       2001:7e8:cc73:de00:24c6:9f1e:3054:64dd  2020-01-08 08:36:54.781554
 93     5P7159lXg8xY83Iu7eZC3hj3Oi6x29jXOhPKg0yn        1       Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36        ::1     2019-12-04 14:58:48.993651
+258    s7C63JpbiZV34B1obie1a6JUnUaSJXl1VNYPndQv        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36     ::1     2020-01-16 09:02:49.520835
 98     9UisAitYaoxdqtBaWUI37R04CiBlFxcp0STuCOZRU       1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       ::1     2019-12-05 07:34:07.997426
 99     v6wZ65qozoWn5P32q4wg16224TcOAM1VJnLFj1UJ        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       192.168.178.23  2019-12-05 07:35:01.756219
 160    pMEnznbOdbCeLbtKUwxgVbn2PNVzrF0HhvVHIWmL        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36      ::1     2019-12-20 12:48:16.464228
-161    fvhUhEhy8bRQnrZd1I0oVdAwntMj86Xdr5Yzz6Yy        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36      ::1     2019-12-22 09:58:14.675553
+162    RRiSGkElRtLTCs3lkdYpQNZDnxKJ2wOJdXrJ7WVO        1       192.168.178.23  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36       2019-12-24 10:59:50.644045
+163    BlvRAYUeX78wr2OhPvWU5TrsNAmsooAQzWy0Ki4x        1       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36        2001:7e8:cc73:de00:f4f8:d2a7:1c8:2664   2019-12-24 11:00:44.808971
+279    U9ksV3dLzsxjylgOx5WK5lPitIiU8nrSmBb8veJU        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36 Edg/79.0.309.71     ::1     2020-02-04 08:32:56.845626
+281    zdaOUZfTtPkLpOQYYPGqzViSKLTgtMWTPXxAMCj6        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36     ::1     2020-02-05 10:18:52.389333
+283    qCTq7PB9Ml539u6mdEoTGensJglVwc8MER3CxvC9        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36      ::1     2020-02-10 09:03:25.356532
+286    WeNOQHFuxR7KfY1DAK8nkMgCAc7JQ6EDaihRQNcd        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.100 Safari/537.36     ::1     2020-02-14 18:56:34.030027
+299    UgTmbOQeAFpuAAPqP7CGP22KXtsWMglxn4JoIqt9        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36     ::1     2020-02-24 11:53:27.013773
+301    0947l9NXchB8bZJx7UKHuBpazWGacjx2is0trEgu        1       Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36     ::1     2020-02-26 11:26:44.355966
 \.
 
 
@@ -863,9 +886,9 @@ COPY public.sessions (id, idsession, id_user, user_agent, remote_addr, created)
 COPY public.usergroups (id, usergroup, isdefault, groupname) FROM stdin;
 1      superadmin      \N      SuperAdmin
 2      admin   \N      Admin
-4      site    \N      Site
 5      user    t       Utilisateur
 3      manager \N      GĂ©rant
+4      teamleader      \N      Responsable
 \.
 
 
@@ -873,27 +896,10 @@ COPY public.usergroups (id, usergroup, isdefault, groupname) FROM stdin;
 -- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: potlu_user
 --
 
-COPY public.users (id, userpassword, created, blocked, username, regcode, vcode, schemaaccess, id_usergroups, surname, prename, phone, job, id_company) FROM stdin;
-2      f7252754a4cb7391d966316351b3501bce81fee9bc0b71807ddf61281a27821e        2019-12-20 11:03:08.757357      \N      kilian@saffran.lu       \N      \N      ["portanova"]   ["5"]   Saffran Kilian  691504574       \N      1
-1      228c27a646f18ce069bc2b8ef091a03c46cd51557e5b5ac90abc05c4f635b3ba        2019-10-10 17:12:11.934747      \N      kilian.saffran@gmail.com        \N      6tgfkew ["portanova"]   ["2","5","3"]   Saffran Kilian  +352691504574   GĂ©rant 1
-\.
-
-
---
--- Data for Name: zzold_members; Type: TABLE DATA; Schema: public; Owner: potlu_user
---
-
-COPY public.zzold_members (id, surname, prename, phone, id_user, id_company, job) FROM stdin;
-1      Saffran Kilian  \N      1       1       \N
-\.
-
-
---
--- Data for Name: zzold_useringroups; Type: TABLE DATA; Schema: public; Owner: potlu_user
---
-
-COPY public.zzold_useringroups (id, id_user, id_group) FROM stdin;
-1      1       1
+COPY public.users (id, userpassword, created, blocked, username, regcode, vcode, schemaaccess, id_usergroups, surname, prename, phone, job, id_company, id_usergroup) FROM stdin;
+1      0ecf731e2426a8a469f06e9f4a3bcbed6f8071d9d3e3ef7ef5fd9165021e27ec        2019-10-10 17:12:11.934747      \N      kilian.saffran@gmail.com        \N      6tgfkew ["test","portanova"]    ["2","5","3","4"]       Saffran Kilian  +352691504574   GĂ©rant 1       2
+2      f7252754a4cb7391d966316351b3501bce81fee9bc0b71807ddf61281a27821e        2019-12-20 11:03:08.757357      \N      kilian@saffran.lu       \N      \N      ["portanova"]   ["5"]   Saffran Kilian  691504574       \N      1       5
+4      ad3d14273d47ed24f6d62e3f8c64032e946d9e9d5965364a81e15d12a69cf2ce        2019-12-29 16:53:19.68549       \N      ksaffran@dks.lu \N      \N      ["portanova"]   ["3","5"]       Saffran Kilian  \N      \N      1       3
 \.
 
 
@@ -908,7 +914,7 @@ SELECT pg_catalog.setval('public.apps_id_seq', 11, true);
 -- Name: companies_id_seq; Type: SEQUENCE SET; Schema: public; Owner: potlu_user
 --
 
-SELECT pg_catalog.setval('public.companies_id_seq', 24, true);
+SELECT pg_catalog.setval('public.companies_id_seq', 26, true);
 
 
 --
@@ -925,18 +931,11 @@ SELECT pg_catalog.setval('public.maillayouts_id_seq', 1, true);
 SELECT pg_catalog.setval('public.mailtemplates_id_seq', 7, true);
 
 
---
--- Name: members_id_seq; Type: SEQUENCE SET; Schema: public; Owner: potlu_user
---
-
-SELECT pg_catalog.setval('public.members_id_seq', 1, false);
-
-
 --
 -- Name: sessions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: potlu_user
 --
 
-SELECT pg_catalog.setval('public.sessions_id_seq', 161, true);
+SELECT pg_catalog.setval('public.sessions_id_seq', 301, true);
 
 
 --
@@ -946,18 +945,11 @@ SELECT pg_catalog.setval('public.sessions_id_seq', 161, true);
 SELECT pg_catalog.setval('public.usergroups_id_seq', 4, true);
 
 
---
--- Name: useringroups_id_seq; Type: SEQUENCE SET; Schema: public; Owner: potlu_user
---
-
-SELECT pg_catalog.setval('public.useringroups_id_seq', 1, true);
-
-
 --
 -- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: potlu_user
 --
 
-SELECT pg_catalog.setval('public.users_id_seq', 2, true);
+SELECT pg_catalog.setval('public.users_id_seq', 4, true);
 
 
 --
@@ -992,14 +984,6 @@ ALTER TABLE ONLY public.mailtemplates
     ADD CONSTRAINT mailtemplates_pkey PRIMARY KEY (id);
 
 
---
--- Name: zzold_members members_pkey; Type: CONSTRAINT; Schema: public; Owner: potlu_user
---
-
-ALTER TABLE ONLY public.zzold_members
-    ADD CONSTRAINT members_pkey PRIMARY KEY (id);
-
-
 --
 -- Name: users uniq_username; Type: CONSTRAINT; Schema: public; Owner: potlu_user
 --
@@ -1016,14 +1000,6 @@ ALTER TABLE ONLY public.usergroups
     ADD CONSTRAINT usergroups_pkey PRIMARY KEY (id);
 
 
---
--- Name: zzold_useringroups useringroups_pkey; Type: CONSTRAINT; Schema: public; Owner: potlu_user
---
-
-ALTER TABLE ONLY public.zzold_useringroups
-    ADD CONSTRAINT useringroups_pkey PRIMARY KEY (id);
-
-
 --
 -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: potlu_user
 --
@@ -1048,21 +1024,22 @@ CREATE OR REPLACE VIEW public.vw_userslist AS
  SELECT us.id,
     us.blocked,
     us.username,
-    json_array_elements_text(us.schemaaccess) AS schemaaccess,
+    string_agg(DISTINCT uga.schemaccess, ','::text) AS schemaaccess,
     us.surname,
     us.prename,
     us.phone,
     us.job,
     us.id_company,
     co.company,
-    string_agg(ugrp.groupname, ','::text) AS usergroups
+    ugrp.groupname,
+    us.id_usergroup
    FROM (((public.users us
      LEFT JOIN public.companies co ON ((us.id_company = co.id)))
      LEFT JOIN ( SELECT users.id AS id_user,
-            (json_array_elements_text(users.id_usergroups))::integer AS id_usergroup
-           FROM public.users) ugs ON ((ugs.id_user = us.id)))
-     LEFT JOIN public.usergroups ugrp ON ((ugrp.id = ugs.id_usergroup)))
-  GROUP BY us.id, co.id;
+            json_array_elements_text(users.schemaaccess) AS schemaccess
+           FROM public.users) uga ON ((uga.id_user = us.id)))
+     LEFT JOIN public.usergroups ugrp ON ((ugrp.id = us.id_usergroup)))
+  GROUP BY us.id, co.id, ugrp.id;
 
 
 --
@@ -1082,27 +1059,19 @@ ALTER TABLE ONLY public.mailtemplates
 
 
 --
--- Name: zzold_members members_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: potlu_user
+-- Name: users users_fk; Type: FK CONSTRAINT; Schema: public; Owner: potlu_user
 --
 
-ALTER TABLE ONLY public.zzold_members
-    ADD CONSTRAINT members_users_fkey FOREIGN KEY (id_user) REFERENCES public.users(id);
-
-
---
--- Name: zzold_useringroups useringroups_idgroup_fkey; Type: FK CONSTRAINT; Schema: public; Owner: potlu_user
---
-
-ALTER TABLE ONLY public.zzold_useringroups
-    ADD CONSTRAINT useringroups_idgroup_fkey FOREIGN KEY (id_group) REFERENCES public.usergroups(id);
+ALTER TABLE ONLY public.users
+    ADD CONSTRAINT users_fk FOREIGN KEY (id_company) REFERENCES public.companies(id);
 
 
 --
--- Name: zzold_useringroups useringroups_iduser_fkey; Type: FK CONSTRAINT; Schema: public; Owner: potlu_user
+-- Name: users users_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: potlu_user
 --
 
-ALTER TABLE ONLY public.zzold_useringroups
-    ADD CONSTRAINT useringroups_iduser_fkey FOREIGN KEY (id_user) REFERENCES public.users(id);
+ALTER TABLE ONLY public.users
+    ADD CONSTRAINT users_fk_1 FOREIGN KEY (id_usergroup) REFERENCES public.usergroups(id);
 
 
 --
index d36ecb5..ca32120 100644 (file)
@@ -99,17 +99,16 @@ $$;
 -- Name: getsession(text, text, text); Type: FUNCTION; Schema: public; Owner: -
 --
 
-CREATE FUNCTION public.getsession(vidsession text, vremoteaddr text, vuseragent text) RETURNS TABLE(idsession text, id integer, username text, usergroups text, userschemata text)
+CREATE FUNCTION public.getsession(vidsession text, vremoteaddr text, vuseragent text) RETURNS TABLE(idsession text, id integer, username text, usergroup text)
     LANGUAGE plpgsql
-    AS $$\r
- BEGIN\r
- return QUERY select se.idsession,us.id,us.username,string_agg(distinct(ugrp.usergroup),',') as usergroups,json_array_elements_text(us.schemaaccess) as userschemata from sessions se 
+    AS $$
+ BEGIN
+ return QUERY select se.idsession,us.id,us.username,ugrp.usergroup from sessions se 
 join users us on (us.id=se.id_user)
-left join (SELECT users.id,json_array_elements_text(users.id_usergroups) AS id_usergroup FROM users) ugs on (us.id=ugs.id)
-left join usergroups ugrp on (ugrp.id=ugs.id)
+left join usergroups ugrp on (ugrp.id=us.id_usergroup)
 where se.idsession= vidsession and se.remote_addr= vremoteaddr and se.user_agent= vuseragent and 
-us.blocked is null group by se.id,us.id;\r
- END;  \r
+us.blocked is null group by se.id,us.id,ugrp.id;
+ END;  
 $$;
 
 
@@ -143,6 +142,23 @@ CREATE FUNCTION public.getweeks(vyear integer) RETURNS TABLE(cw integer, mondays
 $$;
 
 
+--
+-- Name: getweeksbydaterange(date, date); Type: FUNCTION; Schema: public; Owner: -
+--
+
+CREATE FUNCTION public.getweeksbydaterange(datefrom date, dateto date) RETURNS TABLE(calyear integer, calweek integer, weekstart date, weekend date)
+    LANGUAGE plpgsql
+    AS $$
+ BEGIN
+ return QUERY select date_part('isoyear',daydate)::int as calyear,date_part('week',daydate)::int4 as calweek,date(date_trunc('week',daydate)) as weekstart , date(date_trunc('week',daydate) + interval '6 days') as weekend 
+from
+(select datefrom + s*'1 day'::interval as daydate from 
+(select * from generate_series(0,dateto - datefrom )s)x ) d group by calyear,calweek,weekstart,weekend order by weekstart,weekend;
+
+ END;  
+$$;
+
+
 --
 -- Name: random_string(integer); Type: FUNCTION; Schema: public; Owner: -
 --
@@ -160,6 +176,29 @@ end;
 $$;
 
 
+--
+-- Name: staffworplan_contracthours(text, integer); Type: FUNCTION; Schema: public; Owner: -
+--
+
+CREATE FUNCTION public.staffworplan_contracthours(vschemaname text, vcontractid integer) RETURNS void
+    LANGUAGE plpgsql
+    AS $$\r
+declare\r
+       cur_contracthours TEXT;\r
+       cur_startdate date;\r
+       cur_enddate date;\r
+       cur_id_staff int4;\r
+ BEGIN\r
+       execute 'select startdate,enddate,id_staff,to_char(to_timestamp((round(weekhours/weekdays,3)) * 60), ''MI:SS:00'')   from ' || vschemaname || '.staffcontract where id=' || vcontractid || ';' into cur_startdate,cur_enddate,cur_id_staff,cur_contracthours;\r
+       if cur_enddate is null then\r
+               execute 'update ' || vschemaname || '.staffworkplan SET contracthours='''||  cur_contracthours || ''' WHERE id_staff=' || cur_id_staff || ' and daydate>=date(''' || to_char(cur_startdate,'YYYY-MM-DD') || ''');';  \r
+       else \r
+               execute 'update ' || vschemaname || '.staffworkplan SET contracthours='''||  cur_contracthours || ''' WHERE id_staff=' || cur_id_staff || ' and daydate between date(''' || to_char(cur_startdate,'YYYY-MM-DD') || ''') and date(''' || to_char(cur_enddate,'YYYY-MM-DD') || ''');';\r
+       end if;\r
+ END;  \r
+$$;
+
+
 --
 -- Name: trg_update_basemonthhours(); Type: FUNCTION; Schema: public; Owner: -
 --
@@ -220,6 +259,29 @@ CREATE FUNCTION public.trg_update_monthlyhours() RETURNS trigger
 $$;
 
 
+--
+-- Name: weekvacancy(text, double precision, integer); Type: FUNCTION; Schema: public; Owner: -
+--
+
+CREATE FUNCTION public.weekvacancy(vschema text, vcalweek double precision, vidstaff integer) RETURNS text
+    LANGUAGE plpgsql
+    AS $$\r
+ declare \r
+       vret text;\r
+    xsql text;\r
+ begin\r
+        xsql := 'select ''{"vacancy":{'' || string_agg(''"'' || id_vacancytype || ''":'' || row_to_json(weekvacancy),'','') || ''}}'' from (\r
+select  vk.id_vacancytype,sum(vk.vacancyhours) as vacancyhours,vt.vacancyname,vt.color,vt.isworktime from portanova.staffworkplan vk\r
+\r
+join ' || vschema || '.vacancytypes vt on (vt.id=vk.id_vacancytype)\r
+where date_part(''week'', daydate)= ' || vcalweek  || ' and id_staff= ' || vidstaff || ' group by vk.id_vacancytype,vt.vacancyname,vt.color,vt.isworktime) weekvacancy;';\r
+       --raise notice '%s',xsql;\r
+       execute xsql into vret;\r
+return vret;\r
+END;  \r
+$$;
+
+
 SET default_tablespace = '';
 
 SET default_with_oids = false;
@@ -236,7 +298,8 @@ CREATE TABLE public.apps (
     id_usergroup integer,
     icon text,
     sort integer,
-    menutype text
+    menutype text,
+    id_usergroups json
 );
 
 
@@ -279,7 +342,10 @@ CREATE TABLE public.companies (
     schemata2 json,
     email text,
     socialtype text,
-    vatvalidated boolean
+    vatvalidated boolean,
+    reportperiodunit text,
+    reportperiodlength integer,
+    reportperiodstart date
 );
 
 
@@ -369,41 +435,6 @@ CREATE SEQUENCE public.mailtemplates_id_seq
 ALTER SEQUENCE public.mailtemplates_id_seq OWNED BY public.mailtemplates.id;
 
 
---
--- Name: zzold_members; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.zzold_members (
-    id integer NOT NULL,
-    surname text,
-    prename text,
-    phone text,
-    id_user bigint,
-    id_company integer,
-    job text
-);
-
-
---
--- Name: members_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.members_id_seq
-    AS integer
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: members_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.members_id_seq OWNED BY public.zzold_members.id;
-
-
 --
 -- Name: sessions; Type: TABLE; Schema: public; Owner: -
 --
@@ -469,37 +500,6 @@ CREATE SEQUENCE public.usergroups_id_seq
 ALTER SEQUENCE public.usergroups_id_seq OWNED BY public.usergroups.id;
 
 
---
--- Name: zzold_useringroups; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE public.zzold_useringroups (
-    id integer NOT NULL,
-    id_user bigint,
-    id_group bigint
-);
-
-
---
--- Name: useringroups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE public.useringroups_id_seq
-    AS integer
-    START WITH 1
-    INCREMENT BY 1
-    NO MINVALUE
-    NO MAXVALUE
-    CACHE 1;
-
-
---
--- Name: useringroups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
---
-
-ALTER SEQUENCE public.useringroups_id_seq OWNED BY public.zzold_useringroups.id;
-
-
 --
 -- Name: users; Type: TABLE; Schema: public; Owner: -
 --
@@ -518,7 +518,8 @@ CREATE TABLE public.users (
     prename text,
     phone text,
     job text,
-    id_company integer
+    id_company integer,
+    id_usergroup integer
 );
 
 
@@ -561,7 +562,10 @@ CREATE VIEW public.vw_companiesdata AS
     companies.schemata2,
     companies.email,
     companies.socialtype,
-    companies.vatvalidated
+    companies.vatvalidated,
+    companies.reportperiodlength,
+    companies.reportperiodstart,
+    companies.reportperiodunit
    FROM public.companies;
 
 
@@ -584,7 +588,10 @@ CREATE VIEW public.vw_companieslist AS
     companies.schemata2,
     companies.email,
     companies.socialtype,
-    companies.vatvalidated
+    companies.vatvalidated,
+    companies.reportperiodlength,
+    companies.reportperiodstart,
+    companies.reportperiodunit
    FROM public.companies;
 
 
@@ -593,9 +600,11 @@ CREATE VIEW public.vw_companieslist AS
 --
 
 CREATE VIEW public.vw_schemata AS
- SELECT schemata.schema_name AS schemaname
-   FROM information_schema.schemata
-  WHERE ((schemata.schema_owner)::text = 'potlu_user'::text);
+ SELECT sct.schema_name AS schemaname,
+    cp.company
+   FROM (information_schema.schemata sct
+     JOIN public.companies cp ON (((sct.schema_name)::text = cp.schemata)))
+  WHERE (((sct.schema_owner)::text = 'potlu_user'::text) AND ((sct.schema_name)::text <> 'public'::text));
 
 
 --
@@ -610,6 +619,16 @@ CREATE VIEW public.vw_usergroupslist AS
    FROM public.usergroups;
 
 
+--
+-- Name: vw_userschemaaccess; Type: VIEW; Schema: public; Owner: -
+--
+
+CREATE VIEW public.vw_userschemaaccess AS
+ SELECT users.id,
+    json_array_elements_text(users.schemaaccess) AS schemaaccess
+   FROM public.users;
+
+
 --
 -- Name: vw_usersdata; Type: VIEW; Schema: public; Owner: -
 --
@@ -623,7 +642,7 @@ CREATE VIEW public.vw_usersdata AS
     users.regcode,
     users.vcode,
     users.schemaaccess,
-    users.id_usergroups,
+    users.id_usergroup,
     users.surname,
     users.prename,
     users.phone,
@@ -648,7 +667,8 @@ SELECT
     NULL::text AS job,
     NULL::integer AS id_company,
     NULL::text AS company,
-    NULL::text AS usergroups;
+    NULL::text AS groupname,
+    NULL::integer AS id_usergroup;
 
 
 --
@@ -700,20 +720,6 @@ ALTER TABLE ONLY public.usergroups ALTER COLUMN id SET DEFAULT nextval('public.u
 ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
 
 
---
--- Name: zzold_members id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.zzold_members ALTER COLUMN id SET DEFAULT nextval('public.members_id_seq'::regclass);
-
-
---
--- Name: zzold_useringroups id; Type: DEFAULT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.zzold_useringroups ALTER COLUMN id SET DEFAULT nextval('public.useringroups_id_seq'::regclass);
-
-
 --
 -- Name: apps apps_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 --
@@ -746,14 +752,6 @@ ALTER TABLE ONLY public.mailtemplates
     ADD CONSTRAINT mailtemplates_pkey PRIMARY KEY (id);
 
 
---
--- Name: zzold_members members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.zzold_members
-    ADD CONSTRAINT members_pkey PRIMARY KEY (id);
-
-
 --
 -- Name: users uniq_username; Type: CONSTRAINT; Schema: public; Owner: -
 --
@@ -770,14 +768,6 @@ ALTER TABLE ONLY public.usergroups
     ADD CONSTRAINT usergroups_pkey PRIMARY KEY (id);
 
 
---
--- Name: zzold_useringroups useringroups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.zzold_useringroups
-    ADD CONSTRAINT useringroups_pkey PRIMARY KEY (id);
-
-
 --
 -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
 --
@@ -802,21 +792,22 @@ CREATE OR REPLACE VIEW public.vw_userslist AS
  SELECT us.id,
     us.blocked,
     us.username,
-    json_array_elements_text(us.schemaaccess) AS schemaaccess,
+    string_agg(DISTINCT uga.schemaccess, ','::text) AS schemaaccess,
     us.surname,
     us.prename,
     us.phone,
     us.job,
     us.id_company,
     co.company,
-    string_agg(ugrp.groupname, ','::text) AS usergroups
+    ugrp.groupname,
+    us.id_usergroup
    FROM (((public.users us
      LEFT JOIN public.companies co ON ((us.id_company = co.id)))
      LEFT JOIN ( SELECT users.id AS id_user,
-            (json_array_elements_text(users.id_usergroups))::integer AS id_usergroup
-           FROM public.users) ugs ON ((ugs.id_user = us.id)))
-     LEFT JOIN public.usergroups ugrp ON ((ugrp.id = ugs.id_usergroup)))
-  GROUP BY us.id, co.id;
+            json_array_elements_text(users.schemaaccess) AS schemaccess
+           FROM public.users) uga ON ((uga.id_user = us.id)))
+     LEFT JOIN public.usergroups ugrp ON ((ugrp.id = us.id_usergroup)))
+  GROUP BY us.id, co.id, ugrp.id;
 
 
 --
@@ -836,27 +827,19 @@ ALTER TABLE ONLY public.mailtemplates
 
 
 --
--- Name: zzold_members members_users_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+-- Name: users users_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
 --
 
-ALTER TABLE ONLY public.zzold_members
-    ADD CONSTRAINT members_users_fkey FOREIGN KEY (id_user) REFERENCES public.users(id);
-
-
---
--- Name: zzold_useringroups useringroups_idgroup_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.zzold_useringroups
-    ADD CONSTRAINT useringroups_idgroup_fkey FOREIGN KEY (id_group) REFERENCES public.usergroups(id);
+ALTER TABLE ONLY public.users
+    ADD CONSTRAINT users_fk FOREIGN KEY (id_company) REFERENCES public.companies(id);
 
 
 --
--- Name: zzold_useringroups useringroups_iduser_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
+-- Name: users users_fk_1; Type: FK CONSTRAINT; Schema: public; Owner: -
 --
 
-ALTER TABLE ONLY public.zzold_useringroups
-    ADD CONSTRAINT useringroups_iduser_fkey FOREIGN KEY (id_user) REFERENCES public.users(id);
+ALTER TABLE ONLY public.users
+    ADD CONSTRAINT users_fk_1 FOREIGN KEY (id_usergroup) REFERENCES public.usergroups(id);
 
 
 --
diff --git a/dev/db/potlu_db.public.tables.live.txt b/dev/db/potlu_db.public.tables.live.txt
deleted file mode 100644 (file)
index c9844f6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-
-public|apps|BASETABLE
-public|companies|BASETABLE
-public|maillayouts|BASETABLE
-public|mailtemplates|BASETABLE
-public|members|BASETABLE
-public|sessions|BASETABLE
-public|usergroups|BASETABLE
-public|useringroups|BASETABLE
-public|users|BASETABLE
-public|vw_companiesdata|VIEW
-public|vw_companieslist|VIEW
-public|vw_memberdata|VIEW
-public|vw_userdata|VIEW
-public|vw_userlist|VIEW
diff --git a/dev/db/potlu_db.public.tables.local.txt b/dev/db/potlu_db.public.tables.local.txt
deleted file mode 100644 (file)
index 3182c7e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-public|apps|BASETABLE
-public|companies|BASETABLE
-public|maillayouts|BASETABLE
-public|mailtemplates|BASETABLE
-public|sessions|BASETABLE
-public|usergroups|BASETABLE
-public|users|BASETABLE
-public|vw_companiesdata|VIEW
-public|vw_companieslist|VIEW
-public|vw_schemata|VIEW
-public|vw_usergroupslist|VIEW
-public|vw_usersdata|VIEW
-public|vw_userslist|VIEW
diff --git a/dev/db/potlu_db.refschema.columns.local.txt b/dev/db/potlu_db.refschema.columns.local.txt
deleted file mode 100644 (file)
index 4be0aaa..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-
-reportperiod|BASETABLE|enddate|date
-reportperiod|BASETABLE|id|integer
-reportperiod|BASETABLE|periodname|text
-reportperiod|BASETABLE|startdate|date
-sites|BASETABLE|address|text
-sites|BASETABLE|city|text
-sites|BASETABLE|country|text
-sites|BASETABLE|created|timestampwithouttimezone
-sites|BASETABLE|id|integer
-sites|BASETABLE|id_timetracker|integer
-sites|BASETABLE|modified|timestampwithouttimezone
-sites|BASETABLE|sitename|text
-sites|BASETABLE|timeclockhost|text
-sites|BASETABLE|zip|text
-staff|BASETABLE|birthdate|date
-staff|BASETABLE|entrydate|date
-staff|BASETABLE|id|integer
-staff|BASETABLE|job|text
-staff|BASETABLE|leavedate|date
-staff|BASETABLE|prename|text
-staff|BASETABLE|staffnumber|text
-staff|BASETABLE|surname|text
-staffcontract|BASETABLE|id|integer
-staffcontract|BASETABLE|id_staffgroup|integer
-staffcontract|BASETABLE|id_staff|integer
-staffcontract|BASETABLE|monthhours|numeric
-staffcontract|BASETABLE|startdate|date
-staffcontract|BASETABLE|weekhours|numeric
-staffgroups|BASETABLE|groupcolor|text
-staffgroups|BASETABLE|groupname|text
-staffgroups|BASETABLE|id|integer
-stafftimetracks|BASETABLE|created|timestampwithouttimezone
-stafftimetracks|BASETABLE|id|bigint
-stafftimetracks|BASETABLE|id_staff|integer
-stafftimetracks|BASETABLE|modified|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_in|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_out|timestampwithouttimezone
-stafftimetracks|BASETABLE|tracktype|text
-staffvacancy|BASETABLE|dayhours|timewithouttimezone
-staffvacancy|BASETABLE|enddate|date
-staffvacancy|BASETABLE|id|integer
-staffvacancy|BASETABLE|id_staff|integer
-staffvacancy|BASETABLE|note|text
-staffvacancy|BASETABLE|startdate|date
-staffvacancy|BASETABLE|vacancytype|text
-staffvacancy|BASETABLE|validated|boolean
-staffvacancyyear|BASETABLE|days|numeric
-staffvacancyyear|BASETABLE|hours|numeric
-staffvacancyyear|BASETABLE|id|integer
-staffvacancyyear|BASETABLE|id_staff|integer
-staffvacancyyear|BASETABLE|vyear|integer
-staffworkplan|BASETABLE|daydate|date
-staffworkplan|BASETABLE|id|bigint
-staffworkplan|BASETABLE|id_staff|integer
-staffworkplan|BASETABLE|timeend1|timewithouttimezone
-staffworkplan|BASETABLE|timeend2|timewithouttimezone
-staffworkplan|BASETABLE|timepause|timewithouttimezone
-staffworkplan|BASETABLE|timestart1|timewithouttimezone
-staffworkplan|BASETABLE|timestart2|timewithouttimezone
-staffworkplan|BASETABLE|vacancyhours|timewithouttimezone
-staffworkplan|BASETABLE|vacancytype|text
-vw_reportperiodlist|VIEW|enddate|date
-vw_reportperiodlist|VIEW|id|integer
-vw_reportperiodlist|VIEW|periodname|text
-vw_reportperiodlist|VIEW|startdate|date
-vw_staffcontractdata|VIEW|id|integer
-vw_staffcontractdata|VIEW|id_staffgroup|integer
-vw_staffcontractdata|VIEW|id_staff|integer
-vw_staffcontractdata|VIEW|monthhours|numeric
-vw_staffcontractdata|VIEW|startdate|date
-vw_staffcontractdata|VIEW|weekhours|numeric
-vw_staffcontractlist|VIEW|groupcolor|text
-vw_staffcontractlist|VIEW|groupname|text
-vw_staffcontractlist|VIEW|id|integer
-vw_staffcontractlist|VIEW|id_staffgroup|integer
-vw_staffcontractlist|VIEW|id_staff|integer
-vw_staffcontractlist|VIEW|monthhours|numeric
-vw_staffcontractlist|VIEW|startdate|date
-vw_staffcontractlist|VIEW|weekhours|numeric
-vw_staffdata|VIEW|birthdate|date
-vw_staffdata|VIEW|entrydate|date
-vw_staffdata|VIEW|id|integer
-vw_staffdata|VIEW|job|text
-vw_staffdata|VIEW|leavedate|date
-vw_staffdata|VIEW|prename|text
-vw_staffdata|VIEW|staffnumber|text
-vw_staffdata|VIEW|surname|text
-vw_staffgroupsdata|VIEW|groupcolor|text
-vw_staffgroupsdata|VIEW|groupname|text
-vw_staffgroupsdata|VIEW|id|integer
-vw_staffgroupslist|VIEW|groupcolor|text
-vw_staffgroupslist|VIEW|groupname|text
-vw_staffgroupslist|VIEW|id|integer
-vw_stafflist|VIEW|birthdate|date
-vw_stafflist|VIEW|dspname|text
-vw_stafflist|VIEW|entrydate|date
-vw_stafflist|VIEW|id|integer
-vw_stafflist|VIEW|job|text
-vw_stafflist|VIEW|leavedate|date
-vw_stafflist|VIEW|prename|text
-vw_stafflist|VIEW|staffnumber|text
-vw_stafflist|VIEW|surname|text
-vw_staffplanned_dayweektotals|VIEW|calweek|doubleprecision
-vw_staffplanned_dayweektotals|VIEW|dates|date
-vw_staffplanned_dayweektotals|VIEW|fri_end1|text
-vw_staffplanned_dayweektotals|VIEW|fri_end2|text
-vw_staffplanned_dayweektotals|VIEW|fri_id|bigint
-vw_staffplanned_dayweektotals|VIEW|fri_pause|text
-vw_staffplanned_dayweektotals|VIEW|fri_start1|text
-vw_staffplanned_dayweektotals|VIEW|fri_start2|text
-vw_staffplanned_dayweektotals|VIEW|fri_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|id_staff|integer
-vw_staffplanned_dayweektotals|VIEW|mon_end1|text
-vw_staffplanned_dayweektotals|VIEW|mon_end2|text
-vw_staffplanned_dayweektotals|VIEW|mon_id|bigint
-vw_staffplanned_dayweektotals|VIEW|mon_pause|text
-vw_staffplanned_dayweektotals|VIEW|mon_start1|text
-vw_staffplanned_dayweektotals|VIEW|mon_start2|text
-vw_staffplanned_dayweektotals|VIEW|mon_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|sat_end1|text
-vw_staffplanned_dayweektotals|VIEW|sat_end2|text
-vw_staffplanned_dayweektotals|VIEW|sat_id|bigint
-vw_staffplanned_dayweektotals|VIEW|sat_pause|text
-vw_staffplanned_dayweektotals|VIEW|sat_start1|text
-vw_staffplanned_dayweektotals|VIEW|sat_start2|text
-vw_staffplanned_dayweektotals|VIEW|sat_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|sun_end1|text
-vw_staffplanned_dayweektotals|VIEW|sun_end2|text
-vw_staffplanned_dayweektotals|VIEW|sun_id|bigint
-vw_staffplanned_dayweektotals|VIEW|sun_pause|text
-vw_staffplanned_dayweektotals|VIEW|sun_start1|text
-vw_staffplanned_dayweektotals|VIEW|sun_start2|text
-vw_staffplanned_dayweektotals|VIEW|sun_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|thu_end1|text
-vw_staffplanned_dayweektotals|VIEW|thu_end2|text
-vw_staffplanned_dayweektotals|VIEW|thu_id|bigint
-vw_staffplanned_dayweektotals|VIEW|thu_pause|text
-vw_staffplanned_dayweektotals|VIEW|thu_start1|text
-vw_staffplanned_dayweektotals|VIEW|thu_start2|text
-vw_staffplanned_dayweektotals|VIEW|thu_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|tue_end1|text
-vw_staffplanned_dayweektotals|VIEW|tue_end2|text
-vw_staffplanned_dayweektotals|VIEW|tue_id|bigint
-vw_staffplanned_dayweektotals|VIEW|tue_pause|text
-vw_staffplanned_dayweektotals|VIEW|tue_start1|text
-vw_staffplanned_dayweektotals|VIEW|tue_start2|text
-vw_staffplanned_dayweektotals|VIEW|tue_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|wed_end1|text
-vw_staffplanned_dayweektotals|VIEW|wed_end2|text
-vw_staffplanned_dayweektotals|VIEW|wed_id|bigint
-vw_staffplanned_dayweektotals|VIEW|wed_pause|text
-vw_staffplanned_dayweektotals|VIEW|wed_start1|text
-vw_staffplanned_dayweektotals|VIEW|wed_start2|text
-vw_staffplanned_dayweektotals|VIEW|wed_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|week_timetotal|text
-vw_staffworkplanlist|VIEW|calweek|integer
-vw_staffworkplanlist|VIEW|calyear|text
-vw_staffworkplanlist|VIEW|dspcalweek|text
-vw_staffworkplanlist|VIEW|dspfritimes|text
-vw_staffworkplanlist|VIEW|dspmontimes|text
-vw_staffworkplanlist|VIEW|dspsattimes|text
-vw_staffworkplanlist|VIEW|dspsuntimes|text
-vw_staffworkplanlist|VIEW|dspthutimes|text
-vw_staffworkplanlist|VIEW|dsptuetimes|text
-vw_staffworkplanlist|VIEW|dspwedtimes|text
-vw_staffworkplanlist|VIEW|fri_date|date
-vw_staffworkplanlist|VIEW|fri_id|bigint
-vw_staffworkplanlist|VIEW|fri_timetotal|text
-vw_staffworkplanlist|VIEW|id_staff|integer
-vw_staffworkplanlist|VIEW|mon_date|date
-vw_staffworkplanlist|VIEW|mon_id|bigint
-vw_staffworkplanlist|VIEW|mon_timetotal|text
-vw_staffworkplanlist|VIEW|sat_date|date
-vw_staffworkplanlist|VIEW|sat_id|bigint
-vw_staffworkplanlist|VIEW|sat_timetotal|text
-vw_staffworkplanlist|VIEW|staffname|text
-vw_staffworkplanlist|VIEW|sun_date|date
-vw_staffworkplanlist|VIEW|sun_id|bigint
-vw_staffworkplanlist|VIEW|sun_timetotal|text
-vw_staffworkplanlist|VIEW|thu_date|date
-vw_staffworkplanlist|VIEW|thu_id|bigint
-vw_staffworkplanlist|VIEW|thu_timetotal|text
-vw_staffworkplanlist|VIEW|tue_date|date
-vw_staffworkplanlist|VIEW|tue_id|bigint
-vw_staffworkplanlist|VIEW|tue_timetotal|text
-vw_staffworkplanlist|VIEW|wed_date|date
-vw_staffworkplanlist|VIEW|wed_id|bigint
-vw_staffworkplanlist|VIEW|wed_timetotal|text
-vw_staffworkplanlist|VIEW|weekend|date
-vw_staffworkplanlist|VIEW|weekminutes|numeric
-vw_staffworkplanlist|VIEW|weekstart|date
-vw_staffworkplanlist|VIEW|week_timetotal|text
-vw_staffworkplanlist|VIEW|weekvacancy_minutes_ill|numeric
-vw_staffworkplanlist|VIEW|weekvacancy_minutes|numeric
-vw_staffworkplanlist|VIEW|weekvacancy_times_ill|text
-vw_staffworkplanlist|VIEW|weekvacancy_times|text
-vw_staffworkplan_weekly|VIEW|calweek|doubleprecision
-vw_staffworkplan_weekly|VIEW|calyear|text
-vw_staffworkplan_weekly|VIEW|dates|text
-vw_staffworkplan_weekly|VIEW|fri_id|bigint
-vw_staffworkplan_weekly|VIEW|fri_timeend1|text
-vw_staffworkplan_weekly|VIEW|fri_timeend2|text
-vw_staffworkplan_weekly|VIEW|fri_timepause|text
-vw_staffworkplan_weekly|VIEW|fri_timestart1|text
-vw_staffworkplan_weekly|VIEW|fri_timestart2|text
-vw_staffworkplan_weekly|VIEW|fri_timetotal|text
-vw_staffworkplan_weekly|VIEW|fri_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|fri_vacancytype|text
-vw_staffworkplan_weekly|VIEW|id_staff|integer
-vw_staffworkplan_weekly|VIEW|mon_id|bigint
-vw_staffworkplan_weekly|VIEW|mon_timeend1|text
-vw_staffworkplan_weekly|VIEW|mon_timeend2|text
-vw_staffworkplan_weekly|VIEW|mon_timepause|text
-vw_staffworkplan_weekly|VIEW|mon_timestart1|text
-vw_staffworkplan_weekly|VIEW|mon_timestart2|text
-vw_staffworkplan_weekly|VIEW|mon_timetotal|text
-vw_staffworkplan_weekly|VIEW|mon_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|mon_vacancytype|text
-vw_staffworkplan_weekly|VIEW|sat_id|bigint
-vw_staffworkplan_weekly|VIEW|sat_timeend1|text
-vw_staffworkplan_weekly|VIEW|sat_timeend2|text
-vw_staffworkplan_weekly|VIEW|sat_timepause|text
-vw_staffworkplan_weekly|VIEW|sat_timestart1|text
-vw_staffworkplan_weekly|VIEW|sat_timestart2|text
-vw_staffworkplan_weekly|VIEW|sat_timetotal|text
-vw_staffworkplan_weekly|VIEW|sat_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|sat_vacancytype|text
-vw_staffworkplan_weekly|VIEW|sun_id|bigint
-vw_staffworkplan_weekly|VIEW|sun_timeend1|text
-vw_staffworkplan_weekly|VIEW|sun_timeend2|text
-vw_staffworkplan_weekly|VIEW|sun_timepause|text
-vw_staffworkplan_weekly|VIEW|sun_timestart1|text
-vw_staffworkplan_weekly|VIEW|sun_timestart2|text
-vw_staffworkplan_weekly|VIEW|sun_timetotal|text
-vw_staffworkplan_weekly|VIEW|sun_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|sun_vacancytype|text
-vw_staffworkplan_weekly|VIEW|thu_id|bigint
-vw_staffworkplan_weekly|VIEW|thu_timeend1|text
-vw_staffworkplan_weekly|VIEW|thu_timeend2|text
-vw_staffworkplan_weekly|VIEW|thu_timepause|text
-vw_staffworkplan_weekly|VIEW|thu_timestart1|text
-vw_staffworkplan_weekly|VIEW|thu_timestart2|text
-vw_staffworkplan_weekly|VIEW|thu_timetotal|text
-vw_staffworkplan_weekly|VIEW|thu_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|thu_vacancytype|text
-vw_staffworkplan_weekly|VIEW|tue_id|bigint
-vw_staffworkplan_weekly|VIEW|tue_timeend1|text
-vw_staffworkplan_weekly|VIEW|tue_timeend2|text
-vw_staffworkplan_weekly|VIEW|tue_timepause|text
-vw_staffworkplan_weekly|VIEW|tue_timestart1|text
-vw_staffworkplan_weekly|VIEW|tue_timestart2|text
-vw_staffworkplan_weekly|VIEW|tue_timetotal|text
-vw_staffworkplan_weekly|VIEW|tue_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|tue_vacancytype|text
-vw_staffworkplan_weekly|VIEW|wed_id|bigint
-vw_staffworkplan_weekly|VIEW|wed_timeend1|text
-vw_staffworkplan_weekly|VIEW|wed_timeend2|text
-vw_staffworkplan_weekly|VIEW|wed_timepause|text
-vw_staffworkplan_weekly|VIEW|wed_timestart1|text
-vw_staffworkplan_weekly|VIEW|wed_timestart2|text
-vw_staffworkplan_weekly|VIEW|wed_timetotal|text
-vw_staffworkplan_weekly|VIEW|wed_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|wed_vacancytype|text
-vw_staffworkplan_weekly|VIEW|weekbegin|date
-vw_staffworkplan_weekly|VIEW|week_timetotal|text
-vw_workplanlist|VIEW|id|integer
-vw_workplanlist|VIEW|workplan|text
-vw_workplansdata|VIEW|fri_timeend1|text
-vw_workplansdata|VIEW|fri_timeend2|text
-vw_workplansdata|VIEW|fri_timepause|text
-vw_workplansdata|VIEW|fri_timestart1|text
-vw_workplansdata|VIEW|fri_timestart2|text
-vw_workplansdata|VIEW|id|integer
-vw_workplansdata|VIEW|mon_timeend1|text
-vw_workplansdata|VIEW|mon_timeend2|text
-vw_workplansdata|VIEW|mon_timepause|text
-vw_workplansdata|VIEW|mon_timestart1|text
-vw_workplansdata|VIEW|mon_timestart2|text
-vw_workplansdata|VIEW|sat_timeend1|text
-vw_workplansdata|VIEW|sat_timeend2|text
-vw_workplansdata|VIEW|sat_timepause|text
-vw_workplansdata|VIEW|sat_timestart1|text
-vw_workplansdata|VIEW|sat_timestart2|text
-vw_workplansdata|VIEW|sun_timeend1|text
-vw_workplansdata|VIEW|sun_timeend2|text
-vw_workplansdata|VIEW|sun_timepause|text
-vw_workplansdata|VIEW|sun_timestart1|text
-vw_workplansdata|VIEW|sun_timestart2|text
-vw_workplansdata|VIEW|thu_timeend1|text
-vw_workplansdata|VIEW|thu_timeend2|text
-vw_workplansdata|VIEW|thu_timepause|text
-vw_workplansdata|VIEW|thu_timestart1|text
-vw_workplansdata|VIEW|thu_timestart2|text
-vw_workplansdata|VIEW|tue_timeend1|text
-vw_workplansdata|VIEW|tue_timeend2|text
-vw_workplansdata|VIEW|tue_timepause|text
-vw_workplansdata|VIEW|tue_timestart1|text
-vw_workplansdata|VIEW|tue_timestart2|text
-vw_workplansdata|VIEW|wed_timeend1|text
-vw_workplansdata|VIEW|wed_timeend2|text
-vw_workplansdata|VIEW|wed_timepause|text
-vw_workplansdata|VIEW|wed_timestart1|text
-vw_workplansdata|VIEW|wed_timestart2|text
-vw_workplansdata|VIEW|workplan|text
-vw_workplans|VIEW|dspfritimes|text
-vw_workplans|VIEW|dspmontimes|text
-vw_workplans|VIEW|dspsattimes|text
-vw_workplans|VIEW|dspsuntimes|text
-vw_workplans|VIEW|dspthutimes|text
-vw_workplans|VIEW|dsptuetimes|text
-vw_workplans|VIEW|dspwedtimes|text
-vw_workplans|VIEW|id|integer
-vw_workplans|VIEW|workplan|text
-workplans|BASETABLE|fri_timeend1|timewithouttimezone
-workplans|BASETABLE|fri_timeend2|timewithouttimezone
-workplans|BASETABLE|fri_timepause|timewithouttimezone
-workplans|BASETABLE|fri_timestart1|timewithouttimezone
-workplans|BASETABLE|fri_timestart2|timewithouttimezone
-workplans|BASETABLE|id|integer
-workplans|BASETABLE|mon_timeend1|timewithouttimezone
-workplans|BASETABLE|mon_timeend2|timewithouttimezone
-workplans|BASETABLE|mon_timepause|timewithouttimezone
-workplans|BASETABLE|mon_timestart1|timewithouttimezone
-workplans|BASETABLE|mon_timestart2|timewithouttimezone
-workplans|BASETABLE|sat_timeend1|timewithouttimezone
-workplans|BASETABLE|sat_timeend2|timewithouttimezone
-workplans|BASETABLE|sat_timepause|timewithouttimezone
-workplans|BASETABLE|sat_timestart1|timewithouttimezone
-workplans|BASETABLE|sat_timestart2|timewithouttimezone
-workplans|BASETABLE|sun_timeend1|timewithouttimezone
-workplans|BASETABLE|sun_timeend2|timewithouttimezone
-workplans|BASETABLE|sun_timepause|timewithouttimezone
-workplans|BASETABLE|sun_timestart1|timewithouttimezone
-workplans|BASETABLE|sun_timestart2|timewithouttimezone
-workplans|BASETABLE|thu_timeend1|timewithouttimezone
-workplans|BASETABLE|thu_timeend2|timewithouttimezone
-workplans|BASETABLE|thu_timepause|timewithouttimezone
-workplans|BASETABLE|thu_timestart1|timewithouttimezone
-workplans|BASETABLE|thu_timestart2|timewithouttimezone
-workplans|BASETABLE|tue_timeend1|timewithouttimezone
-workplans|BASETABLE|tue_timeend2|timewithouttimezone
-workplans|BASETABLE|tue_timepause|timewithouttimezone
-workplans|BASETABLE|tue_timestart1|timewithouttimezone
-workplans|BASETABLE|tue_timestart2|timewithouttimezone
-workplans|BASETABLE|wed_timeend1|timewithouttimezone
-workplans|BASETABLE|wed_timeend2|timewithouttimezone
-workplans|BASETABLE|wed_timepause|timewithouttimezone
-workplans|BASETABLE|wed_timestart1|timewithouttimezone
-workplans|BASETABLE|wed_timestart2|timewithouttimezone
-workplans|BASETABLE|workplan|text
-worktypes|BASETABLE|id|integer
-worktypes|BASETABLE|isfreetime|boolean
-worktypes|BASETABLE|isworktime|boolean
-worktypes|BASETABLE|typecolor|text
-worktypes|BASETABLE|worktype|text
diff --git a/dev/db/potlu_db.refschema.tables.local.txt b/dev/db/potlu_db.refschema.tables.local.txt
deleted file mode 100644 (file)
index 3a72c19..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-reportperiod|BASETABLE
-sites|BASETABLE
-staff|BASETABLE
-staffcontract|BASETABLE
-staffgroups|BASETABLE
-stafftimetracks|BASETABLE
-staffvacancy|BASETABLE
-staffvacancyyear|BASETABLE
-staffworkplan|BASETABLE
-vw_reportperiodlist|VIEW
-vw_staffcontractdata|VIEW
-vw_staffcontractlist|VIEW
-vw_staffdata|VIEW
-vw_staffgroupsdata|VIEW
-vw_staffgroupslist|VIEW
-vw_stafflist|VIEW
-vw_staffplanned_dayweektotals|VIEW
-vw_staffworkplanlist|VIEW
-vw_staffworkplan_weekly|VIEW
-vw_workplanlist|VIEW
-vw_workplansdata|VIEW
-vw_workplans|VIEW
-workplans|BASETABLE
-worktypes|BASETABLE
diff --git a/dev/db/potlu_db.test.columns.live.txt b/dev/db/potlu_db.test.columns.live.txt
deleted file mode 100644 (file)
index 4be0aaa..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-
-reportperiod|BASETABLE|enddate|date
-reportperiod|BASETABLE|id|integer
-reportperiod|BASETABLE|periodname|text
-reportperiod|BASETABLE|startdate|date
-sites|BASETABLE|address|text
-sites|BASETABLE|city|text
-sites|BASETABLE|country|text
-sites|BASETABLE|created|timestampwithouttimezone
-sites|BASETABLE|id|integer
-sites|BASETABLE|id_timetracker|integer
-sites|BASETABLE|modified|timestampwithouttimezone
-sites|BASETABLE|sitename|text
-sites|BASETABLE|timeclockhost|text
-sites|BASETABLE|zip|text
-staff|BASETABLE|birthdate|date
-staff|BASETABLE|entrydate|date
-staff|BASETABLE|id|integer
-staff|BASETABLE|job|text
-staff|BASETABLE|leavedate|date
-staff|BASETABLE|prename|text
-staff|BASETABLE|staffnumber|text
-staff|BASETABLE|surname|text
-staffcontract|BASETABLE|id|integer
-staffcontract|BASETABLE|id_staffgroup|integer
-staffcontract|BASETABLE|id_staff|integer
-staffcontract|BASETABLE|monthhours|numeric
-staffcontract|BASETABLE|startdate|date
-staffcontract|BASETABLE|weekhours|numeric
-staffgroups|BASETABLE|groupcolor|text
-staffgroups|BASETABLE|groupname|text
-staffgroups|BASETABLE|id|integer
-stafftimetracks|BASETABLE|created|timestampwithouttimezone
-stafftimetracks|BASETABLE|id|bigint
-stafftimetracks|BASETABLE|id_staff|integer
-stafftimetracks|BASETABLE|modified|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_in|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_out|timestampwithouttimezone
-stafftimetracks|BASETABLE|tracktype|text
-staffvacancy|BASETABLE|dayhours|timewithouttimezone
-staffvacancy|BASETABLE|enddate|date
-staffvacancy|BASETABLE|id|integer
-staffvacancy|BASETABLE|id_staff|integer
-staffvacancy|BASETABLE|note|text
-staffvacancy|BASETABLE|startdate|date
-staffvacancy|BASETABLE|vacancytype|text
-staffvacancy|BASETABLE|validated|boolean
-staffvacancyyear|BASETABLE|days|numeric
-staffvacancyyear|BASETABLE|hours|numeric
-staffvacancyyear|BASETABLE|id|integer
-staffvacancyyear|BASETABLE|id_staff|integer
-staffvacancyyear|BASETABLE|vyear|integer
-staffworkplan|BASETABLE|daydate|date
-staffworkplan|BASETABLE|id|bigint
-staffworkplan|BASETABLE|id_staff|integer
-staffworkplan|BASETABLE|timeend1|timewithouttimezone
-staffworkplan|BASETABLE|timeend2|timewithouttimezone
-staffworkplan|BASETABLE|timepause|timewithouttimezone
-staffworkplan|BASETABLE|timestart1|timewithouttimezone
-staffworkplan|BASETABLE|timestart2|timewithouttimezone
-staffworkplan|BASETABLE|vacancyhours|timewithouttimezone
-staffworkplan|BASETABLE|vacancytype|text
-vw_reportperiodlist|VIEW|enddate|date
-vw_reportperiodlist|VIEW|id|integer
-vw_reportperiodlist|VIEW|periodname|text
-vw_reportperiodlist|VIEW|startdate|date
-vw_staffcontractdata|VIEW|id|integer
-vw_staffcontractdata|VIEW|id_staffgroup|integer
-vw_staffcontractdata|VIEW|id_staff|integer
-vw_staffcontractdata|VIEW|monthhours|numeric
-vw_staffcontractdata|VIEW|startdate|date
-vw_staffcontractdata|VIEW|weekhours|numeric
-vw_staffcontractlist|VIEW|groupcolor|text
-vw_staffcontractlist|VIEW|groupname|text
-vw_staffcontractlist|VIEW|id|integer
-vw_staffcontractlist|VIEW|id_staffgroup|integer
-vw_staffcontractlist|VIEW|id_staff|integer
-vw_staffcontractlist|VIEW|monthhours|numeric
-vw_staffcontractlist|VIEW|startdate|date
-vw_staffcontractlist|VIEW|weekhours|numeric
-vw_staffdata|VIEW|birthdate|date
-vw_staffdata|VIEW|entrydate|date
-vw_staffdata|VIEW|id|integer
-vw_staffdata|VIEW|job|text
-vw_staffdata|VIEW|leavedate|date
-vw_staffdata|VIEW|prename|text
-vw_staffdata|VIEW|staffnumber|text
-vw_staffdata|VIEW|surname|text
-vw_staffgroupsdata|VIEW|groupcolor|text
-vw_staffgroupsdata|VIEW|groupname|text
-vw_staffgroupsdata|VIEW|id|integer
-vw_staffgroupslist|VIEW|groupcolor|text
-vw_staffgroupslist|VIEW|groupname|text
-vw_staffgroupslist|VIEW|id|integer
-vw_stafflist|VIEW|birthdate|date
-vw_stafflist|VIEW|dspname|text
-vw_stafflist|VIEW|entrydate|date
-vw_stafflist|VIEW|id|integer
-vw_stafflist|VIEW|job|text
-vw_stafflist|VIEW|leavedate|date
-vw_stafflist|VIEW|prename|text
-vw_stafflist|VIEW|staffnumber|text
-vw_stafflist|VIEW|surname|text
-vw_staffplanned_dayweektotals|VIEW|calweek|doubleprecision
-vw_staffplanned_dayweektotals|VIEW|dates|date
-vw_staffplanned_dayweektotals|VIEW|fri_end1|text
-vw_staffplanned_dayweektotals|VIEW|fri_end2|text
-vw_staffplanned_dayweektotals|VIEW|fri_id|bigint
-vw_staffplanned_dayweektotals|VIEW|fri_pause|text
-vw_staffplanned_dayweektotals|VIEW|fri_start1|text
-vw_staffplanned_dayweektotals|VIEW|fri_start2|text
-vw_staffplanned_dayweektotals|VIEW|fri_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|id_staff|integer
-vw_staffplanned_dayweektotals|VIEW|mon_end1|text
-vw_staffplanned_dayweektotals|VIEW|mon_end2|text
-vw_staffplanned_dayweektotals|VIEW|mon_id|bigint
-vw_staffplanned_dayweektotals|VIEW|mon_pause|text
-vw_staffplanned_dayweektotals|VIEW|mon_start1|text
-vw_staffplanned_dayweektotals|VIEW|mon_start2|text
-vw_staffplanned_dayweektotals|VIEW|mon_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|sat_end1|text
-vw_staffplanned_dayweektotals|VIEW|sat_end2|text
-vw_staffplanned_dayweektotals|VIEW|sat_id|bigint
-vw_staffplanned_dayweektotals|VIEW|sat_pause|text
-vw_staffplanned_dayweektotals|VIEW|sat_start1|text
-vw_staffplanned_dayweektotals|VIEW|sat_start2|text
-vw_staffplanned_dayweektotals|VIEW|sat_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|sun_end1|text
-vw_staffplanned_dayweektotals|VIEW|sun_end2|text
-vw_staffplanned_dayweektotals|VIEW|sun_id|bigint
-vw_staffplanned_dayweektotals|VIEW|sun_pause|text
-vw_staffplanned_dayweektotals|VIEW|sun_start1|text
-vw_staffplanned_dayweektotals|VIEW|sun_start2|text
-vw_staffplanned_dayweektotals|VIEW|sun_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|thu_end1|text
-vw_staffplanned_dayweektotals|VIEW|thu_end2|text
-vw_staffplanned_dayweektotals|VIEW|thu_id|bigint
-vw_staffplanned_dayweektotals|VIEW|thu_pause|text
-vw_staffplanned_dayweektotals|VIEW|thu_start1|text
-vw_staffplanned_dayweektotals|VIEW|thu_start2|text
-vw_staffplanned_dayweektotals|VIEW|thu_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|tue_end1|text
-vw_staffplanned_dayweektotals|VIEW|tue_end2|text
-vw_staffplanned_dayweektotals|VIEW|tue_id|bigint
-vw_staffplanned_dayweektotals|VIEW|tue_pause|text
-vw_staffplanned_dayweektotals|VIEW|tue_start1|text
-vw_staffplanned_dayweektotals|VIEW|tue_start2|text
-vw_staffplanned_dayweektotals|VIEW|tue_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|wed_end1|text
-vw_staffplanned_dayweektotals|VIEW|wed_end2|text
-vw_staffplanned_dayweektotals|VIEW|wed_id|bigint
-vw_staffplanned_dayweektotals|VIEW|wed_pause|text
-vw_staffplanned_dayweektotals|VIEW|wed_start1|text
-vw_staffplanned_dayweektotals|VIEW|wed_start2|text
-vw_staffplanned_dayweektotals|VIEW|wed_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|week_timetotal|text
-vw_staffworkplanlist|VIEW|calweek|integer
-vw_staffworkplanlist|VIEW|calyear|text
-vw_staffworkplanlist|VIEW|dspcalweek|text
-vw_staffworkplanlist|VIEW|dspfritimes|text
-vw_staffworkplanlist|VIEW|dspmontimes|text
-vw_staffworkplanlist|VIEW|dspsattimes|text
-vw_staffworkplanlist|VIEW|dspsuntimes|text
-vw_staffworkplanlist|VIEW|dspthutimes|text
-vw_staffworkplanlist|VIEW|dsptuetimes|text
-vw_staffworkplanlist|VIEW|dspwedtimes|text
-vw_staffworkplanlist|VIEW|fri_date|date
-vw_staffworkplanlist|VIEW|fri_id|bigint
-vw_staffworkplanlist|VIEW|fri_timetotal|text
-vw_staffworkplanlist|VIEW|id_staff|integer
-vw_staffworkplanlist|VIEW|mon_date|date
-vw_staffworkplanlist|VIEW|mon_id|bigint
-vw_staffworkplanlist|VIEW|mon_timetotal|text
-vw_staffworkplanlist|VIEW|sat_date|date
-vw_staffworkplanlist|VIEW|sat_id|bigint
-vw_staffworkplanlist|VIEW|sat_timetotal|text
-vw_staffworkplanlist|VIEW|staffname|text
-vw_staffworkplanlist|VIEW|sun_date|date
-vw_staffworkplanlist|VIEW|sun_id|bigint
-vw_staffworkplanlist|VIEW|sun_timetotal|text
-vw_staffworkplanlist|VIEW|thu_date|date
-vw_staffworkplanlist|VIEW|thu_id|bigint
-vw_staffworkplanlist|VIEW|thu_timetotal|text
-vw_staffworkplanlist|VIEW|tue_date|date
-vw_staffworkplanlist|VIEW|tue_id|bigint
-vw_staffworkplanlist|VIEW|tue_timetotal|text
-vw_staffworkplanlist|VIEW|wed_date|date
-vw_staffworkplanlist|VIEW|wed_id|bigint
-vw_staffworkplanlist|VIEW|wed_timetotal|text
-vw_staffworkplanlist|VIEW|weekend|date
-vw_staffworkplanlist|VIEW|weekminutes|numeric
-vw_staffworkplanlist|VIEW|weekstart|date
-vw_staffworkplanlist|VIEW|week_timetotal|text
-vw_staffworkplanlist|VIEW|weekvacancy_minutes_ill|numeric
-vw_staffworkplanlist|VIEW|weekvacancy_minutes|numeric
-vw_staffworkplanlist|VIEW|weekvacancy_times_ill|text
-vw_staffworkplanlist|VIEW|weekvacancy_times|text
-vw_staffworkplan_weekly|VIEW|calweek|doubleprecision
-vw_staffworkplan_weekly|VIEW|calyear|text
-vw_staffworkplan_weekly|VIEW|dates|text
-vw_staffworkplan_weekly|VIEW|fri_id|bigint
-vw_staffworkplan_weekly|VIEW|fri_timeend1|text
-vw_staffworkplan_weekly|VIEW|fri_timeend2|text
-vw_staffworkplan_weekly|VIEW|fri_timepause|text
-vw_staffworkplan_weekly|VIEW|fri_timestart1|text
-vw_staffworkplan_weekly|VIEW|fri_timestart2|text
-vw_staffworkplan_weekly|VIEW|fri_timetotal|text
-vw_staffworkplan_weekly|VIEW|fri_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|fri_vacancytype|text
-vw_staffworkplan_weekly|VIEW|id_staff|integer
-vw_staffworkplan_weekly|VIEW|mon_id|bigint
-vw_staffworkplan_weekly|VIEW|mon_timeend1|text
-vw_staffworkplan_weekly|VIEW|mon_timeend2|text
-vw_staffworkplan_weekly|VIEW|mon_timepause|text
-vw_staffworkplan_weekly|VIEW|mon_timestart1|text
-vw_staffworkplan_weekly|VIEW|mon_timestart2|text
-vw_staffworkplan_weekly|VIEW|mon_timetotal|text
-vw_staffworkplan_weekly|VIEW|mon_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|mon_vacancytype|text
-vw_staffworkplan_weekly|VIEW|sat_id|bigint
-vw_staffworkplan_weekly|VIEW|sat_timeend1|text
-vw_staffworkplan_weekly|VIEW|sat_timeend2|text
-vw_staffworkplan_weekly|VIEW|sat_timepause|text
-vw_staffworkplan_weekly|VIEW|sat_timestart1|text
-vw_staffworkplan_weekly|VIEW|sat_timestart2|text
-vw_staffworkplan_weekly|VIEW|sat_timetotal|text
-vw_staffworkplan_weekly|VIEW|sat_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|sat_vacancytype|text
-vw_staffworkplan_weekly|VIEW|sun_id|bigint
-vw_staffworkplan_weekly|VIEW|sun_timeend1|text
-vw_staffworkplan_weekly|VIEW|sun_timeend2|text
-vw_staffworkplan_weekly|VIEW|sun_timepause|text
-vw_staffworkplan_weekly|VIEW|sun_timestart1|text
-vw_staffworkplan_weekly|VIEW|sun_timestart2|text
-vw_staffworkplan_weekly|VIEW|sun_timetotal|text
-vw_staffworkplan_weekly|VIEW|sun_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|sun_vacancytype|text
-vw_staffworkplan_weekly|VIEW|thu_id|bigint
-vw_staffworkplan_weekly|VIEW|thu_timeend1|text
-vw_staffworkplan_weekly|VIEW|thu_timeend2|text
-vw_staffworkplan_weekly|VIEW|thu_timepause|text
-vw_staffworkplan_weekly|VIEW|thu_timestart1|text
-vw_staffworkplan_weekly|VIEW|thu_timestart2|text
-vw_staffworkplan_weekly|VIEW|thu_timetotal|text
-vw_staffworkplan_weekly|VIEW|thu_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|thu_vacancytype|text
-vw_staffworkplan_weekly|VIEW|tue_id|bigint
-vw_staffworkplan_weekly|VIEW|tue_timeend1|text
-vw_staffworkplan_weekly|VIEW|tue_timeend2|text
-vw_staffworkplan_weekly|VIEW|tue_timepause|text
-vw_staffworkplan_weekly|VIEW|tue_timestart1|text
-vw_staffworkplan_weekly|VIEW|tue_timestart2|text
-vw_staffworkplan_weekly|VIEW|tue_timetotal|text
-vw_staffworkplan_weekly|VIEW|tue_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|tue_vacancytype|text
-vw_staffworkplan_weekly|VIEW|wed_id|bigint
-vw_staffworkplan_weekly|VIEW|wed_timeend1|text
-vw_staffworkplan_weekly|VIEW|wed_timeend2|text
-vw_staffworkplan_weekly|VIEW|wed_timepause|text
-vw_staffworkplan_weekly|VIEW|wed_timestart1|text
-vw_staffworkplan_weekly|VIEW|wed_timestart2|text
-vw_staffworkplan_weekly|VIEW|wed_timetotal|text
-vw_staffworkplan_weekly|VIEW|wed_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|wed_vacancytype|text
-vw_staffworkplan_weekly|VIEW|weekbegin|date
-vw_staffworkplan_weekly|VIEW|week_timetotal|text
-vw_workplanlist|VIEW|id|integer
-vw_workplanlist|VIEW|workplan|text
-vw_workplansdata|VIEW|fri_timeend1|text
-vw_workplansdata|VIEW|fri_timeend2|text
-vw_workplansdata|VIEW|fri_timepause|text
-vw_workplansdata|VIEW|fri_timestart1|text
-vw_workplansdata|VIEW|fri_timestart2|text
-vw_workplansdata|VIEW|id|integer
-vw_workplansdata|VIEW|mon_timeend1|text
-vw_workplansdata|VIEW|mon_timeend2|text
-vw_workplansdata|VIEW|mon_timepause|text
-vw_workplansdata|VIEW|mon_timestart1|text
-vw_workplansdata|VIEW|mon_timestart2|text
-vw_workplansdata|VIEW|sat_timeend1|text
-vw_workplansdata|VIEW|sat_timeend2|text
-vw_workplansdata|VIEW|sat_timepause|text
-vw_workplansdata|VIEW|sat_timestart1|text
-vw_workplansdata|VIEW|sat_timestart2|text
-vw_workplansdata|VIEW|sun_timeend1|text
-vw_workplansdata|VIEW|sun_timeend2|text
-vw_workplansdata|VIEW|sun_timepause|text
-vw_workplansdata|VIEW|sun_timestart1|text
-vw_workplansdata|VIEW|sun_timestart2|text
-vw_workplansdata|VIEW|thu_timeend1|text
-vw_workplansdata|VIEW|thu_timeend2|text
-vw_workplansdata|VIEW|thu_timepause|text
-vw_workplansdata|VIEW|thu_timestart1|text
-vw_workplansdata|VIEW|thu_timestart2|text
-vw_workplansdata|VIEW|tue_timeend1|text
-vw_workplansdata|VIEW|tue_timeend2|text
-vw_workplansdata|VIEW|tue_timepause|text
-vw_workplansdata|VIEW|tue_timestart1|text
-vw_workplansdata|VIEW|tue_timestart2|text
-vw_workplansdata|VIEW|wed_timeend1|text
-vw_workplansdata|VIEW|wed_timeend2|text
-vw_workplansdata|VIEW|wed_timepause|text
-vw_workplansdata|VIEW|wed_timestart1|text
-vw_workplansdata|VIEW|wed_timestart2|text
-vw_workplansdata|VIEW|workplan|text
-vw_workplans|VIEW|dspfritimes|text
-vw_workplans|VIEW|dspmontimes|text
-vw_workplans|VIEW|dspsattimes|text
-vw_workplans|VIEW|dspsuntimes|text
-vw_workplans|VIEW|dspthutimes|text
-vw_workplans|VIEW|dsptuetimes|text
-vw_workplans|VIEW|dspwedtimes|text
-vw_workplans|VIEW|id|integer
-vw_workplans|VIEW|workplan|text
-workplans|BASETABLE|fri_timeend1|timewithouttimezone
-workplans|BASETABLE|fri_timeend2|timewithouttimezone
-workplans|BASETABLE|fri_timepause|timewithouttimezone
-workplans|BASETABLE|fri_timestart1|timewithouttimezone
-workplans|BASETABLE|fri_timestart2|timewithouttimezone
-workplans|BASETABLE|id|integer
-workplans|BASETABLE|mon_timeend1|timewithouttimezone
-workplans|BASETABLE|mon_timeend2|timewithouttimezone
-workplans|BASETABLE|mon_timepause|timewithouttimezone
-workplans|BASETABLE|mon_timestart1|timewithouttimezone
-workplans|BASETABLE|mon_timestart2|timewithouttimezone
-workplans|BASETABLE|sat_timeend1|timewithouttimezone
-workplans|BASETABLE|sat_timeend2|timewithouttimezone
-workplans|BASETABLE|sat_timepause|timewithouttimezone
-workplans|BASETABLE|sat_timestart1|timewithouttimezone
-workplans|BASETABLE|sat_timestart2|timewithouttimezone
-workplans|BASETABLE|sun_timeend1|timewithouttimezone
-workplans|BASETABLE|sun_timeend2|timewithouttimezone
-workplans|BASETABLE|sun_timepause|timewithouttimezone
-workplans|BASETABLE|sun_timestart1|timewithouttimezone
-workplans|BASETABLE|sun_timestart2|timewithouttimezone
-workplans|BASETABLE|thu_timeend1|timewithouttimezone
-workplans|BASETABLE|thu_timeend2|timewithouttimezone
-workplans|BASETABLE|thu_timepause|timewithouttimezone
-workplans|BASETABLE|thu_timestart1|timewithouttimezone
-workplans|BASETABLE|thu_timestart2|timewithouttimezone
-workplans|BASETABLE|tue_timeend1|timewithouttimezone
-workplans|BASETABLE|tue_timeend2|timewithouttimezone
-workplans|BASETABLE|tue_timepause|timewithouttimezone
-workplans|BASETABLE|tue_timestart1|timewithouttimezone
-workplans|BASETABLE|tue_timestart2|timewithouttimezone
-workplans|BASETABLE|wed_timeend1|timewithouttimezone
-workplans|BASETABLE|wed_timeend2|timewithouttimezone
-workplans|BASETABLE|wed_timepause|timewithouttimezone
-workplans|BASETABLE|wed_timestart1|timewithouttimezone
-workplans|BASETABLE|wed_timestart2|timewithouttimezone
-workplans|BASETABLE|workplan|text
-worktypes|BASETABLE|id|integer
-worktypes|BASETABLE|isfreetime|boolean
-worktypes|BASETABLE|isworktime|boolean
-worktypes|BASETABLE|typecolor|text
-worktypes|BASETABLE|worktype|text
diff --git a/dev/db/potlu_db.test.tables.live.txt b/dev/db/potlu_db.test.tables.live.txt
deleted file mode 100644 (file)
index 3a72c19..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-reportperiod|BASETABLE
-sites|BASETABLE
-staff|BASETABLE
-staffcontract|BASETABLE
-staffgroups|BASETABLE
-stafftimetracks|BASETABLE
-staffvacancy|BASETABLE
-staffvacancyyear|BASETABLE
-staffworkplan|BASETABLE
-vw_reportperiodlist|VIEW
-vw_staffcontractdata|VIEW
-vw_staffcontractlist|VIEW
-vw_staffdata|VIEW
-vw_staffgroupsdata|VIEW
-vw_staffgroupslist|VIEW
-vw_stafflist|VIEW
-vw_staffplanned_dayweektotals|VIEW
-vw_staffworkplanlist|VIEW
-vw_staffworkplan_weekly|VIEW
-vw_workplanlist|VIEW
-vw_workplansdata|VIEW
-vw_workplans|VIEW
-workplans|BASETABLE
-worktypes|BASETABLE
diff --git a/dev/db/potlu_db.test2.columns.live.txt b/dev/db/potlu_db.test2.columns.live.txt
deleted file mode 100644 (file)
index 4be0aaa..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-
-reportperiod|BASETABLE|enddate|date
-reportperiod|BASETABLE|id|integer
-reportperiod|BASETABLE|periodname|text
-reportperiod|BASETABLE|startdate|date
-sites|BASETABLE|address|text
-sites|BASETABLE|city|text
-sites|BASETABLE|country|text
-sites|BASETABLE|created|timestampwithouttimezone
-sites|BASETABLE|id|integer
-sites|BASETABLE|id_timetracker|integer
-sites|BASETABLE|modified|timestampwithouttimezone
-sites|BASETABLE|sitename|text
-sites|BASETABLE|timeclockhost|text
-sites|BASETABLE|zip|text
-staff|BASETABLE|birthdate|date
-staff|BASETABLE|entrydate|date
-staff|BASETABLE|id|integer
-staff|BASETABLE|job|text
-staff|BASETABLE|leavedate|date
-staff|BASETABLE|prename|text
-staff|BASETABLE|staffnumber|text
-staff|BASETABLE|surname|text
-staffcontract|BASETABLE|id|integer
-staffcontract|BASETABLE|id_staffgroup|integer
-staffcontract|BASETABLE|id_staff|integer
-staffcontract|BASETABLE|monthhours|numeric
-staffcontract|BASETABLE|startdate|date
-staffcontract|BASETABLE|weekhours|numeric
-staffgroups|BASETABLE|groupcolor|text
-staffgroups|BASETABLE|groupname|text
-staffgroups|BASETABLE|id|integer
-stafftimetracks|BASETABLE|created|timestampwithouttimezone
-stafftimetracks|BASETABLE|id|bigint
-stafftimetracks|BASETABLE|id_staff|integer
-stafftimetracks|BASETABLE|modified|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_in|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_out|timestampwithouttimezone
-stafftimetracks|BASETABLE|tracktype|text
-staffvacancy|BASETABLE|dayhours|timewithouttimezone
-staffvacancy|BASETABLE|enddate|date
-staffvacancy|BASETABLE|id|integer
-staffvacancy|BASETABLE|id_staff|integer
-staffvacancy|BASETABLE|note|text
-staffvacancy|BASETABLE|startdate|date
-staffvacancy|BASETABLE|vacancytype|text
-staffvacancy|BASETABLE|validated|boolean
-staffvacancyyear|BASETABLE|days|numeric
-staffvacancyyear|BASETABLE|hours|numeric
-staffvacancyyear|BASETABLE|id|integer
-staffvacancyyear|BASETABLE|id_staff|integer
-staffvacancyyear|BASETABLE|vyear|integer
-staffworkplan|BASETABLE|daydate|date
-staffworkplan|BASETABLE|id|bigint
-staffworkplan|BASETABLE|id_staff|integer
-staffworkplan|BASETABLE|timeend1|timewithouttimezone
-staffworkplan|BASETABLE|timeend2|timewithouttimezone
-staffworkplan|BASETABLE|timepause|timewithouttimezone
-staffworkplan|BASETABLE|timestart1|timewithouttimezone
-staffworkplan|BASETABLE|timestart2|timewithouttimezone
-staffworkplan|BASETABLE|vacancyhours|timewithouttimezone
-staffworkplan|BASETABLE|vacancytype|text
-vw_reportperiodlist|VIEW|enddate|date
-vw_reportperiodlist|VIEW|id|integer
-vw_reportperiodlist|VIEW|periodname|text
-vw_reportperiodlist|VIEW|startdate|date
-vw_staffcontractdata|VIEW|id|integer
-vw_staffcontractdata|VIEW|id_staffgroup|integer
-vw_staffcontractdata|VIEW|id_staff|integer
-vw_staffcontractdata|VIEW|monthhours|numeric
-vw_staffcontractdata|VIEW|startdate|date
-vw_staffcontractdata|VIEW|weekhours|numeric
-vw_staffcontractlist|VIEW|groupcolor|text
-vw_staffcontractlist|VIEW|groupname|text
-vw_staffcontractlist|VIEW|id|integer
-vw_staffcontractlist|VIEW|id_staffgroup|integer
-vw_staffcontractlist|VIEW|id_staff|integer
-vw_staffcontractlist|VIEW|monthhours|numeric
-vw_staffcontractlist|VIEW|startdate|date
-vw_staffcontractlist|VIEW|weekhours|numeric
-vw_staffdata|VIEW|birthdate|date
-vw_staffdata|VIEW|entrydate|date
-vw_staffdata|VIEW|id|integer
-vw_staffdata|VIEW|job|text
-vw_staffdata|VIEW|leavedate|date
-vw_staffdata|VIEW|prename|text
-vw_staffdata|VIEW|staffnumber|text
-vw_staffdata|VIEW|surname|text
-vw_staffgroupsdata|VIEW|groupcolor|text
-vw_staffgroupsdata|VIEW|groupname|text
-vw_staffgroupsdata|VIEW|id|integer
-vw_staffgroupslist|VIEW|groupcolor|text
-vw_staffgroupslist|VIEW|groupname|text
-vw_staffgroupslist|VIEW|id|integer
-vw_stafflist|VIEW|birthdate|date
-vw_stafflist|VIEW|dspname|text
-vw_stafflist|VIEW|entrydate|date
-vw_stafflist|VIEW|id|integer
-vw_stafflist|VIEW|job|text
-vw_stafflist|VIEW|leavedate|date
-vw_stafflist|VIEW|prename|text
-vw_stafflist|VIEW|staffnumber|text
-vw_stafflist|VIEW|surname|text
-vw_staffplanned_dayweektotals|VIEW|calweek|doubleprecision
-vw_staffplanned_dayweektotals|VIEW|dates|date
-vw_staffplanned_dayweektotals|VIEW|fri_end1|text
-vw_staffplanned_dayweektotals|VIEW|fri_end2|text
-vw_staffplanned_dayweektotals|VIEW|fri_id|bigint
-vw_staffplanned_dayweektotals|VIEW|fri_pause|text
-vw_staffplanned_dayweektotals|VIEW|fri_start1|text
-vw_staffplanned_dayweektotals|VIEW|fri_start2|text
-vw_staffplanned_dayweektotals|VIEW|fri_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|id_staff|integer
-vw_staffplanned_dayweektotals|VIEW|mon_end1|text
-vw_staffplanned_dayweektotals|VIEW|mon_end2|text
-vw_staffplanned_dayweektotals|VIEW|mon_id|bigint
-vw_staffplanned_dayweektotals|VIEW|mon_pause|text
-vw_staffplanned_dayweektotals|VIEW|mon_start1|text
-vw_staffplanned_dayweektotals|VIEW|mon_start2|text
-vw_staffplanned_dayweektotals|VIEW|mon_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|sat_end1|text
-vw_staffplanned_dayweektotals|VIEW|sat_end2|text
-vw_staffplanned_dayweektotals|VIEW|sat_id|bigint
-vw_staffplanned_dayweektotals|VIEW|sat_pause|text
-vw_staffplanned_dayweektotals|VIEW|sat_start1|text
-vw_staffplanned_dayweektotals|VIEW|sat_start2|text
-vw_staffplanned_dayweektotals|VIEW|sat_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|sun_end1|text
-vw_staffplanned_dayweektotals|VIEW|sun_end2|text
-vw_staffplanned_dayweektotals|VIEW|sun_id|bigint
-vw_staffplanned_dayweektotals|VIEW|sun_pause|text
-vw_staffplanned_dayweektotals|VIEW|sun_start1|text
-vw_staffplanned_dayweektotals|VIEW|sun_start2|text
-vw_staffplanned_dayweektotals|VIEW|sun_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|thu_end1|text
-vw_staffplanned_dayweektotals|VIEW|thu_end2|text
-vw_staffplanned_dayweektotals|VIEW|thu_id|bigint
-vw_staffplanned_dayweektotals|VIEW|thu_pause|text
-vw_staffplanned_dayweektotals|VIEW|thu_start1|text
-vw_staffplanned_dayweektotals|VIEW|thu_start2|text
-vw_staffplanned_dayweektotals|VIEW|thu_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|tue_end1|text
-vw_staffplanned_dayweektotals|VIEW|tue_end2|text
-vw_staffplanned_dayweektotals|VIEW|tue_id|bigint
-vw_staffplanned_dayweektotals|VIEW|tue_pause|text
-vw_staffplanned_dayweektotals|VIEW|tue_start1|text
-vw_staffplanned_dayweektotals|VIEW|tue_start2|text
-vw_staffplanned_dayweektotals|VIEW|tue_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|wed_end1|text
-vw_staffplanned_dayweektotals|VIEW|wed_end2|text
-vw_staffplanned_dayweektotals|VIEW|wed_id|bigint
-vw_staffplanned_dayweektotals|VIEW|wed_pause|text
-vw_staffplanned_dayweektotals|VIEW|wed_start1|text
-vw_staffplanned_dayweektotals|VIEW|wed_start2|text
-vw_staffplanned_dayweektotals|VIEW|wed_timetotal|text
-vw_staffplanned_dayweektotals|VIEW|week_timetotal|text
-vw_staffworkplanlist|VIEW|calweek|integer
-vw_staffworkplanlist|VIEW|calyear|text
-vw_staffworkplanlist|VIEW|dspcalweek|text
-vw_staffworkplanlist|VIEW|dspfritimes|text
-vw_staffworkplanlist|VIEW|dspmontimes|text
-vw_staffworkplanlist|VIEW|dspsattimes|text
-vw_staffworkplanlist|VIEW|dspsuntimes|text
-vw_staffworkplanlist|VIEW|dspthutimes|text
-vw_staffworkplanlist|VIEW|dsptuetimes|text
-vw_staffworkplanlist|VIEW|dspwedtimes|text
-vw_staffworkplanlist|VIEW|fri_date|date
-vw_staffworkplanlist|VIEW|fri_id|bigint
-vw_staffworkplanlist|VIEW|fri_timetotal|text
-vw_staffworkplanlist|VIEW|id_staff|integer
-vw_staffworkplanlist|VIEW|mon_date|date
-vw_staffworkplanlist|VIEW|mon_id|bigint
-vw_staffworkplanlist|VIEW|mon_timetotal|text
-vw_staffworkplanlist|VIEW|sat_date|date
-vw_staffworkplanlist|VIEW|sat_id|bigint
-vw_staffworkplanlist|VIEW|sat_timetotal|text
-vw_staffworkplanlist|VIEW|staffname|text
-vw_staffworkplanlist|VIEW|sun_date|date
-vw_staffworkplanlist|VIEW|sun_id|bigint
-vw_staffworkplanlist|VIEW|sun_timetotal|text
-vw_staffworkplanlist|VIEW|thu_date|date
-vw_staffworkplanlist|VIEW|thu_id|bigint
-vw_staffworkplanlist|VIEW|thu_timetotal|text
-vw_staffworkplanlist|VIEW|tue_date|date
-vw_staffworkplanlist|VIEW|tue_id|bigint
-vw_staffworkplanlist|VIEW|tue_timetotal|text
-vw_staffworkplanlist|VIEW|wed_date|date
-vw_staffworkplanlist|VIEW|wed_id|bigint
-vw_staffworkplanlist|VIEW|wed_timetotal|text
-vw_staffworkplanlist|VIEW|weekend|date
-vw_staffworkplanlist|VIEW|weekminutes|numeric
-vw_staffworkplanlist|VIEW|weekstart|date
-vw_staffworkplanlist|VIEW|week_timetotal|text
-vw_staffworkplanlist|VIEW|weekvacancy_minutes_ill|numeric
-vw_staffworkplanlist|VIEW|weekvacancy_minutes|numeric
-vw_staffworkplanlist|VIEW|weekvacancy_times_ill|text
-vw_staffworkplanlist|VIEW|weekvacancy_times|text
-vw_staffworkplan_weekly|VIEW|calweek|doubleprecision
-vw_staffworkplan_weekly|VIEW|calyear|text
-vw_staffworkplan_weekly|VIEW|dates|text
-vw_staffworkplan_weekly|VIEW|fri_id|bigint
-vw_staffworkplan_weekly|VIEW|fri_timeend1|text
-vw_staffworkplan_weekly|VIEW|fri_timeend2|text
-vw_staffworkplan_weekly|VIEW|fri_timepause|text
-vw_staffworkplan_weekly|VIEW|fri_timestart1|text
-vw_staffworkplan_weekly|VIEW|fri_timestart2|text
-vw_staffworkplan_weekly|VIEW|fri_timetotal|text
-vw_staffworkplan_weekly|VIEW|fri_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|fri_vacancytype|text
-vw_staffworkplan_weekly|VIEW|id_staff|integer
-vw_staffworkplan_weekly|VIEW|mon_id|bigint
-vw_staffworkplan_weekly|VIEW|mon_timeend1|text
-vw_staffworkplan_weekly|VIEW|mon_timeend2|text
-vw_staffworkplan_weekly|VIEW|mon_timepause|text
-vw_staffworkplan_weekly|VIEW|mon_timestart1|text
-vw_staffworkplan_weekly|VIEW|mon_timestart2|text
-vw_staffworkplan_weekly|VIEW|mon_timetotal|text
-vw_staffworkplan_weekly|VIEW|mon_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|mon_vacancytype|text
-vw_staffworkplan_weekly|VIEW|sat_id|bigint
-vw_staffworkplan_weekly|VIEW|sat_timeend1|text
-vw_staffworkplan_weekly|VIEW|sat_timeend2|text
-vw_staffworkplan_weekly|VIEW|sat_timepause|text
-vw_staffworkplan_weekly|VIEW|sat_timestart1|text
-vw_staffworkplan_weekly|VIEW|sat_timestart2|text
-vw_staffworkplan_weekly|VIEW|sat_timetotal|text
-vw_staffworkplan_weekly|VIEW|sat_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|sat_vacancytype|text
-vw_staffworkplan_weekly|VIEW|sun_id|bigint
-vw_staffworkplan_weekly|VIEW|sun_timeend1|text
-vw_staffworkplan_weekly|VIEW|sun_timeend2|text
-vw_staffworkplan_weekly|VIEW|sun_timepause|text
-vw_staffworkplan_weekly|VIEW|sun_timestart1|text
-vw_staffworkplan_weekly|VIEW|sun_timestart2|text
-vw_staffworkplan_weekly|VIEW|sun_timetotal|text
-vw_staffworkplan_weekly|VIEW|sun_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|sun_vacancytype|text
-vw_staffworkplan_weekly|VIEW|thu_id|bigint
-vw_staffworkplan_weekly|VIEW|thu_timeend1|text
-vw_staffworkplan_weekly|VIEW|thu_timeend2|text
-vw_staffworkplan_weekly|VIEW|thu_timepause|text
-vw_staffworkplan_weekly|VIEW|thu_timestart1|text
-vw_staffworkplan_weekly|VIEW|thu_timestart2|text
-vw_staffworkplan_weekly|VIEW|thu_timetotal|text
-vw_staffworkplan_weekly|VIEW|thu_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|thu_vacancytype|text
-vw_staffworkplan_weekly|VIEW|tue_id|bigint
-vw_staffworkplan_weekly|VIEW|tue_timeend1|text
-vw_staffworkplan_weekly|VIEW|tue_timeend2|text
-vw_staffworkplan_weekly|VIEW|tue_timepause|text
-vw_staffworkplan_weekly|VIEW|tue_timestart1|text
-vw_staffworkplan_weekly|VIEW|tue_timestart2|text
-vw_staffworkplan_weekly|VIEW|tue_timetotal|text
-vw_staffworkplan_weekly|VIEW|tue_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|tue_vacancytype|text
-vw_staffworkplan_weekly|VIEW|wed_id|bigint
-vw_staffworkplan_weekly|VIEW|wed_timeend1|text
-vw_staffworkplan_weekly|VIEW|wed_timeend2|text
-vw_staffworkplan_weekly|VIEW|wed_timepause|text
-vw_staffworkplan_weekly|VIEW|wed_timestart1|text
-vw_staffworkplan_weekly|VIEW|wed_timestart2|text
-vw_staffworkplan_weekly|VIEW|wed_timetotal|text
-vw_staffworkplan_weekly|VIEW|wed_vacancyhours|text
-vw_staffworkplan_weekly|VIEW|wed_vacancytype|text
-vw_staffworkplan_weekly|VIEW|weekbegin|date
-vw_staffworkplan_weekly|VIEW|week_timetotal|text
-vw_workplanlist|VIEW|id|integer
-vw_workplanlist|VIEW|workplan|text
-vw_workplansdata|VIEW|fri_timeend1|text
-vw_workplansdata|VIEW|fri_timeend2|text
-vw_workplansdata|VIEW|fri_timepause|text
-vw_workplansdata|VIEW|fri_timestart1|text
-vw_workplansdata|VIEW|fri_timestart2|text
-vw_workplansdata|VIEW|id|integer
-vw_workplansdata|VIEW|mon_timeend1|text
-vw_workplansdata|VIEW|mon_timeend2|text
-vw_workplansdata|VIEW|mon_timepause|text
-vw_workplansdata|VIEW|mon_timestart1|text
-vw_workplansdata|VIEW|mon_timestart2|text
-vw_workplansdata|VIEW|sat_timeend1|text
-vw_workplansdata|VIEW|sat_timeend2|text
-vw_workplansdata|VIEW|sat_timepause|text
-vw_workplansdata|VIEW|sat_timestart1|text
-vw_workplansdata|VIEW|sat_timestart2|text
-vw_workplansdata|VIEW|sun_timeend1|text
-vw_workplansdata|VIEW|sun_timeend2|text
-vw_workplansdata|VIEW|sun_timepause|text
-vw_workplansdata|VIEW|sun_timestart1|text
-vw_workplansdata|VIEW|sun_timestart2|text
-vw_workplansdata|VIEW|thu_timeend1|text
-vw_workplansdata|VIEW|thu_timeend2|text
-vw_workplansdata|VIEW|thu_timepause|text
-vw_workplansdata|VIEW|thu_timestart1|text
-vw_workplansdata|VIEW|thu_timestart2|text
-vw_workplansdata|VIEW|tue_timeend1|text
-vw_workplansdata|VIEW|tue_timeend2|text
-vw_workplansdata|VIEW|tue_timepause|text
-vw_workplansdata|VIEW|tue_timestart1|text
-vw_workplansdata|VIEW|tue_timestart2|text
-vw_workplansdata|VIEW|wed_timeend1|text
-vw_workplansdata|VIEW|wed_timeend2|text
-vw_workplansdata|VIEW|wed_timepause|text
-vw_workplansdata|VIEW|wed_timestart1|text
-vw_workplansdata|VIEW|wed_timestart2|text
-vw_workplansdata|VIEW|workplan|text
-vw_workplans|VIEW|dspfritimes|text
-vw_workplans|VIEW|dspmontimes|text
-vw_workplans|VIEW|dspsattimes|text
-vw_workplans|VIEW|dspsuntimes|text
-vw_workplans|VIEW|dspthutimes|text
-vw_workplans|VIEW|dsptuetimes|text
-vw_workplans|VIEW|dspwedtimes|text
-vw_workplans|VIEW|id|integer
-vw_workplans|VIEW|workplan|text
-workplans|BASETABLE|fri_timeend1|timewithouttimezone
-workplans|BASETABLE|fri_timeend2|timewithouttimezone
-workplans|BASETABLE|fri_timepause|timewithouttimezone
-workplans|BASETABLE|fri_timestart1|timewithouttimezone
-workplans|BASETABLE|fri_timestart2|timewithouttimezone
-workplans|BASETABLE|id|integer
-workplans|BASETABLE|mon_timeend1|timewithouttimezone
-workplans|BASETABLE|mon_timeend2|timewithouttimezone
-workplans|BASETABLE|mon_timepause|timewithouttimezone
-workplans|BASETABLE|mon_timestart1|timewithouttimezone
-workplans|BASETABLE|mon_timestart2|timewithouttimezone
-workplans|BASETABLE|sat_timeend1|timewithouttimezone
-workplans|BASETABLE|sat_timeend2|timewithouttimezone
-workplans|BASETABLE|sat_timepause|timewithouttimezone
-workplans|BASETABLE|sat_timestart1|timewithouttimezone
-workplans|BASETABLE|sat_timestart2|timewithouttimezone
-workplans|BASETABLE|sun_timeend1|timewithouttimezone
-workplans|BASETABLE|sun_timeend2|timewithouttimezone
-workplans|BASETABLE|sun_timepause|timewithouttimezone
-workplans|BASETABLE|sun_timestart1|timewithouttimezone
-workplans|BASETABLE|sun_timestart2|timewithouttimezone
-workplans|BASETABLE|thu_timeend1|timewithouttimezone
-workplans|BASETABLE|thu_timeend2|timewithouttimezone
-workplans|BASETABLE|thu_timepause|timewithouttimezone
-workplans|BASETABLE|thu_timestart1|timewithouttimezone
-workplans|BASETABLE|thu_timestart2|timewithouttimezone
-workplans|BASETABLE|tue_timeend1|timewithouttimezone
-workplans|BASETABLE|tue_timeend2|timewithouttimezone
-workplans|BASETABLE|tue_timepause|timewithouttimezone
-workplans|BASETABLE|tue_timestart1|timewithouttimezone
-workplans|BASETABLE|tue_timestart2|timewithouttimezone
-workplans|BASETABLE|wed_timeend1|timewithouttimezone
-workplans|BASETABLE|wed_timeend2|timewithouttimezone
-workplans|BASETABLE|wed_timepause|timewithouttimezone
-workplans|BASETABLE|wed_timestart1|timewithouttimezone
-workplans|BASETABLE|wed_timestart2|timewithouttimezone
-workplans|BASETABLE|workplan|text
-worktypes|BASETABLE|id|integer
-worktypes|BASETABLE|isfreetime|boolean
-worktypes|BASETABLE|isworktime|boolean
-worktypes|BASETABLE|typecolor|text
-worktypes|BASETABLE|worktype|text
diff --git a/dev/db/potlu_db.test2.tables.live.txt b/dev/db/potlu_db.test2.tables.live.txt
deleted file mode 100644 (file)
index 3a72c19..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-reportperiod|BASETABLE
-sites|BASETABLE
-staff|BASETABLE
-staffcontract|BASETABLE
-staffgroups|BASETABLE
-stafftimetracks|BASETABLE
-staffvacancy|BASETABLE
-staffvacancyyear|BASETABLE
-staffworkplan|BASETABLE
-vw_reportperiodlist|VIEW
-vw_staffcontractdata|VIEW
-vw_staffcontractlist|VIEW
-vw_staffdata|VIEW
-vw_staffgroupsdata|VIEW
-vw_staffgroupslist|VIEW
-vw_stafflist|VIEW
-vw_staffplanned_dayweektotals|VIEW
-vw_staffworkplanlist|VIEW
-vw_staffworkplan_weekly|VIEW
-vw_workplanlist|VIEW
-vw_workplansdata|VIEW
-vw_workplans|VIEW
-workplans|BASETABLE
-worktypes|BASETABLE
diff --git a/dev/db/reinstallschema.sh b/dev/db/reinstallschema.sh
new file mode 100644 (file)
index 0000000..107dc47
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+CALLDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+DBNAME="potlu_db"
+DBUSER="potlu_user"
+export PGPASSWORD="r2btTTRfuJz4whez"
+DBHOST="sql629.your-server.de"
+
+if [[ $# -eq 0 ]]
+then 
+       echo "No args"
+       exit 0
+fi
+
+DBSCHEMA=$1
+
+psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} -c "DROP SCHEMA ${DBSCHEMA} CASCADE;"
+psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} < ${CALLDIR}"/"${DBNAME}"."${DBSCHEMA}".pg.schema.sql"
+psql -h ${DBHOST} -U ${DBUSER} -w ${DBNAME} < ${CALLDIR}"/"${DBNAME}"."${DBSCHEMA}".pg.data.sql"
\ No newline at end of file
diff --git a/dev/db/update.demo.columns.txt b/dev/db/update.demo.columns.txt
deleted file mode 100644 (file)
index c9d5ee8..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-reportperiod|BASETABLE|enddate|date
-reportperiod|BASETABLE|id|integer
-reportperiod|BASETABLE|periodname|text
-reportperiod|BASETABLE|startdate|date
-sites|BASETABLE|address|text
-sites|BASETABLE|city|text
-sites|BASETABLE|country|text
-sites|BASETABLE|created|timestampwithouttimezone
-sites|BASETABLE|id|integer
-sites|BASETABLE|id_timetracker|integer
-sites|BASETABLE|modified|timestampwithouttimezone
-sites|BASETABLE|sitename|text
-sites|BASETABLE|timeclockhost|text
-sites|BASETABLE|zip|text
-staff|BASETABLE|birthdate|date
-staff|BASETABLE|entrydate|date
-staff|BASETABLE|job|text
-staff|BASETABLE|leavedate|date
-staff|BASETABLE|staffnumber|text
-staffcontract|BASETABLE|id|integer
-staffcontract|BASETABLE|id_staffgroup|integer
-staffcontract|BASETABLE|id_staff|integer
-staffcontract|BASETABLE|monthhours|numeric
-staffcontract|BASETABLE|startdate|date
-staffcontract|BASETABLE|weekhours|numeric
-staffgroups|BASETABLE|groupcolor|text
-staffgroups|BASETABLE|groupname|text
-staffgroups|BASETABLE|id|integer
-stafftimetracks|BASETABLE|created|timestampwithouttimezone
-stafftimetracks|BASETABLE|id|bigint
-stafftimetracks|BASETABLE|id_staff|integer
-stafftimetracks|BASETABLE|modified|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_in|timestampwithouttimezone
-stafftimetracks|BASETABLE|stamp_out|timestampwithouttimezone
-stafftimetracks|BASETABLE|tracktype|text
-staffvacancy|BASETABLE|dayhours|timewithouttimezone
-staffvacancy|BASETABLE|enddate|date
-staffvacancy|BASETABLE|id|integer
-staffvacancy|BASETABLE|id_staff|integer
-staffvacancy|BASETABLE|note|text
-staffvacancy|BASETABLE|startdate|date
-staffvacancy|BASETABLE|vacancytype|text
-staffvacancy|BASETABLE|validated|boolean
-staffvacancyyear|BASETABLE|days|numeric
-staffvacancyyear|BASETABLE|hours|numeric
-staffvacancyyear|BASETABLE|id|integer
-staffvacancyyear|BASETABLE|id_staff|integer
-staffvacancyyear|BASETABLE|vyear|integer
-staffworkplan|BASETABLE|daydate|date
-staffworkplan|BASETABLE|id|bigint
-staffworkplan|BASETABLE|id_staff|integer
-staffworkplan|BASETABLE|timeend1|timewithouttimezone
-staffworkplan|BASETABLE|timeend2|timewithouttimezone
-staffworkplan|BASETABLE|timepause|timewithouttimezone
-staffworkplan|BASETABLE|timestart1|timewithouttimezone
-staffworkplan|BASETABLE|timestart2|timewithouttimezone
-staffworkplan|BASETABLE|vacancyhours|timewithouttimezone
-staffworkplan|BASETABLE|vacancytype|text
-workplans|BASETABLE|fri_timeend1|timewithouttimezone
-workplans|BASETABLE|fri_timeend2|timewithouttimezone
-workplans|BASETABLE|fri_timepause|timewithouttimezone
-workplans|BASETABLE|fri_timestart1|timewithouttimezone
-workplans|BASETABLE|fri_timestart2|timewithouttimezone
-workplans|BASETABLE|id|integer
-workplans|BASETABLE|mon_timeend1|timewithouttimezone
-workplans|BASETABLE|mon_timeend2|timewithouttimezone
-workplans|BASETABLE|mon_timepause|timewithouttimezone
-workplans|BASETABLE|mon_timestart1|timewithouttimezone
-workplans|BASETABLE|mon_timestart2|timewithouttimezone
-workplans|BASETABLE|sat_timeend1|timewithouttimezone
-workplans|BASETABLE|sat_timeend2|timewithouttimezone
-workplans|BASETABLE|sat_timepause|timewithouttimezone
-workplans|BASETABLE|sat_timestart1|timewithouttimezone
-workplans|BASETABLE|sat_timestart2|timewithouttimezone
-workplans|BASETABLE|sun_timeend1|timewithouttimezone
-workplans|BASETABLE|sun_timeend2|timewithouttimezone
-workplans|BASETABLE|sun_timepause|timewithouttimezone
-workplans|BASETABLE|sun_timestart1|timewithouttimezone
-workplans|BASETABLE|sun_timestart2|timewithouttimezone
-workplans|BASETABLE|thu_timeend1|timewithouttimezone
-workplans|BASETABLE|thu_timeend2|timewithouttimezone
-workplans|BASETABLE|thu_timepause|timewithouttimezone
-workplans|BASETABLE|thu_timestart1|timewithouttimezone
-workplans|BASETABLE|thu_timestart2|timewithouttimezone
-workplans|BASETABLE|tue_timeend1|timewithouttimezone
-workplans|BASETABLE|tue_timeend2|timewithouttimezone
-workplans|BASETABLE|tue_timepause|timewithouttimezone
-workplans|BASETABLE|tue_timestart1|timewithouttimezone
-workplans|BASETABLE|tue_timestart2|timewithouttimezone
-workplans|BASETABLE|wed_timeend1|timewithouttimezone
-workplans|BASETABLE|wed_timeend2|timewithouttimezone
-workplans|BASETABLE|wed_timepause|timewithouttimezone
-workplans|BASETABLE|wed_timestart1|timewithouttimezone
-workplans|BASETABLE|wed_timestart2|timewithouttimezone
-workplans|BASETABLE|workplan|text
-worktypes|BASETABLE|id|integer
-worktypes|BASETABLE|isfreetime|boolean
-worktypes|BASETABLE|isworktime|boolean
-worktypes|BASETABLE|typecolor|text
-worktypes|BASETABLE|worktype|text
diff --git a/dev/db/update.demo.tables.txt b/dev/db/update.demo.tables.txt
deleted file mode 100644 (file)
index 96647a3..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-reportperiod|BASETABLE
-sites|BASETABLE
-staffcontract|BASETABLE
-staffgroups|BASETABLE
-stafftimetracks|BASETABLE
-staffvacancy|BASETABLE
-staffvacancyyear|BASETABLE
-staffworkplan|BASETABLE
-workplans|BASETABLE
-worktypes|BASETABLE
diff --git a/dev/db/update.portanova.columns.txt b/dev/db/update.portanova.columns.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/dev/db/update.portanova.tables.txt b/dev/db/update.portanova.tables.txt
deleted file mode 100644 (file)
index e69de29..0000000
index 1e1b011..157a26b 100644 (file)
@@ -1,6 +1,5 @@
-public|users|BASETABLE|id_company|integer
-public|users|BASETABLE|id_usergroups|json
-public|users|BASETABLE|job|text
-public|users|BASETABLE|phone|text
-public|users|BASETABLE|prename|text
-public|users|BASETABLE|surname|text
+public|apps|BASETABLE|id_usergroups|json
+public|companies|BASETABLE|reportperiodlength|integer
+public|companies|BASETABLE|reportperiodstart|date
+public|companies|BASETABLE|reportperiodunit|text
+public|users|BASETABLE|id_usergroup|integer
diff --git a/dev/db/update.test.columns.txt b/dev/db/update.test.columns.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/dev/db/update.test.tables.txt b/dev/db/update.test.tables.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/dev/db/update.test2.columns.txt b/dev/db/update.test2.columns.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/dev/db/update.test2.tables.txt b/dev/db/update.test2.tables.txt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/dev/db/users.sql b/dev/db/users.sql
new file mode 100644 (file)
index 0000000..fa22dd0
--- /dev/null
@@ -0,0 +1,4 @@
+INSERT INTO public.users (id, userpassword, created, "blocked", username, regcode, vcode, schemaaccess, id_company, id_usergroups, job, phone, prename, surname) VALUES(2, '6eae75b57865a4a2c6e7995ba9c9e03e7a81765fce6c3dce8673ea94e8ed4cfa', '2019-12-29 16:54:03.977', NULL, 'max.dibartolomeo@dbe.lu', NULL, NULL, '["pot"]', 2, '["3","2","5"]', NULL, NULL, 'Max', 'Di Bartolomeo');
+INSERT INTO public.users (id, userpassword, created, "blocked", username, regcode, vcode, schemaaccess, id_company, id_usergroups, job, phone, prename, surname) VALUES(4, 'a7a79278b41386634d6062a25756ba559b00690f3911bf889da09ac658cc4182', '2019-12-29 16:58:20.244', NULL, 'fiduciairetiger@gmail.com', NULL, NULL, '["pot"]', 2, '["2","3","5"]', NULL, NULL, 'AndrĂ©', 'Wantz');
+INSERT INTO public.users (id, userpassword, created, "blocked", username, regcode, vcode, schemaaccess, id_company, id_usergroups, job, phone, prename, surname) VALUES(3, '8b35dcf77029733c5565a167241c3129544aaa2d5d220feeee0be0042afa3040', '2019-12-29 16:55:37.027', NULL, 'pierre.eberhard@dbe.lu', NULL, NULL, '["pot"]', 2, '["2","3","5"]', NULL, NULL, 'Pierre', 'Eberhard');
+INSERT INTO public.users (id, userpassword, created, "blocked", username, regcode, vcode, schemaaccess, id_company, id_usergroups, job, phone, prename, surname) VALUES(1, 'a146bb8ab1ff4710ac055fb5dfe70cf24a676fb26a18ddc8ac90254d335e27f3', '2019-10-10 17:12:11.934', NULL, 'ksaffran@dks.lu', NULL, NULL, '["pot"]', 2, '["2","5","3"]', NULL, NULL, 'Kilian', 'Saffran');
index b143b79..145ebe3 100644 (file)
@@ -8,7 +8,7 @@ SSHHOST="www422.your-server.de"
 
 CALLDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 cd ..
-find . -type f -printf "%p|%s\n" | grep -v -e "^\.\/\.git\/" | grep -v -e "\.\/dev\/" | grep -v -e "\.\/OLD\/" | grep -v -e "\.\/data\/output\/" | grep -v -e "\.\/data\/tmp\/" | sort  > dev/sourcefiles.local.txt
+find . -type f -printf "%p|%s\n" | grep -v -e "^\.\/\.git\/" | grep -v -e "\.\/dev\/" | grep -v -e "\.\/OLD\/" | grep -v -e "\/data\/output\/" | grep -v -e "\/data\/tmp\/" | grep -v -e "\/backoffice\/tmp\/" | sort  > dev/sourcefiles.local.txt
 
 ssh -p ${SSHPORT} ${SSHUSER}@${SSHHOST} 'cd '${REMOTEFOLDER}' && find . -type f -printf "%p|%s\n" | sort' > dev/sourcefiles.remote.txt
 
index c193bee..f570716 100644 (file)
 ./backoffice/data/mail/body/user_forgotpasswd.tt|243
 ./backoffice/data/mail/body/user_registration.tt|551
 ./backoffice/data/mail/mail.tt|709
-./backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf|302716
-./backoffice/data/output/pot/periode_20200224-20200419_pot_period.pdf|299068
-./backoffice/data/output/pot/periode_20200420-20200614_pot_period.pdf|17755
-./backoffice/data/output/pot/periode_20200615-20200809_pot_period.pdf|18187
 ./backoffice/data/reports/invoices/dks-deutsch.conf|244
 ./backoffice/data/reports/invoices/dks-deutsch/dks_500.png|19377
 ./backoffice/data/reports/invoices/dks-deutsch.footer.tt|1595
 ./backoffice/data/reports/pot/pot_period.tt|3247
 ./backoffice/data/schemata/defaultcompany.schema.sql|47179
 ./backoffice/data/schemata/.htaccess|167
-./backoffice/data/tmp/pot_period4139.footer.html|1381
-./backoffice/data/tmp/pot_period4139.header.html|674
-./backoffice/data/tmp/pot_period4139.html|441145
-./backoffice/data/tmp/pot_period8800.footer.html|1381
-./backoffice/data/tmp/pot_period8800.header.html|674
-./backoffice/data/tmp/pot_period8800.html|414923
-./backoffice/data/tmp/pot_period8874.footer.html|1381
-./backoffice/data/tmp/pot_period8874.header.html|674
-./backoffice/data/tmp/pot_period8874.html|432945
 ./backoffice/.htaccess|202
 ./backoffice/img/bg1.jpg|135161
 ./backoffice/img/favicon/android-icon-144x144.png|12179
 ./backoffice/tmpl/skeleton/login/validationcode.tt|954
 ./backoffice/tmpl/skeleton/module_file.tt|84
 ./backoffice/tmpl/skeleton/module.tt|2584
-./backoffice/tmp/periods.html|13713
-./backoffice/tmp/rp.js|10474
-./backoffice/tmp/staffreportperiod.js|2268
-./backoffice/tmp/staffworkplan_daily.js|5230
-./backoffice/tmp/staffworkplanform.html|5985
-./backoffice/tmp/staffworkplan.js|24993
 ./backoffice/vendors/choices/base.css|2320
 ./backoffice/vendors/choices/base.min.css|1391
 ./backoffice/vendors/choices/choices.css|8549
index 27d7f90..c8260b1 100644 (file)
@@ -1,9 +1,10 @@
-./backoffice/api/db.cgi|4005
+./backoffice/api/db.cgi|4588
 ./backoffice/api/file.cgi|4381
-./backoffice/api/index.cgi|6445
-./backoffice/api/lib/dksconfig.pm|1536
-./backoffice/api/lib/dksdb.pm|10421
+./backoffice/api/index.cgi|6962
+./backoffice/api/lib/dksconfig.pm|1525
+./backoffice/api/lib/dksdb.pm|10832
 ./backoffice/api/lib/dkssavefile.pm|991
+./backoffice/api/lib/pdfreport.pm|4180
 ./backoffice/api/lib/perl5/Business/Tax/VAT/Validation.pm|14797
 ./backoffice/api/lib/perl5/CGI/Cookie.pm|6599
 ./backoffice/api/lib/perl5/CGI/File/Temp.pm|969
 ./backoffice/api/lib/perl5/x86_64-linux-gnu-thread-multi/Test/LeakTrace/Script.pm|986
 ./backoffice/api/lib/perl5/x86_64-linux-gnu-thread-multi/Text/Soundex.pm|8345
 ./backoffice/api/lib/sendemail_new.pm|4865
-./backoffice/api/lib/sendemail.pm|3040
+./backoffice/api/lib/sendemail.pm|3038
 ./backoffice/api/lib/session.pm|9650
+./backoffice/api/report.cgi|3938
 ./backoffice/api/sendEmail|80246
 ./backoffice/api/tmp/mailbody_fiduciairetiger_gmail.com.txt|1026
 ./backoffice/api/tmp/mailbody_ksaffran_dks.lu.txt|831
 ./backoffice/api/tmp/mailbody_pierre.eberhard_dbe.lu.txt|1027
 ./backoffice/api/upload.cgi|9418
 ./backoffice/css/module.css|181
-./backoffice/css/w3pro.css|27053
+./backoffice/css/w3pro.css|27227
+./backoffice/css/w3pro.min.css|25940
 ./backoffice/data/.htaccess|169
 ./backoffice/data/mail/block/greeting.tt|180
 ./backoffice/data/mail/block/signature.tt|62
 ./backoffice/data/mail/body/user_forgotpasswd.tt|243
 ./backoffice/data/mail/body/user_registration.tt|551
 ./backoffice/data/mail/mail.tt|709
-./backoffice/data/schemata/defaultcompany.schema.sql|53843
+./backoffice/data/reports/invoices/dks-deutsch.conf|244
+./backoffice/data/reports/invoices/dks-deutsch/dks_500.png|19377
+./backoffice/data/reports/invoices/dks-deutsch.footer.tt|1595
+./backoffice/data/reports/invoices/dks-deutsch.header.tt|685
+./backoffice/data/reports/invoices/dks-deutsch/sitc.png|57392
+./backoffice/data/reports/invoices/dks-deutsch.tt|3712
+./backoffice/data/reports/invoices/staff_department.conf|262
+./backoffice/data/reports/invoices/staff_department.footer.tt|1595
+./backoffice/data/reports/invoices/staff_department.header.tt|685
+./backoffice/data/reports/invoices/staff_department.tt|3712
+./backoffice/data/reports/invoices/staff_workplan.conf|258
+./backoffice/data/reports/invoices/staff_workplan.footer.tt|1595
+./backoffice/data/reports/invoices/staff_workplan.header.tt|685
+./backoffice/data/reports/invoices/staff_workplan.tt|1568
+./backoffice/data/reports/pot/pot_period.conf|259
+./backoffice/data/reports/pot/pot_period.footer.tt|1381
+./backoffice/data/reports/pot/pot_period.header.tt|1205
+./backoffice/data/reports/pot/pot_period.tt|3247
+./backoffice/data/schemata/defaultcompany.schema.sql|47179
 ./backoffice/data/schemata/.htaccess|167
 ./backoffice/.htaccess|214
 ./backoffice/img/bg1.jpg|135161
 ./backoffice/img/icons/clubs_white.svg|1045
 ./backoffice/img/icons/club_white.svg|835
 ./backoffice/img/icons/code.svg|589
+./backoffice/img/icons/coin.svg|2323
 ./backoffice/img/icons/company.svg|1482
 ./backoffice/img/icons/company_white.svg|1498
 ./backoffice/img/icons/cubelight.svg|1023
 ./backoffice/img/icons/cube_white.svg|378
 ./backoffice/img/icons/dashboard.svg|1085
 ./backoffice/img/icons/dashboard_white.svg|1098
+./backoffice/img/icons/data_refresh.svg|2969
+./backoffice/img/icons/data_refresh_white.svg|2985
 ./backoffice/img/icons/Document_Save.svg|729
 ./backoffice/img/icons/documents.svg|987
 ./backoffice/img/icons/documents_white.svg|1003
 ./backoffice/img/icons/download_white.svg|351
 ./backoffice/img/icons/duplicate.svg|430
 ./backoffice/img/icons/duplicate_white.svg|442
-./backoffice/img/icons/edit.svg|712
+./backoffice/img/icons/edit.svg|750
 ./backoffice/img/icons/edit_white.svg|725
 ./backoffice/img/icons/excel.svg|1394
 ./backoffice/img/icons/excel_white.svg|1410
+./backoffice/img/icons/expand.svg|322
 ./backoffice/img/icons/file/dir.png|6937
 ./backoffice/img/icons/file/doc.png|6455
 ./backoffice/img/icons/file/docx.png|6455
 ./backoffice/img/icons/numberlist_white.svg|920
 ./backoffice/img/icons/package.svg|408
 ./backoffice/img/icons/package_white.svg|420
+./backoffice/img/icons/pay.svg|3048
 ./backoffice/img/icons/pdfexport.svg|2730
 ./backoffice/img/icons/pdfexport_white.svg|2730
 ./backoffice/img/icons/pdf.svg|3436
 ./backoffice/img/icons/pdf_white.svg|3452
 ./backoffice/img/icons/pictures.svg|1420
 ./backoffice/img/icons/pictures_white.svg|1436
-./backoffice/img/icons/plus.svg|535
+./backoffice/img/icons/plus2.svg|535
+./backoffice/img/icons/plus.svg|404
 ./backoffice/img/icons/plus_white.svg|547
 ./backoffice/img/icons/poticon.svg|10061
 ./backoffice/img/icons/projects.svg|939
 ./backoffice/img/icons/projects_white.svg|955
-./backoffice/img/icons/remove.svg|816
+./backoffice/img/icons/remove_2.svg|816
+./backoffice/img/icons/remove.svg|447
 ./backoffice/img/icons/remove_white.svg|828
+./backoffice/img/icons/rename.svg|1136
 ./backoffice/img/icons/Save.svg|477
 ./backoffice/img/icons/squares.svg|502
 ./backoffice/img/icons/squares_white.svg|514
+./backoffice/img/icons/table.svg|454
 ./backoffice/img/icons/target.svg|780
 ./backoffice/img/icons/target_white.svg|792
 ./backoffice/img/icons/upload.svg|507
 ./backoffice/img/no-news-img.png|17922
 ./backoffice/img/pottop.png|2689
 ./backoffice/img/toplogo.png|31456
-./backoffice/index.cgi|5550
-./backoffice/js/admin.js|3435
+./backoffice/index.cgi|5552
+./backoffice/js/admin.js|2596
 ./backoffice/js/.DS_Store|6148
-./backoffice/js/formsave.js|9096
-./backoffice/js/module_global.js|3286
-./backoffice/js/request.js|3866
+./backoffice/js/formsave.js|8472
+./backoffice/js/module_global.js|4107
+./backoffice/js/request.js|2967
 ./backoffice/tmpl/block/cgu.tt|9358
+./backoffice/tmpl/block/dlgaction.tt|2865
 ./backoffice/tmpl/block/dlgdataload.tt|1293
-./backoffice/tmpl/block/dlgdeleterow.tt|2573
+./backoffice/tmpl/block/dlgdeleterow.tt|2736
 ./backoffice/tmpl/block/dlgmessage.tt|950
+./backoffice/tmpl/block/dlgreport.tt|2354
 ./backoffice/tmpl/block/dlguploadfile.tt|3399
 ./backoffice/tmpl/block/head.tt|1782
 ./backoffice/tmpl/block/snackbar.tt|25
-./backoffice/tmpl/block/toolbars.tt|515
-./backoffice/tmpl/macro/fields.tt|8707
-./backoffice/tmpl/module/companies/index.js|229
-./backoffice/tmpl/module/companies/index.tt|626
+./backoffice/tmpl/block/toolbars.tt|519
+./backoffice/tmpl/macro/fields.tt|12382
+./backoffice/tmpl/module/companies/companies.js|4239
+./backoffice/tmpl/module/companies/index.js|186
+./backoffice/tmpl/module/companies/index.tt|8478
+./backoffice/tmpl/module/companies/staffgroups.js|2346
 ./backoffice/tmpl/module/companies/widgets/companies/companies.js|4126
 ./backoffice/tmpl/module/companies/widgets/companies/frm_companies.tt|1897
 ./backoffice/tmpl/module/companies/widgets/companies/tbar_companies.tt|694
 ./backoffice/tmpl/module/companies/widgets/companies/tbl_companies.tt|133
+./backoffice/tmpl/module/companies/worktimes.js|3616
 ./backoffice/tmpl/module/dashboard/index.js|165
-./backoffice/tmpl/module/dashboard/index.tt|987
-./backoffice/tmpl/module/planning/index.js|305
-./backoffice/tmpl/module/planning/index.tt|1001
-./backoffice/tmpl/module/planning/widgets/reportperiod/dlg_reportperiod.tt|1396
-./backoffice/tmpl/module/planning/widgets/reportperiod/reportperiod.js|3491
-./backoffice/tmpl/module/planning/widgets/reportperiod/tbar_reportperiod.tt|632
-./backoffice/tmpl/module/planning/widgets/reportperiod/tbl_reportperiod.tt|139
-./backoffice/tmpl/module/planning/widgets/staffworkplan/frm_staffworkplan.tt|2928
-./backoffice/tmpl/module/planning/widgets/staffworkplan/staffworkplan.js|14277
-./backoffice/tmpl/module/planning/widgets/staffworkplan/tbar_staffworkplan.tt|912
-./backoffice/tmpl/module/planning/widgets/staffworkplan/tbl_staffworkplan.tt|141
+./backoffice/tmpl/module/dashboard/index.tt|1163
+./backoffice/tmpl/module/periods/index.js|219
+./backoffice/tmpl/module/periods/index.tt|7831
+./backoffice/tmpl/module/periods/reportperiod.js|4442
+./backoffice/tmpl/module/periods/staffperiodweeks.js|10895
 ./backoffice/tmpl/module/profile/dlgpassword.tt|2911
 ./backoffice/tmpl/module/profile/dlgusername.tt|3814
-./backoffice/tmpl/module/profile/index.js|1410
+./backoffice/tmpl/module/profile/index.js|403
 ./backoffice/tmpl/module/profile/index.tt|1767
-./backoffice/tmpl/module/sites/index.js|4519
-./backoffice/tmpl/module/sites/index.tt|0
-./backoffice/tmpl/module/staff/index.js|247
-./backoffice/tmpl/module/staff/index.tt|701
+./backoffice/tmpl/module/staff/index.js|199
+./backoffice/tmpl/module/staff/index.tt|5754
+./backoffice/tmpl/module/staff/staffcontract.js|6449
+./backoffice/tmpl/module/staff/staff.js|3528
 ./backoffice/tmpl/module/staff/widgets/staffcontract/dlg_staffcontract.tt|1344
 ./backoffice/tmpl/module/staff/widgets/staffcontract/staffcontract.js|4239
 ./backoffice/tmpl/module/staff/widgets/staffcontract/tbar_staffcontract.tt|645
 ./backoffice/tmpl/module/staff/widgets/staff/staff.js|3787
 ./backoffice/tmpl/module/staff/widgets/staff/tbar_staff.tt|672
 ./backoffice/tmpl/module/staff/widgets/staff/tbl_staff.tt|125
-./backoffice/tmpl/module/timetrackers/index.js|399
-./backoffice/tmpl/module/timetrackers/index.tt|1304
-./backoffice/tmpl/module/users/index.js|221
-./backoffice/tmpl/module/users/index.tt|594
+./backoffice/tmpl/module/timetrackers/index.js|401
+./backoffice/tmpl/module/timetrackers/index.tt|1310
+./backoffice/tmpl/module/users/index.js|126
+./backoffice/tmpl/module/users/index.tt|3043
+./backoffice/tmpl/module/users/users.js|6741
 ./backoffice/tmpl/module/users/widgets/users/dlg_users.tt|1765
 ./backoffice/tmpl/module/users/widgets/users/tbar_users.tt|601
 ./backoffice/tmpl/module/users/widgets/users/tbl_users.tt|125
 ./backoffice/tmpl/module/users/widgets/users/users.js|6218
-./backoffice/tmpl/module/workplans/index.js|3126
-./backoffice/tmpl/module/workplans/index.tt|3065
-./backoffice/tmpl/skeleton/index.tt|4550
+./backoffice/tmpl/module/workplans/index.js|169
+./backoffice/tmpl/module/workplans/index.tt|5446
+./backoffice/tmpl/module/workplans/workplans.js|6385
+./backoffice/tmpl/skeleton/index.tt|4407
 ./backoffice/tmpl/skeleton/login/accountreset.tt|1679
 ./backoffice/tmpl/skeleton/login/forgotpassword.tt|874
 ./backoffice/tmpl/skeleton/login/login.tt|1231
 ./backoffice/tmpl/skeleton/login.tt|1171
 ./backoffice/tmpl/skeleton/login/validationcode.tt|954
 ./backoffice/tmpl/skeleton/module_file.tt|84
-./backoffice/tmpl/skeleton/module.tt|2718
-./backoffice/vendors/choices/base.css|2314
-./backoffice/vendors/choices/base.min.css|1604
-./backoffice/vendors/choices/choices.css|8099
+./backoffice/tmpl/skeleton/module.tt|2584
+./backoffice/vendors/choices/base.css|2320
+./backoffice/vendors/choices/base.min.css|1391
+./backoffice/vendors/choices/choices.css|8549
 ./backoffice/vendors/choices/choices.js|217424
-./backoffice/vendors/choices/choices.min.css|6735
+./backoffice/vendors/choices/choices.min.css|6293
 ./backoffice/vendors/choices/choices.min.js|91604
+./backoffice/vendors/choices/choices.min.orig.css|6735
+./backoffice/vendors/choices/choices.orig.css|8099
 ./backoffice/vendors/choices/scripts/choices.js|217424
 ./backoffice/vendors/choices/scripts/choices.min.js|91604
-./backoffice/vendors/ctxmenu/ctxmenu.css|1689
-./backoffice/vendors/ctxmenu/ctxmenu.js|7569
 ./backoffice/vendors/flatpickr/flatpickr.css|18831
-./backoffice/vendors/flatpickr/flatpickr.js|118042
-./backoffice/vendors/flatpickr/flatpickr.min.css|15954
-./backoffice/vendors/flatpickr/flatpickr.min.js|48368
+./backoffice/vendors/flatpickr/flatpickr.js|118005
+./backoffice/vendors/flatpickr/flatpickr.min.css|15556
+./backoffice/vendors/flatpickr/flatpickr.min.js|48355
+./backoffice/vendors/flatpickr/flatpickr.min.orig.css|15954
 ./backoffice/vendors/flatpickr/ie.css|260
 ./backoffice/vendors/flatpickr/index.d.ts|138
 ./backoffice/vendors/flatpickr/l10n/de.d.ts|2272
 ./backoffice/vendors/flatpickr/plugins/labelPlugin/labelPlugin.d.ts|114
 ./backoffice/vendors/flatpickr/plugins/labelPlugin/labelPlugin.js|964
 ./backoffice/vendors/flatpickr/plugins/minMaxTimePlugin.d.ts|491
-./backoffice/vendors/flatpickr/plugins/minMaxTimePlugin.js|12399
+./backoffice/vendors/flatpickr/plugins/minMaxTimePlugin.js|12386
 ./backoffice/vendors/flatpickr/plugins/monthSelect/index.d.ts|367
 ./backoffice/vendors/flatpickr/plugins/monthSelect/index.js|7757
 ./backoffice/vendors/flatpickr/plugins/monthSelect/style.css|1561
 ./backoffice/vendors/flatpickr/plugins/weekSelect/weekSelect.d.ts|218
 ./backoffice/vendors/flatpickr/plugins/weekSelect/weekSelect.js|3500
 ./backoffice/vendors/flatpickr/themes/airbnb.css|21148
+./backoffice/vendors/flatpickr/themes/airbnb.min.css|17638
 ./backoffice/vendors/flatpickr/themes/confetti.css|19048
 ./backoffice/vendors/flatpickr/themes/dark.css|18875
 ./backoffice/vendors/flatpickr/themes/light.css|18996
 ./backoffice/vendors/flatpickr/utils/formatting.d.ts|834
 ./backoffice/vendors/flatpickr/utils/index.d.ts|393
 ./backoffice/vendors/flatpickr/utils/polyfills.d.ts|0
-./backoffice/vendors/jspdf/jspdf.min.js|307591
-./backoffice/vendors/jspdf/jspdf.plugin.autotable.js|71296
-./backoffice/vendors/jspdf/jspdf.plugin.autotable.min.js|30274
-./backoffice/vendors/jsxlsx/cpexcel.js|471033
-./backoffice/vendors/jsxlsx/jszip.js|288108
-./backoffice/vendors/jsxlsx/LICENSE|11356
-./backoffice/vendors/jsxlsx/shim.min.js|5651
-./backoffice/vendors/jsxlsx/xlsx.core.min.js|477227
-./backoffice/vendors/jsxlsx/xlsx.core.min.map|717898
-./backoffice/vendors/jsxlsx/xlsx.extendscript.js|992249
-./backoffice/vendors/jsxlsx/xlsx.full.min.js|921331
-./backoffice/vendors/jsxlsx/xlsx.full.min.map|841224
-./backoffice/vendors/jsxlsx/xlsx.js|696439
-./backoffice/vendors/jsxlsx/xlsx.min.js|397226
-./backoffice/vendors/jsxlsx/xlsx.min.map|586186
 ./backoffice/vendors/moment/moment.js|150941
 ./backoffice/vendors/moment/moment.min.js|53324
 ./backoffice/vendors/moment/moment-with-locales.js|541363
 ./index.cgi|2355
 ./js/slides.js|669
 ./tmpl/skeleton/index_next.tt|11738
-./tmpl/skeleton/index.tt|3324
+./tmpl/skeleton/index.tt|3321