|
@@ -114,13 +114,13 @@ def create_member_invoice_for_a_period(member, date):
|
|
|
# Si la période de facturation varie par rapport à celle prévue par
|
|
|
# l'offre, calcul au prorata en faisant varier la quantité
|
|
|
period_number_of_days = (period_to - period_from).days + 1
|
|
|
- if (planned_period_number_of_days != period_number_of_days):
|
|
|
+ if planned_period_number_of_days != period_number_of_days:
|
|
|
quantity = (Decimal(period_number_of_days) /
|
|
|
Decimal(planned_period_number_of_days))
|
|
|
|
|
|
# Si durée de 0jours ou dates incohérentes, alors on ajoute pas
|
|
|
# (Si la period est de 0jours c'est que la facture existe déjà.)
|
|
|
- if (period_from<period_to):
|
|
|
+ if period_from<period_to:
|
|
|
# Ajout l'item de l'offre correspondant à l'abonnement
|
|
|
# à la facture
|
|
|
invoice.details.create(label=offer.name,
|
|
@@ -131,7 +131,7 @@ def create_member_invoice_for_a_period(member, date):
|
|
|
period_to=period_to)
|
|
|
|
|
|
# S'il n'y a pas d'items dans la facture, ne commit pas la transaction.
|
|
|
- if (invoice.details.count()>0):
|
|
|
+ if invoice.details.count() > 0:
|
|
|
invoice.save()
|
|
|
transaction.savepoint_commit(sid)
|
|
|
return invoice
|