Skip to content

Commit

Permalink
Merge branch 'release/v6.0.24'
Browse files Browse the repository at this point in the history
  • Loading branch information
JC5 committed Sep 15, 2023
2 parents 67d29b8 + 4aba842 commit 88c145a
Show file tree
Hide file tree
Showing 118 changed files with 1,030 additions and 847 deletions.
12 changes: 6 additions & 6 deletions .ci/php-cs-fixer/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/Api/V1/Controllers/Autocomplete/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function accounts(AutocompleteRequest $request): JsonResponse
'name' => $account->name,
'name_with_balance' => $nameWithBalance,
'type' => $account->accountType->type,
'currency_id' => $currency->id,
'currency_id' => (string)$currency->id,
'currency_name' => $currency->name,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
Expand Down
16 changes: 8 additions & 8 deletions app/Api/V1/Controllers/Summary/BasicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private function getBalanceInformation(Carbon $start, Carbon $end): array
'key' => sprintf('balance-in-%s', $currency->code),
'title' => trans('firefly.box_balance_in_currency', ['currency' => $currency->symbol]),
'monetary_value' => $sums[$currencyId] ?? '0',
'currency_id' => $currency->id,
'currency_id' => (string)$currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
Expand All @@ -203,7 +203,7 @@ private function getBalanceInformation(Carbon $start, Carbon $end): array
'key' => sprintf('spent-in-%s', $currency->code),
'title' => trans('firefly.box_spent_in_currency', ['currency' => $currency->symbol]),
'monetary_value' => $expenses[$currencyId] ?? '0',
'currency_id' => $currency->id,
'currency_id' => (string)$currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
Expand All @@ -215,7 +215,7 @@ private function getBalanceInformation(Carbon $start, Carbon $end): array
'key' => sprintf('earned-in-%s', $currency->code),
'title' => trans('firefly.box_earned_in_currency', ['currency' => $currency->symbol]),
'monetary_value' => $incomes[$currencyId] ?? '0',
'currency_id' => $currency->id,
'currency_id' => (string)$currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
Expand Down Expand Up @@ -253,7 +253,7 @@ private function getBillInformation(Carbon $start, Carbon $end): array
'key' => sprintf('bills-paid-in-%s', $info['code']),
'title' => trans('firefly.box_bill_paid_in_currency', ['currency' => $info['symbol']]),
'monetary_value' => $amount,
'currency_id' => $info['id'],
'currency_id' => (string)$info['id'],
'currency_code' => $info['code'],
'currency_symbol' => $info['symbol'],
'currency_decimal_places' => $info['decimal_places'],
Expand All @@ -272,7 +272,7 @@ private function getBillInformation(Carbon $start, Carbon $end): array
'key' => sprintf('bills-unpaid-in-%s', $info['code']),
'title' => trans('firefly.box_bill_unpaid_in_currency', ['currency' => $info['symbol']]),
'monetary_value' => $amount,
'currency_id' => $info['id'],
'currency_id' => (string)$info['id'],
'currency_code' => $info['code'],
'currency_symbol' => $info['symbol'],
'currency_decimal_places' => $info['decimal_places'],
Expand Down Expand Up @@ -302,7 +302,7 @@ private function getLeftToSpendInfo(Carbon $start, Carbon $end): array

