Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

148 linhas
8.6KB

  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">
  8. <img style="max-height: 80px;" src="<?= $producer->getUrlLogo() ?>" />
  9. </div>
  10. <?php endif; ?>
  11. <div class="address"><?= $producer->getFullAddress(true) ; ?></div>
  12. </div>
  13. <div class="user">
  14. <?= $document->user->getFullAddress(true) ; ?>
  15. </div>
  16. </div>
  17. <div id="block-infos-document">
  18. <div class="date">
  19. Le <?= strftime('%d %B %Y', strtotime($document->date)) ?>
  20. </div>
  21. <div class="reference">
  22. <?php if(strlen($document->reference)) : ?>
  23. <?= $document->getType(); ?> N°<?= $document->reference ; ?>
  24. <?php else: ?>
  25. <div class="block-is-draft"><?= $document->getType(); ?> non validé<?= ($document->getType() == 'Facture') ? 'e' : '' ?></div>
  26. <?php endif; ?>
  27. </div>
  28. <div class="name">
  29. <strong>Libellé : </strong><?= $document->name ; ?>
  30. </div>
  31. </div>
  32. <div id="block-products">
  33. <?php if(count($document->orders) > 0) : ?>
  34. <table class="table table-bordered">
  35. <thead>
  36. <tr>
  37. <th class="align-left">Produit</th>
  38. <?php if(Yii::$app->controller->getClass() != 'DeliveryNote'): ?>
  39. <?php if(GlobalParam::getCurrentProducer()->taxRate->value == 0): ?>
  40. <th>Prix unitaire</th>
  41. <?php else: ?>
  42. <th>Prix unitaire HT</th>
  43. <?php endif; ?>
  44. <?php endif; ?>
  45. <th>Quantité</th>
  46. <th>Unité</th>
  47. <?php if(Yii::$app->controller->getClass() != 'DeliveryNote'): ?>
  48. <?php if(GlobalParam::getCurrentProducer()->taxRate->value == 0): ?>
  49. <th>Prix</th>
  50. <?php else: ?>
  51. <th>TVA</th>
  52. <th>Prix HT</th>
  53. <?php endif; ?>
  54. <?php endif; ?>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <?php if($document->isDisplayOrders()): ?>
  59. <?php foreach($document->orders as $order): ?>
  60. <tr>
  61. <td>
  62. <strong><?= Html::encode($order->getUsername()) ; ?></strong>
  63. le <?= date('d/m/Y', strtotime($order->date)) ?>
  64. </td>
  65. <?php if(Yii::$app->controller->getClass() != 'DeliveryNote'): ?>
  66. <td class="align-center"></td>
  67. <?php endif; ?>
  68. <td></td>
  69. <td></td>
  70. <?php if(Yii::$app->controller->getClass() != 'DeliveryNote'): ?>
  71. <?php if(GlobalParam::getCurrentProducer()->taxRate->value != 0): ?>
  72. <td class="align-center"></td>
  73. <?php endif; ?>
  74. <td class="align-center"></td>
  75. <?php endif; ?>
  76. </tr>
  77. <?php foreach($order->productOrder as $productOrder): ?>
  78. <?= $this->render('_download_product_line', [
  79. 'productOrder' => $productOrder,
  80. 'displayOrders' => true,
  81. ]) ?>
  82. <?php endforeach; ?>
  83. <?php endforeach; ?>
  84. <?php else: ?>
  85. <?php foreach($document->getProductsOrders() as $product): ?>
  86. <?php foreach($product as $productOrder): ?>
  87. <?= $this->render('_download_product_line', [
  88. 'productOrder' => $productOrder,
  89. ]) ?>
  90. <?php endforeach; ?>
  91. <?php endforeach; ?>
  92. <?php endif; ?>
  93. <?php if(Yii::$app->controller->getClass() != 'DeliveryNote'): ?>
  94. <?php if(GlobalParam::getCurrentProducer()->taxRate->value != 0): ?>
  95. <tr>
  96. <td class="align-right" colspan="5"><strong>Total HT</strong></td>
  97. <td class="align-center"><?= Price::format($document->getAmount()) ?></td>
  98. </tr>
  99. <tr>
  100. <td class="align-right" colspan="5"><strong>TVA</strong></td>
  101. <td class="align-center"><?= Price::format($document->getAmountWithTax() - $document->getAmount()) ?></td>
  102. </tr>
  103. <tr>
  104. <td class="align-right" colspan="5"><strong>Total TTC</strong></td>
  105. <td class="align-center"><?= Price::format($document->getAmountWithTax()) ?></td>
  106. </tr>
  107. <?php else: ?>
  108. <tr>
  109. <td class="align-right" colspan="4">
  110. <strong>Total</strong><br />
  111. TVA non applicable
  112. </td>
  113. <td class="align-center"><?= Price::format($document->getAmount()) ?></td>
  114. </tr>
  115. <?php endif; ?>
  116. <?php endif; ?>
  117. </tbody>
  118. </table>
  119. <?php else : ?>
  120. <div id="block-no-product">
  121. <strong>Aucun produit</strong>
  122. </div>
  123. <?php endif; ?>
  124. </div>
  125. <?php if(strlen($document->comment)): ?>
  126. <div class="block-infos">
  127. <strong>Commentaire</strong><br />
  128. <?= Html::encode($document->comment) ?>
  129. </div>
  130. <?php endif; ?>
  131. <?php
  132. $fieldProducerDocumentInfo = 'document_infos_'.str_replace('deliverynote','delivery_note',strtolower($document->getClass())) ; ?>
  133. <?php if(strlen($producer->$fieldProducerDocumentInfo)): ?>
  134. <div class="block-infos">
  135. <strong>Informations</strong><br />
  136. <?= nl2br(Html::encode($producer->$fieldProducerDocumentInfo)) ?>
  137. </div>
  138. <?php endif; ?>
  139. </div>