Skip to content

Commit

Permalink
Fix typo in function name
Browse files Browse the repository at this point in the history
  • Loading branch information
blackpidgeon authored and DK committed Mar 9, 2020
1 parent 58a796c commit 3444cd8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Banking/Reconciliations.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function getOpeningBalance($account, $started_at)
$total = $account->opening_balance;

// Sum income transactions
$transactions = $account->income_transacions()->whereDate('paid_at', '<', $started_at)->get();
$transactions = $account->income_transactions()->whereDate('paid_at', '<', $started_at)->get();
foreach ($transactions as $item) {
$total += $item->amount;
}
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Banking/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function expense_transactions()
return $this->transactions()->where('type', 'expense');
}

public function income_transacions()
public function income_transactions()
{
return $this->transactions()->where('type', 'income');
}
Expand Down Expand Up @@ -81,7 +81,7 @@ public function getBalanceAttribute()
$total = $this->opening_balance;

// Sum Incomes
$total += $this->income_transacions->sum('amount');
$total += $this->income_transactions->sum('amount');

// Subtract Expenses
$total -= $this->expense_transactions->sum('amount');
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Setting/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function expense_transactions()
return $this->transactions()->where('type', 'expense');
}

public function income_transacions()
public function income_transactions()
{
return $this->transactions()->where('type', 'income');
}
Expand Down
4 changes: 2 additions & 2 deletions app/Widgets/IncomeByCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class IncomeByCategory extends Widget

public function show()
{
Category::with('income_transacions')->type('income')->each(function ($category) {
Category::with('income_transactions')->type('income')->each(function ($category) {
$amount = 0;

$this->applyFilters($category->income_transacions())->each(function ($transaction) use (&$amount) {
$this->applyFilters($category->income_transactions())->each(function ($transaction) use (&$amount) {
$amount += $transaction->getAmountConvertedToDefault();
});

Expand Down

0 comments on commit 3444cd8

Please sign in to comment.