dolibarr 21.0.0-beta
linkedobjectblock.tpl.php
1<?php
2/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
3 * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
4 * Copyright (C) 2014 Marcos GarcĂ­a <marcosgdf@gmail.com>
5 * Copyright (C) 2017 Charlene Benke <cf.benke@patas-monkey.com>
6 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 *
21 */
22
23print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedobjectblock.tpl.php -->\n";
24
25global $user;
26global $noMoreLinkedObjectBlockAfter;
27
28$langs = $GLOBALS['langs'];
29$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
30
31$langs->load("donations");
32
33$total = 0;
34$ilink = 0;
35foreach ($linkedObjectBlock as $key => $objectlink) {
36 $ilink++;
37
38 $trclass = 'oddeven';
39 if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
40 $trclass .= ' liste_sub_total';
41 }
42 print '<tr class="'.$trclass.'">';
43 print '<td>'.$langs->trans("Donation").'</td>';
44 print '<td>'.$objectlink->getNomUrl(1).'</td>';
45 print '<td class="center">'.$objectlink->ref_client.'</td>';
46 print '<td class="center">'.dol_print_date($objectlink->date, 'day').'</td>';
47 print '<td class="right">';
48 $total += $objectlink->total_ht;
49 echo price($objectlink->total_ht);
50}
51print '</td>';
52print '<td class="right">'.$objectlink->getLibStatut(3).'</td>';
53print '</tr>';
54
55if (count($linkedObjectBlock) > 1) {
56 ?>
57 <tr class="liste_total <?php echo(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
58 <td><?php echo $langs->trans("Total"); ?></td>
59 <td></td>
60 <td class="center"></td>
61 <td class="center"></td>
62 <td class="right"><?php echo price($total); ?></td>
63 <td class="right"></td>
64 <td class="right"></td>
65 </tr>
66 <?php
67}
68
69print "<!-- END PHP TEMPLATE -->\n";
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
$objectlink