Projet

Général

Profil

0001-contrib.teamnet_axel-fix-invoice-payment-limit-date-.patch

Serghei Mihai (congés, retour 15/05), 28 octobre 2015 16:28

Télécharger (1,51 ko)

Voir les différences:

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(-)
passerelle/contrib/teamnet_axel/utils.py
1
from datetime import datetime
1
from datetime import date, datetime
2 2
from decimal import Decimal
3 3

  
4 4
def normalize_invoice(invoice, family_id, historical=False):
......
10 10
    invoice['has_pdf'] = invoice['FPDF'] == 'O'
11 11
    invoice['created'] = datetime.strptime(invoice['FEMISSION'], '%d/%m/%Y')
12 12
    invoice['label'] = invoice['FLIBELLE']
13
    invoice['pay_limit_date'] = datetime.strptime(invoice['FECHEANCE'], '%d/%m/%Y')
13
    invoice['pay_limit_date'] = datetime.strptime(invoice['FECHEANCE'], '%d/%m/%Y').date()
14 14
    if historical:
15 15
        invoice['online_payment'] = False
16 16
    else:
17
        invoice['online_payment'] = invoice['amount'] > 0 and invoice['pay_limit_date'] >= datetime.today()
17
        invoice['online_payment'] = invoice['amount'] > 0 and invoice['pay_limit_date'] >= date.today()
18 18
    return {invoice_id: invoice}
19 19

  
20 20
def normalize_person(person):
21
-