dolibarr  13.0.2
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  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21 
22 print "<!-- BEGIN PHP TEMPLATE -->\n";
23 
24 global $user;
25 global $noMoreLinkedObjectBlockAfter;
26 
27 $langs = $GLOBALS['langs'];
28 $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
29 
30 $langs->load("donations");
31 
32 $total = 0;
33 $ilink = 0;
34 foreach ($linkedObjectBlock as $key => $objectlink) {
35  $ilink++;
36 
37  $trclass = 'oddeven';
38  if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total';
39  print '<tr class="'.$trclass.'">';
40  print '<td>'.$langs->trans("Donation").'</td>';
41  print '<td>'.$objectlink->getNomUrl(1).'</td>';
42  print '<td class="center">'.$objectlink->ref_client.'</td>';
43  print '<td class="center">'.dol_print_date($objectlink->date, 'day').'</td>';
44  print '<td class="right">';
45  $total = $total + $objectlink->total_ht;
46  echo price($objectlink->total_ht);
47 }
48 print '</td>';
49 print '<td class="right">'.$objectlink->getLibStatut(3).'</td>';
50 print '</tr>';
51 
52 if (count($linkedObjectBlock) > 1)
53 {
54  ?>
55  <tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
56  <td><?php echo $langs->trans("Total"); ?></td>
57  <td></td>
58  <td class="center"></td>
59  <td class="center"></td>
60  <td class="right"><?php echo price($total); ?></td>
61  <td class="right"></td>
62  <td class="right"></td>
63  </tr>
64  <?php
65 }
66 
67 print "<!-- 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...
print
Draft customers invoices.
Definition: index.php:89