Skip to content

Commit

Permalink
Auto commit for release 'v6.1.17' on 2024-06-15
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 15, 2024
1 parent d426e09 commit 2d7d05e
Show file tree
Hide file tree
Showing 10 changed files with 433 additions and 341 deletions.
18 changes: 9 additions & 9 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/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function showLoginForm(Request $request)
$storeInCookie = config('google2fa.store_in_cookie', false);
if (false !== $storeInCookie) {
$cookieName = config('google2fa.cookie_name', 'google2fa_token');
Cookie::queue(Cookie::make($cookieName, 'invalid-'.time()));
\Cookie::queue(\Cookie::make($cookieName, 'invalid-'.time()));
}
$usernameField = $this->username();

Expand Down
70 changes: 35 additions & 35 deletions app/Http/Controllers/Transaction/ConvertController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ public function index(TransactionType $destinationType, TransactionGroup $group)
}

/** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class);
$transformer = app(TransactionGroupTransformer::class);

/** @var TransactionJournal $first */
$first = $group->transactionJournals()->first();
$sourceType = $first->transactionType;
$first = $group->transactionJournals()->first();
$sourceType = $first->transactionType;

$groupTitle = $group->title ?? $first->description;
$groupArray = $transformer->transformObject($group);
$subTitle = (string) trans('firefly.convert_to_' . $destinationType->type, ['description' => $groupTitle]);
$subTitleIcon = 'fa-exchange';
$groupTitle = $group->title ?? $first->description;
$groupArray = $transformer->transformObject($group);
$subTitle = (string) trans('firefly.convert_to_'.$destinationType->type, ['description' => $groupTitle]);
$subTitleIcon = 'fa-exchange';

// get a list of asset accounts and liabilities and stuff, in various combinations:
$validDepositSources = $this->getValidDepositSources();
Expand All @@ -104,13 +104,13 @@ public function index(TransactionType $destinationType, TransactionGroup $group)
$assets = $this->getAssetAccounts();

