1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-22 23:42:25 +00:00

FP is bugggy

This commit is contained in:
Yohann D'ANELLO 2020-08-06 15:08:35 +02:00
parent f47a0b8c9d
commit d8c7018b9a
2 changed files with 3 additions and 7 deletions

View File

@ -16,10 +16,5 @@ def do_latex_escape(value):
)
def fp_value(value):
return value.replace("-", "").replace("-", "neg")
register = template.Library()
register.filter("escape_tex", do_latex_escape)
register.filter("fp_value", fp_value)

View File

@ -31,7 +31,8 @@
\newcommand{\AfficheResultat}{%
\ListeProduits
\FPeval{\TotalTVA}{\TotalHT * \TVA / 100}
\FPmul{\TotalTVA}{\TotalHT}{\TVA}
\FPdiv{\TotalTVA}{\TotalTVA}{100}
\FPadd{\TotalTTC}{\TotalHT}{\TotalTVA}
\FPround{\TotalHT}{\TotalHT}{2}
\FPround{\TotalTVA}{\TotalTVA}{2}
@ -98,7 +99,7 @@
% Liste des produits facturés : Désignation, quantité, prix unitaire HT
{% for product in products %}
\AjouterProduit{ {{ product.designation|safe|escape_tex }}} { {{ product.quantity|safe|escape_tex|fp_value }}} { {{ product.amount_euros|safe|escape_tex|fp_value }}} { {{ product.total_euros|safe|escape_tex|fp_value }}}
\AjouterProduit{{"{"}}{{ product.designation|safe|escape_tex }}} {{"{"}}{{ product.quantity|safe|escape_tex }}} {{"{"}}{{ product.amount_euros|safe|escape_tex }}} {{"{"}}{{ product.total_euros|safe|escape_tex }}}
{% endfor %}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%