mirror of https://gitlab.crans.org/bde/nk20
FP is bugggy
This commit is contained in:
parent
f47a0b8c9d
commit
d8c7018b9a
|
@ -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)
|
||||
|
|
|
@ -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 %}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
Loading…
Reference in New Issue