fixing invoice activation criteria

This commit is contained in:
Serghei Mihai 2014-04-04 00:42:38 +02:00
parent dde45a3fd1
commit 6fdf800604
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ invoice is present the invoice becomes active and inactive if not."""
for invoice in Facture.objects.all():
active = path.exists(settings.INVOICES_LOCATION_PATTERN.format(invoice_id = invoice.id))
active = active and invoice.date_generation > date.today()
active = active and invoice.date_generation < date.today()
if active != invoice.active:
invoice.active = active