removed extra brackets

This commit is contained in:
Denis Duliçi 2020-06-07 12:11:37 +03:00
parent 180107b13a
commit 0f1e13bb48
38 changed files with 48 additions and 48 deletions

View File

@ -9,7 +9,7 @@ class Transactions extends Export
{
public function collection()
{
$model = Model::with(['account', 'bill', 'category', 'contact', 'invoice'])->usingSearchString(request('search'));
$model = Model::with('account', 'bill', 'category', 'contact', 'invoice')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class Items extends Export
{
public function collection()
{
$model = Model::with(['category', 'tax'])->usingSearchString(request('search'));
$model = Model::with('category', 'tax')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class Payments extends Export
{
public function collection()
{
$model = Model::with(['account', 'bill', 'category', 'contact'])->expense()->usingSearchString(request('search'));
$model = Model::with('account', 'bill', 'category', 'contact')->expense()->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class BillHistories extends Export
{
public function collection()
{
$model = Model::with(['bill'])->usingSearchString(request('search'));
$model = Model::with('bill')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('bill_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class BillItemTaxes extends Export
{
public function collection()
{
$model = Model::with(['bill', 'item', 'tax'])->usingSearchString(request('search'));
$model = Model::with('bill', 'item', 'tax')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('bill_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class BillItems extends Export
{
public function collection()
{
$model = Model::with(['bill', 'item'])->usingSearchString(request('search'));
$model = Model::with('bill', 'item')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('bill_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class BillTotals extends Export
{
public function collection()
{
$model = Model::with(['bill'])->usingSearchString(request('search'));
$model = Model::with('bill')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('bill_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class BillTransactions extends Export
{
public function collection()
{
$model = Model::with(['account', 'category', 'contact', 'bill'])->expense()->isDocument()->usingSearchString(request('search'));
$model = Model::with('account', 'category', 'contact', 'bill')->expense()->isDocument()->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('document_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class Bills extends Export
{
public function collection()
{
$model = Model::with(['category'])->usingSearchString(request('search'));
$model = Model::with('category')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class Revenues extends Export
{
public function collection()
{
$model = Model::with(['account', 'category', 'contact', 'invoice'])->income()->usingSearchString(request('search'));
$model = Model::with('account', 'category', 'contact', 'invoice')->income()->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class InvoiceHistories extends Export
{
public function collection()
{
$model = Model::with(['invoice'])->usingSearchString(request('search'));
$model = Model::with('invoice')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('invoice_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class InvoiceItemTaxes extends Export
{
public function collection()
{
$model = Model::with(['invoice', 'item', 'tax'])->usingSearchString(request('search'));
$model = Model::with('invoice', 'item', 'tax')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('invoice_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class InvoiceItems extends Export
{
public function collection()
{
$model = Model::with(['invoice', 'item'])->usingSearchString(request('search'));
$model = Model::with('invoice', 'item')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('invoice_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class InvoiceTotals extends Export
{
public function collection()
{
$model = Model::with(['invoice'])->usingSearchString(request('search'));
$model = Model::with('invoice')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('invoice_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class InvoiceTransactions extends Export
{
public function collection()
{
$model = Model::with(['account', 'category', 'contact', 'invoice'])->income()->isDocument()->usingSearchString(request('search'));
$model = Model::with('account', 'category', 'contact', 'invoice')->income()->isDocument()->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('document_id', (array) $this->ids);

View File

@ -9,7 +9,7 @@ class Invoices extends Export
{
public function collection()
{
$model = Model::with(['category'])->usingSearchString(request('search'));
$model = Model::with('category')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);

View File

@ -19,7 +19,7 @@ class Users extends ApiController
*/
public function index()
{
$users = User::with(['companies', 'roles', 'permissions'])->collect();
$users = User::with('companies', 'permissions', 'roles')->collect();
return $this->response->paginator($users, new Transformer());
}
@ -34,9 +34,9 @@ class Users extends ApiController
{
// Check if we're querying by id or email
if (is_numeric($id)) {
$user = User::with(['companies', 'roles', 'permissions'])->find($id);
$user = User::with('companies', 'permissions', 'roles')->find($id);
} else {
$user = User::with(['companies', 'roles', 'permissions'])->where('email', $id)->first();
$user = User::with('companies', 'permissions', 'roles')->where('email', $id)->first();
}
return $this->response->item($user, new Transformer());

View File

@ -19,7 +19,7 @@ class Reconciliations extends ApiController
*/
public function index()
{
$items = Reconciliation::with(['account'])->collect();
$items = Reconciliation::with('account')->collect();
return $this->response->paginator($items, new Transformer());
}

View File

@ -19,7 +19,7 @@ class Transactions extends ApiController
*/
public function index()
{
$transactions = Transaction::with(['account', 'category', 'contact'])->collect(['paid_at'=> 'desc']);
$transactions = Transaction::with('account', 'category', 'contact')->collect(['paid_at'=> 'desc']);
return $this->response->paginator($transactions, new Transformer());
}

View File

@ -19,9 +19,9 @@ class Transfers extends ApiController
*/
public function index()
{
$transfers = Transfer::with([
$transfers = Transfer::with(
'expense_transaction', 'expense_transaction.account', 'income_transaction', 'income_transaction.account'
])->collect('expense_transaction.paid_at');
)->collect('expense_transaction.paid_at');
$special_key = [
'expense_transaction.name' => 'from_account',

View File

@ -22,7 +22,7 @@ class Items extends ApiController
*/
public function index()
{
$items = Item::with(['category', 'tax'])->collect();
$items = Item::with('category', 'tax')->collect();
return $this->response->paginator($items, new Transformer());
}
@ -35,7 +35,7 @@ class Items extends ApiController
*/
public function show($id)
{
$item = Item::with(['category', 'tax'])->find($id);
$item = Item::with('category', 'tax')->find($id);
return $this->response->item($item, new Transformer());
}

View File

@ -19,7 +19,7 @@ class Bills extends ApiController
*/
public function index()
{
$bills = Bill::with(['contact', 'items', 'transactions', 'histories'])->collect(['billed_at'=> 'desc']);
$bills = Bill::with('contact', 'histories', 'items', 'transactions')->collect(['billed_at'=> 'desc']);
return $this->response->paginator($bills, new Transformer());
}

View File

@ -19,7 +19,7 @@ class Invoices extends ApiController
*/
public function index()
{
$invoices = Invoice::with(['contact', 'items', 'transactions', 'histories'])->collect(['invoiced_at'=> 'desc']);
$invoices = Invoice::with('contact', 'histories', 'items', 'transactions')->collect(['invoiced_at'=> 'desc']);
return $this->response->paginator($invoices, new Transformer());
}

View File

@ -23,7 +23,7 @@ class Users extends Controller
*/
public function index()
{
$users = User::with(['media', 'roles'])->collect();
$users = User::with('media', 'roles')->collect();
return view('auth.users.index', compact('users'));
}

View File

@ -28,7 +28,7 @@ class Transactions extends Controller
$request_type = !request()->has('type') ? ['income', 'expense'] : request('type');
$categories = Category::enabled()->type($request_type)->orderBy('name')->pluck('name', 'id');
$transactions = Transaction::with(['account', 'category', 'contact'])->collect(['paid_at'=> 'desc']);
$transactions = Transaction::with('account', 'category', 'contact')->collect(['paid_at'=> 'desc']);
return view('banking.transactions.index', compact('transactions', 'accounts', 'types', 'categories'));
}

View File

@ -24,9 +24,9 @@ class Transfers extends Controller
{
$data = [];
$items = Transfer::with([
$items = Transfer::with(
'expense_transaction', 'expense_transaction.account', 'income_transaction', 'income_transaction.account'
])->collect(['expense_transaction.paid_at' => 'desc']);
)->collect(['expense_transaction.paid_at' => 'desc']);
foreach ($items as $item) {
$income_transaction = $item->income_transaction;

View File

@ -28,7 +28,7 @@ class Items extends Controller
*/
public function index()
{
$items = Item::with(['category', 'media'])->collect();
$items = Item::with('category', 'media')->collect();
return view('common.items.index', compact('items'));
}

View File

@ -23,7 +23,7 @@ class Invoices extends Controller
*/
public function index()
{
$invoices = Invoice::with(['contact', 'items', 'payments', 'histories'])
$invoices = Invoice::with('contact', 'histories', 'items', 'payments')
->accrued()->where('contact_id', user()->contact->id)
->collect(['invoice_number'=> 'desc']);

View File

@ -37,7 +37,7 @@ class Bills extends Controller
*/
public function index()
{
$bills = Bill::with(['contact', 'transactions'])->collect(['billed_at'=> 'desc']);
$bills = Bill::with('contact', 'transactions')->collect(['billed_at'=> 'desc']);
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');

View File

@ -30,7 +30,7 @@ class Payments extends Controller
*/
public function index()
{
$payments = Transaction::with(['account', 'bill', 'category', 'contact'])->expense()->isNotTransfer()->collect(['paid_at'=> 'desc']);
$payments = Transaction::with('account', 'bill', 'category', 'contact')->expense()->isNotTransfer()->collect(['paid_at'=> 'desc']);
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');

View File

@ -38,7 +38,7 @@ class Invoices extends Controller
*/
public function index()
{
$invoices = Invoice::with(['contact', 'transactions'])->collect(['invoice_number'=> 'desc']);
$invoices = Invoice::with('contact', 'transactions')->collect(['invoice_number'=> 'desc']);
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');

View File

@ -30,7 +30,7 @@ class Revenues extends Controller
*/
public function index()
{
$revenues = Transaction::with(['account', 'category', 'contact', 'invoice'])->income()->isNotTransfer()->collect(['paid_at'=> 'desc']);
$revenues = Transaction::with('account', 'category', 'contact', 'invoice')->income()->isNotTransfer()->collect(['paid_at'=> 'desc']);
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');

View File

@ -41,7 +41,7 @@ class ExpenseSummary extends Report
break;
default:
// Bills
$bills = $this->applyFilters(Bill::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'billed_at'])->get();
$bills = $this->applyFilters(Bill::with('recurring', 'transactions')->accrued(), ['date_field' => 'billed_at'])->get();
Recurring::reflect($bills, 'billed_at');
$this->setTotals($bills, 'billed_at');

View File

@ -32,7 +32,7 @@ class IncomeExpenseSummary extends Report
break;
default:
// Invoices
$invoices = $this->applyFilters(Invoice::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'invoiced_at'])->get();
$invoices = $this->applyFilters(Invoice::with('recurring', 'transactions')->accrued(), ['date_field' => 'invoiced_at'])->get();
Recurring::reflect($invoices, 'invoiced_at');
$this->setTotals($invoices, 'invoiced_at', true);
@ -42,7 +42,7 @@ class IncomeExpenseSummary extends Report
$this->setTotals($revenues, 'paid_at', true);
// Bills
$bills = $this->applyFilters(Bill::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'billed_at'])->get();
$bills = $this->applyFilters(Bill::with('recurring', 'transactions')->accrued(), ['date_field' => 'billed_at'])->get();
Recurring::reflect($bills, 'bill', 'billed_at');
$this->setTotals($bills, 'billed_at', true);

View File

@ -41,7 +41,7 @@ class IncomeSummary extends Report
break;
default:
// Invoices
$invoices = $this->applyFilters(Invoice::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'invoiced_at'])->get();
$invoices = $this->applyFilters(Invoice::with('recurring', 'transactions')->accrued(), ['date_field' => 'invoiced_at'])->get();
Recurring::reflect($invoices, 'invoiced_at');
$this->setTotals($invoices, 'invoiced_at');

View File

@ -51,7 +51,7 @@ class ProfitLoss extends Report
break;
default:
// Invoices
$invoices = $this->applyFilters(Invoice::with(['recurring', 'transactions', 'totals'])->accrued(), ['date_field' => 'invoiced_at'])->get();
$invoices = $this->applyFilters(Invoice::with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'invoiced_at'])->get();
Recurring::reflect($invoices, 'invoiced_at');
$this->setTotals($invoices, 'invoiced_at', true, $this->tables['income'], false);
@ -61,7 +61,7 @@ class ProfitLoss extends Report
$this->setTotals($revenues, 'paid_at', true, $this->tables['income'], false);
// Bills
$bills = $this->applyFilters(Bill::with(['recurring', 'transactions', 'totals'])->accrued(), ['date_field' => 'billed_at'])->get();
$bills = $this->applyFilters(Bill::with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'billed_at'])->get();
Recurring::reflect($bills, 'bill', 'billed_at');
$this->setTotals($bills, 'billed_at', true, $this->tables['expense'], false);

View File

@ -42,22 +42,22 @@ class TaxSummary extends Report
switch ($this->model->settings->basis) {
case 'cash':
// Invoice Payments
$invoices = $this->applyFilters(Transaction::with(['recurring', 'invoice', 'invoice.totals'])->income()->isDocument()->isNotTransfer(), ['date_field' => 'paid_at'])->get();
$invoices = $this->applyFilters(Transaction::with('recurring', 'invoice', 'invoice.totals')->income()->isDocument()->isNotTransfer(), ['date_field' => 'paid_at'])->get();
$this->setTotals($invoices, 'paid_at');
// Bill Payments
$bills = $this->applyFilters(Transaction::with(['recurring', 'bill', 'bill.totals'])->expense()->isDocument()->isNotTransfer(), ['date_field' => 'paid_at'])->get();
$bills = $this->applyFilters(Transaction::with('recurring', 'bill', 'bill.totals')->expense()->isDocument()->isNotTransfer(), ['date_field' => 'paid_at'])->get();
$this->setTotals($bills, 'paid_at');
break;
default:
// Invoices
$invoices = $this->applyFilters(Invoice::with(['recurring', 'transactions', 'totals'])->accrued(), ['date_field' => 'invoiced_at'])->get();
$invoices = $this->applyFilters(Invoice::with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'invoiced_at'])->get();
Recurring::reflect($invoices, 'invoiced_at');
$this->setTotals($invoices, 'invoiced_at');
// Bills
$bills = $this->applyFilters(Bill::with(['recurring', 'transactions', 'totals'])->accrued(), ['date_field' => 'billed_at'])->get();
$bills = $this->applyFilters(Bill::with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'billed_at'])->get();
Recurring::reflect($bills, 'billed_at');
$this->setTotals($bills, 'billed_at');

View File

@ -11,7 +11,7 @@ class AccountBalance extends Widget
public function show()
{
$accounts = Account::with(['income_transactions', 'expense_transactions'])->enabled()->take(5)->get();
$accounts = Account::with('income_transactions', 'expense_transactions')->enabled()->take(5)->get();
return $this->view('widgets.account_balance', [
'accounts' => $accounts,