Skip to content
Snippets Groups Projects

Render invoices

Merged ynerant requested to merge render-invoices into purchase
6 files
+ 254
8
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 221
0
{% load pretty_money %}
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Facture n°{{ invoice.pk }}</title>
<style>
.invoice-box {
max-width: 800px;
margin: auto;
padding: 30px;
border: 1px solid #eee;
box-shadow: 0 0 10px rgba(0, 0, 0, .15);
font-size: 16px;
line-height: 24px;
font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
color: #555;
}
.invoice-box table {
width: 100%;
line-height: inherit;
text-align: left;
}
.invoice-box table td {
padding: 5px;
vertical-align: top;
}
.invoice-box table tr td:nth-child(4) {
text-align: right;
}
.invoice-box table tr.top table td {
padding-bottom: 20px;
}
.invoice-box table tr.top table td.title {
font-size: 45px;
line-height: 45px;
color: #333;
}
.invoice-box table tr.information table td {
padding-bottom: 40px;
}
.invoice-box table tr.heading td {
background: #eee;
border-bottom: 1px solid #ddd;
font-weight: bold;
}
.invoice-box table tr.details td {
padding-bottom: 20px;
}
.invoice-box table tr.item td{
border-bottom: 1px solid #eee;
}
.invoice-box table tr.item.last td {
border-bottom: none;
}
.invoice-box table tr.total td:nth-child(4) {
border-top: 2px solid #eee;
font-weight: bold;
}
.blank_row {
height: 20px !important;
background-color: #FFFFFF;
}
@media only screen and (max-width: 600px) {
.invoice-box table tr.top table td {
width: 100%;
display: block;
text-align: center;
}
.invoice-box table tr.information table td {
width: 100%;
display: block;
text-align: center;
}
}
</style>
</head>
<body>
<div class="invoice-box">
<table cellpadding="0" cellspacing="0">
<tr class="top">
<td colspan="4">
<table>
<tr>
<td class="title">
<img src="https://wiki.crans.org/VieCrans/Identit%C3%A9Visuelle?action=AttachFile&do=get&target=crans_2021_dark.png" style="width:100%; max-width:200px;">
</td>
<td></td><td></td>
<td>
<b>Crans</b><br>
<b>Siège associatif :</b> 4, avenue des sciences<br>
91190 Gif-sur-Yvette<br>
<b>Siret :</b> 452 661 531 00015<br>
<b>Email : </b>contact@crans.org<br>
<!-- Téléphone : 0000000000 -->
</td>
</tr>
</table>
</td>
</tr>
<tr class="information">
<td colspan="4">
<table>
<tr>
<td>
<b>Facture numéro : </b>{{ invoice.pk }}<br>
<b>Date : </b>Le {{ invoice.date }}
</td>
<td></td><td></td>
<td>
<b>Pour : </b>{{ invoice.target.owner.profile }}<br>
<b>Adresse : </b>{{ invoice.target.owner.profile.address }}
</td>
</tr>
</table>
</td>
</tr>
<tr class="heading">
<td>
Article
</td>
<td>
Prix unitaire
</td>
<td>
Quantité
</td>
<td>
Total
</td>
</tr>
{% for entry in invoice.entries.all %}
<tr class="item">
<td>
{{ entry.product.name }}
</td>
<td>
{{ entry.product.price|pretty_money }}
</td>
<td>
{{ entry.number }}
</td>
<td>
{{ entry.price|pretty_money }}
</td>
</tr>
{% endfor %}
<tr class="blank_row">
<td colspan="4"></td>
</tr>
<tr class="heading">
<td>
Total
</td>
<td>
Montant payé
</td>
<td>
Moyen de paiement
</td>
<td>
Reste à payer
</td>
</tr>
<tr class="item">
<td>
{{ invoice.price|pretty_money }}
</td>
<td>
{% if invoice.valid %}{{ invoice.price|pretty_money }}{% else %}{{ 0|pretty_money }}{% endif %}
</td>
<td>
Com'n'Pay (Carte en ligne)
</td>
<td>
{% if invoice.valid %}{{ 0|pretty_money }}{% else %}{{ invoice.price|pretty_money }}{% endif %}
</td>
</tr>
</table>
</div>
<hr style="width: 50%">
<div style="text-align: center">
TVA non applicable, article 293 B du CGI
</div>
</body>
</html>
\ No newline at end of file
Loading