Optimisation pour le tri suivant les aid. Ajout de kikooness
This commit is contained in:
parent
fbe99ab65c
commit
7a9dd65698
1 changed files with 12 additions and 6 deletions
|
@ -118,13 +118,15 @@ def traiter_factures(ldap, args):
|
|||
while True:
|
||||
# On trie les factures par fid en ordre décroissant.
|
||||
if args.tri == 'fid':
|
||||
controle_ok.sort(cmp=lambda x, y: cmp(int(x['fid'][0]), int(y['fid'][0])), reverse=True)
|
||||
controle_non.sort(cmp=lambda x, y: cmp(int(x['fid'][0]), int(y['fid'][0])), reverse=True)
|
||||
sans_controle.sort(cmp=lambda x, y: cmp(int(x['fid'][0]), int(y['fid'][0])), reverse=True)
|
||||
print affichage.style(u"Tri des factures en cours.", what=["gras", "rouge"])
|
||||
controle_ok.sort(key=lambda x: int(x['fid'][0]), reverse=True)
|
||||
controle_non.sort(key=lambda x: int(x['fid'][0]), reverse=True)
|
||||
sans_controle.sort(key=lambda x: int(x['fid'][0]), reverse=True)
|
||||
else:
|
||||
controle_ok.sort(cmp=lambda x, y: cmp(int(x.proprio().oid()[0]), int(y.proprio().oid()[0])), reverse=True)
|
||||
controle_non.sort(cmp=lambda x, y: cmp(int(x.proprio().oid()[0]), int(y.proprio().oid()[0])), reverse=True)
|
||||
sans_controle.sort(cmp=lambda x, y: cmp(int(x.proprio().oid()[0]), int(y.proprio().oid()[0])), reverse=True)
|
||||
print affichage.style(u"Tri des factures en cours.", what=["gras", "rouge"])
|
||||
controle_ok.sort(key=lambda x: int(x.parent_dn.split(",")[0].split("=")[1]), reverse=True)
|
||||
controle_non.sort(key=lambda x: int(x.parent_dn.split(",")[0].split("=")[1]), reverse=True)
|
||||
sans_controle.sort(key=lambda x: int(x.parent_dn.split(",")[0].split("=")[1]), reverse=True)
|
||||
|
||||
# Menu principal
|
||||
(code, tag) = dialog_interface.menu(
|
||||
|
@ -422,7 +424,9 @@ def trie_factures(ldap, args):
|
|||
'recuPaiement': _recu_paiement,
|
||||
}
|
||||
|
||||
print affichage.style(u"Chargement des factures depuis la base de données.", what=["magenta"])
|
||||
factures = ldap.search(filterstr=filtre, mode="w", sizelimit=0)
|
||||
_animation = affichage.Animation(texte=u"Classification des factures", nb_cycles=len(factures), couleur=True, kikoo=True)
|
||||
for facture in factures:
|
||||
if unicode(facture.get('controle', [u''])[0]) == u"TRUE":
|
||||
controle_ok.append(facture)
|
||||
|
@ -430,6 +434,8 @@ def trie_factures(ldap, args):
|
|||
controle_non.append(facture)
|
||||
else:
|
||||
sans_controle.append(facture)
|
||||
_animation.new_step()
|
||||
_animation.end()
|
||||
|
||||
return controle_ok, controle_non, sans_controle
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue