Fix typo in function name

This commit is contained in:
blackpidgeon 2020-03-09 09:02:25 +01:00 committed by DK
parent 58a796c2b4
commit 3444cd8dd8
4 changed files with 6 additions and 6 deletions

View File

@ -198,7 +198,7 @@ class Reconciliations extends Controller
$total = $account->opening_balance; $total = $account->opening_balance;
// Sum income transactions // 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) { foreach ($transactions as $item) {
$total += $item->amount; $total += $item->amount;
} }

View File

@ -39,7 +39,7 @@ class Account extends Model
return $this->transactions()->where('type', 'expense'); return $this->transactions()->where('type', 'expense');
} }
public function income_transacions() public function income_transactions()
{ {
return $this->transactions()->where('type', 'income'); return $this->transactions()->where('type', 'income');
} }
@ -81,7 +81,7 @@ class Account extends Model
$total = $this->opening_balance; $total = $this->opening_balance;
// Sum Incomes // Sum Incomes
$total += $this->income_transacions->sum('amount'); $total += $this->income_transactions->sum('amount');
// Subtract Expenses // Subtract Expenses
$total -= $this->expense_transactions->sum('amount'); $total -= $this->expense_transactions->sum('amount');

View File

@ -32,7 +32,7 @@ class Category extends Model
return $this->transactions()->where('type', 'expense'); return $this->transactions()->where('type', 'expense');
} }
public function income_transacions() public function income_transactions()
{ {
return $this->transactions()->where('type', 'income'); return $this->transactions()->where('type', 'income');
} }

View File

@ -15,10 +15,10 @@ class IncomeByCategory extends Widget
public function show() public function show()
{ {
Category::with('income_transacions')->type('income')->each(function ($category) { Category::with('income_transactions')->type('income')->each(function ($category) {
$amount = 0; $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(); $amount += $transaction->getAmountConvertedToDefault();
}); });