mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for previews
This commit is contained in:
parent
742d566f27
commit
a790101f34
@ -210,12 +210,16 @@ class PreviewController extends BaseController
|
|||||||
if ($request->has('entity_id')) {
|
if ($request->has('entity_id')) {
|
||||||
|
|
||||||
/** @var \App\Models\Quote | \App\Models\Invoice | \App\Models\RecurringInvoice | \App\Models\Credit $class */
|
/** @var \App\Models\Quote | \App\Models\Invoice | \App\Models\RecurringInvoice | \App\Models\Credit $class */
|
||||||
$entity_obj = $class::on(config('database.default'))
|
$temp_obj = $class::on(config('database.default'))
|
||||||
->with('client.company')
|
->with('client.company')
|
||||||
->where('id', $this->decodePrimaryKey($request->input('entity_id')))
|
->where('id', $this->decodePrimaryKey($request->input('entity_id')))
|
||||||
->where('company_id', $company->id)
|
->where('company_id', $company->id)
|
||||||
->withTrashed()
|
->withTrashed()
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
/** Prevents null values from being passed into entity_obj */
|
||||||
|
if($temp_obj)
|
||||||
|
$entity_obj = $temp_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->has('footer') && !$request->filled('footer') && $request->input('entity') == 'recurring_invoice') {
|
if ($request->has('footer') && !$request->filled('footer') && $request->input('entity') == 'recurring_invoice') {
|
||||||
|
@ -103,7 +103,7 @@ class PdfMock
|
|||||||
|
|
||||||
switch ($this->request['entity_type']) {
|
switch ($this->request['entity_type']) {
|
||||||
case 'invoice':
|
case 'invoice':
|
||||||
/** @var \App\Models\Invoice | \App\Models\Credit | \App\Models\Quote $entity */
|
/** @var \App\Models\Invoice | \App\Models\Credit | \App\Models\Quote $entity */
|
||||||
$entity = Invoice::factory()->make();
|
$entity = Invoice::factory()->make();
|
||||||
$entity->client = Client::factory()->make(['settings' => $settings]);
|
$entity->client = Client::factory()->make(['settings' => $settings]);
|
||||||
$entity->invitation = InvoiceInvitation::factory()->make();
|
$entity->invitation = InvoiceInvitation::factory()->make();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user