dolibarr 24.0.0-beta
linkedobjectblock.tpl.php
Go to the documentation of this file.
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-2025 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
39'@phan-var-force Don[] $linkedObjectBlock';
40
41print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedobjectblock.tpl.php -->\n";
42
43$langs->load("donations");
44
45$total = 0;
46$ilink = 0;
47$lastObjectLink = null;
48foreach ($linkedObjectBlock as $key => $objectlink) {
49 '@phan-var-force Don $objectlink';
50 $ilink++;
51
52 $trclass = 'oddeven';
53 if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
54 $trclass .= ' liste_sub_total';
55 }
56 print '<tr class="'.$trclass.'">';
57 print '<td>'.$langs->trans("Donation").'</td>';
58 print '<td>'.$objectlink->getNomUrl(1).'</td>';
59 print '<td class="center linkedcol-ref"></td>';
60 print '<td class="center">'.dol_print_date($objectlink->date, 'day').'</td>';
61 print '<td class="right">';
62 $total += $objectlink->total_ht;
63 echo price($objectlink->total_ht);
64 $lastObjectLink = $objectlink;
65}
66print '</td>';
67print '<td class="right">'.(is_object($lastObjectLink) ? $lastObjectLink->getLibStatut(3) : '').'</td>';
68print '</tr>';
69
70if (count($linkedObjectBlock) > 1) {
71 ?>
72 <tr class="liste_total <?php echo(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
73 <td><?php echo $langs->trans("Total"); ?></td>
74 <td></td>
75 <td class="center"></td>
76 <td class="center"></td>
77 <td class="right"><?php echo price($total); ?></td>
78 <td class="right"></td>
79 <td class="right"></td>
80 </tr>
81 <?php
82}
83
84print "<!-- 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.