foreach ($spent as $row) {
// either an amount was budgeted or 0 is available.
$amount = $available[$row['currency_id']] ?? '0';
$amount = (string)($available[$row['currency_id']] ?? '0');
$spentInCurrency = $row['sum'];
$leftToSpend = bcadd($amount, $spentInCurrency);

Expand All @@ -316,7 +316,7 @@ private function getLeftToSpendInfo(Carbon $start, Carbon $end): array
'key' => sprintf('left-to-spend-in-%s', $row['currency_code']),
'title' => trans('firefly.box_left_to_spend_in_currency', ['currency' => $row['currency_symbol']]),
'monetary_value' => $leftToSpend,
'currency_id' => $row['currency_id'],
'currency_id' => (string)$row['currency_id'],
'currency_code' => $row['currency_code'],
'currency_symbol' => $row['currency_symbol'],
'currency_decimal_places' => $row['currency_decimal_places'],
Expand Down Expand Up @@ -381,7 +381,7 @@ function (Account $account) {
'key' => sprintf('net-worth-in-%s', $currency->code),
'title' => trans('firefly.box_net_worth_in_currency', ['currency' => $currency->symbol]),
'monetary_value' => $amount,
'currency_id' => $currency->id,
'currency_id' => (string)$currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
Expand Down
2 changes: 1 addition & 1 deletion app/Api/V2/Controllers/Autocomplete/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function accounts(AutocompleteRequest $request): JsonResponse
'name' => $account->name,
'name_with_balance' => $nameWithBalance,
'type' => $account->accountType->type,
'currency_id' => $currency->id,
'currency_id' => (string)$currency->id,
'currency_name' => $currency->name,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
Expand Down
2 changes: 1 addition & 1 deletion app/Api/V2/Controllers/Chart/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function dashboard(DateRequest $request): JsonResponse
'currency_decimal_places' => $currency->decimal_places,

// the default currency of the user (could be the same!)
'native_id' => (int)$default->id,
'native_id' => (string)$default->id,
'native_code' => $default->code,
'native_symbol' => $default->symbol,
'native_decimal_places' => (int)$default->decimal_places,
Expand Down
16 changes: 8 additions & 8 deletions app/Api/V2/Controllers/Chart/BalanceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ public function balance(BalanceChartRequest $request): JsonResponse
// set array for default currency (even if unused later on)
$defaultCurrencyId = (int)$default->id;
$data[$defaultCurrencyId] = [
'currency_id' => $defaultCurrencyId,
'currency_id' => (string)$defaultCurrencyId,
'currency_symbol' => $default->symbol,
'currency_code' => $default->code,
'currency_name' => $default->name,
'currency_decimal_places' => (int)$default->decimal_places,
'native_id' => $defaultCurrencyId,
'native_id' => (string)$defaultCurrencyId,
'native_symbol' => $default->symbol,
'native_code' => $default->code,
'native_name' => $default->name,
Expand All @@ -138,13 +138,13 @@ public function balance(BalanceChartRequest $request): JsonResponse

// set the array with monetary info, if it does not exist.
$data[$currencyId] = $data[$currencyId] ?? [
'currency_id' => $currencyId,
'currency_id' => (string)$currencyId,
'currency_symbol' => $journal['currency_symbol'],
'currency_code' => $journal['currency_code'],
'currency_name' => $journal['currency_name'],
'currency_decimal_places' => $journal['currency_decimal_places'],
// native currency info (could be the same)
'native_id' => (int)$default->id,
'native_id' => (string)$default->id,
'native_code' => $default->code,
'native_symbol' => $default->symbol,
'native_decimal_places' => (int)$default->decimal_places,
Expand Down Expand Up @@ -203,11 +203,11 @@ public function balance(BalanceChartRequest $request): JsonResponse
// income and expense array prepped:
$income = [
'label' => 'earned',
'currency_id' => $currency['currency_id'],
'currency_id' => (string)$currency['currency_id'],
'currency_symbol' => $currency['currency_symbol'],
'currency_code' => $currency['currency_code'],
'currency_decimal_places' => $currency['currency_decimal_places'],
'native_id' => $currency['native_id'],
'native_id' => (string)$currency['native_id'],
'native_symbol' => $currency['native_symbol'],
'native_code' => $currency['native_code'],
'native_decimal_places' => $currency['native_decimal_places'],
Expand All @@ -219,11 +219,11 @@ public function balance(BalanceChartRequest $request): JsonResponse
];
$expense = [
'label' => 'spent',
'currency_id' => $currency['currency_id'],
'currency_id' => (string)$currency['currency_id'],
'currency_symbol' => $currency['currency_symbol'],
'currency_code' => $currency['currency_code'],
'currency_decimal_places' => $currency['currency_decimal_places'],
'native_id' => $currency['native_id'],
'native_id' => (string)$currency['native_id'],
'native_symbol' => $currency['native_symbol'],
'native_code' => $currency['native_code'],
'native_decimal_places' => $currency['native_decimal_places'],
Expand Down
8 changes: 4 additions & 4 deletions app/Api/V2/Controllers/Chart/BudgetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ private function processBudget(Budget $budget, Carbon $start, Carbon $end): arra
foreach ($rows as $row) {
$current = [
'label' => $budget->name,
'currency_id' => $row['currency_id'],
'currency_id' => (string)$row['currency_id'],
'currency_code' => $row['currency_code'],
'currency_name' => $row['currency_name'],
'currency_decimal_places' => $row['currency_decimal_places'],
'native_id' => $row['native_id'],
'native_id' => (string)$row['native_id'],
'native_code' => $row['native_code'],
'native_name' => $row['native_name'],
'native_decimal_places' => $row['native_decimal_places'],
Expand Down Expand Up @@ -199,12 +199,12 @@ private function processExpenses(int $budgetId, array $array, Carbon $start, Car
foreach ($array as $currencyId => $block) {
$this->currencies[$currencyId] = $this->currencies[$currencyId] ?? TransactionCurrency::find($currencyId);
$return[$currencyId] = $return[$currencyId] ?? [
'currency_id' => $currencyId,
'currency_id' => (string)$currencyId,
'currency_code' => $block['currency_code'],
'currency_name' => $block['currency_name'],
'currency_symbol' => $block['currency_symbol'],
'currency_decimal_places' => (int)$block['currency_decimal_places'],
'native_id' => (int)$this->currency->id,
'native_id' => (string)$this->currency->id,
'native_code' => $this->currency->code,
'native_name' => $this->currency->name,
'native_symbol' => $this->currency->symbol,
Expand Down
4 changes: 2 additions & 2 deletions app/Api/V2/Controllers/Chart/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ public function dashboard(DateRequest $request): JsonResponse
// create arrays
$return[$key] = $return[$key] ?? [
'label' => $categoryName,
'currency_id' => (int)$currency->id,
'currency_id' => (string)$currency->id,
'currency_code' => $currency->code,
'currency_name' => $currency->name,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => (int)$currency->decimal_places,
'native_id' => (int)$default->id,
'native_id' => (string)$default->id,
'native_code' => $default->code,
'native_name' => $default->name,
'native_symbol' => $default->symbol,
Expand Down

0 comments on commit 88c145a

Please sign in to comment.