PageRenderTime 38ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/core/tpl/objectline_view.tpl.php

https://bitbucket.org/speedealing/speedealing
PHP | 174 lines | 128 code | 19 blank | 27 comment | 47 complexity | f3f272748e9c83b719f20bb86f05462b MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT
  1. <?php
  2. /* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
  3. * Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
  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 <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. ?>
  21. <!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
  22. <tr <?php echo 'id="row-'.$line->id.'" '.$bcdd[$var]; ?>>
  23. <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
  24. <td align="center"><?php echo ($i+1); ?></td>
  25. <?php } ?>
  26. <td><div id="<?php echo $line->rowid; ?>"></div>
  27. <?php if (($line->info_bits & 2) == 2) { ?>
  28. <a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
  29. <?php
  30. $txt='';
  31. print img_object($langs->trans("ShowReduc"),'reduc').' ';
  32. if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
  33. //else $txt=$langs->trans("Discount");
  34. print $txt;
  35. ?>
  36. </a>
  37. <?php
  38. if ($line->description)
  39. {
  40. if ($line->description == '(CREDIT_NOTE)')
  41. {
  42. $discount=new DiscountAbsolute($this->db);
  43. $discount->fetch($line->fk_remise_except);
  44. echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
  45. }
  46. elseif ($line->description == '(DEPOSIT)')
  47. {
  48. $discount=new DiscountAbsolute($this->db);
  49. $discount->fetch($line->fk_remise_except);
  50. echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
  51. // Add date of deposit
  52. if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')';
  53. }
  54. else
  55. {
  56. echo ($txt?' - ':'').dol_htmlentitiesbr($line->description);
  57. }
  58. }
  59. }
  60. else
  61. {
  62. if (!empty($line->fk_product)) {
  63. echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
  64. // Show range
  65. print_date_range($line->date_start, $line->date_end);
  66. // Add description in form
  67. if (! empty($conf->global->PRODUIT_DESC_IN_FORM))
  68. {
  69. print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
  70. }
  71. } else {
  72. if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
  73. if ($type==1) $text = img_object($langs->trans('Service'),'service');
  74. else $text = img_object($langs->trans('Product'),'product');
  75. if (! empty($line->label)) {
  76. $text.= ' <strong>'.$line->label.'</strong>';
  77. echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
  78. } else {
  79. echo $text.' '.dol_htmlentitiesbr($line->description);
  80. }
  81. // Show range
  82. print_date_range($line->date_start,$line->date_end);
  83. }
  84. }
  85. ?>
  86. </td>
  87. <td align="right" nowrap="nowrap"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
  88. <td align="right" nowrap="nowrap"><?php echo price($line->subprice); ?></td>
  89. <?php if ($conf->global->MAIN_FEATURES_LEVEL > 1) { ?>
  90. <td align="right" nowrap="nowrap">&nbsp;</td>
  91. <?php } ?>
  92. <td align="right" nowrap="nowrap">
  93. <?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
  94. // I comment this because it shows info even when not required
  95. // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
  96. // must also not be output for most entities (proposal, intervention, ...)
  97. //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
  98. echo $line->qty;
  99. } else echo '&nbsp;'; ?>
  100. </td>
  101. <?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?>
  102. <td align="right"><?php echo dol_print_reduction($line->remise_percent,$langs); ?></td>
  103. <?php } else { ?>
  104. <td>&nbsp;</td>
  105. <?php }
  106. if (! empty($conf->margin->enabled)) {
  107. ?>
  108. <td align="right" nowrap="nowrap"><?php echo price($line->pa_ht); ?></td>
  109. <?php if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {?>
  110. <td align="right" nowrap="nowrap"><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?></td>
  111. <?php
  112. }
  113. if (! empty($conf->global->DISPLAY_MARK_RATES)) {?>
  114. <td align="right" nowrap="nowrap"><?php echo price($line->marque_tx).'%'; ?></td>
  115. <?php } } ?>
  116. <?php if ($line->special_code == 3) { ?>
  117. <td align="right" nowrap="nowrap"><?php echo $langs->trans('Option'); ?></td>
  118. <?php } else { ?>
  119. <td align="right" nowrap="nowrap"><?php echo price($line->total_ht); ?></td>
  120. <?php } ?>
  121. <?php if ($this->statut == 0 && $user->rights->$element->creer) { ?>
  122. <td align="center">
  123. <?php if (($line->info_bits & 2) == 2) { ?>
  124. <?php } else { ?>
  125. <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#'.$line->id; ?>">
  126. <?php echo img_edit(); ?>
  127. </a>
  128. <?php } ?>
  129. </td>
  130. <td align="center">
  131. <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=ask_deleteline&amp;lineid='.$line->id; ?>">
  132. <?php echo img_delete(); ?>
  133. </a>
  134. </td>
  135. <?php if ($num > 1) { ?>
  136. <td align="center" class="tdlineupdown">
  137. <?php if ($i > 0) { ?>
  138. <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
  139. <?php echo img_up(); ?>
  140. </a>
  141. <?php } ?>
  142. <?php if ($i < $num-1) { ?>
  143. <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
  144. <?php echo img_down(); ?>
  145. </a>
  146. <?php } ?>
  147. </td>
  148. <?php } else { ?>
  149. <td align="center" class="tdlineupdown">&nbsp;</td>
  150. <?php } ?>
  151. <?php } else { ?>
  152. <td colspan="3">&nbsp;</td>
  153. <?php } ?>
  154. </tr>
  155. <!-- END PHP TEMPLATE objectline_view.tpl.php -->