mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
PHP 7.2 fixes
This commit is contained in:
parent
54353563f9
commit
c344af9de3
@ -327,7 +327,7 @@ class InvoiceController extends BaseController
|
||||
'invoiceLabels' => Auth::user()->account->getInvoiceLabels(),
|
||||
'tasks' => Session::get('tasks') ? Session::get('tasks') : null,
|
||||
'expenseCurrencyId' => Session::get('expenseCurrencyId') ?: null,
|
||||
'expenses' => Session::get('expenses') ? Expense::scope(Session::get('expenses'))->with('documents', 'expense_category')->get() : [],
|
||||
'expenses' => Expense::scope(Session::get('expenses'))->with('documents', 'expense_category')->get(),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class QuoteController extends BaseController
|
||||
'invoiceFonts' => Cache::get('fonts'),
|
||||
'invoiceLabels' => Auth::user()->account->getInvoiceLabels(),
|
||||
'isRecurring' => false,
|
||||
'expenses' => [],
|
||||
'expenses' => collect(),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -155,18 +155,18 @@ class EntityModel extends Eloquent
|
||||
*/
|
||||
public function scopeScope($query, $publicId = false, $accountId = false)
|
||||
{
|
||||
if (! $accountId) {
|
||||
$accountId = Auth::user()->account_id;
|
||||
}
|
||||
|
||||
$query->where($this->getTable() .'.account_id', '=', $accountId);
|
||||
|
||||
// If 'false' is passed as the publicId return nothing rather than everything
|
||||
if (func_num_args() > 1 && ! $publicId && ! $accountId) {
|
||||
$query->where('id', '=', 0);
|
||||
return $query;
|
||||
}
|
||||
|
||||
if (! $accountId) {
|
||||
$accountId = Auth::user()->account_id;
|
||||
}
|
||||
|
||||
$query->where($this->getTable() .'.account_id', '=', $accountId);
|
||||
|
||||
if ($publicId) {
|
||||
if (is_array($publicId)) {
|
||||
$query->whereIn('public_id', $publicId);
|
||||
|
@ -470,7 +470,7 @@
|
||||
<input type="hidden" name="document_ids[]" data-bind="value: public_id"/>
|
||||
</div>
|
||||
</div>
|
||||
@if ($invoice->hasExpenseDocuments() || count($expenses))
|
||||
@if ($invoice->hasExpenseDocuments() || $expenses->count())
|
||||
<h4>{{trans('texts.documents_from_expenses')}}</h4>
|
||||
@foreach($invoice->expenses as $expense)
|
||||
@if ($expense->invoice_documents)
|
||||
|
Loading…
Reference in New Issue
Block a user