Fix charts and balances.

This commit is contained in:
James Cole
2024-12-26 05:11:32 +01:00
parent 756bb9cf5e
commit 6d22663ca2
6 changed files with 361 additions and 201 deletions

View File

@@ -116,7 +116,7 @@ class AccountController extends Controller
];
// TODO this code is also present in the V2 chart account controller so this method is due to be deprecated.
$currentStart = clone $start;
$range = app('steam')->finalAccountBalanceInRange($account, $start, clone $end);
$range = app('steam')->finalAccountBalanceInRange($account, $start, clone $end, $this->convertToNative);
// 2022-10-11 this method no longer converts to float.
$previous = array_values($range)[0];
while ($currentStart <= $end) {

View File

@@ -55,6 +55,7 @@ abstract class Controller extends BaseController
/** @var array<int, string> */
protected array $allowedSort;
protected ParameterBag $parameters;
protected bool $convertToNative = false;
/**
* Controller constructor.
@@ -68,7 +69,9 @@ abstract class Controller extends BaseController
$this->parameters = $this->getParameters();
if (auth()->check()) {
$language = app('steam')->getLanguage();
$this->convertToNative = app('preferences')->get('convert_to_native', false)->data;
app()->setLocale($language);
}
return $next($request);