From d43b8eb67c8263288310784e2a71eda14e27a9dd Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Wed, 28 Oct 2015 15:51:39 +0100 Subject: [PATCH] contrib.teamnet_axel: fix invoice payment limit date comparison (#8813) --- passerelle/contrib/teamnet_axel/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/passerelle/contrib/teamnet_axel/utils.py b/passerelle/contrib/teamnet_axel/utils.py index 93ed2a7..9142faa 100644 --- a/passerelle/contrib/teamnet_axel/utils.py +++ b/passerelle/contrib/teamnet_axel/utils.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import date, datetime from decimal import Decimal def normalize_invoice(invoice, family_id, historical=False): @@ -10,11 +10,11 @@ def normalize_invoice(invoice, family_id, historical=False): invoice['has_pdf'] = invoice['FPDF'] == 'O' invoice['created'] = datetime.strptime(invoice['FEMISSION'], '%d/%m/%Y') invoice['label'] = invoice['FLIBELLE'] - invoice['pay_limit_date'] = datetime.strptime(invoice['FECHEANCE'], '%d/%m/%Y') + invoice['pay_limit_date'] = datetime.strptime(invoice['FECHEANCE'], '%d/%m/%Y').date() if historical: invoice['online_payment'] = False else: - invoice['online_payment'] = invoice['amount'] > 0 and invoice['pay_limit_date'] >= datetime.today() + invoice['online_payment'] = invoice['amount'] > 0 and invoice['pay_limit_date'] >= date.today() return {invoice_id: invoice} def normalize_person(person): -- 2.6.2