dolibarr  9.0.0
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 <http://www.gnu.org/licenses/>.
19  *
20  */
21 ?>
22 
23 <!-- BEGIN PHP TEMPLATE -->
24 
25 <?php
26 
27 global $user;
28 global $noMoreLinkedObjectBlockAfter;
29 
30 $langs = $GLOBALS['langs'];
31 $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
32 
33 $langs->load("donations");
34 
35 $total=0; $ilink=0;
36 foreach($linkedObjectBlock as $key => $objectlink)
37 {
38  $ilink++;
39 
40  $trclass='oddeven';
41  if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
42 ?>
43  <tr class="<?php echo $trclass; ?>">
44  <td><?php echo $langs->trans("Donation"); ?></td>
45  <td><?php echo $objectlink->getNomUrl(1); ?></td>
46  <td align="center"><?php echo $objectlink->ref_client; ?></td>
47  <td align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
48  <td align="right"><?php
49  $total = $total + $objectlink->total_ht;
50  echo price($objectlink->total_ht);
51  } ?>
52  </td>
53  <td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
54  </tr>
55 <?php
56 
57 if (count($linkedObjectBlock) > 1)
58 {
59  ?>
60  <tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
61  <td><?php echo $langs->trans("Total"); ?></td>
62  <td></td>
63  <td align="center"></td>
64  <td align="center"></td>
65  <td align="right"><?php echo price($total); ?></td>
66  <td align="right"></td>
67  <td align="right"></td>
68  </tr>
69  <?php
70 }
71 ?>
72 
73 <!-- END PHP TEMPLATE -->
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...
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).