PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/htdocs/core/tpl/freeproductline_create.tpl.php

https://bitbucket.org/speedealing/speedealing
PHP | 133 lines | 100 code | 8 blank | 25 comment | 21 complexity | 6fe6ff95337f39af8995ba2565d2c3dc MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT
  1. <?php
  2. /* Copyright (C) 2010-2011 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. * Need to have following variables defined:
  20. * $conf
  21. * $langs
  22. * $dateSelector
  23. * $this (invoice, order, ...)
  24. * $line defined
  25. */
  26. ?>
  27. <!-- BEGIN PHP TEMPLATE freeproductline_create.tpl.php -->
  28. <tr class="liste_titre nodrag nodrop">
  29. <td
  30. <?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>><div
  31. id="add"></div> <?php echo $langs->trans('AddNewLine').' - '.$langs->trans("FreeZone"); ?>
  32. </td>
  33. <td align="right"><?php echo $langs->trans('VAT'); ?></td>
  34. <td align="right"><?php echo $langs->trans('PriceUHT'); ?></td>
  35. <td align="right"><?php echo $langs->trans('Qty'); ?></td>
  36. <td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
  37. <?php
  38. $colspan = 4;
  39. if (! empty($conf->margin->enabled)) {
  40. ?>
  41. <td align="right"><?php echo $langs->trans('BuyingPrice'); ?></td>
  42. <?php
  43. if (! empty($conf->global->DISPLAY_MARGIN_RATES))
  44. $colspan++;
  45. if (! empty($conf->global->DISPLAY_MARK_RATES))
  46. $colspan++;
  47. }
  48. ?>
  49. <td colspan="<?php echo $colspan; ?>">&nbsp;</td>
  50. </tr>
  51. <form name="addproduct" id="addproduct"
  52. action="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id; ?>#add"
  53. method="POST">
  54. <input type="hidden" name="token"
  55. value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden"
  56. name="action" value="addline" /> <input type="hidden" name="id"
  57. value="<?php echo $this->id; ?>" />
  58. <tr <?php echo $bcnd[$var]; ?>>
  59. <td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
  60. <?php
  61. echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1);
  62. if ((! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '<br>';
  63. if (is_object($hookmanager))
  64. {
  65. $parameters=array();
  66. $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
  67. }
  68. // Editor wysiwyg
  69. require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
  70. $nbrows=ROWS_2;
  71. if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
  72. $doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
  73. $doleditor->Create();
  74. ?>
  75. </td>
  76. <td align="right"><?php
  77. if ($seller->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
  78. else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
  79. ?>
  80. </td>
  81. <td align="right"><input type="text" size="5" name="price_ht" value="<?php echo (isset($_POST["price_ht"])?$_POST["price_ht"]:''); ?>">
  82. </td>
  83. <td align="right"><input type="text" size="2" name="qty" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>"></td>
  84. <td align="right" nowrap><input type="text" size="1" value="<?php echo $buyer->remise_client; ?>" name="remise_percent">%</td>
  85. <?php
  86. $colspan = 4;
  87. if (! empty($conf->margin->enabled)) {
  88. ?>
  89. <td align="right"><input type="text" size="5" name="buying_price"
  90. value="<?php echo (isset($_POST["buying_price"])?$_POST["buying_price"]:''); ?>">
  91. </td>
  92. <?php
  93. if (! empty($conf->global->DISPLAY_MARGIN_RATES))
  94. $colspan++;
  95. if (! empty($conf->global->DISPLAY_MARK_RATES))
  96. $colspan++;
  97. }
  98. ?>
  99. <td align="center" valign="middle" colspan="<?php echo $colspan; ?>"><input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline"></td>
  100. </tr>
  101. <?php if (! empty($conf->service->enabled) && $dateSelector) {
  102. if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
  103. $colspan = 10;
  104. else
  105. $colspan = 9;
  106. if (! empty($conf->margin->enabled)) {
  107. $colspan++; // For the buying price
  108. if($conf->global->DISPLAY_MARGIN_RATES)
  109. $colspan++;
  110. if($conf->global->DISPLAY_MARK_RATES)
  111. $colspan++;
  112. }
  113. ?>
  114. <tr <?php echo $bcnd[$var]; ?>>
  115. <td colspan="<?php echo $colspan; ?>"><?php
  116. echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
  117. echo $form->select_date('','date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct");
  118. echo ' '.$langs->trans('to').' ';
  119. echo $form->select_date('','date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct");
  120. ?>
  121. </td>
  122. </tr>
  123. <?php } ?>
  124. </form>
  125. <!-- END PHP TEMPLATE freeproductline_create.tpl.php -->