c8fe37f417ed97670492c7fb5aeef5567ab5f535
[misc/kostenrechnung] / masks / overview_stunden.php
1 <?php
2
3 include_once($_SESSION['sys']['basedir'].'/lib/overview_utils.php');
4
5 if (empty($_SESSION['overview_stunden.year'])) $_SESSION['overview_stunden.year'] = 0;
6
7 $mask = array(
8               'table' => 'einsatz',
9               'title' => 'Stundenübersicht nach Kostenstellen',
10               'join' => array(
11                               'arbeitsarten ON einsatz.arbeiten = arbeitsarten.id',
12                               'einsatzpersonal ON einsatzpersonal.einsatz = einsatz.id',
13                               'einsatzgeraete ON einsatzgeraete.einsatz = einsatz.id',
14                               'gebiet ON einsatz.gebiet = gebiet.id',
15                               'kostenstellen ON einsatz.kostenstelle = kostenstellen.id',
16                               'personal ON einsatzpersonal.personal = personal.id',
17                               'gerate ON einsatzgeraete.geraet = gerate.id',
18                               'anbaugeraete ON einsatzgeraete.anbaugeraet = anbaugeraete.id',
19                               ),
20               'where' => "arbeitsarten.arbeitsart <> 'Urlaub' AND arbeitsarten.arbeitsart <> 'Krank' AND arbeitsarten.arbeitsart <> 'Sonstige Fehltage'"
21                        . " AND date_part('year', datum) = " . $_SESSION['overview_stunden.year'],
22               'select' => array(
23                                 'title' => 'Auswahl',
24                                 'options' => discover_years(),
25                                 'default' => 'Jahr wählen',
26                                 'selected' => $_SESSION['overview_stunden.year'],
27                                 'onchange' => "setvar(this,'year',select_year_calback,select_year_status)",
28                                 ),
29               'variables' => array(
30                                    'year' => array(),
31                                    ),
32               'list' => array(
33                               'id' => array(
34                                             'name' => 'ID',
35                                             'visible' => false,
36                                             'width' => 6-0,
37                                             'sql' => 'einsatz.id',
38                                             ),
39                               'datum' => array(
40                                             'name' => 'Datum',
41                                             'type' => 'date',
42                                             'width' => 70,
43                                             ),
44                               'gebiet' => array(
45                                             'name' => 'Gebiet',
46                                             'sql' => "gebiet.gebiet",
47                                             'width' => 150,
48                                             'specs' => "filterUI: 's'",
49                                             ),
50                               'kostenstelle' => array(
51                                             'name' => 'Kostenstelle',
52                                             'sql' => "kostenstellen.kostenstelle",
53                                             'width' => 150,
54                                             'specs' => "filterUI: 's'",
55                                             ),
56                               'arbeitsarten' => array(
57                                             'name' => 'Arbeiten',
58                                             'sql' => "arbeitsarten.arbeitsart",
59                                             'width' => 150,
60                                             'specs' => "filterUI: 's'",
61                                             ),
62                               'personal' => array(
63                                             'name' => 'Mitarbeiter',
64                                             'sql' => "personal.vorname || ' ' || personal.name",
65                                             'width' => 150,
66                                             'specs' => "filterUI: 's'",
67                                             ),
68                               'stunden' => array(
69                                             'name' => 'Mitarbeiterstunden',
70                                             'type' => 'number',
71                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
72                                             'width' => 60,
73                                             'sql' => 'einsatzpersonal.stunden'
74                                             ),
75                               'geraet' => array(
76                                             'name' => 'Gerät',
77                                             'sql' => "gerate.geraet",
78                                             'width' => 150,
79                                             'specs' => "filterUI: 's'",
80                                             ),
81                               'anbaugeraet' => array(
82                                             'name' => 'Anbaugerät',
83                                             'sql' => "anbaugeraete.anbaugeraet",
84                                             'width' => 150,
85                                             'specs' => "filterUI: 's'",
86                                             ),
87                               'geraetstunden' => array(
88                                             'name' => 'Gerätstunden',
89                                             'type' => 'number',
90                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
91                                             'width' => 60,
92                                             'sql' => 'einsatzgeraete.stunden'
93                                             ),
94                               'gesamtstunden' => array(
95                                             'name' => 'Gesamtstunden',
96                                             'type' => 'number',
97                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
98                                             'width' => 60,
99                                             'sql' => 'einsatzpersonal.stunden + einsatzgeraete.stunden',
100                                             ),
101                               'stdlfdm' => array(
102                                             'name' => 'Stunden pro lfdm',
103                                             'type' => 'number',
104                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
105                                             'width' => 60,
106                                             'sql' => '(einsatzpersonal.stunden + einsatzgeraete.stunden) / laenge',
107                                             ),
108                               ),
109               );
110
111 ?>