1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-25 03:30:30 +02:00

Store invoice source code instead of generate it everytime

This commit is contained in:
Yohann D'ANELLO
2020-08-06 22:30:14 +02:00
parent e23eafd56c
commit 1fb14ea33d
8 changed files with 224 additions and 180 deletions

View File

@ -4,6 +4,16 @@
{% load crispy_forms_tags %}
{% block content %}
<p><a class="btn btn-default" href="{% url 'treasury:invoice_list' %}">{% trans "Invoices list" %}</a></p>
{% if not object.pk %}
<div class="alert alert-info">
{% blocktrans trimmed %}
Warning: the LaTeX template is saved with this object. Updating the invoice implies regenerate it.
Be careful if you manipulate old invoices.
{% endblocktrans %}
</div>
{% endif %}
<form method="post" action="">
{% csrf_token %}
{# Render the invoice form #}

View File

@ -1,5 +1,4 @@
{% load escape_tex %}
{% load l10n %}
\nonstopmode
\documentclass[11pt]{article}
@ -48,11 +47,9 @@
}
\newcommand {\ListeProduits}{
{% localize off %}
{% for product in products %}
{{ product.designation|safe|escape_tex }} & {{ product.amount_euros|safe|escape_tex|floatformat:2 }} & {{ product.quantity|safe|escape_tex|floatformat:2 }} & {{ product.total_euros|safe|escape_tex|floatformat:2 }} \cr
{% endfor %}
{% endlocalize %}
{% for product in products %}
{{ product.designation|safe|escape_tex }} & {{ product.amount_euros|safe|escape_tex|floatformat:2 }} & {{ product.quantity|safe|escape_tex|floatformat:2 }} & {{ product.total_euros|safe|escape_tex|floatformat:2 }} \cr
{% endfor %}
}
% Logo du BDE
@ -70,9 +67,9 @@
%%%%%%%%%%%%%%%%%%%%% A MODIFIER DANS LA FACTURE %%%%%%%%%%%%%%%%%%%%%
% Infos Association
\def\MonNom{{"{"}}{{ obj.my_name }}} % Nom de l'association
\def\MonAdresseRue{{"{"}}{{ obj.my_address_street }}} % Adresse de l'association
\def\MonAdresseVille{{"{"}}{{ obj.my_city }}}
\def\MonNom{{"{"}}{{ obj.my_name|safe|escape_tex }}} % Nom de l'association
\def\MonAdresseRue{{"{"}}{{ obj.my_address_street|safe|escape_tex }}} % Adresse de l'association
\def\MonAdresseVille{{"{"}}{{ obj.my_city|safe|escape_tex }}}
% Informations bancaires de l'association
\def\CodeBanque{{"{"}}{{ obj.bank_code|stringformat:".05d" }}}