PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/core/tpl/freeproductline_view.tpl.php

https://github.com/asterix14/dolibarr
PHP | 127 lines | 97 code | 10 blank | 20 comment | 35 complexity | 629914b0da5b74a5feaa0d3e10ff586f MD5 | raw file
Possible License(s): LGPL-2.0
  1. <?php
  2. /* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
  3. * Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. */
  19. ?>
  20. <!-- BEGIN PHP TEMPLATE freeproductline_view.tpl.php -->
  21. <tr <?php echo 'id="row-'.$line->id.'" '.$bcdd[$var]; ?>>
  22. <td><a name="<?php echo $line->rowid; ?>"></a>
  23. <?php if (($line->info_bits & 2) == 2) { ?>
  24. <a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
  25. <?php
  26. $txt='';
  27. print img_object($langs->trans("ShowReduc"),'reduc').' ';
  28. if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
  29. //else $txt=$langs->trans("Discount");
  30. print $txt;
  31. ?>
  32. </a>
  33. <?php
  34. if ($line->description)
  35. {
  36. if ($line->description == '(CREDIT_NOTE)')
  37. {
  38. $discount=new DiscountAbsolute($this->db);
  39. $discount->fetch($line->fk_remise_except);
  40. echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
  41. }
  42. elseif ($line->description == '(DEPOSIT)')
  43. {
  44. $discount=new DiscountAbsolute($this->db);
  45. $discount->fetch($line->fk_remise_except);
  46. echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
  47. // Add date of deposit
  48. if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')';
  49. }
  50. else
  51. {
  52. echo ($txt?' - ':'').dol_htmlentitiesbr($line->description,1,true);
  53. }
  54. }
  55. }
  56. else
  57. {
  58. if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
  59. if ($type==1) $text = img_object($langs->trans('Service'),'service');
  60. else $text = img_object($langs->trans('Product'),'product');
  61. echo $text.' '.dol_htmlentitiesbr($line->description,1,true);
  62. // Show range
  63. print_date_range($line->date_start,$line->date_end);
  64. }
  65. ?>
  66. </td>
  67. <td align="right" nowrap="nowrap"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
  68. <td align="right" nowrap="nowrap"><?php echo price($line->subprice); ?></td>
  69. <td align="right" nowrap="nowrap">
  70. <?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty;
  71. else echo '&nbsp;'; ?>
  72. </td>
  73. <?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?>
  74. <td align="right"><?php echo dol_print_reduction($line->remise_percent,$langs); ?></td>
  75. <?php } else { ?>
  76. <td>&nbsp;</td>
  77. <?php } ?>
  78. <?php if ($line->special_code == 3) { ?>
  79. <td align="right" nowrap="nowrap"><?php echo $langs->trans('Option'); ?></td>
  80. <?php } else { ?>
  81. <td align="right" nowrap="nowrap"><?php echo price($line->total_ht); ?></td>
  82. <?php } ?>
  83. <?php if ($this->statut == 0 && $user->rights->$element->creer) { ?>
  84. <td align="center">
  85. <?php if (($line->info_bits & 2) == 2) { ?>
  86. <?php } else { ?>
  87. <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#'.$line->id; ?>">
  88. <?php echo img_edit(); ?>
  89. </a>
  90. <?php } ?>
  91. </td>
  92. <td align="center">
  93. <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=ask_deleteline&amp;lineid='.$line->id; ?>">
  94. <?php echo img_delete(); ?>
  95. </a>
  96. </td>
  97. <?php if ($num > 1) { ?>
  98. <td align="center" class="tdlineupdown">
  99. <?php if ($i > 0) { ?>
  100. <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
  101. <?php echo img_up(); ?>
  102. </a>
  103. <?php } ?>
  104. <?php if ($i < $num-1) { ?>
  105. <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
  106. <?php echo img_down(); ?>
  107. </a>
  108. <?php } ?>
  109. </td>
  110. <?php } else { ?>
  111. <td align="center" class="tdlineupdown">&nbsp;</td>
  112. <?php } ?>
  113. <?php } else { ?>
  114. <td colspan="3">&nbsp;</td>
  115. <?php } ?>
  116. </tr>
  117. <!-- END PHP TEMPLATE freeproductline_view.tpl.php -->