akaunting 3.0 (the last dance)

This commit is contained in:
Burak Civan
2022-06-01 10:15:55 +03:00
parent cead09f6d4
commit d9c0764572
3812 changed files with 126831 additions and 102949 deletions

View File

@ -9,9 +9,17 @@ class AccountBalance extends Widget
{
public $default_name = 'widgets.account_balance';
public $description = 'widgets.description.account_balance';
public $report_class = 'App\Reports\IncomeExpense';
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()->map(function($account) {
$account->balance_formatted = money($account->balance, $account->currency_code, true);
return $account;
})->all();
return $this->view('widgets.account_balance', [
'accounts' => $accounts,