Permet le tri par fid ou aid pour les factures.
This commit is contained in:
parent
6d4f6b0864
commit
2860fe931c
1 changed files with 9 additions and 3 deletions
|
@ -105,9 +105,14 @@ def traiter_factures(ldap, args):
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
# On trie les factures par fid en ordre décroissant.
|
# 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_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)
|
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)
|
sans_controle.sort(cmp=lambda x, y: cmp(int(x['fid'][0]), int(y['fid'][0])), reverse=True)
|
||||||
|
else:
|
||||||
|
controle_ok.sort(cmp=lambda x, y: cmp(int(x.proprio()._id()[0]), int(y.proprio()._id()[0])), reverse=True)
|
||||||
|
controle_non.sort(cmp=lambda x, y: cmp(int(x.proprio()._id()[0]), int(y.proprio()._id()[0])), reverse=True)
|
||||||
|
sans_controle.sort(cmp=lambda x, y: cmp(int(x.proprio()._id()[0]), int(y.proprio()._id()[0])), reverse=True)
|
||||||
|
|
||||||
# Menu principal
|
# Menu principal
|
||||||
(code, tag) = dialog_interface.menu(
|
(code, tag) = dialog_interface.menu(
|
||||||
|
@ -403,6 +408,7 @@ if __name__ == '__main__':
|
||||||
PARSER.add_argument("-l", "--last", help="Date de début, dans un format compréhensible par postgresql (\"AAAA/MM/JJ HH:MM:SS\" fonctionne bien)", type=str, action="store")
|
PARSER.add_argument("-l", "--last", help="Date de début, dans un format compréhensible par postgresql (\"AAAA/MM/JJ HH:MM:SS\" fonctionne bien)", type=str, action="store")
|
||||||
PARSER.add_argument("-m", "--mode", help="Filtre sur le mode de paiement", type=str, action="store")
|
PARSER.add_argument("-m", "--mode", help="Filtre sur le mode de paiement", type=str, action="store")
|
||||||
PARSER.add_argument("-h", "--help", help="Affiche cette aide et quitte.", action="store_true")
|
PARSER.add_argument("-h", "--help", help="Affiche cette aide et quitte.", action="store_true")
|
||||||
|
PARSER.add_argument("-t", "--tri", help="Trie les factures suivant l'aid ou le fid", type=str, action="store")
|
||||||
|
|
||||||
ARGS = PARSER.parse_args()
|
ARGS = PARSER.parse_args()
|
||||||
LDAP = shortcuts.lc_ldap_admin()
|
LDAP = shortcuts.lc_ldap_admin()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue