Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

119 lines
6.4KB

  1. <?php
  2. ?>
  3. <div class="document-download">
  4. <div id="block-addresses">
  5. <div class="producer">
  6. <?php if(strlen($producer->logo)) : ?>
  7. <div class="logo"><?= $producer->getHtmlLogo() ; ?></div>
  8. <?php endif; ?>
  9. <div class="address"><?= $producer->getFullAddress(true) ; ?></div>
  10. </div>
  11. <div class="user">
  12. <?= $document->user->getFullAddress(true) ; ?>
  13. </div>
  14. </div>
  15. <div id="block-infos-document">
  16. <div class="date">
  17. Le <?= strftime('%d %B %Y', strtotime($document->date)) ?>
  18. </div>
  19. <div class="reference">
  20. <?php if(strlen($document->reference)) : ?>
  21. <?= $document->getType(); ?> N°<?= $document->reference ; ?>
  22. <?php else: ?>
  23. <div class="block-is-draft"><?= $document->getType(); ?> non validé<?= ($document->getType() == 'Facture') ? 'e' : '' ?></div>
  24. <?php endif; ?>
  25. </div>
  26. <div class="name">
  27. <strong>Libellé : </strong><?= $document->name ; ?>
  28. </div>
  29. </div>
  30. <div id="block-products">
  31. <?php if(count($document->orders) > 0) : ?>
  32. <table class="table table-bordered">
  33. <thead>
  34. <tr>
  35. <th class="align-left">Produit</th>
  36. <?php if(GlobalParam::getCurrentProducer()->taxRate->value == 0): ?>
  37. <th>Prix unitaire</th>
  38. <?php else: ?>
  39. <th>Prix unitaire HT</th>
  40. <?php endif; ?>
  41. <th>Quantité</th>
  42. <th>Unité</th>
  43. <?php if(GlobalParam::getCurrentProducer()->taxRate->value == 0): ?>
  44. <th>Prix</th>
  45. <?php else: ?>
  46. <th>TVA</th>
  47. <th>Prix HT</th>
  48. <?php endif; ?>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <?php foreach($document->getProductsOrders() as $product): ?>
  53. <?php foreach($product as $productOrder): ?>
  54. <tr>
  55. <td class="align-left"><?= Html::encode($productOrder->product->name) ?></td>
  56. <td class="align-center"><?= Price::format($productOrder->getPrice()) ?></td>
  57. <td class="align-center"><?= $productOrder->quantity ?></td>
  58. <td class="align-center"><?= Product::strUnit($productOrder->unit, 'wording') ?></td>
  59. <?php if(GlobalParam::getCurrentProducer()->taxRate->value != 0): ?>
  60. <td class="align-center"><?= $productOrder->taxRate->value * 100 ?> %</td>
  61. <?php endif; ?>
  62. <td class="align-center"><?= Price::format($productOrder->getPrice() * $productOrder->quantity) ?></td>
  63. </tr>
  64. <?php endforeach; ?>
  65. <?php endforeach; ?>
  66. <?php if(GlobalParam::getCurrentProducer()->taxRate->value != 0): ?>
  67. <tr>
  68. <td class="align-right" colspan="5"><strong>Total HT</strong></td>
  69. <td class="align-center"><?= Price::format($document->getAmount()) ?></td>
  70. </tr>
  71. <tr>
  72. <td class="align-right" colspan="5"><strong>TVA</strong></td>
  73. <td class="align-center"><?= Price::format($document->getAmountWithTax() - $document->getAmount()) ?></td>
  74. </tr>
  75. <tr>
  76. <td class="align-right" colspan="5"><strong>Total TTC</strong></td>
  77. <td class="align-center"><?= Price::format($document->getAmountWithTax()) ?></td>
  78. </tr>
  79. <?php else: ?>
  80. <tr>
  81. <td class="align-right" colspan="4">
  82. <strong>Total</strong><br />
  83. TVA non applicable
  84. </td>
  85. <td class="align-center"><?= Price::format($document->getAmount()) ?></td>
  86. </tr>
  87. <?php endif; ?>
  88. </tbody>
  89. </table>
  90. <?php else : ?>
  91. <div id="block-no-product">
  92. <strong>Aucun produit</strong>
  93. </div>
  94. <?php endif; ?>
  95. </div>
  96. <?php if(strlen($document->comment)): ?>
  97. <div class="block-infos">
  98. <strong>Commentaire</strong><br />
  99. <?= Html::encode($document->comment) ?>
  100. </div>
  101. <?php endif; ?>
  102. <?php
  103. $fieldProducerDocumentInfo = 'document_infos_'.str_replace('deliverynote','delivery_note',strtolower($document->getClass())) ; ?>
  104. <?php if(strlen($producer->$fieldProducerDocumentInfo)): ?>
  105. <div class="block-infos">
  106. <strong>Informations</strong><br />
  107. <?= nl2br(Html::encode($producer->$fieldProducerDocumentInfo)) ?>
  108. </div>
  109. <?php endif; ?>
  110. </div>