您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

97 行
4.9KB

  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. <th>Prix unitaire HT</th>
  37. <th>Quantité</th>
  38. <th>Unité</th>
  39. <th>TVA</th>
  40. <th>Prix HT</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <?php foreach($document->getProductsOrders() as $product): ?>
  45. <?php foreach($product as $productOrder): ?>
  46. <tr>
  47. <td class="align-left"><?= Html::encode($productOrder->product->name) ?></td>
  48. <td class="align-center"><?= Price::format($productOrder->getPrice()) ?></td>
  49. <td class="align-center"><?= $productOrder->quantity ?></td>
  50. <td class="align-center"><?= Product::strUnit($productOrder->unit, 'wording') ?></td>
  51. <td class="align-center"><?= $productOrder->product->taxRate->value * 100 ?> %</td>
  52. <td class="align-center"><?= Price::format($productOrder->getPrice() * $productOrder->quantity) ?></td>
  53. </tr>
  54. <?php endforeach; ?>
  55. <?php endforeach; ?>
  56. <tr>
  57. <td class="align-right" colspan="5"><strong>Total HT</strong></td>
  58. <td class="align-center"><?= Price::format($document->getAmount()) ?></td>
  59. </tr>
  60. <tr>
  61. <td class="align-right" colspan="5"><strong>TVA</strong></td>
  62. <td class="align-center"><?= Price::format($document->getAmountWithTax() - $document->getAmount()) ?></td>
  63. </tr>
  64. <tr>
  65. <td class="align-right" colspan="5"><strong>Total TTC</strong></td>
  66. <td class="align-center"><?= Price::format($document->getAmountWithTax()) ?></td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. <?php else : ?>
  71. <div id="block-no-product">
  72. <strong>Aucun produit</strong>
  73. </div>
  74. <?php endif; ?>
  75. </div>
  76. <?php if(strlen($document->comment)): ?>
  77. <div class="block-infos">
  78. <strong>Commentaire</strong><br />
  79. <?= Html::encode($document->comment) ?>
  80. </div>
  81. <?php endif; ?>
  82. <?php
  83. $fieldProducerDocumentInfo = 'document_infos_'.str_replace('deliverynote','delivery_note',strtolower($document->getClass())) ; ?>
  84. <?php if(strlen($producer->$fieldProducerDocumentInfo)): ?>
  85. <div class="block-infos">
  86. <strong>Informations</strong><br />
  87. <?= nl2br(Html::encode($producer->$fieldProducerDocumentInfo)) ?>
  88. </div>
  89. <?php endif; ?>
  90. </div>