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

@@ -79,7 +79,7 @@ class UpdateController extends Controller
$account = $this->repository->update($account, $data);
$manager = $this->getManager();
$account->refresh();
Preferences::mark();
app('preferences')->mark();
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);

View File

@@ -107,8 +107,8 @@ class BasicController extends Controller
$balanceData = $this->getBalanceInformation($start, $end);
$billData = $this->getBillInformation($start, $end);
$spentData = $this->getLeftToSpendInfo($start, $end);
$networthData = $this->getNetWorthInfo($start, $end);
$total = array_merge($balanceData, $billData, $spentData, $networthData);
$netWorthData = $this->getNetWorthInfo($start, $end);
$total = array_merge($balanceData, $billData, $spentData, $netWorthData);
// give new keys
$return = [];
@@ -368,30 +368,30 @@ class BasicController extends Controller
}
);
$netWorthSet = $netWorthHelper->getNetWorthByCurrency($filtered, $date);
$netWorthSet = $netWorthHelper->byAccounts($filtered, $date);
$return = [];
foreach ($netWorthSet as $data) {
/** @var TransactionCurrency $currency */
$currency = $data['currency'];
foreach ($netWorthSet as $key => $data) {
if('native' === $key) {
continue;
}
$amount = $data['balance'];
if (0 === bccomp($amount, '0')) {
continue;
}
// return stuff
$return[] = [
'key' => sprintf('net-worth-in-%s', $currency->code),
'title' => trans('firefly.box_net_worth_in_currency', ['currency' => $currency->symbol]),
'key' => sprintf('net-worth-in-%s', $data['currency_code']),
'title' => trans('firefly.box_net_worth_in_currency', ['currency' => $data['currency_symbol']]),
'monetary_value' => $amount,
'currency_id' => (string)$currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'value_parsed' => app('amount')->formatAnything($currency, $data['balance'], false),
'currency_id' => (string)$data['currency_id'],
'currency_code' => $data['currency_code'],
'currency_symbol' => $data['currency_symbol'],
'currency_decimal_places' => $data['currency_decimal_places'],
'value_parsed' => app('amount')->formatFlat($data['currency_symbol'], $data['currency_decimal_places'], $data['balance'], false),
'local_icon' => 'line-chart',
'sub_title' => '',
];
}
return $return;
}