ajout devis_preview.pt

This commit is contained in:
2020-10-16 10:27:05 +02:00
parent 9b6f016c32
commit 50fea4710e
14 changed files with 221 additions and 33 deletions

View File

@@ -47,7 +47,7 @@ def to_euroz(x):
if x == 0:
return ""
else:
return ("%.2f" % x).replace('.', ',')
return ("%9.2f" % x).replace('.', ',')
def to_decz(x):
"""Takes a decimal and returns a string"""
@@ -326,7 +326,10 @@ def ajax_texte(request):
liste=[]
for row in items:
d = '%s | %s | %s' % (row.ref_cli2, row.LIBART, to_euro(row.PRIXHT2))
if type == 'AR':
d = '%s | %s | %s' % (row.ref_cli2, row.LIBART, to_euro(row.PRIXHT2))
else:
d = row.LIBART
liste.append(d)
return Response(json.dumps(liste))
@@ -335,9 +338,9 @@ def ajax_texte(request):
def ajax_article(request):
ref = request.GET['ref']
# lire les articles commencant par
# lire l'article
items = get_article(request, 'REF', ref)
# puis retourne son libellé et son prixht
liste=[]
d = {}
d['ref'] = items.ref_cli2