/
invoice_exported.php
executable file
·102 lines (85 loc) · 3.08 KB
/
invoice_exported.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/*
JM-booking
Copyright (C) 2007-2010 Jaermuseet <http://www.jaermuseet.no>
Contact: <hn@jaermuseet.no>
Project: <http://github.com/hnJaermuseet/JM-booking>
Based on ARBS, Advanced Resource Booking System, copyright (C) 2005-2007
ITMC der TU Dortmund <http://sourceforge.net/projects/arbs/>. ARBS is based
on MRBS by Daniel Gardner <http://mrbs.sourceforge.net/>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require "include/invoice_top.php";
$section = 'exported';
require "include/invoice_menu.php";
echo '<h1 style="margin-bottom: 0px;">Bookinger som er sendt til regnskap'.chr(10).chr(10);
if(isset($_GET['filters']))
{
echo ' - endret filter';
echo '</h1>'.chr(10).chr(10);
$filters = filterGetFromSerialized($_GET['filters']);
if(!$filters)
$filters = array();
$SQL = genSQLFromFilters($filters, 'entry_id');
filterLink($filters, 'invoice_exported'); echo '<br>'.chr(10);
filterPrint($filters); echo '<br>'.chr(10);
echo '<br>'.chr(10).chr(10);
$tamed_booking = true;
foreach($filters as $filter) {
if($filter[0] == 'tamed_booking')
{
$tamed_booking = $filter[1];
}
}
entrylist_invoice_exported($SQL, $tamed_booking);
}
else
{
echo '</h1>'.chr(10).chr(10);
echo '<span class="hiddenprint">';
$Q_area = db()->prepare("select id as area_id, area_name from mrbs_area order by area_name");
$Q_area->execute();
$num_area = $Q_area->rowCount();
$counter_area = 0;
echo '<span style="font-size: 0.8em;">Filtrer på anlegg: ';
while($R = $Q_area->fetch())
{
$counter_area++;
if($area_spesific && $area_invoice['area_id'] == $R['area_id'])
echo '<b>';
echo '<a href="'.$_SERVER['PHP_SELF'].'?area_id='.$R['area_id'].'">'.$R['area_name'].'</a>';
if($area_spesific && $area_invoice['area_id'] == $R['area_id'])
echo '</b>';
if($counter_area != $num_area)
echo ' -:- ';
}
echo '<br /><br /></span>';
$filters = array();
$filters = addFilter($filters, 'invoice', '1');
$filters = addFilter($filters, 'invoice_status', '3');
if($area_spesific)
$filters = addFilter($filters, 'area_id', $area_invoice['area_id']);
$SQL = genSQLFromFilters($filters, 'entry_id');
filterLink($filters, 'invoice_exported'); echo '<br>'.chr(10);
echo '</span>';
filterPrint($filters); echo '<br>'.chr(10);
echo '<br>'.chr(10).chr(10);
$tamed_booking = true;
foreach($filters as $filter) {
if($filter[0] == 'tamed_booking')
{
$tamed_booking = $filter[1];
}
}
entrylist_invoice_exported($SQL, $tamed_booking, $area_spesific);
}