mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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(),
|
'invoiceLabels' => Auth::user()->account->getInvoiceLabels(),
|
||||||
'tasks' => Session::get('tasks') ? Session::get('tasks') : null,
|
'tasks' => Session::get('tasks') ? Session::get('tasks') : null,
|
||||||
'expenseCurrencyId' => Session::get('expenseCurrencyId') ?: 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'),
|
'invoiceFonts' => Cache::get('fonts'),
|
||||||
'invoiceLabels' => Auth::user()->account->getInvoiceLabels(),
|
'invoiceLabels' => Auth::user()->account->getInvoiceLabels(),
|
||||||
'isRecurring' => false,
|
'isRecurring' => false,
|
||||||
'expenses' => [],
|
'expenses' => collect(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,18 +155,18 @@ class EntityModel extends Eloquent
|
|||||||
*/
|
*/
|
||||||
public function scopeScope($query, $publicId = false, $accountId = false)
|
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 'false' is passed as the publicId return nothing rather than everything
|
||||||
if (func_num_args() > 1 && ! $publicId && ! $accountId) {
|
if (func_num_args() > 1 && ! $publicId && ! $accountId) {
|
||||||
$query->where('id', '=', 0);
|
$query->where('id', '=', 0);
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $accountId) {
|
||||||
|
$accountId = Auth::user()->account_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query->where($this->getTable() .'.account_id', '=', $accountId);
|
||||||
|
|
||||||
if ($publicId) {
|
if ($publicId) {
|
||||||
if (is_array($publicId)) {
|
if (is_array($publicId)) {
|
||||||
$query->whereIn('public_id', $publicId);
|
$query->whereIn('public_id', $publicId);
|
||||||
|
@ -470,7 +470,7 @@
|
|||||||
<input type="hidden" name="document_ids[]" data-bind="value: public_id"/>
|
<input type="hidden" name="document_ids[]" data-bind="value: public_id"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if ($invoice->hasExpenseDocuments() || count($expenses))
|
@if ($invoice->hasExpenseDocuments() || $expenses->count())
|
||||||
<h4>{{trans('texts.documents_from_expenses')}}</h4>
|
<h4>{{trans('texts.documents_from_expenses')}}</h4>
|
||||||
@foreach($invoice->expenses as $expense)
|
@foreach($invoice->expenses as $expense)
|
||||||
@if ($expense->invoice_documents)
|
@if ($expense->invoice_documents)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user