Commit 247f05a4 authored by Patrick's avatar Patrick
Browse files

Use previous payment date of the permanence in case such date is known

parent f18942ec
......@@ -265,9 +265,11 @@ class PermanenceDoneAdmin(TranslatableAdmin):
producer_invoice.save(update_fields=[
'calculated_invoiced_balance'
])
permanence_form = PermanenceInvoicedForm(payment_date=max_payment_date)
if permanence.payment_date is not None:
# In this case we have also, permanence.status > PERMANENCE_SEND
permanence_form = PermanenceInvoicedForm(payment_date=permanence.payment_date)
else:
permanence_form = PermanenceInvoicedForm(payment_date=max_payment_date)
qs = ProducerInvoice.objects.filter(
producer__to_be_paid=True,
permanence_id=permanence.id
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment