Invoice is sent to multiple clients

I’ve recently upgraded to 3.6.1 (self hosted). Now when a recuring invoice is sent, it is wrongfully sent to more than one client. The symptoms are the same as noted in the Bug-report:
However, I will not be able to flush my tables, as I don’t want to lose all the data.

Note: I have to admit, that I have made manual changes to the DB-data right after the update.
Because of Tax Authorities rules, invoicenumbers need to be contiguous and need to be in chronological order at the same time. But when creating an invoice-draft, the draft takes up the next invoicenumber immediatly, althought I might send it a month later, so It then breakt the Rule set by the Tax Authorites.

When running the query below, I see multiple invitations.

select i.invoice_number,
from invoices i
left join invitations ii on ii.invoice_id =
left join contacts c on = ii.contact_id
where i.invoice_number = '20170150';

How can I fix this, without flushing my DB tables?

Can you clarify what manual changes you made to the database, if you deleted invoices you’ll also need to delete the related invitation records.

I’ve changed multiple fields on multiple occasions, like client_id, invoice_status_id and invoice_date on an invoice.

How does invoice-ninja determine what invitations to create on a new invoice? Does it look at a previous invoice and then copies them?
If so, what query would I need to find those invitations? And can I then safely delete the ones I don’t need?

When an invoice is saved it creates an invitation for each of the checked contacts.

Hi Hillel, thanks for your answers, and sorry I wasn’t clear, but I was talking in terms of DB-queries. I’m still looking for a way to resolve this issue.

I revisited this problem to get my install of Invoice-Ninja up and running again.
By using the following query I managed to single out the failty invitation-records;

FROM invitations i, invoices f, contacts c
where i.invoice_id =
and i.contact_id =
AND f.client_id <> c.client_id
order by i.contact_id, asc;

After deleting these records, the invoices would not be sent to the wrong customers any more.

  • Problem solved -

I am having a similair issue in v5.2.14
I have many clients that have recurring invoices.
It appears that no matter what all the contacts on each client are getting the eMail from the the recurring invoices even though the recurring invoice only has one contact checkmarked. How do I fix this or this how it is supposed to work?

Thanks for reporting this!

cc @david

1 Like


Thanks for reporting this. I can recreate the issue and have checked in a fix which will be available in 5.2.18

1 Like

The issue reappeared in v5.3.25, I am upgrading to v5.3.30 is this fixed in that version again?

Still sends invoices to wrong people on version 30. I double-checked and the correct contacts are checked on the invoice, but still everyone in the organization is eMailed. Will upgrading to .33 fix this issue?