Adjust form to new table einsatz and co.
[misc/kostenrechnung] / masks / akkord_geraete.php
1 <?php
2
3 include_once($_SESSION['sys']['basedir'].'/lib/overview_utils.php');
4
5 if (empty($_SESSION['akkord_geraete.year'])) $_SESSION['akkord_geraete.year'] = 0;
6
7 $mask = array(
8               'table' => 'einsatz',
9               'title' => 'Akkordstunden für Geräte',
10               'join' => array('gerate ON einsatz.geraet = gerate.id',
11                               'anbaugeraete ON einsatz.anbaugeraet = anbaugeraete.id',
12                               'arbeitsarten ON einsatz.arbeiten = arbeitsarten.id',
13                               'kostenstellen ON einsatz.kostenstelle = kostenstellen.id',
14                               ),
15               'where' => "arbeitsarten.arbeitsart <> 'Urlaub' AND arbeitsarten.arbeitsart <> 'Krank' AND arbeitsarten.arbeitsart <> 'Sonstige Fehltage'"
16                        . " AND date_part('year', datum) = " . $_SESSION['akkord_geraete.year']
17                        . " AND akkord = 1"
18                        . " GROUP BY gerate.id,gerate.geraet,arbeitsarten.arbeitsart",
19               'select' => array(
20                                 'title' => 'Auswahl',
21                                 'options' => discover_years(),
22                                 'default' => 'Jahr wählen',
23                                 'selected' => $_SESSION['akkord_geraete.year'],
24                                 'onchange' => "setvar(this,'year',select_year_calback,select_year_status)",
25                                 ),
26               'variables' => array(
27                                    'year' => array(),
28                                    ),
29               'list' => array(
30                               'id' => array(
31                                             'name' => 'ID',
32                                             'visible' => false,
33                                             'sql' => 'gerate.id',
34                                             ),
35                               'geraet' => array(
36                                             'name' => 'Gerät',
37                                             'sql' => "gerate.geraet",
38                                             'width' => 170,
39                                             'specs' => "filterUI: 's'",
40                                             ),
41                               'arbeitsart' => array(
42                                             'name' => 'Arbeitsart',
43                                             'sql' => "arbeitsarten.arbeitsart",
44                                             'width' => 150,
45                                             'specs' => "filterUI: 's'",
46                                             ),
47                               'stunden' => array(
48                                             'name' => 'Stunden',
49                                             'type' => 'number',
50                                             'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
51                                             'width' => 90,
52                                             'sql' => 'sum(geraetstunden)',
53                                             ),
54                               ),
55               );
56
57 ?>