Adjust form to new table einsatz and co.
[misc/kostenrechnung] / masks / overview_stunden.php
index da9f2f5..c8fe37f 100644 (file)
@@ -2,25 +2,28 @@
 
 include_once($_SESSION['sys']['basedir'].'/lib/overview_utils.php');
 
-if (empty($_SESSION['stunden.year'])) $_SESSION['stunden.year'] = 0;
+if (empty($_SESSION['overview_stunden.year'])) $_SESSION['overview_stunden.year'] = 0;
 
 $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',
-                             '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['stunden.year'],
+                      . " AND date_part('year', datum) = " . $_SESSION['overview_stunden.year'],
              'select' => array(
                                'title' => 'Auswahl',
                                'options' => discover_years(),
                                'default' => 'Jahr wählen',
-                               'selected' => $_SESSION['stunden.year'],
+                               'selected' => $_SESSION['overview_stunden.year'],
                                'onchange' => "setvar(this,'year',select_year_calback,select_year_status)",
                                ),
              'variables' => array(
@@ -30,7 +33,7 @@ $mask = array(
                              'id' => array(
                                            'name' => 'ID',
                                            'visible' => false,
-                                           'width' => 40,
+                                           'width' => 6-0,
                                            'sql' => 'einsatz.id',
                                            ),
                              'datum' => array(
@@ -67,6 +70,7 @@ $mask = array(
                                            'type' => 'number',
                                            'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
                                            'width' => 60,
+                                           'sql' => 'einsatzpersonal.stunden'
                                            ),
                              'geraet' => array(
                                            'name' => 'Gerät',
@@ -85,20 +89,21 @@ $mask = array(
                                            '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,
-                                           '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,
-                                           'sql' => '(stunden + geraetstunden) / laenge',
+                                           'sql' => '(einsatzpersonal.stunden + einsatzgeraete.stunden) / laenge',
                                            ),
                              ),
              );