mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for getting first contact/primary
This commit is contained in:
parent
a3dae762d0
commit
2b145e8833
@ -163,7 +163,7 @@ class NinjaPlanController extends Controller
|
||||
|
||||
$recurring_invoice->service()->start();
|
||||
|
||||
return redirect('/');
|
||||
return redirect('https://invoicing.co');
|
||||
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ class GetCreditPdf extends AbstractService
|
||||
public function run()
|
||||
{
|
||||
if (! $this->contact) {
|
||||
$this->contact = $this->credit->client->primary_contact()->first();
|
||||
$this->contact = $this->credit->client->primary_contact()->first() ?: $this->credit->client->contacts()->first();
|
||||
}
|
||||
|
||||
$path = $this->credit->client->credit_filepath($this->invitation);
|
||||
|
@ -30,7 +30,7 @@ class GetInvoicePdf extends AbstractService
|
||||
public function run()
|
||||
{
|
||||
if (! $this->contact) {
|
||||
$this->contact = $this->invoice->client->primary_contact()->first();
|
||||
$this->contact = $this->invoice->client->primary_contact()->first() ?: $this->invoice->client->contacts()->first();
|
||||
}
|
||||
|
||||
$invitation = $this->invoice->invitations->where('client_contact_id', $this->contact->id)->first();
|
||||
|
@ -30,7 +30,7 @@ class GetQuotePdf extends AbstractService
|
||||
public function run()
|
||||
{
|
||||
if (! $this->contact) {
|
||||
$this->contact = $this->quote->client->primary_contact()->first();
|
||||
$this->contact = $this->quote->client->primary_contact()->first() ?: $this->quote->client->contacts()->first();
|
||||
}
|
||||
|
||||
$invitation = $this->quote->invitations->where('client_contact_id', $this->contact->id)->first();
|
||||
|
@ -57,7 +57,7 @@
|
||||
<!-- Styles -->
|
||||
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
|
||||
|
||||
@if(!auth()->guard('contact')->user()->user->account->isPaid())
|
||||
@if(auth()->guard('contact')->user() && !auth()->guard('contact')->user()->user->account->isPaid())
|
||||
<link href="{{ asset('favicon.png') }}" rel="shortcut icon" type="image/png">
|
||||
@endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user