1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Additional check to ensure recurring invoices have invitations

This commit is contained in:
David Bomba 2022-12-05 13:27:33 +11:00
parent 252416a5b0
commit 3869dcccf9

View File

@ -161,6 +161,11 @@ class SendRecurring implements ShouldQueue
*/
private function createRecurringInvitations($invoice) :Invoice
{
if($this->recurring_invoice->invitations->count() == 0) {
$this->recurring_invoice = $this->recurring_invoice->service()->createInvitations()->save();
}
$this->recurring_invoice->invitations->each(function ($recurring_invitation) use ($invoice) {
$ii = InvoiceInvitationFactory::create($invoice->company_id, $invoice->user_id);
$ii->key = $this->createDbHash($invoice->company->db);