not showing disabled categories in widgets
This commit is contained in:
parent
9fd944cb61
commit
0a13039cce
@ -15,14 +15,12 @@ class ExpensesByCategory extends Widget
|
||||
|
||||
public function show()
|
||||
{
|
||||
Category::with('expense_transactions')->type('expense')->enabled()->each(function ($category) {
|
||||
Category::with('expense_transactions')->type('expense')->each(function ($category) {
|
||||
$amount = 0;
|
||||
|
||||
$transactions = $this->applyFilters($category->expense_transactions())->get();
|
||||
|
||||
foreach ($transactions as $transacion) {
|
||||
$amount += $transacion->getAmountConvertedToDefault();
|
||||
}
|
||||
$this->applyFilters($category->expense_transactions())->each(function ($transaction) use (&$amount) {
|
||||
$amount += $transaction->getAmountConvertedToDefault();
|
||||
});
|
||||
|
||||
$this->addMoneyToDonut($category->color, $amount, $category->name);
|
||||
});
|
||||
|
@ -15,14 +15,12 @@ class IncomeByCategory extends Widget
|
||||
|
||||
public function show()
|
||||
{
|
||||
Category::with('income_transacions')->type('income')->enabled()->each(function ($category) {
|
||||
Category::with('income_transacions')->type('income')->each(function ($category) {
|
||||
$amount = 0;
|
||||
|
||||
$transactions = $this->applyFilters($category->income_transacions())->get();
|
||||
|
||||
foreach ($transactions as $transacion) {
|
||||
$amount += $transacion->getAmountConvertedToDefault();
|
||||
}
|
||||
$this->applyFilters($category->income_transacions())->each(function ($transaction) use (&$amount) {
|
||||
$amount += $transaction->getAmountConvertedToDefault();
|
||||
});
|
||||
|
||||
$this->addMoneyToDonut($category->color, $amount, $category->name);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user