1
0
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:
Hillel Coren 2018-03-05 16:40:10 +02:00
parent 54353563f9
commit c344af9de3
4 changed files with 9 additions and 9 deletions

View File

@ -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(),
];
}

View File

@ -108,7 +108,7 @@ class QuoteController extends BaseController
'invoiceFonts' => Cache::get('fonts'),
'invoiceLabels' => Auth::user()->account->getInvoiceLabels(),
'isRecurring' => false,
'expenses' => [],
'expenses' => collect(),
];
}

View File

@ -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);

View File

@ -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)