diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php index f45f37e419..cbe3d80d8d 100644 --- a/app/Http/Controllers/Account/ShowController.php +++ b/app/Http/Controllers/Account/ShowController.php @@ -123,12 +123,13 @@ class ShowController extends Controller $groups = $collector->getPaginatedGroups(); $groups->setPath(route('accounts.show', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')])); $showAll = false; + $balance = app('steam')->balance($account, $end); return view( 'accounts.show', compact( 'account', 'showAll', 'objectType', 'currency', 'today', 'periods', 'subTitleIcon', 'groups', 'subTitle', 'start', 'end', - 'chartUri', 'location' + 'chartUri', 'location','balance' ) ); } @@ -147,6 +148,7 @@ class ShowController extends Controller return $this->redirectAccountToAccount($account); // @codeCoverageIgnore } + $location = $this->repository->getLocation($account); $isLiability = $this->repository->isLiability($account); $objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type)); @@ -166,12 +168,13 @@ class ShowController extends Controller $groups->setPath(route('accounts.show.all', [$account->id])); $chartUri = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]); $showAll = true; + $balance = app('steam')->balance($account, $end); return view( 'accounts.show', compact( 'account', 'showAll', 'location', 'objectType', 'isLiability', 'currency', 'today', - 'chartUri', 'periods', 'subTitleIcon', 'groups', 'subTitle', 'start', 'end' + 'chartUri', 'periods', 'subTitleIcon', 'groups', 'subTitle', 'start', 'end', 'balance' ) ); } diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 2591bcde27..d812cd7bbc 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -138,7 +138,7 @@ return [ 'budget_in_period' => 'All transactions for budget ":name" between :start and :end in :currency', 'chart_budget_in_period' => 'Chart for all transactions for budget ":name" between :start and :end in :currency', 'chart_budget_in_period_only_currency' => 'The amount you budgeted was in :currency, so this chart will only show transactions in :currency.', - 'chart_account_in_period' => 'Chart for all transactions for account ":name" between :start and :end', + 'chart_account_in_period' => 'Chart for all transactions for account ":name" (:balance) between :start and :end', 'chart_category_in_period' => 'Chart for all transactions for category ":name" between :start and :end', 'chart_category_all' => 'Chart for all transactions for category ":name"', 'clone_withdrawal' => 'Clone this withdrawal', diff --git a/resources/views/v1/accounts/show.twig b/resources/views/v1/accounts/show.twig index d8757863ad..5acff5f48b 100644 --- a/resources/views/v1/accounts/show.twig +++ b/resources/views/v1/accounts/show.twig @@ -11,7 +11,9 @@