Browse Source

Add remark to custom invoices

mac_vendor
Hugo LEVY-FALK 7 years ago
committed by chirac
parent
commit
f612e4192f
  1. 20
      cotisations/migrations/0036_custominvoice_remark.py
  2. 5
      cotisations/models.py
  3. 6
      cotisations/templates/cotisations/factures.tex
  4. 1
      cotisations/views.py

20
cotisations/migrations/0036_custominvoice_remark.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-12-29 14:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cotisations', '0035_notepayment'),
]
operations = [
migrations.AddField(
model_name='custominvoice',
name='remark',
field=models.TextField(blank=True, null=True, verbose_name='Remark'),
),
]

5
cotisations/models.py

@ -286,6 +286,11 @@ class CustomInvoice(BaseInvoice):
paid = models.BooleanField( paid = models.BooleanField(
verbose_name=_("Paid") verbose_name=_("Paid")
) )
remark = models.TextField(
verbose_name=_("Remark"),
blank=True,
null=True
)
# TODO : change Vente to Purchase # TODO : change Vente to Purchase

6
cotisations/templates/cotisations/factures.tex

@ -111,10 +111,14 @@
\end{tabular} \end{tabular}
\vspace{1cm} \vspace{1cm}
\begin{tabularx}{\textwidth}{c X} \begin{tabularx}{\textwidth}{r X}
\hline \hline
\textbf{Moyen de paiement} & {{payment_method|default:"Non spécifié"}} \\ \textbf{Moyen de paiement} & {{payment_method|default:"Non spécifié"}} \\
\hline \hline
{% if remark %}
\textbf{Remarque} & {{remark|safe}} \\
\hline
{% endif %}
\end{tabularx} \end{tabularx}

1
cotisations/views.py

@ -408,6 +408,7 @@ def custom_invoice_pdf(request, invoice, **_kwargs):
'phone': AssoOption.get_cached_value('telephone'), 'phone': AssoOption.get_cached_value('telephone'),
'tpl_path': os.path.join(settings.BASE_DIR, LOGO_PATH), 'tpl_path': os.path.join(settings.BASE_DIR, LOGO_PATH),
'payment_method': invoice.payment, 'payment_method': invoice.payment,
'remark': invoice.remark,
}) })

Loading…
Cancel
Save