Adjust form to new table einsatz and co.
authorJoey Schulze <joey@infodrom.org>
Wed, 10 Mar 2010 14:22:31 +0000 (15:22 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 10 Mar 2010 14:22:31 +0000 (15:22 +0100)
masks/overview_kosten.php
masks/overview_stunden.php

index 7800dfc..6196b12 100644 (file)
@@ -7,16 +7,19 @@ if (empty($_SESSION['overview_kosten.year'])) $_SESSION['overview_kosten.year']
 $mask = array(
              'table' => 'einsatz',
              'title' => 'Kostenaufwand für Kostenstellen',
 $mask = array(
              'table' => 'einsatz',
              'title' => 'Kostenaufwand für Kostenstellen',
-             'join' => array('personal ON einsatz.personal = personal.id',
-                             'gerate ON einsatz.geraet = gerate.id',
-                             'anbaugeraete ON einsatz.anbaugeraet = anbaugeraete.id',
+             'join' => array(
+                             'einsatzpersonal ON einsatzpersonal.einsatz = einsatz.id',
+                             'einsatzgeraete ON einsatzgeraete.einsatz = einsatz.id',
+                             'personal ON einsatzpersonal.personal = personal.id',
+                             'gerate ON einsatzgeraete.geraet = gerate.id',
+                             'anbaugeraete ON einsatzgeraete.anbaugeraet = anbaugeraete.id',
                              'arbeitsarten ON einsatz.arbeiten = arbeitsarten.id',
                              'gebiet ON einsatz.gebiet = gebiet.id',
                              'kostenstellen ON einsatz.kostenstelle = kostenstellen.id',
                              ),
              'where' => "arbeitsarten.arbeitsart <> 'Urlaub' AND arbeitsarten.arbeitsart <> 'Krank' AND arbeitsarten.arbeitsart <> 'Sonstige Fehltage'"
                       . " AND date_part('year', datum) = " . $_SESSION['overview_kosten.year']
                              'arbeitsarten ON einsatz.arbeiten = arbeitsarten.id',
                              'gebiet ON einsatz.gebiet = gebiet.id',
                              'kostenstellen ON einsatz.kostenstelle = kostenstellen.id',
                              ),
              'where' => "arbeitsarten.arbeitsart <> 'Urlaub' AND arbeitsarten.arbeitsart <> 'Krank' AND arbeitsarten.arbeitsart <> 'Sonstige Fehltage'"
                       . " AND date_part('year', datum) = " . $_SESSION['overview_kosten.year']
-                      . " GROUP BY gebiet.gebiet,kostenstellen.kostenstelle,kostenstellen.id,personal.name,personal.vorname,gerate.geraet,laenge",
+                      . " GROUP BY einsatz.id,gebiet.gebiet,kostenstellen.kostenstelle,kostenstellen.id,personal.name,personal.vorname,gerate.geraet,laenge",
              'select' => array(
                                'title' => 'Auswahl',
                                'options' => discover_years(),
              'select' => array(
                                'title' => 'Auswahl',
                                'options' => discover_years(),
@@ -31,7 +34,8 @@ $mask = array(
                              'id' => array(
                                            'name' => 'ID',
                                            'visible' => false,
                              'id' => array(
                                            'name' => 'ID',
                                            'visible' => false,
-                                           'sql' => 'kostenstellen.id',
+                                           'width' => 60,
+                                           'sql' => 'einsatz.id',
                                            ),
                              'gebiet' => array(
                                            'name' => 'Gebiet',
                                            ),
                              'gebiet' => array(
                                            'name' => 'Gebiet',
@@ -68,33 +72,33 @@ $mask = array(
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 90,
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 90,
-                                           'sql' => 'sum(stunden * personal.persstdsatz)',
+                                           'sql' => 'sum(einsatzpersonal.stunden * personal.persstdsatz)',
                                            ),
                              'geraetkosten' => array(
                                            'name' => 'Gerätkosten',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 90,
                                            ),
                              'geraetkosten' => array(
                                            'name' => 'Gerätkosten',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 90,
-                                           'sql' => 'sum(geraetstunden * gerate.geraetkst_intern + ' .
-                                                    'geraetstunden * anbaugeraete.anbkst_intern)',
+                                           'sql' => 'sum(einsatzgeraete.stunden * gerate.geraetkst_intern + ' .
+                                                    'einsatzgeraete.stunden * anbaugeraete.anbkst_intern)',
                                            ),
                              'gesamtkosten' => array(
                                            'name' => 'Gesamtkosten',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 90,
                                            ),
                              'gesamtkosten' => array(
                                            'name' => 'Gesamtkosten',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 90,
-                                           'sql' => 'sum(stunden * personal.persstdsatz + ' . 
-                                                    'geraetstunden * gerate.geraetkst_intern + ' .
-                                                    'geraetstunden * anbaugeraete.anbkst_intern)',
+                                           'sql' => 'sum(einsatzpersonal.stunden * personal.persstdsatz + ' . 
+                                                    'einsatzgeraete.stunden * gerate.geraetkst_intern + ' .
+                                                    'einsatzgeraete.stunden * anbaugeraete.anbkst_intern)',
                                            ),
                              'prolfdm' => array(
                                            'name' => 'pro lfdm',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
                                            ),
                              'prolfdm' => array(
                                            'name' => 'pro lfdm',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
-                                           'sql' => 'sum(stunden * personal.persstdsatz + ' . 
-                                                    'geraetstunden * gerate.geraetkst_intern + ' .
-                                                    'geraetstunden * anbaugeraete.anbkst_intern) / laenge',
+                                           'sql' => 'sum(einsatzpersonal.stunden * personal.persstdsatz + ' . 
+                                                    'einsatzgeraete.stunden * gerate.geraetkst_intern + ' .
+                                                    'einsatzgeraete.stunden * anbaugeraete.anbkst_intern) / laenge',
                                            ),
                              ),
              );
                                            ),
                              ),
              );
index 51aa420..c8fe37f 100644 (file)
@@ -7,12 +7,15 @@ if (empty($_SESSION['overview_stunden.year'])) $_SESSION['overview_stunden.year'
 $mask = array(
              'table' => 'einsatz',
              'title' => 'Stundenübersicht nach Kostenstellen',
 $mask = array(
              'table' => 'einsatz',
              'title' => 'Stundenübersicht nach Kostenstellen',
-             'join' => array('arbeitsarten ON einsatz.arbeiten = arbeitsarten.id',
+             'join' => array(
+                             'arbeitsarten ON einsatz.arbeiten = arbeitsarten.id',
+                             'einsatzpersonal ON einsatzpersonal.einsatz = einsatz.id',
+                             'einsatzgeraete ON einsatzgeraete.einsatz = einsatz.id',
                              'gebiet ON einsatz.gebiet = gebiet.id',
                              'kostenstellen ON einsatz.kostenstelle = kostenstellen.id',
                              'gebiet ON einsatz.gebiet = gebiet.id',
                              'kostenstellen ON einsatz.kostenstelle = kostenstellen.id',
-                             'personal ON einsatz.personal = personal.id',
-                             'gerate ON einsatz.geraet = gerate.id',
-                             'anbaugeraete ON einsatz.anbaugeraet = anbaugeraete.id',
+                             'personal ON einsatzpersonal.personal = personal.id',
+                             'gerate ON einsatzgeraete.geraet = gerate.id',
+                             'anbaugeraete ON einsatzgeraete.anbaugeraet = anbaugeraete.id',
                              ),
              'where' => "arbeitsarten.arbeitsart <> 'Urlaub' AND arbeitsarten.arbeitsart <> 'Krank' AND arbeitsarten.arbeitsart <> 'Sonstige Fehltage'"
                       . " AND date_part('year', datum) = " . $_SESSION['overview_stunden.year'],
                              ),
              'where' => "arbeitsarten.arbeitsart <> 'Urlaub' AND arbeitsarten.arbeitsart <> 'Krank' AND arbeitsarten.arbeitsart <> 'Sonstige Fehltage'"
                       . " AND date_part('year', datum) = " . $_SESSION['overview_stunden.year'],
@@ -30,7 +33,7 @@ $mask = array(
                              'id' => array(
                                            'name' => 'ID',
                                            'visible' => false,
                              'id' => array(
                                            'name' => 'ID',
                                            'visible' => false,
-                                           'width' => 40,
+                                           'width' => 6-0,
                                            'sql' => 'einsatz.id',
                                            ),
                              'datum' => array(
                                            'sql' => 'einsatz.id',
                                            ),
                              'datum' => array(
@@ -67,6 +70,7 @@ $mask = array(
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
+                                           'sql' => 'einsatzpersonal.stunden'
                                            ),
                              'geraet' => array(
                                            'name' => 'Gerät',
                                            ),
                              'geraet' => array(
                                            'name' => 'Gerät',
@@ -85,20 +89,21 @@ $mask = array(
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
+                                           'sql' => 'einsatzgeraete.stunden'
                                            ),
                              'gesamtstunden' => array(
                                            'name' => 'Gesamtstunden',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
                                            ),
                              'gesamtstunden' => array(
                                            'name' => 'Gesamtstunden',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
-                                           'sql' => 'stunden + geraetstunden',
+                                           'sql' => 'einsatzpersonal.stunden + einsatzgeraete.stunden',
                                            ),
                              'stdlfdm' => array(
                                            'name' => 'Stunden pro lfdm',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
                                            ),
                              'stdlfdm' => array(
                                            'name' => 'Stunden pro lfdm',
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
-                                           'sql' => '(stunden + geraetstunden) / laenge',
+                                           'sql' => '(einsatzpersonal.stunden + einsatzgeraete.stunden) / laenge',
                                            ),
                              ),
              );
                                            ),
                              ),
              );