// old input variables:
$preFilled = [
$preFilled = [
'source_name' => old('source_name'),
];

if ($sourceType->type === $destinationType->type) { // cannot convert to its own type.
app('log')->debug('This is already a transaction of the expected type..');
session()->flash('info', (string) trans('firefly.convert_is_already_type_' . $destinationType->type));
session()->flash('info', (string) trans('firefly.convert_is_already_type_'.$destinationType->type));

return redirect(route('transactions.show', [$group->id]));
}
Expand Down Expand Up @@ -139,21 +139,22 @@ private function getValidDepositSources(): array
// make repositories
$liabilityTypes = [AccountType::MORTGAGE, AccountType::DEBT, AccountType::CREDITCARD, AccountType::LOAN];
$accountList = $this->accountRepository
->getActiveAccountsByType([AccountType::REVENUE, AccountType::CASH, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]);
->getActiveAccountsByType([AccountType::REVENUE, AccountType::CASH, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE])
;
$grouped = [];

// group accounts:
/** @var Account $account */
foreach ($accountList as $account) {
$role = (string) $this->accountRepository->getMetaValue($account, 'account_role');
$name = $account->name;
$role = (string) $this->accountRepository->getMetaValue($account, 'account_role');
$name = $account->name;
if ('' === $role) {
$role = 'no_account_type';
}

// maybe it's a liability thing:
if (in_array($account->accountType->type, $liabilityTypes, true)) {
$role = 'l_' . $account->accountType->type;
$role = 'l_'.$account->accountType->type;
}
if (AccountType::CASH === $account->accountType->type) {
$role = 'cash_account';
Expand All @@ -163,7 +164,7 @@ private function getValidDepositSources(): array
$role = 'revenue_account';
}

$key = (string) trans('firefly.opt_group_' . $role);
$key = (string) trans('firefly.opt_group_'.$role);
$grouped[$key][$account->id] = $name;
}

Expand All @@ -182,15 +183,15 @@ private function getValidWithdrawalDests(): array
// group accounts:
/** @var Account $account */
foreach ($accountList as $account) {
$role = (string) $this->accountRepository->getMetaValue($account, 'account_role');
$name = $account->name;
$role = (string) $this->accountRepository->getMetaValue($account, 'account_role');
$name = $account->name;
if ('' === $role) {
$role = 'no_account_type';
}

// maybe it's a liability thing:
if (in_array($account->accountType->type, $liabilityTypes, true)) {
$role = 'l_' . $account->accountType->type;
$role = 'l_'.$account->accountType->type;
}
if (AccountType::CASH === $account->accountType->type) {
$role = 'cash_account';
Expand All @@ -200,7 +201,7 @@ private function getValidWithdrawalDests(): array
$role = 'expense_account';
}

$key = (string) trans('firefly.opt_group_' . $role);
$key = (string) trans('firefly.opt_group_'.$role);
$grouped[$key][$account->id] = $name;
}

Expand All @@ -222,9 +223,9 @@ private function getLiabilities(): array
foreach ($accountList as $account) {
$balance = app('steam')->balance($account, today());
$currency = $this->accountRepository->getAccountCurrency($account) ?? $defaultCurrency;
$role = 'l_' . $account->accountType->type;
$key = (string) trans('firefly.opt_group_' . $role);
$grouped[$key][$account->id] = $account->name . ' (' . app('amount')->formatAnything($currency, $balance, false) . ')';
$role = 'l_'.$account->accountType->type;
$key = (string) trans('firefly.opt_group_'.$role);
$grouped[$key][$account->id] = $account->name.' ('.app('amount')->formatAnything($currency, $balance, false).')';
}

return $grouped;
Expand All @@ -243,15 +244,15 @@ private function getAssetAccounts(): array
// group accounts:
/** @var Account $account */
foreach ($accountList as $account) {
$balance = app('steam')->balance($account, today());
$currency = $this->accountRepository->getAccountCurrency($account) ?? $defaultCurrency;
$role = (string) $this->accountRepository->getMetaValue($account, 'account_role');
$balance = app('steam')->balance($account, today());
$currency = $this->accountRepository->getAccountCurrency($account) ?? $defaultCurrency;
$role = (string) $this->accountRepository->getMetaValue($account, 'account_role');
if ('' === $role) {
$role = 'no_account_type';
}

$key = (string) trans('firefly.opt_group_' . $role);
$grouped[$key][$account->id] = $account->name . ' (' . app('amount')->formatAnything($currency, $balance, false) . ')';
$key = (string) trans('firefly.opt_group_'.$role);
$grouped[$key][$account->id] = $account->name.' ('.app('amount')->formatAnything($currency, $balance, false).')';
}

return $grouped;
Expand Down Expand Up @@ -283,7 +284,7 @@ public function postIndex(Request $request, TransactionType $destinationType, Tr
// correct transfers:
$group->refresh();

session()->flash('success', (string) trans('firefly.converted_to_' . $destinationType->type));
session()->flash('success', (string) trans('firefly.converted_to_'.$destinationType->type));
event(new UpdatedTransactionGroup($group, true, true));

return redirect(route('transactions.show', [$group->id]));
Expand All @@ -295,14 +296,14 @@ public function postIndex(Request $request, TransactionType $destinationType, Tr
private function convertJournal(TransactionJournal $journal, TransactionType $transactionType, array $data): TransactionJournal
{
/** @var AccountValidator $validator */
$validator = app(AccountValidator::class);
$validator = app(AccountValidator::class);
$validator->setUser(auth()->user());
$validator->setTransactionType($transactionType->type);

$sourceId = $data['source_id'][$journal->id] ?? null;
$sourceName = $data['source_name'][$journal->id] ?? null;
$destinationId = $data['destination_id'][$journal->id] ?? null;
$destinationName = $data['destination_name'][$journal->id] ?? null;
$sourceId = $data['source_id'][$journal->id] ?? null;
$sourceName = $data['source_name'][$journal->id] ?? null;
$destinationId = $data['destination_id'][$journal->id] ?? null;
$destinationName = $data['destination_name'][$journal->id] ?? null;

// double check it's not an empty string.
$sourceId = '' === $sourceId || null === $sourceId ? null : (int) $sourceId;
Expand All @@ -321,7 +322,7 @@ private function convertJournal(TransactionJournal $journal, TransactionType $tr

// TODO typeOverrule: the account validator may have another opinion on the transaction type.

$update = [
$update = [
'source_id' => $sourceId,
'source_name' => $sourceName,
'destination_id' => $destinationId,
Expand All @@ -342,9 +343,8 @@ private function convertJournal(TransactionJournal $journal, TransactionType $tr
}
}


/** @var JournalUpdateService $service */
$service = app(JournalUpdateService::class);
$service = app(JournalUpdateService::class);
$service->setTransactionJournal($journal);
$service->setData($update);
$service->update();
Expand Down
2 changes: 1 addition & 1 deletion app/Support/Http/Controllers/PeriodOverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ protected function getNoCategoryPeriodOverview(Carbon $theDate): array
$first = $this->journalRepos->firstNull();
$start = null === $first ? new Carbon() : $first->date;
$end = clone $theDate;
$end = app('navigation')->endOfPeriod($end, $range);
$end = app('navigation')->endOfPeriod($end, $range);

app('log')->debug(sprintf('Start for getNoCategoryPeriodOverview() is %s', $start->format('Y-m-d')));
app('log')->debug(sprintf('End for getNoCategoryPeriodOverview() is %s', $end->format('Y-m-d')));
Expand Down
20 changes: 10 additions & 10 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- #8907
- #8911
- #8929
- #8930
- #8951
- #8957
- #8958
- #8893
- #8954
- #8927
- [Issue 8907](https://github.com/firefly-iii/firefly-iii/issues/8907) (Error when adding initial balance: bcadd(): Argument #2 ($num2) must be of type string, int given) reported by @wnklmnn
- [Issue 8911](https://github.com/firefly-iii/firefly-iii/issues/8911) (Docker container startup very slow) reported by @daften
- [PR 8929](https://github.com/firefly-iii/firefly-iii/pull/8929) (icon title chgd from Deposit to Transfer) reported by @stevewasiura
- [PR 8930](https://github.com/firefly-iii/firefly-iii/pull/8930) (icon title chgd from Deposit to Transfer) reported by @stevewasiura
- [PR 8951](https://github.com/firefly-iii/firefly-iii/pull/8951) (add icon for delete action) reported by @stevewasiura
- [PR 8957](https://github.com/firefly-iii/firefly-iii/pull/8957) (Remove nesting level for markdown) reported by @JeroenED
- [Issue 8958](https://github.com/firefly-iii/firefly-iii/issues/8958) (Weird line appears above the UI when clicking on matching transactions for a rule) reported by @avee87
- [Issue 8893](https://github.com/firefly-iii/firefly-iii/issues/8893) (API: `reconciled: false` does not have precedence) reported by @dreautall
- [Issue 8954](https://github.com/firefly-iii/firefly-iii/issues/8954) (Wrong calculation of transaction without category) reported by @anarion80
- [Issue 8927](https://github.com/firefly-iii/firefly-iii/issues/8927) (Converting deposit to transfer can set incorrect transaction currency) reported by @avee87
- Various issues in release train.
- There is a confirmation again before you delete data using the page in your profile

Expand Down
12 changes: 6 additions & 6 deletions 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 config/firefly.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
'expression_engine' => false,
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2024-06-13',
'version' => '6.1.17',
'api_version' => '2.1.0',
'db_version' => 24,

Expand Down
Loading

0 comments on commit 2d7d05e

Please sign in to comment.