|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
-
- ?>
-
- <div class="document-download">
-
- <div id="block-addresses">
- <div class="producer">
- <?php if(strlen($producer->logo)) : ?>
- <div class="logo"><?= $producer->getHtmlLogo() ; ?></div>
- <?php endif; ?>
- <div class="address"><?= $producer->getFullAddress(true) ; ?></div>
- </div>
- <div class="user">
- <?= $document->user->getFullAddress(true) ; ?>
- </div>
- </div>
-
- <div id="block-infos-document">
- <div class="date">
- Le <?= strftime('%d %B %Y', strtotime($document->date)) ?>
- </div>
- <div class="reference">
- <?php if(strlen($document->reference)) : ?>
- <?= $document->getType(); ?> N°<?= $document->reference ; ?>
- <?php else: ?>
- <div class="block-is-draft"><?= $document->getType(); ?> non validé<?= ($document->getType() == 'Facture') ? 'e' : '' ?></div>
- <?php endif; ?>
- </div>
- <div class="name">
- <strong>Libellé : </strong><?= $document->name ; ?>
- </div>
- </div>
-
- <div id="block-products">
- <?php if(count($document->orders) > 0) : ?>
- <table class="table table-bordered">
- <thead>
- <tr>
- <th class="align-left">Produit</th>
- <th>Prix unitaire HT</th>
- <th>Quantité</th>
- <th>Unité</th>
- <th>TVA</th>
- <th>Prix HT</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($document->getProductsOrders() as $product): ?>
- <?php foreach($product as $productOrder): ?>
- <tr>
- <td class="align-left"><?= Html::encode($productOrder->product->name) ?></td>
- <td class="align-center"><?= Price::format($productOrder->getPrice()) ?></td>
- <td class="align-center"><?= $productOrder->quantity ?></td>
- <td class="align-center"><?= Product::strUnit($productOrder->unit, 'wording') ?></td>
- <td class="align-center"><?= $productOrder->product->taxRate->value * 100 ?> %</td>
- <td class="align-center"><?= Price::format($productOrder->getPrice() * $productOrder->quantity) ?></td>
- </tr>
- <?php endforeach; ?>
- <?php endforeach; ?>
- <tr>
- <td class="align-right" colspan="5"><strong>Total HT</strong></td>
- <td class="align-center"><?= Price::format($document->getAmount()) ?></td>
- </tr>
- <tr>
- <td class="align-right" colspan="5"><strong>TVA</strong></td>
- <td class="align-center"><?= Price::format($document->getAmountWithTax() - $document->getAmount()) ?></td>
- </tr>
- <tr>
- <td class="align-right" colspan="5"><strong>Total TTC</strong></td>
- <td class="align-center"><?= Price::format($document->getAmountWithTax()) ?></td>
- </tr>
- </tbody>
- </table>
- <?php else : ?>
- <div id="block-no-product">
- <strong>Aucun produit</strong>
- </div>
- <?php endif; ?>
- </div>
-
- <?php if(strlen($document->comment)): ?>
- <div class="block-infos">
- <strong>Commentaire</strong><br />
- <?= Html::encode($document->comment) ?>
- </div>
- <?php endif; ?>
-
- <?php
- $fieldProducerDocumentInfo = 'document_infos_'.str_replace('deliverynote','delivery_note',strtolower($document->getClass())) ; ?>
- <?php if(strlen($producer->$fieldProducerDocumentInfo)): ?>
- <div class="block-infos">
- <strong>Informations</strong><br />
- <?= nl2br(Html::encode($producer->$fieldProducerDocumentInfo)) ?>
- </div>
- <?php endif; ?>
- </div>
|