dolibarr  7.0.0-beta
linkedobjectblock.tpl.php
1 <?php
2 /* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.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 $var=true;
37 foreach($linkedObjectBlock as $key => $objectlink)
38 {
39  $ilink++;
40 
41  $trclass=($var?'pair':'impair');
42  if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
43 ?>
44  <tr class="<?php echo $trclass; ?>">
45  <td><?php echo $langs->trans("Donation"); ?></td>
46  <td><?php echo $objectlink->getNomUrl(1); ?></td>
47  <td align="center"><?php echo $objectlink->ref_client; ?></td>
48  <td align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
49  <td align="right"><?php
50  $total = $total + $objectlink->total_ht;
51  echo price($objectlink->total_ht);
52  } ?>
53  </td>
54  <td align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
55  </tr>
56 <?php
57 
58 if (count($linkedObjectBlock) > 1)
59 {
60  ?>
61  <tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
62  <td><?php echo $langs->trans("Total"); ?></td>
63  <td></td>
64  <td align="center"></td>
65  <td align="center"></td>
66  <td align="right"><?php echo price($total); ?></td>
67  <td align="right"></td>
68  <td align="right"></td>
69  </tr>
70  <?php
71 }
72 ?>
73 
74 <!-- 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).