linkedobjectblockForRec.tpl.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. // Protection to avoid direct call of template
  20. if (empty($conf) || !is_object($conf)) {
  21. print "Error, template page can't be called as URL";
  22. exit;
  23. }
  24. print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedobjectblockForRec.tpl.php -->\n";
  25. global $user;
  26. global $noMoreLinkedObjectBlockAfter;
  27. $langs = $GLOBALS['langs'];
  28. $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
  29. $langs->load("bills");
  30. $total = 0;
  31. $ilink = 0;
  32. foreach ($linkedObjectBlock as $key => $objectlink) {
  33. $ilink++;
  34. $trclass = 'oddeven';
  35. if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
  36. $trclass .= ' liste_sub_total';
  37. }
  38. ?>
  39. <tr class="<?php echo $trclass; ?>" >
  40. <td class="linkedcol-element tdoverflowmax100"><?php echo $langs->trans("RepeatableInvoice"); ?></td>
  41. <td class="linkedcol-name tdoverflowmax150"><?php echo $objectlink->getNomUrl(1); ?></td>
  42. <td class="linkedcol-ref" align="center"></td>
  43. <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_when, 'day'); ?></td>
  44. <td class="linkedcol-amount right"><?php
  45. if ($user->rights->facture->lire) {
  46. $total = $total + $objectlink->total_ht;
  47. echo price($objectlink->total_ht);
  48. }
  49. ?></td>
  50. <td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
  51. <td class="linkedcol-action right"><a class="reposition" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
  52. </tr>
  53. <?php
  54. }
  55. if (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 align="center"></td>
  61. <td align="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. print "<!-- END PHP TEMPLATE -->\n";