From 3c8de21709cfc7a1476eeb502b800183616f0293 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 4 Feb 2025 21:34:46 +0100 Subject: [PATCH] Fix balance and native balance lists. --- app/Support/Steam.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Support/Steam.php b/app/Support/Steam.php index d805f8d6a7..aa19ec7b00 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -329,7 +329,7 @@ class Steam $hasCurrency = null !== $accountCurrency; $currency = $hasCurrency ? $accountCurrency : $native; $return = [ - 'balance' => '0', + //'balance' => '0', 'native_balance' => '0', ]; // balance(s) in other (all) currencies. @@ -343,9 +343,9 @@ class Steam Log::debug('All balances are (joined)', $others); // if there is no request to convert, take this as "balance" and "native_balance". if (!$convertToNative) { - $return['balance'] = $others[$currency->code] ?? '0'; + //$return['balance'] = $others[$currency->code] ?? '0'; $return['native_balance'] = $others[$currency->code] ?? '0'; - Log::debug(sprintf('Set balance + native_balance to %s', $return['balance'])); + Log::debug(sprintf('Set balance + native_balance to %s', $return['native_balance'])); } // if there is a request to convert, convert to "native_balance" and use "balance" for whichever amount is in the native currency. if ($convertToNative) { @@ -356,8 +356,8 @@ class Steam // either way, the balance is always combined with the virtual balance: $virtualBalance = (string) ('' === (string) $account->virtual_balance ? '0' : $account->virtual_balance); - $return['balance'] = bcadd($return['balance'], $virtualBalance); - Log::debug(sprintf('Virtual balance makes the total %s', $return['balance'])); + //$return['balance'] = bcadd($return['balance'], $virtualBalance); + //Log::debug(sprintf('Virtual balance makes the total %s', $return['balance'])); if ($convertToNative) { // the native balance is combined with a converted virtual_balance: @@ -369,7 +369,7 @@ class Steam if (!$convertToNative) { // if not, also increase the native balance for consistency. $return['native_balance'] = bcadd($return['native_balance'], $virtualBalance); - Log::debug(sprintf('Virtual balance makes the (native) total %s', $return['balance'])); + Log::debug(sprintf('Virtual balance makes the (native) total %s', $return['native_balance'])); } // if the currency is the same as the native currency, set the native_balance to the balance for consistency.