Skip to content

Commit

Permalink
removed extra brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Jun 7, 2020
1 parent 180107b commit 0f1e13b
Show file tree
Hide file tree
Showing 38 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion app/Exports/Banking/Transactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Common/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Purchases/Payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Purchases/Sheets/BillHistories.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Purchases/Sheets/BillItemTaxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Purchases/Sheets/BillItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Purchases/Sheets/BillTotals.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Purchases/Sheets/BillTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Purchases/Sheets/Bills.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Sales/Revenues.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Sales/Sheets/InvoiceHistories.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Sales/Sheets/InvoiceItemTaxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Sales/Sheets/InvoiceItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Sales/Sheets/InvoiceTotals.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Sales/Sheets/InvoiceTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Exports/Sales/Sheets/Invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Api/Auth/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -34,9 +34,9 @@ public function show($id)
{
// 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());
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/Banking/Reconciliations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/Banking/Transactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/Banking/Transfers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/Common/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -35,7 +35,7 @@ public function index()
*/
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());
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/Purchases/Bills.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/Sales/Invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Banking/Transactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function index()
$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'));
}
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Banking/Transfers.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public function index()
{
$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;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Common/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Portal/Invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Purchases/Bills.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Purchases/Payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Sales/Invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Sales/Revenues.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion app/Reports/ExpenseSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function setData()
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');

Expand Down
4 changes: 2 additions & 2 deletions app/Reports/IncomeExpenseSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function setData()
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);

Expand All @@ -42,7 +42,7 @@ public function setData()
$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);

Expand Down
2 changes: 1 addition & 1 deletion app/Reports/IncomeSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function setData()
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');

Expand Down
4 changes: 2 additions & 2 deletions app/Reports/ProfitLoss.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function setData()
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);

Expand All @@ -61,7 +61,7 @@ public function setData()
$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);

Expand Down
8 changes: 4 additions & 4 deletions app/Reports/TaxSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ public function setData()
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');

Expand Down

0 comments on commit 0f1e13b

Please sign in to comment.