invoices.phtml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php if ($this->form->hasElements()) { ?>
  2. <?php $nbColumns = count($this->columns); ?>
  3. <form method="<?php echo $this->form->getMethod(); ?>" action="<?php echo $this->form->getAction(); ?>" class="form-horizontal">
  4. <?php echo $this->form->hiddenElements; ?>
  5. <table class="table table-striped table-hover">
  6. <thead>
  7. <tr>
  8. <?php foreach ($this->columns as $column) { ?>
  9. <th<?php echo (isset($column['class'])) ? ' class="' . $column['class'] . '"' : ''; ?>><?php echo $this->_($column['label']); ?></th>
  10. <?php } ?>
  11. </tr>
  12. </thead>
  13. <tbody>
  14. <!-- list table data -->
  15. <?php
  16. $checkboxCounter = 0;
  17. $shippingModelInput = array();
  18. foreach ((array) $this->form->getData() as $data) {
  19. if (is_array($data)) { ?>
  20. <tr>
  21. <?php foreach ($this->columns as $column) { ?>
  22. <td<?php echo (isset($column['class'])) ? ' class="' . $column['class'] . '"' : ''; ?>>
  23. <?php foreach ((array) $column['element_id'] as $elementId) {
  24. $element = $this->form->getElement($elementId);
  25. if ($elementId == 'price') {
  26. $element->setPrefix($data['currency']);
  27. }
  28. if ($elementId == 'id' && $element->getType() == 'checkbox') {
  29. $element->setMultiOptions(array($data['id'] => null));
  30. }
  31. if (isset($data[$elementId])) {
  32. $element->setData($data[$elementId]);
  33. }
  34. $element->setBrackets('[' . $checkboxCounter . ']');
  35. echo $element;
  36. } ?>
  37. </td>
  38. <?php } ?>
  39. </tr>
  40. <?php $checkboxCounter ++;
  41. }
  42. } ?>
  43. <?php if ($this->settings['enable_shipping']) { ?>
  44. <?php $shippingAddress = $this->form->getElement('shipping_address_id'); ?>
  45. <tr>
  46. <td colspan="<?php echo ($nbColumns - 2); ?>">
  47. <div class="text-right">
  48. <strong><?php echo $shippingAddress->getLabel(); ?></strong>
  49. </div>
  50. </td>
  51. <!-- select shipping address dropdown -->
  52. <td colspan="2">
  53. <div>
  54. <?php echo $shippingAddress->render(); ?>
  55. </div>
  56. </td>
  57. </tr>
  58. <?php $postageMethod = $this->form->getElement('postage_id'); ?>
  59. <tr>
  60. <td colspan="<?php echo ($nbColumns - 2); ?>">
  61. <div class="text-right">
  62. <strong><?php echo $postageMethod->getLabel(); ?></strong>
  63. </div>
  64. </td>
  65. <!-- select postage method dropdown -->
  66. <!-- postage amount field (text box or description field) -->
  67. <td colspan="2">
  68. <div>
  69. <?php echo $postageMethod->render(); ?>
  70. </div>
  71. <div>
  72. <?php echo $this->form->getElement('postage_amount')->render(); ?>
  73. </div>
  74. </td>
  75. </tr>
  76. <?php if ($this->form->hasElement('tax_rate')) { ?>
  77. <?php $taxRate = $this->form->getElement('tax_rate'); ?>
  78. <tr>
  79. <td colspan="<?php echo ($nbColumns - 2); ?>">
  80. <div class="text-right">
  81. <strong><?php echo $taxRate->getLabel(); ?></strong>
  82. </div>
  83. </td>
  84. <!-- tax rate field (text box or description field) -->
  85. <td colspan="2">
  86. <div>
  87. <?php echo $taxRate->render(); ?>
  88. </div>
  89. </td>
  90. </tr>
  91. <?php } ?>
  92. <?php $insuranceCheckbox = $this->form->getElement('apply_insurance'); ?>
  93. <tr>
  94. <td colspan="<?php echo ($nbColumns - 2); ?>">
  95. <div class="text-right">
  96. <strong><?php echo $insuranceCheckbox->getLabel(); ?></strong>
  97. </div>
  98. </td>
  99. <!-- apply insurance checkbox -->
  100. <!-- insurance amount field (text box or description field) -->
  101. <td colspan="2">
  102. <div>
  103. <?php echo $insuranceCheckbox->render(); ?>
  104. </div>
  105. <div>
  106. <?php echo $this->form->getElement('insurance_amount')->render(); ?>
  107. </div>
  108. </td>
  109. </tr>
  110. <?php } ?>
  111. <tr>
  112. <td colspan="<?php echo ($nbColumns - 2); ?>">
  113. <p class="text-right">
  114. <strong><?php echo $this->_('Total'); ?></strong>
  115. </p>
  116. </td>
  117. <td colspan="2"><?php echo $this->amount($sale->calculateTotal(), $sale['currency']); ?></td>
  118. </tr>
  119. <tr>
  120. <td colspan="<?php echo $nbColumns; ?>">
  121. <?php echo $this->form->getElement('update_values')->render(); ?>
  122. <?php echo $this->form->getElement(\App\Form\Tables::BTN_SUBMIT)->render(); ?>
  123. </td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. </form>
  128. <?php } ?>