Remove the use of deprecated methods.

This commit is contained in:
James Cole
2023-10-29 05:54:01 +01:00
parent a28f561e0c
commit 4bb171128e
10 changed files with 43 additions and 137 deletions

View File

@@ -268,12 +268,13 @@ class BoxController extends Controller
}
);
$netWorthSet = $netWorthHelper->getNetWorthByCurrency($filtered, $date);
$netWorthSet = $netWorthHelper->byAccounts($filtered, $date);
$return = [];
foreach ($netWorthSet as $data) {
/** @var TransactionCurrency $currency */
$currency = $data['currency'];
$return[$currency->id] = app('amount')->formatAnything($currency, $data['balance'], false);
foreach ($netWorthSet as $key => $data) {
if('native' === $key) {
continue;
}
$return[$data['currency_id']] = app('amount')->formatFlat($data['currency_symbol'], $data['currency_decimal_places'], $data['balance'], false);
}
$return = [
'net_worths' => array_values($return),