[dialog/proprio] On ne propose le paiement par solde que si on a un solde

comme l'attribut ldap est optionnel, ça peut arriver sur les nouveaux comptes
This commit is contained in:
Valentin Samir 2014-12-02 20:44:20 +01:00
parent 91fc1359b0
commit 602a5bb8a6

View file

@ -416,7 +416,7 @@ class Dialog(machine.Dialog, blacklist.Dialog):
def box_choose_paiment(tag, articles):
box_paiement_order = ["liquide", "cheque", "carte"]
if "cransAccount" in proprio['objectClass']:
if not "SOLDE" in [art['code'] for art in articles]:
if not "SOLDE" in [art['code'] for art in articles] and proprio["solde"]:
box_paiement_order.append("solde")
box_paiement["solde"] = box_paiement["solde"] % proprio["solde"][0]
choices = []