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

Fix for restoring invoices

This commit is contained in:
David Bomba 2020-06-09 07:43:46 +10:00
parent 532197621b
commit bf6044006d
2 changed files with 8 additions and 1 deletions

View File

@ -662,6 +662,13 @@ class InvoiceController extends BaseController
case 'download':
return response()->download(TempFile::path($invoice->pdf_file_path()), basename($invoice->pdf_file_path()));
break;
case 'restore':
$this->invoice_repo->restore($invoice);
if (!$bulk) {
return $this->listResponse($invoice);
}
break;
case 'archive':
$this->invoice_repo->archive($invoice);

View File

@ -263,7 +263,7 @@ class BaseRepository
//make sure we are creating an invite for a contact who belongs to the client only!
$contact = ClientContact::find($invitation['client_contact_id']);
if ($model->client_id == $contact->client_id);
if ($contact && $model->client_id == $contact->client_id);
{
$new_invitation = $invitation_factory_class::create($model->company_id, $model->user_id);
$new_invitation->{$lcfirst_resource_id} = $model->id;