diff --git a/gestion/dialog/proprio.py b/gestion/dialog/proprio.py index b387c42a..5f4f50de 100644 --- a/gestion/dialog/proprio.py +++ b/gestion/dialog/proprio.py @@ -411,7 +411,7 @@ class Dialog(machine.Dialog, blacklist.Dialog): "cheque" : "Chèque", "carte" : "Par carte bancaire", "solde" : "Solde Crans (actuel : %s€)", - "arbitraire" : "Ne crée pas de facture", + "arbitraire" : "Création ou destruction magique d'argent.", } def box_choose_paiment(tag, articles): @@ -420,8 +420,9 @@ class Dialog(machine.Dialog, blacklist.Dialog): 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] - else: + if len(articles) == 1 and "SOLDE" in [art['code'] for art in articles]: box_paiement_order.append("arbitraire") + choices = [] for key in box_paiement_order: choices.append((key, box_paiement[key], 1 if key == tag else 0)) @@ -512,7 +513,7 @@ class Dialog(machine.Dialog, blacklist.Dialog): # En arbitraire, on accepte que le solde if tag == u"arbitraire": - if len(articles) > 1: + if len(articles) > 1 or "SOLDE" not in [art['code'] for art in articles]: raise ValueError("Il n'est possible que de faire une opération de solde en mode arbitraire") else: with self.conn.search(dn=proprio.dn, scope=0, mode='rw')[0] as adh: