[printing/facture] Jolie liste d'articles
This commit is contained in:
parent
aebe4613e4
commit
54dd95bb22
2 changed files with 6 additions and 1 deletions
|
@ -46,6 +46,7 @@ def template():
|
||||||
template_path = '/usr/scripts/lc_ldap/printing/templates/'
|
template_path = '/usr/scripts/lc_ldap/printing/templates/'
|
||||||
templateLoader = jinja2.FileSystemLoader( searchpath=["/", template_path] )
|
templateLoader = jinja2.FileSystemLoader( searchpath=["/", template_path] )
|
||||||
templateEnv = jinja2.Environment( loader=templateLoader, trim_blocks=True )
|
templateEnv = jinja2.Environment( loader=templateLoader, trim_blocks=True )
|
||||||
|
templateEnv.add_extension('jinja2.ext.do')
|
||||||
templateEnv.filters['coul'] = coul
|
templateEnv.filters['coul'] = coul
|
||||||
templateEnv.filters['blacklist'] = blacklist
|
templateEnv.filters['blacklist'] = blacklist
|
||||||
templateEnv.filters['prise_etat'] = prise_etat
|
templateEnv.filters['prise_etat'] = prise_etat
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
{{["fid=",o.fid.0]|join|coul('bleu')}} {{"À : "|coul('gras')}}{{o.proprio().prenom|join(' ')}} {{o.proprio().nom|join(' ')}} ({{o.proprio().aid.0}})
|
{{["fid=",o.fid.0]|join|coul('bleu')}} {{"À : "|coul('gras')}}{{o.proprio().prenom|join(' ')}} {{o.proprio().nom|join(' ')}} ({{o.proprio().aid.0}})
|
||||||
{% if o.article %}
|
{% if o.article %}
|
||||||
{{"Article : "|coul('gras')}}{{o.article|join('\n ')}}
|
{{"Article : "|coul('gras')}} Prix N° Total Commentaire
|
||||||
|
{% set total = [] %}{% for a in o.article %}
|
||||||
|
{% do total.append( a.pu|float * a.nombre|int) %}{{"%05.2f" % a.pu|float}}€ x{{"%02d" % a.nombre|int}} {{"%05.2f" % a.pu|float * a.nombre|int}}€ {{a.designation}}
|
||||||
|
{% endfor %}
|
||||||
|
{{"total : "|coul('gras')}}{{"%05.2f" % total|sum}}€
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{"Mode de Paiement : "|coul('gras')}}{{o.modePaiement|join(', ')}}
|
{{"Mode de Paiement : "|coul('gras')}}{{o.modePaiement|join(', ')}}
|
||||||
{% if o.recuPaiement %}
|
{% if o.recuPaiement %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue