Browse Source

Add payments on invoice template
Add how to pay on invoice payment

Fabs 10 years ago
parent
commit
2763f8d4be

+ 46 - 9
coin/billing/templates/billing/invoice.html

@@ -1,16 +1,23 @@
 {% extends "base.html" %}
 
 {% block content %}
-<h2>Facture N°{{ invoice.number }}</h2>
-<p>Émise le {{ invoice.date }}</p>
+<div class="row">
+    <div class="large-8 columns">
+        <h2>Facture N°{{ invoice.number }}</h2>
+        <p>Émise le {{ invoice.date }}</p>
+    </div>
+    <div class="large-4 columns">
+        <a href="{% url 'billing:invoice_pdf' id=invoice.number %}" target="_blank" class="button">Télécharger en PDF</a>
+    </div>
+</div>
 
-<table id="invoice_details" class="full-width">
+<table id="invoice_details" class="invoice-table full-width">
     <thead>
         <tr>
             <th></th>
             <th>Quantité</th>
             <th>PU</th>
-            <th>Total</th>
+            <th class="total">Total TTC</th>
         </tr>
     </thead>
     <tbody>
@@ -20,17 +27,47 @@
                 {% if detail.period_from and detail.period_to %}<br/><span class="period">Pour la période du {{ detail.period_from }} au {{ detail.period_to }}{% endif %}</span></td>
             <td>{{ detail.quantity }}</td>
             <td>{{ detail.amount }}€</td>
-            <td>{{ detail.total }}€</td>
+            <td class="total">{{ detail.total }}€</td>
         </tr>
         {% endfor %}
         <tr class="total">
-            <td colspan="2"></td>
-            <td><strong>Total</strong></td>
-            <td>{{ invoice.amount }}</td>
+            <td class="" colspan="3">Total TTC</td>
+            <td class="total">{{ invoice.amount }}€</td>
         </tr>
     </tbody>
 </table>
 
-<a href="{% url 'billing:invoice_pdf' id=invoice.number %}" target="_blank" class="button">Télécharger en PDF</a>
+<h3>Réglement</h3>
+
+{% if invoice.payments.exists %}
+    <table id="invoice_payments" class="invoice-table full-width">
+        <thead>
+            <tr>
+                <th>Type de paiement</th>
+                <th>Date</th>
+                <th class="total">Montant</th>
+            </tr>
+        </thead>
+        <tbody>
+            {% for payment in invoice.payments.all %}
+            <tr class="payment">
+                <td>{{ payment.get_payment_mean_display }}</td>
+                <td>{{ payment.date }}</td>
+                <td class="total">-{{ payment.amount }}€</td>
+            </tr>
+            {% endfor %}
+            <tr class="total">
+                <td class="" colspan="2">Reste à payer</td>
+                <td class="total">{{ invoice.amount_remaining_to_pay }}€</td>
+            </tr>
+        </tbody>
+    </table>
+{% endif %}
+
+{% if invoice.amount_remaining_to_pay > 0 %}
+    <div class="panel">
+        {% include "billing/payment_howto.html" %}
+    </div>
+{% endif %}
 
 {% endblock %}

+ 1 - 9
coin/billing/templates/billing/invoice_pdf.html

@@ -127,15 +127,7 @@
 		</tbody>
 	</table>
 	<div id="paiements">
-		<p><strong>Merci de préférer si possible le paiement par virement</strong></p>
-
-		<strong>Virement</strong><br />
-		Titulaire du compte : ILLYSE<br/>
-		RIB : 42559 00012 41020023285 19<br/>
-		IBAN : FR76 4255 9000 1241 0200 2328 519<br />
-
-		<strong>Chèque</strong><br />
-		Paiement par chèque à l'ordre de "Association ILLYSE" envoyé à l'adresse : Association ILLYSE, c/o Jean-François MOURGUES, 225 route de Genas, 69100 Villeurbanne
+        {% include "billing/payment_howto.html" %}
 	</div>
 
 </body>

+ 10 - 0
coin/billing/templates/billing/payment_howto.html

@@ -0,0 +1,10 @@
+<p><strong>Merci de préférer si possible le paiement par virement</strong></p>
+
+<strong>Virement</strong><br />
+Titulaire du compte : ILLYSE<br/>
+RIB : 42559 00012 41020023285 19<br/>
+IBAN : FR76 4255 9000 1241 0200 2328 519<br />
+Merci de faire figurer le code suivant sur votre virement : <strong>#{{ invoice.member.id }}</strong>
+<br /><br />
+<strong>Chèque</strong><br />
+Paiement par chèque à l'ordre de "Association ILLYSE" envoyé à l'adresse : Association ILLYSE, c/o Jean-François MOURGUES, 225 route de Genas, 69100 Villeurbanne

+ 8 - 1
coin/static/css/illyse.css

@@ -141,11 +141,18 @@ table.full-width {
     color:#999;
 }
 
-#invoice_details tr.total>td {
+table.invoice-table tr.total>td {
     font-weight:bold;
     border-top:2px solid #DDD;
 }
 
+table.invoice-table td.total {
+    width:100px;
+}
+
 #member_invoices td.unpaid {
     color:red;
 }
+#member_invoices tr.total>td.right {
+    text-align:right;
+}