-
Notifications
You must be signed in to change notification settings - Fork 0
/
template_facturacio_resultats.php
188 lines (164 loc) · 6.21 KB
/
template_facturacio_resultats.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<title>Resultats</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="css/buttons.dataTables.min.css">
<script src="js/jquery-3.7.0.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="js/dataTables.buttons.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jszip.min.js"></script>
<script type="text/javascript" language="javascript" src="js/pdfmake.min.js"></script>
<script type="text/javascript" language="javascript" src="js/vfs_fonts.js"></script>
<script type="text/javascript" language="javascript" src="js/buttons.html5.min.js"></script>
<script type="text/javascript" language="javascript" src="js/buttons.print.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#resultats_agrupats_per_cartid').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"paging": false,
"ordering": false,
"info": false,
"searching": false,
"fixedColumns": true,
scrollX: true,
scrollY: true,
});
$('#resultats_agrupats_per_soci').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"paging": false,
"ordering": false,
"info": false,
"searching": false,
"fixedColumns": true,
scrollX: true,
scrollY: true,
});
});
</script>
<style>
/* Custom CSS for dashed column borders */
table.dataTable th,
table.dataTable td {
border: 1px solid #deddda66; /* Dashed border with light gray */
padding: 8px; /* Add padding for better appearance */
}
</style>
</head>
<body>
<h3>RESULTATS PER cart id</h3>
<table id="resultats_agrupats_per_cartid" class="display primary" cellspacing="0" width="100%">
<thead>
<tr>
<th style="width: 170px;"></th> <!-- necessary for buttons CSV, PDF etc -->
<th style="width: 200px;"></th> <!-- necessary for buttons CSV, PDF etc -->
<?php foreach ($factures as $factura): ?>
<th></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>Detall compra<br/>(Cart id)</td>
<?php foreach ($factures as $factura): ?>
<td><?= $factura['cart_id'] ?></td>
<?php endforeach; ?>
</tr>
<tr>
<td>Despesa total: <?= $total_totes_comandes ?></td>
<td>NUM SOCI:</td>
<?php foreach ($factures as $factura): ?>
<td><?= $factura['soci'] ?></td>
<?php endforeach; ?>
</tr>
<tr>
<td><?= count($factures) ?> comandes</td>
<td></td>
<?php foreach ($factures as $factura): ?>
<td></td>
<?php endforeach; ?>
</tr>
<tr>
<td></td>
<td>Total:</td>
<?php foreach ($factures as $factura): ?>
<td><?= $factura['total'] ?></td>
<?php endforeach; ?>
</tr>
<?php
$iva_keys = get_iva_types();
?>
<?php foreach ($iva_types as $iva): ?>
<tr>
<td></td>
<td><?= $iva ?>%</td>
<?php foreach ($factures as $factura): ?>
<td><?= $factura['base_iva'][$iva] ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<br>
<h3>RESULTATS PER SOCI</h3>
<table id="resultats_agrupats_per_soci" class="display primary" cellspacing="0" width="100%">
<thead>
<tr>
<th style="width: 170px;"></th> <!-- necessary for buttons CSV, PDF etc -->
<th style="width: 200px;"></th> <!-- necessary for buttons CSV, PDF etc -->
<?php foreach ($factures_agrupades as $factura): ?>
<th></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<tr>
<td>Despesa Total: <?= $total_totes_comandes ?></td>
<td>NUM SOCI:</td>
<?php foreach ($factures_agrupades as $factura): ?>
<td><?= $factura['soci'] ?></td>
<?php endforeach; ?>
</tr>
<tr>
<td><?= count($factures_agrupades) ?> socis agrupats</td>
<td></td>
<?php foreach ($factures_agrupades as $factura): ?>
<td></td>
<?php endforeach; ?>
</tr>
<tr>
<td></td>
<td>Total:</td>
<?php foreach ($factures_agrupades as $factura): ?>
<td><?= $factura['total'] ?></td>
<?php endforeach; ?>
</tr>
<?php
$iva_keys = get_iva_types();
?>
<?php foreach ($iva_types as $iva): ?>
<tr>
<td></td>
<td><?= $iva ?>%</td>
<?php foreach ($factures_agrupades as $factura): ?>
<td><?= $factura['base_iva'][$iva] ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<!--
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
-->
</body>
</html>