[templates] Le listing des factures affiche le contrôle.
This commit is contained in:
parent
3fdb4b1936
commit
f4d17f2f45
1 changed files with 23 additions and 10 deletions
|
@ -129,15 +129,28 @@ def list_machines(machines, width=None):
|
||||||
width=width)
|
width=width)
|
||||||
|
|
||||||
def list_factures(factures, width=None):
|
def list_factures(factures, width=None):
|
||||||
return tableau([
|
data = []
|
||||||
[f['fid'][0], f['modePaiement'][0],
|
for facture in factures:
|
||||||
style("OK", "vert") if f.get('recuPaiement', []) else style("NON", "rouge"),
|
controle = facture.get('controle', [""])[0]
|
||||||
' '.join(attr['code'] for attr in f.get('article',[])),
|
if controle == "TRUE":
|
||||||
u"%s€" % sum([float(a['pu'])*int(a['nombre']) for a in f.get('article',[])])
|
controle = style(u"Validée", "vert")
|
||||||
] for f in factures],
|
elif controle == "FALSE":
|
||||||
titre = [u'fid', u'Mode de paiement', u'Payé', u'Articles', u"Total"],
|
controle = style(u"Invalide", "rouge")
|
||||||
largeur = [5, 16, 6, '*', 8],
|
else:
|
||||||
alignement = ['d', 'g', 'c', 'g', 'd'],
|
controle = u"N/A"
|
||||||
|
data.append([
|
||||||
|
facture['fid'][0],
|
||||||
|
facture['modePaiement'][0],
|
||||||
|
style("OK", "vert") if facture.get('recuPaiement', []) else style("NON", "rouge"),
|
||||||
|
controle,
|
||||||
|
' '.join(attr['code'] for attr in facture.get('article',[])),
|
||||||
|
u"%s €" % sum([float(a['pu'])*int(a['nombre']) for a in facture.get('article',[])])
|
||||||
|
])
|
||||||
|
return tableau(
|
||||||
|
data,
|
||||||
|
titre = [u'fid', u'Mode de paiement', u'Payé', u'Contrôle', u'Articles', u"Total"],
|
||||||
|
largeur = [5, 16, 6, 8, '*', 8],
|
||||||
|
alignement = ['d', 'g', 'c', 'c', 'g', 'd'],
|
||||||
width=width)
|
width=width)
|
||||||
|
|
||||||
def list_adherents(adherents, width=None):
|
def list_adherents(adherents, width=None):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue