diff --git a/CHANGELOG.md b/CHANGELOG.md index 82d0da3566..c245627b66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). + + +## [4.0.2] - 2016-10-14 +### Added +- Added ``intl`` dependency to composer file to ease installation (thanks @telyn) +- Added support for Croatian. + +### Changed +- Updated all copyright notices to refer to the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/) +- Fixed #344 +- Fixed #346, thanks to @SanderKleykens +- #351 +- Did some internal remodelling. + +### Fixed +- PostgreSQL compatibility thanks to @SanderKleykens +- @RobertHorlings fixed a bug in the ABN Amro import specific. + + ## [4.0.1] - 2016-10-04 ### Added - New ING import specific by @tomwerf diff --git a/app/Bootstrap/ConfigureLogging.php b/app/Bootstrap/ConfigureLogging.php index eff190f44c..03b704d0f2 100644 --- a/app/Bootstrap/ConfigureLogging.php +++ b/app/Bootstrap/ConfigureLogging.php @@ -3,8 +3,10 @@ * ConfigureLogging.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Console/Commands/EncryptFile.php b/app/Console/Commands/EncryptFile.php index 734da2de91..415649f9a4 100644 --- a/app/Console/Commands/EncryptFile.php +++ b/app/Console/Commands/EncryptFile.php @@ -3,8 +3,10 @@ * EncryptFile.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Console/Commands/Import.php b/app/Console/Commands/Import.php index 44a10acbe4..7b8c77e9f3 100644 --- a/app/Console/Commands/Import.php +++ b/app/Console/Commands/Import.php @@ -3,8 +3,10 @@ * Import.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Console/Commands/ScanAttachments.php b/app/Console/Commands/ScanAttachments.php index 1f9293335f..04254afb6f 100644 --- a/app/Console/Commands/ScanAttachments.php +++ b/app/Console/Commands/ScanAttachments.php @@ -3,8 +3,10 @@ * ScanAttachments.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Console/Commands/UpgradeFireflyInstructions.php b/app/Console/Commands/UpgradeFireflyInstructions.php index 8b14d6e545..2a4a801ade 100644 --- a/app/Console/Commands/UpgradeFireflyInstructions.php +++ b/app/Console/Commands/UpgradeFireflyInstructions.php @@ -3,8 +3,10 @@ * UpgradeFireflyInstructions.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Console/Commands/VerifyDatabase.php b/app/Console/Commands/VerifyDatabase.php index c14a9187f1..eb99c2b3cd 100644 --- a/app/Console/Commands/VerifyDatabase.php +++ b/app/Console/Commands/VerifyDatabase.php @@ -3,8 +3,10 @@ * VerifyDatabase.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -195,7 +197,7 @@ class VerifyDatabase extends Command $date = is_null($entry->transaction_deleted_at) ? $entry->journal_deleted_at : $entry->transaction_deleted_at; $this->error( 'Error: Account #' . $entry->account_id . ' should have been deleted, but has not.' . - ' Find it in the table called `accounts` and change the `deleted_at` field to: "' . $date . '"' + ' Find it in the table called "accounts" and change the "deleted_at" field to: "' . $date . '"' ); } } @@ -222,7 +224,7 @@ class VerifyDatabase extends Command foreach ($set as $entry) { $this->error( 'Error: Transaction #' . $entry->transaction_id . ' should have been deleted, but has not.' . - ' Find it in the table called `transactions` and change the `deleted_at` field to: "' . $entry->journal_deleted . '"' + ' Find it in the table called "transactions" and change the "deleted_at" field to: "' . $entry->journal_deleted . '"' ); } } @@ -240,7 +242,7 @@ class VerifyDatabase extends Command foreach ($set as $entry) { $this->error( - 'Error: Journal #' . $entry->id . ' has zero transactions. Open table `transaction_journals` and delete the entry with id #' . $entry->id + 'Error: Journal #' . $entry->id . ' has zero transactions. Open table "transaction_journals" and delete the entry with id #' . $entry->id ); } @@ -301,7 +303,7 @@ class VerifyDatabase extends Command foreach ($set as $entry) { $this->error( 'Error: Transaction journal #' . $entry->journal_id . ' should have been deleted, but has not.' . - ' Find it in the table called `transaction_journals` and change the `deleted_at` field to: "' . $entry->transaction_deleted . '"' + ' Find it in the table called "transaction_journals" and change the "deleted_at" field to: "' . $entry->transaction_deleted . '"' ); } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 363eccabf5..d3f6037429 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -3,8 +3,10 @@ * Kernel.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Crud/Account/AccountCrud.php b/app/Crud/Account/AccountCrud.php deleted file mode 100644 index e5feeba19e..0000000000 --- a/app/Crud/Account/AccountCrud.php +++ /dev/null @@ -1,561 +0,0 @@ -user = $user; - } - - /** - * @param Account $account - * @param Account $moveTo - * - * @return bool - */ - public function destroy(Account $account, Account $moveTo): bool - { - if (!is_null($moveTo->id)) { - DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]); - } - if (!is_null($account)) { - $account->delete(); - } - - return true; - } - - /** - * @param $accountId - * - * @return Account - */ - public function find(int $accountId): Account - { - $account = $this->user->accounts()->find($accountId); - if (is_null($account)) { - return new Account; - } - - return $account; - } - - /** - * @param string $number - * @param array $types - * - * @return Account - */ - public function findByAccountNumber(string $number, array $types): Account - { - $query = $this->user->accounts() - ->leftJoin('account_meta', 'account_meta.account_id', '=', 'accounts.id') - ->where('account_meta.name', 'accountNumber') - ->where('account_meta.data', json_encode($number)); - - if (count($types) > 0) { - $query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id'); - $query->whereIn('account_types.type', $types); - } - - /** @var Collection $accounts */ - $accounts = $query->get(['accounts.*']); - if ($accounts->count() > 0) { - return $accounts->first(); - } - - return new Account; - } - - /** - * @param string $iban - * @param array $types - * - * @return Account - */ - public function findByIban(string $iban, array $types): Account - { - $query = $this->user->accounts()->where('iban', '!=', ''); - - if (count($types) > 0) { - $query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id'); - $query->whereIn('account_types.type', $types); - } - - $accounts = $query->get(['accounts.*']); - /** @var Account $account */ - foreach ($accounts as $account) { - if ($account->iban === $iban) { - return $account; - } - } - - return new Account; - } - - /** - * @param string $name - * @param array $types - * - * @return Account - */ - public function findByName(string $name, array $types): Account - { - $query = $this->user->accounts(); - - if (count($types) > 0) { - $query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id'); - $query->whereIn('account_types.type', $types); - - } - Log::debug(sprintf('Searching for account named %s of the following type(s)', $name), ['types' => $types]); - - $accounts = $query->get(['accounts.*']); - /** @var Account $account */ - foreach ($accounts as $account) { - if ($account->name === $name) { - Log::debug(sprintf('Found #%d (%s) with type id %d', $account->id, $account->name, $account->account_type_id)); - - return $account; - } - } - Log::debug('Found nothing.'); - - return new Account; - } - - /** - * @param array $accountIds - * - * @return Collection - */ - public function getAccountsById(array $accountIds): Collection - { - /** @var Collection $result */ - $query = $this->user->accounts()->with( - ['accountmeta' => function (HasMany $query) { - $query->where('name', 'accountRole'); - }] - ); - - if (count($accountIds) > 0) { - $query->whereIn('accounts.id', $accountIds); - } - - $result = $query->get(['accounts.*']); - $result = $result->sortBy( - function (Account $account) { - return strtolower($account->name); - } - ); - - return $result; - } - - /** - * @param array $types - * - * @return Collection - */ - public function getAccountsByType(array $types): Collection - { - /** @var Collection $result */ - $query = $this->user->accounts()->with( - ['accountmeta' => function (HasMany $query) { - $query->where('name', 'accountRole'); - }] - ); - if (count($types) > 0) { - $query->accountTypeIn($types); - } - - $result = $query->get(['accounts.*']); - $result = $result->sortBy( - function (Account $account) { - return strtolower($account->name); - } - ); - - return $result; - } - - /** - * @param array $types - * - * @return Collection - */ - public function getActiveAccountsByType(array $types): Collection - { - /** @var Collection $result */ - $query = $this->user->accounts()->with( - ['accountmeta' => function (HasMany $query) { - $query->where('name', 'accountRole'); - }] - ); - if (count($types) > 0) { - $query->accountTypeIn($types); - } - $query->where('active', 1); - $result = $query->get(['accounts.*']); - $result = $result->sortBy( - function (Account $account) { - return strtolower($account->name); - } - ); - - return $result; - } - - /** - * @param array $data - * - * @return Account - */ - public function store(array $data): Account - { - $newAccount = $this->storeAccount($data); - if (!is_null($newAccount->id)) { - $this->storeMetadata($newAccount, $data); - } - - if ($data['openingBalance'] != 0) { - $this->storeInitialBalance($newAccount, $data); - } - - return $newAccount; - - } - - /** - * @param $account - * @param $name - * @param $value - * - * @return AccountMeta - */ - public function storeMeta(Account $account, string $name, $value): AccountMeta - { - return AccountMeta::create(['name' => $name, 'data' => $value, 'account_id' => $account->id,]); - } - - /** - * @param Account $account - * @param array $data - * - * @return Account - */ - public function update(Account $account, array $data): Account - { - // update the account: - $account->name = $data['name']; - $account->active = $data['active'] == '1' ? true : false; - $account->virtual_balance = $data['virtualBalance']; - $account->iban = $data['iban']; - $account->save(); - - $this->updateMetadata($account, $data); - $this->updateInitialBalance($account, $data); - - return $account; - } - - /** - * @param Account $account - * @param string $type - * - * @return Account - */ - public function updateAccountType(Account $account, string $type): Account - { - $type = AccountType::whereType($type)->first(); - if (!is_null($type)) { - $account->accountType()->associate($type); - $account->save(); - } - - return $this->find($account->id); - - } - - /** - * @param array $data - * - * @return Account - */ - protected function storeAccount(array $data): Account - { - $type = config('firefly.accountTypeByIdentifier.' . $data['accountType']); - $accountType = AccountType::whereType($type)->first(); - $newAccount = new Account( - [ - 'user_id' => $data['user'], - 'account_type_id' => $accountType->id, - 'name' => $data['name'], - 'virtual_balance' => $data['virtualBalance'], - 'active' => $data['active'] === true ? true : false, - 'iban' => $data['iban'], - ] - ); - - if (!$newAccount->isValid()) { - // does the account already exist? - $searchData = [ - 'user_id' => $data['user'], - 'account_type_id' => $accountType->id, - 'virtual_balance' => $data['virtualBalance'], - 'name' => $data['name'], - 'iban' => $data['iban'], - ]; - $existingAccount = Account::firstOrNullEncrypted($searchData); - if (!$existingAccount) { - Log::error('Account create error', $newAccount->getErrors()->toArray()); - - return new Account; - } - $newAccount = $existingAccount; - - } - $newAccount->save(); - - return $newAccount; - } - - /** - * @param Account $account - * @param array $data - * - * @return TransactionJournal - */ - protected function storeInitialBalance(Account $account, array $data): TransactionJournal - { - $amount = $data['openingBalance']; - $user = $data['user']; - $name = $data['name']; - $opposing = $this->storeOpposingAccount($amount, $user, $name); - $transactionType = TransactionType::whereType(TransactionType::OPENING_BALANCE)->first(); - $journal = TransactionJournal::create( - [ - 'user_id' => $data['user'], - 'transaction_type_id' => $transactionType->id, - 'transaction_currency_id' => $data['openingBalanceCurrency'], - 'description' => 'Initial balance for "' . $account->name . '"', - 'completed' => true, - 'date' => $data['openingBalanceDate'], - 'encrypted' => true, - ] - ); - - $firstAccount = $account; - $secondAccount = $opposing; - $firstAmount = $amount; - $secondAmount = $amount * -1; - - if ($data['openingBalance'] < 0) { - $firstAccount = $opposing; - $secondAccount = $account; - $firstAmount = $amount * -1; - $secondAmount = $amount; - } - - $one = new Transaction(['account_id' => $firstAccount->id, 'transaction_journal_id' => $journal->id, 'amount' => $firstAmount]); - $one->save();// first transaction: from - $two = new Transaction(['account_id' => $secondAccount->id, 'transaction_journal_id' => $journal->id, 'amount' => $secondAmount]); - $two->save(); // second transaction: to - - return $journal; - } - - /** - * @param Account $account - * @param array $data - */ - protected function storeMetadata(Account $account, array $data) - { - foreach ($this->validFields as $field) { - if (isset($data[$field])) { - $metaData = new AccountMeta( - [ - 'account_id' => $account->id, - 'name' => $field, - 'data' => $data[$field], - ] - ); - $metaData->save(); - } - } - } - - /** - * @param Account $account - * @param array $data - * - * @return bool - */ - protected function updateInitialBalance(Account $account, array $data): bool - { - $openingBalance = $this->openingBalanceTransaction($account); - if ($data['openingBalance'] != 0) { - if (!is_null($openingBalance->id)) { - $date = $data['openingBalanceDate']; - $amount = $data['openingBalance']; - - return $this->updateJournal($account, $openingBalance, $date, $amount); - } - - $this->storeInitialBalance($account, $data); - - return true; - } - // else, delete it: - if ($openingBalance) { // opening balance is zero, should we delete it? - $openingBalance->delete(); // delete existing opening balance. - } - - return true; - } - - /** - * @param Account $account - * @param array $data - * - */ - protected function updateMetadata(Account $account, array $data) - { - foreach ($this->validFields as $field) { - $entry = $account->accountMeta()->where('name', $field)->first(); - - if (isset($data[$field])) { - // update if new data is present: - if (!is_null($entry)) { - $entry->data = $data[$field]; - $entry->save(); - - continue; - } - $metaData = new AccountMeta( - [ - 'account_id' => $account->id, - 'name' => $field, - 'data' => $data[$field], - ] - ); - $metaData->save(); - } - } - - } - - /** - * @param Account $account - * - * @return TransactionJournal|null - */ - private function openingBalanceTransaction(Account $account): TransactionJournal - { - $journal = TransactionJournal - ::sortCorrectly() - ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->where('transactions.account_id', $account->id) - ->transactionTypes([TransactionType::OPENING_BALANCE]) - ->first(['transaction_journals.*']); - if (is_null($journal)) { - return new TransactionJournal; - } - - return $journal; - } - - /** - * @param float $amount - * @param int $user - * @param string $name - * - * @return Account - */ - private function storeOpposingAccount(float $amount, int $user, string $name):Account - { - $type = $amount < 0 ? 'expense' : 'revenue'; - $opposingData = [ - 'user' => $user, - 'accountType' => $type, - 'name' => $name . ' initial balance', - 'active' => false, - 'iban' => '', - 'virtualBalance' => 0, - ]; - - return $this->storeAccount($opposingData); - } - - /** - * @param Account $account - * @param TransactionJournal $journal - * @param Carbon $date - * @param float $amount - * - * @return bool - */ - private function updateJournal(Account $account, TransactionJournal $journal, Carbon $date, float $amount): bool - { - // update date: - $journal->date = $date; - $journal->save(); - // update transactions: - /** @var Transaction $transaction */ - foreach ($journal->transactions()->get() as $transaction) { - if ($account->id == $transaction->account_id) { - $transaction->amount = $amount; - $transaction->save(); - } - if ($account->id != $transaction->account_id) { - $transaction->amount = $amount * -1; - $transaction->save(); - } - } - - return true; - - } -} diff --git a/app/Crud/Account/AccountCrudInterface.php b/app/Crud/Account/AccountCrudInterface.php deleted file mode 100644 index 3f4ebf45e2..0000000000 --- a/app/Crud/Account/AccountCrudInterface.php +++ /dev/null @@ -1,116 +0,0 @@ -storeAccounts($journal->transactionType->type, $transaction); @@ -71,11 +74,11 @@ class Journal implements JournalInterface /** @var Transaction $one */ $one = Transaction::create( ['account_id' => $sourceAccount->id, 'transaction_journal_id' => $journal->id, 'amount' => $transaction['amount'] * -1, - 'description' => $transaction['description']] + 'description' => $transaction['description'], 'identifier' => $identifier] ); $two = Transaction::create( ['account_id' => $destinationAccount->id, 'transaction_journal_id' => $journal->id, 'amount' => $transaction['amount'], - 'description' => $transaction['description']] + 'description' => $transaction['description'], 'identifier' => $identifier] ); if (strlen($transaction['category']) > 0) { @@ -116,8 +119,10 @@ class Journal implements JournalInterface // delete original transactions, and recreate them. $journal->transactions()->delete(); + $identifier = 0; foreach ($data['transactions'] as $transaction) { - $this->storeTransaction($journal, $transaction); + $this->storeTransaction($journal, $transaction, $identifier); + $identifier++; } $journal->completed = true; diff --git a/app/Crud/Split/JournalInterface.php b/app/Crud/Split/JournalInterface.php index 15793101f2..e296a1114c 100644 --- a/app/Crud/Split/JournalInterface.php +++ b/app/Crud/Split/JournalInterface.php @@ -3,8 +3,10 @@ * JournalInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -32,10 +34,11 @@ interface JournalInterface /** * @param TransactionJournal $journal * @param array $transaction + * @param int $identifier * * @return Collection */ - public function storeTransaction(TransactionJournal $journal, array $transaction): Collection; + public function storeTransaction(TransactionJournal $journal, array $transaction, int $identifier): Collection; /** * @param TransactionJournal $journal diff --git a/app/Events/BudgetLimitStored.php b/app/Events/BudgetLimitStored.php index bcfa5f4083..3a60ceabd6 100644 --- a/app/Events/BudgetLimitStored.php +++ b/app/Events/BudgetLimitStored.php @@ -3,8 +3,10 @@ * BudgetLimitStored.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/BudgetLimitUpdated.php b/app/Events/BudgetLimitUpdated.php index f953b84285..596c59c8b2 100644 --- a/app/Events/BudgetLimitUpdated.php +++ b/app/Events/BudgetLimitUpdated.php @@ -3,8 +3,10 @@ * BudgetLimitUpdated.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/Event.php b/app/Events/Event.php index 65b6e30824..feaaa07846 100644 --- a/app/Events/Event.php +++ b/app/Events/Event.php @@ -3,8 +3,10 @@ * Event.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/ResendConfirmation.php b/app/Events/ResendConfirmation.php index 0b49a2c3f6..cb14ea8b75 100644 --- a/app/Events/ResendConfirmation.php +++ b/app/Events/ResendConfirmation.php @@ -3,8 +3,10 @@ * ResendConfirmation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/TransactionJournalStored.php b/app/Events/TransactionJournalStored.php index 74d2be5d8b..6269425485 100644 --- a/app/Events/TransactionJournalStored.php +++ b/app/Events/TransactionJournalStored.php @@ -3,8 +3,10 @@ * TransactionJournalStored.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/TransactionJournalUpdated.php b/app/Events/TransactionJournalUpdated.php index 03ed37a609..862fcef4db 100644 --- a/app/Events/TransactionJournalUpdated.php +++ b/app/Events/TransactionJournalUpdated.php @@ -3,8 +3,10 @@ * TransactionJournalUpdated.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/TransactionStored.php b/app/Events/TransactionStored.php index bb50964738..1233ff43fd 100644 --- a/app/Events/TransactionStored.php +++ b/app/Events/TransactionStored.php @@ -3,8 +3,10 @@ * TransactionStored.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/UserIsConfirmed.php b/app/Events/UserIsConfirmed.php index 8313d835a0..0da2da63b4 100644 --- a/app/Events/UserIsConfirmed.php +++ b/app/Events/UserIsConfirmed.php @@ -3,8 +3,10 @@ * UserIsConfirmed.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/UserIsDeleted.php b/app/Events/UserIsDeleted.php index 34459decec..4312cc0178 100644 --- a/app/Events/UserIsDeleted.php +++ b/app/Events/UserIsDeleted.php @@ -3,8 +3,10 @@ * UserIsDeleted.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Events/UserRegistration.php b/app/Events/UserRegistration.php index 46670d59d1..0af1bc833e 100644 --- a/app/Events/UserRegistration.php +++ b/app/Events/UserRegistration.php @@ -3,8 +3,10 @@ * UserRegistration.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Exceptions/FireflyException.php b/app/Exceptions/FireflyException.php index 7f61b642c8..7b288959a2 100644 --- a/app/Exceptions/FireflyException.php +++ b/app/Exceptions/FireflyException.php @@ -3,8 +3,10 @@ * FireflyException.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index bc8f6e9fd1..4f9d8b6675 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,8 +3,10 @@ * Handler.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -106,7 +108,8 @@ class Handler extends ExceptionHandler /** * Convert an authentication exception into an unauthenticated response. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ protected function unauthenticated($request) diff --git a/app/Exceptions/NotImplementedException.php b/app/Exceptions/NotImplementedException.php index 6cab7e0510..406989bf09 100644 --- a/app/Exceptions/NotImplementedException.php +++ b/app/Exceptions/NotImplementedException.php @@ -3,8 +3,10 @@ * NotImplementedException.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Exceptions/ValidationException.php b/app/Exceptions/ValidationException.php index f7e2251ee6..5de31b4fdd 100644 --- a/app/Exceptions/ValidationException.php +++ b/app/Exceptions/ValidationException.php @@ -3,8 +3,10 @@ * ValidationException.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php index a0caa261ce..2fcb534b13 100644 --- a/app/Export/Collector/AttachmentCollector.php +++ b/app/Export/Collector/AttachmentCollector.php @@ -3,8 +3,10 @@ * AttachmentCollector.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Collector/BasicCollector.php b/app/Export/Collector/BasicCollector.php index b6f0f1e7cb..353dfaf04a 100644 --- a/app/Export/Collector/BasicCollector.php +++ b/app/Export/Collector/BasicCollector.php @@ -3,8 +3,10 @@ * BasicCollector.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Collector/CollectorInterface.php b/app/Export/Collector/CollectorInterface.php index 05c4c52d8b..abf427c2d2 100644 --- a/app/Export/Collector/CollectorInterface.php +++ b/app/Export/Collector/CollectorInterface.php @@ -3,8 +3,10 @@ * CollectorInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Collector/UploadCollector.php b/app/Export/Collector/UploadCollector.php index d2900e51ff..b60a17035f 100644 --- a/app/Export/Collector/UploadCollector.php +++ b/app/Export/Collector/UploadCollector.php @@ -3,8 +3,10 @@ * UploadCollector.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/ConfigurationFile.php b/app/Export/ConfigurationFile.php index 778369dbe8..be32ea8df5 100644 --- a/app/Export/ConfigurationFile.php +++ b/app/Export/ConfigurationFile.php @@ -3,8 +3,10 @@ * ConfigurationFile.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Entry/Entry.php b/app/Export/Entry/Entry.php index 531d6ef72b..fb7c12b68a 100644 --- a/app/Export/Entry/Entry.php +++ b/app/Export/Entry/Entry.php @@ -3,8 +3,10 @@ * Entry.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Entry/EntryAccount.php b/app/Export/Entry/EntryAccount.php index da23d80b68..8ea2f95b8e 100644 --- a/app/Export/Entry/EntryAccount.php +++ b/app/Export/Entry/EntryAccount.php @@ -3,8 +3,10 @@ * EntryAccount.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Entry/EntryBill.php b/app/Export/Entry/EntryBill.php index 696fb58985..723975253a 100644 --- a/app/Export/Entry/EntryBill.php +++ b/app/Export/Entry/EntryBill.php @@ -3,8 +3,10 @@ * EntryBill.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Entry/EntryBudget.php b/app/Export/Entry/EntryBudget.php index 0ca9d38ae5..cbad41a283 100644 --- a/app/Export/Entry/EntryBudget.php +++ b/app/Export/Entry/EntryBudget.php @@ -3,8 +3,10 @@ * EntryBudget.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Entry/EntryCategory.php b/app/Export/Entry/EntryCategory.php index 8a8de50dfa..051137f11f 100644 --- a/app/Export/Entry/EntryCategory.php +++ b/app/Export/Entry/EntryCategory.php @@ -3,8 +3,10 @@ * EntryCategory.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Exporter/BasicExporter.php b/app/Export/Exporter/BasicExporter.php index feed1a8674..b16b19776a 100644 --- a/app/Export/Exporter/BasicExporter.php +++ b/app/Export/Exporter/BasicExporter.php @@ -3,8 +3,10 @@ * BasicExporter.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Exporter/CsvExporter.php b/app/Export/Exporter/CsvExporter.php index 2fd8b88da2..d13497ce6a 100644 --- a/app/Export/Exporter/CsvExporter.php +++ b/app/Export/Exporter/CsvExporter.php @@ -3,8 +3,10 @@ * CsvExporter.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Exporter/ExporterInterface.php b/app/Export/Exporter/ExporterInterface.php index a529f02be6..9b8a4e4ed9 100644 --- a/app/Export/Exporter/ExporterInterface.php +++ b/app/Export/Exporter/ExporterInterface.php @@ -3,8 +3,10 @@ * ExporterInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Export/Processor.php b/app/Export/Processor.php index c3d23b7091..f5c69be451 100644 --- a/app/Export/Processor.php +++ b/app/Export/Processor.php @@ -3,8 +3,10 @@ * Processor.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Account/AccountChartGeneratorInterface.php b/app/Generator/Chart/Account/AccountChartGeneratorInterface.php index 48304d6245..c27376b837 100644 --- a/app/Generator/Chart/Account/AccountChartGeneratorInterface.php +++ b/app/Generator/Chart/Account/AccountChartGeneratorInterface.php @@ -3,8 +3,10 @@ * AccountChartGeneratorInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php index 13a0e066ef..215a9969b0 100644 --- a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php +++ b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php @@ -3,8 +3,10 @@ * ChartJsAccountChartGenerator.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Bill/BillChartGeneratorInterface.php b/app/Generator/Chart/Bill/BillChartGeneratorInterface.php index 6ad00c4606..27b1c11cef 100644 --- a/app/Generator/Chart/Bill/BillChartGeneratorInterface.php +++ b/app/Generator/Chart/Bill/BillChartGeneratorInterface.php @@ -3,8 +3,10 @@ * BillChartGeneratorInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php index 5125c4bc16..e59b49f136 100644 --- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php +++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php @@ -3,8 +3,10 @@ * ChartJsBillChartGenerator.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Budget/BudgetChartGeneratorInterface.php b/app/Generator/Chart/Budget/BudgetChartGeneratorInterface.php index 7e1e8f8d2a..fc466aa418 100644 --- a/app/Generator/Chart/Budget/BudgetChartGeneratorInterface.php +++ b/app/Generator/Chart/Budget/BudgetChartGeneratorInterface.php @@ -3,8 +3,10 @@ * BudgetChartGeneratorInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php index 105db7462a..f82fb807c5 100644 --- a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php +++ b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php @@ -3,8 +3,10 @@ * ChartJsBudgetChartGenerator.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php b/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php index 834f19aa12..56d57f6966 100644 --- a/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php +++ b/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php @@ -3,8 +3,10 @@ * CategoryChartGeneratorInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php index 28e7b87c47..631b867cd1 100644 --- a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php +++ b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php @@ -3,8 +3,10 @@ * ChartJsCategoryChartGenerator.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php index e31a8a23ec..2908fa0661 100644 --- a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php +++ b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php @@ -3,8 +3,10 @@ * ChartJsPiggyBankChartGenerator.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/PiggyBank/PiggyBankChartGeneratorInterface.php b/app/Generator/Chart/PiggyBank/PiggyBankChartGeneratorInterface.php index 14bf3888e9..2841cd928e 100644 --- a/app/Generator/Chart/PiggyBank/PiggyBankChartGeneratorInterface.php +++ b/app/Generator/Chart/PiggyBank/PiggyBankChartGeneratorInterface.php @@ -3,8 +3,10 @@ * PiggyBankChartGeneratorInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php index c3d411093b..1cdb1bdedd 100644 --- a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php +++ b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php @@ -3,8 +3,10 @@ * ChartJsReportChartGenerator.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Generator/Chart/Report/ReportChartGeneratorInterface.php b/app/Generator/Chart/Report/ReportChartGeneratorInterface.php index df15fd750f..021fad844a 100644 --- a/app/Generator/Chart/Report/ReportChartGeneratorInterface.php +++ b/app/Generator/Chart/Report/ReportChartGeneratorInterface.php @@ -3,8 +3,10 @@ * ReportChartGeneratorInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/AttachUserRole.php b/app/Handlers/Events/AttachUserRole.php index e41d18dfff..15855e3391 100644 --- a/app/Handlers/Events/AttachUserRole.php +++ b/app/Handlers/Events/AttachUserRole.php @@ -3,8 +3,10 @@ * AttachUserRole.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/BudgetLimitEventHandler.php b/app/Handlers/Events/BudgetLimitEventHandler.php index d7eb7327c4..a05a752cd2 100644 --- a/app/Handlers/Events/BudgetLimitEventHandler.php +++ b/app/Handlers/Events/BudgetLimitEventHandler.php @@ -3,8 +3,10 @@ * BudgetLimitEventHandler.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/ConnectJournalToPiggyBank.php b/app/Handlers/Events/ConnectJournalToPiggyBank.php index ae1b0c6188..1d7d75d28c 100644 --- a/app/Handlers/Events/ConnectJournalToPiggyBank.php +++ b/app/Handlers/Events/ConnectJournalToPiggyBank.php @@ -3,8 +3,10 @@ * ConnectJournalToPiggyBank.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/ConnectTransactionToPiggyBank.php b/app/Handlers/Events/ConnectTransactionToPiggyBank.php index c96c9dbfaa..8e56987a0d 100644 --- a/app/Handlers/Events/ConnectTransactionToPiggyBank.php +++ b/app/Handlers/Events/ConnectTransactionToPiggyBank.php @@ -3,8 +3,10 @@ * ConnectTransactionToPiggyBank.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/FireRulesForStore.php b/app/Handlers/Events/FireRulesForStore.php index a789585bcd..65cc16d67a 100644 --- a/app/Handlers/Events/FireRulesForStore.php +++ b/app/Handlers/Events/FireRulesForStore.php @@ -3,8 +3,10 @@ * FireRulesForStore.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/FireRulesForUpdate.php b/app/Handlers/Events/FireRulesForUpdate.php index e3c76bf9d0..889d1e3156 100644 --- a/app/Handlers/Events/FireRulesForUpdate.php +++ b/app/Handlers/Events/FireRulesForUpdate.php @@ -3,8 +3,10 @@ * FireRulesForUpdate.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/ScanForBillsAfterStore.php b/app/Handlers/Events/ScanForBillsAfterStore.php index 090fd852ef..499370eab9 100644 --- a/app/Handlers/Events/ScanForBillsAfterStore.php +++ b/app/Handlers/Events/ScanForBillsAfterStore.php @@ -3,8 +3,10 @@ * ScanForBillsAfterStore.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/ScanForBillsAfterUpdate.php b/app/Handlers/Events/ScanForBillsAfterUpdate.php index b8b1c1b9ba..11ddfee6aa 100644 --- a/app/Handlers/Events/ScanForBillsAfterUpdate.php +++ b/app/Handlers/Events/ScanForBillsAfterUpdate.php @@ -3,8 +3,10 @@ * ScanForBillsAfterUpdate.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/SendRegistrationMail.php b/app/Handlers/Events/SendRegistrationMail.php index 1bc1e9f71f..aabb3714af 100644 --- a/app/Handlers/Events/SendRegistrationMail.php +++ b/app/Handlers/Events/SendRegistrationMail.php @@ -3,8 +3,10 @@ * SendRegistrationMail.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/UpdateJournalConnection.php b/app/Handlers/Events/UpdateJournalConnection.php index 4434c82862..a30f63923a 100644 --- a/app/Handlers/Events/UpdateJournalConnection.php +++ b/app/Handlers/Events/UpdateJournalConnection.php @@ -3,8 +3,10 @@ * UpdateJournalConnection.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/UserConfirmation.php b/app/Handlers/Events/UserConfirmation.php index 09300a37ed..439db35e75 100644 --- a/app/Handlers/Events/UserConfirmation.php +++ b/app/Handlers/Events/UserConfirmation.php @@ -3,8 +3,10 @@ * UserConfirmation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/UserEventListener.php b/app/Handlers/Events/UserEventListener.php index 984a9a0929..f81303d084 100644 --- a/app/Handlers/Events/UserEventListener.php +++ b/app/Handlers/Events/UserEventListener.php @@ -3,8 +3,10 @@ * UserEventListener.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Handlers/Events/UserSaveIpAddress.php b/app/Handlers/Events/UserSaveIpAddress.php index 7c9cab2917..1533d84127 100644 --- a/app/Handlers/Events/UserSaveIpAddress.php +++ b/app/Handlers/Events/UserSaveIpAddress.php @@ -3,8 +3,10 @@ * UserSaveIpAddress.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index 375f5ec915..a7bb7c8573 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -3,8 +3,10 @@ * AttachmentHelper.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Attachments/AttachmentHelperInterface.php b/app/Helpers/Attachments/AttachmentHelperInterface.php index c6de207c8b..ba98fd07db 100644 --- a/app/Helpers/Attachments/AttachmentHelperInterface.php +++ b/app/Helpers/Attachments/AttachmentHelperInterface.php @@ -3,8 +3,10 @@ * AttachmentHelperInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/Account.php b/app/Helpers/Collection/Account.php index 4f0adf563d..e3fc70e702 100644 --- a/app/Helpers/Collection/Account.php +++ b/app/Helpers/Collection/Account.php @@ -3,8 +3,10 @@ * Account.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/Balance.php b/app/Helpers/Collection/Balance.php index db1766e4af..b708321536 100644 --- a/app/Helpers/Collection/Balance.php +++ b/app/Helpers/Collection/Balance.php @@ -3,8 +3,10 @@ * Balance.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/BalanceEntry.php b/app/Helpers/Collection/BalanceEntry.php index 9e1e758022..85701ea48b 100644 --- a/app/Helpers/Collection/BalanceEntry.php +++ b/app/Helpers/Collection/BalanceEntry.php @@ -3,8 +3,10 @@ * BalanceEntry.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/BalanceHeader.php b/app/Helpers/Collection/BalanceHeader.php index 8e4c7180f6..66a6145b44 100644 --- a/app/Helpers/Collection/BalanceHeader.php +++ b/app/Helpers/Collection/BalanceHeader.php @@ -3,8 +3,10 @@ * BalanceHeader.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index 905814b011..28b0d879ba 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -3,8 +3,10 @@ * BalanceLine.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/Bill.php b/app/Helpers/Collection/Bill.php index da30164dbf..ce83c87551 100644 --- a/app/Helpers/Collection/Bill.php +++ b/app/Helpers/Collection/Bill.php @@ -3,8 +3,10 @@ * Bill.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/BillLine.php b/app/Helpers/Collection/BillLine.php index 67dada038e..07e49bc30b 100644 --- a/app/Helpers/Collection/BillLine.php +++ b/app/Helpers/Collection/BillLine.php @@ -3,8 +3,10 @@ * BillLine.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/Budget.php b/app/Helpers/Collection/Budget.php index 3d7cc056e8..8821940b3e 100644 --- a/app/Helpers/Collection/Budget.php +++ b/app/Helpers/Collection/Budget.php @@ -3,8 +3,10 @@ * Budget.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/BudgetLine.php b/app/Helpers/Collection/BudgetLine.php index 710f0cf0a7..5538c9e8f1 100644 --- a/app/Helpers/Collection/BudgetLine.php +++ b/app/Helpers/Collection/BudgetLine.php @@ -3,8 +3,10 @@ * BudgetLine.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/Category.php b/app/Helpers/Collection/Category.php index 04c356c798..7090d387ba 100644 --- a/app/Helpers/Collection/Category.php +++ b/app/Helpers/Collection/Category.php @@ -3,8 +3,10 @@ * Category.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Collection/Expense.php b/app/Helpers/Collection/Expense.php index 8550d4d86f..7a06e4f628 100644 --- a/app/Helpers/Collection/Expense.php +++ b/app/Helpers/Collection/Expense.php @@ -3,14 +3,15 @@ * Expense.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Helpers\Collection; -use FireflyIII\Models\TransactionJournal; use Illuminate\Support\Collection; use stdClass; @@ -36,36 +37,11 @@ class Expense } /** - * @param TransactionJournal $entry + * @param stdClass $entry */ - public function addOrCreateExpense(TransactionJournal $entry) + public function addOrCreateExpense(stdClass $entry) { - // add each account individually: - $destinations = TransactionJournal::destinationTransactionList($entry); - - foreach ($destinations as $transaction) { - $amount = strval($transaction->amount); - $account = $transaction->account; - if (bccomp('0', $amount) === -1) { - $amount = bcmul($amount, '-1'); - } - - $object = new stdClass; - $object->amount = $amount; - $object->name = $account->name; - $object->count = 1; - $object->id = $account->id; - - // overrule some properties: - if ($this->expenses->has($account->id)) { - $object = $this->expenses->get($account->id); - $object->amount = bcadd($object->amount, $amount); - $object->count++; - } - $this->expenses->put($account->id, $object); - } - - + $this->expenses->put($entry->id, $entry); } /** diff --git a/app/Helpers/Collection/Income.php b/app/Helpers/Collection/Income.php index 023b45dad2..1bd6036150 100644 --- a/app/Helpers/Collection/Income.php +++ b/app/Helpers/Collection/Income.php @@ -3,14 +3,15 @@ * Income.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Helpers\Collection; -use FireflyIII\Models\TransactionJournal; use Illuminate\Support\Collection; use stdClass; @@ -37,32 +38,11 @@ class Income } /** - * @param TransactionJournal $entry + * @param stdClass $entry */ - public function addOrCreateIncome(TransactionJournal $entry) + public function addOrCreateIncome(stdClass $entry) { - // add each account individually: - $sources = TransactionJournal::sourceTransactionList($entry); - - foreach ($sources as $transaction) { - $amount = strval($transaction->amount); - $account = $transaction->account; - $amount = bcmul($amount, '-1'); - - $object = new stdClass; - $object->amount = $amount; - $object->name = $account->name; - $object->count = 1; - $object->id = $account->id; - - // overrule some properties: - if ($this->incomes->has($account->id)) { - $object = $this->incomes->get($account->id); - $object->amount = bcadd($object->amount, $amount); - $object->count++; - } - $this->incomes->put($account->id, $object); - } + $this->incomes->put($entry->id, $entry); } diff --git a/app/Helpers/FiscalHelper.php b/app/Helpers/FiscalHelper.php index 177a7182b4..16e965f82b 100644 --- a/app/Helpers/FiscalHelper.php +++ b/app/Helpers/FiscalHelper.php @@ -3,8 +3,10 @@ * FiscalHelper.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/FiscalHelperInterface.php b/app/Helpers/FiscalHelperInterface.php index c8c9d4e1b3..830610fa9f 100644 --- a/app/Helpers/FiscalHelperInterface.php +++ b/app/Helpers/FiscalHelperInterface.php @@ -3,8 +3,10 @@ * FiscalHelperInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index 4a283bb224..2c7d83e219 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -3,8 +3,10 @@ * Help.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Help/HelpInterface.php b/app/Helpers/Help/HelpInterface.php index a7cb671802..28665be118 100644 --- a/app/Helpers/Help/HelpInterface.php +++ b/app/Helpers/Help/HelpInterface.php @@ -3,8 +3,10 @@ * HelpInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Report/AccountReportHelper.php b/app/Helpers/Report/AccountReportHelper.php deleted file mode 100644 index 7baa188dab..0000000000 --- a/app/Helpers/Report/AccountReportHelper.php +++ /dev/null @@ -1,142 +0,0 @@ -startBalance = '0'; - $account->endBalance = '0'; - $currentStart = $startSet->filter( - function (Account $entry) use ($account) { - return $account->id == $entry->id; - } - ); - - $currentBackup = $backupSet->filter( // grab entry from current backup as well: - function (Account $entry) use ($account) { - return $account->id == $entry->id; - } - ); - - // first try to set from backup - if (!is_null($currentBackup->first())) { - $account->startBalance = $currentBackup->first()->balance; - } - - // overrule with data from start - if (!is_null($currentStart->first())) { - $account->startBalance = $currentStart->first()->balance; - } - - $currentEnd = $endSet->filter( - function (Account $entry) use ($account) { - return $account->id == $entry->id; - } - ); - - if (!is_null($currentEnd->first())) { - $account->endBalance = $currentEnd->first()->balance; - } - - return $account; - } - - /** - * This method generates a full report for the given period on all - * given accounts. - * - * a special consideration for accounts that did exist on this exact day. - * we also grab the balance from today just in case, to see if that changes things. - * it's a fall back for users who (rightly so) start keeping score at the first of - * the month and find the first report lacking / broken. - * - * @param Carbon $start - * @param Carbon $end - * @param Collection $accounts - * - * @return AccountCollection - */ - public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts): AccountCollection - { - $startAmount = '0'; - $endAmount = '0'; - $diff = '0'; - $ids = $accounts->pluck('id')->toArray(); - $yesterday = clone $start; - $yesterday->subDay(); - $startSet = $this->getSet($ids, $yesterday); // get balances for start. - $backupSet = $this->getSet($ids, $start); - $endSet = $this->getSet($ids, $end); - - $accounts->each( - function (Account $account) use ($startSet, $endSet, $backupSet) { - return self::reportFilter($account, $startSet, $endSet, $backupSet); - } - ); - - // summarize: - foreach ($accounts as $account) { - $startAmount = bcadd($startAmount, $account->startBalance); - $endAmount = bcadd($endAmount, $account->endBalance); - $diff = bcadd($diff, bcsub($account->endBalance, $account->startBalance)); - } - - $object = new AccountCollection; - $object->setStart($startAmount); - $object->setEnd($endAmount); - $object->setDifference($diff); - $object->setAccounts($accounts); - - return $object; - } - - /** - * @param array $ids - * @param Carbon $date - * - * @return Collection - */ - private function getSet(array $ids, Carbon $date): Collection - { - return Account::leftJoin('transactions', 'transactions.account_id', '=', 'accounts.id') - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->whereIn('accounts.id', $ids) - ->whereNull('transaction_journals.deleted_at') - ->whereNull('transactions.deleted_at') - ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) - ->groupBy('accounts.id') - ->get(['accounts.id', DB::raw('SUM(`transactions`.`amount`) as `balance`')]); - } -} diff --git a/app/Helpers/Report/AccountReportHelperInterface.php b/app/Helpers/Report/AccountReportHelperInterface.php deleted file mode 100644 index 8243656853..0000000000 --- a/app/Helpers/Report/AccountReportHelperInterface.php +++ /dev/null @@ -1,38 +0,0 @@ -get( [ 't_destination.account_id', - DB::raw('SUM(`t_destination`.`amount`) as `sum`'), + DB::raw('SUM(t_destination.amount) AS sum'), ] ); diff --git a/app/Helpers/Report/BalanceReportHelperInterface.php b/app/Helpers/Report/BalanceReportHelperInterface.php index 45c6822245..5aa14d09cb 100644 --- a/app/Helpers/Report/BalanceReportHelperInterface.php +++ b/app/Helpers/Report/BalanceReportHelperInterface.php @@ -3,8 +3,10 @@ * BalanceReportHelperInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Report/BudgetReportHelper.php b/app/Helpers/Report/BudgetReportHelper.php index 4478a00066..9c250e8560 100644 --- a/app/Helpers/Report/BudgetReportHelper.php +++ b/app/Helpers/Report/BudgetReportHelper.php @@ -3,8 +3,10 @@ * BudgetReportHelper.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Report/BudgetReportHelperInterface.php b/app/Helpers/Report/BudgetReportHelperInterface.php index d776da2ead..3660447c99 100644 --- a/app/Helpers/Report/BudgetReportHelperInterface.php +++ b/app/Helpers/Report/BudgetReportHelperInterface.php @@ -3,8 +3,10 @@ * BudgetReportHelperInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 67de6c1e97..6f1a1f7529 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -3,8 +3,10 @@ * ReportHelper.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -22,7 +24,7 @@ use FireflyIII\Models\Bill; use FireflyIII\Models\Category; use FireflyIII\Models\Tag; use FireflyIII\Models\TransactionJournal; -use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; @@ -30,6 +32,7 @@ use FireflyIII\Repositories\Tag\TagRepositoryInterface; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; +use stdClass; /** * Class ReportHelper @@ -144,14 +147,14 @@ class ReportHelper implements ReportHelperInterface public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): Expense { $object = new Expense; - /** @var AccountRepositoryInterface $repos */ - $repos = app(AccountRepositoryInterface::class); - $journals = $repos->expensesInPeriod($accounts, $start, $end); - /** @var TransactionJournal $entry */ - foreach ($journals as $entry) { - $amount = TransactionJournal::amount($entry); - $object->addToTotal($amount); + /** @var AccountTaskerInterface $tasker */ + $tasker = app(AccountTaskerInterface::class); + $collection = $tasker->expenseReport($accounts, $accounts, $start, $end); + + /** @var stdClass $entry */ + foreach ($collection as $entry) { + $object->addToTotal($entry->amount); $object->addOrCreateExpense($entry); } @@ -170,13 +173,13 @@ class ReportHelper implements ReportHelperInterface public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): Income { $object = new Income; - /** @var AccountRepositoryInterface $repos */ - $repos = app(AccountRepositoryInterface::class); - $journals = $repos->incomesInPeriod($accounts, $start, $end); + /** @var AccountTaskerInterface $tasker */ + $tasker = app(AccountTaskerInterface::class); + $collection = $tasker->incomeReport($accounts, $accounts, $start, $end); - foreach ($journals as $entry) { - $amount = TransactionJournal::amount($entry); - $object->addToTotal($amount); + /** @var stdClass $entry */ + foreach ($collection as $entry) { + $object->addToTotal($entry->amount); $object->addOrCreateIncome($entry); } @@ -255,9 +258,19 @@ class ReportHelper implements ReportHelperInterface ->where('transaction_journals.date', '>=', $start->format('Y-m-d')) ->where('transaction_journals.date', '<=', $end->format('Y-m-d')) ->where( - function (Builder $q) use ($ids) { - $q->whereIn('source.account_id', $ids) - ->whereIn('destination.account_id', $ids, 'xor'); + // source.account_id in accountIds XOR destination.account_id in accountIds + function (Builder $query) use ($ids) { + $query->where( + function (Builder $q1) use ($ids) { + $q1->whereIn('source.account_id', $ids) + ->whereNotIn('destination.account_id', $ids); + } + )->orWhere( + function (Builder $q2) use ($ids) { + $q2->whereIn('destination.account_id', $ids) + ->whereNotIn('source.account_id', $ids); + } + ); } ) ->get(['tags.id', 'tags.tag', 'transaction_journals.id as journal_id', 'destination.amount']); diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php index d4a887d8a0..34ffcc9e7b 100644 --- a/app/Helpers/Report/ReportHelperInterface.php +++ b/app/Helpers/Report/ReportHelperInterface.php @@ -3,8 +3,10 @@ * ReportHelperInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index b1b8e7c10f..23e71d6e4b 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -3,8 +3,10 @@ * AccountController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,11 +15,11 @@ namespace FireflyIII\Http\Controllers; use Carbon\Carbon; use ExpandedForm; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Http\Requests\AccountFormRequest; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -70,16 +72,16 @@ class AccountController extends Controller } /** - * @param AccountCrudInterface $crud - * @param Account $account + * @param ARI $repository + * @param Account $account * * @return View */ - public function delete(AccountCrudInterface $crud, Account $account) + public function delete(ARI $repository, Account $account) { $typeName = config('firefly.shortNamesByFullName.' . $account->accountType->type); $subTitle = trans('firefly.delete_' . $typeName . '_account', ['name' => $account->name]); - $accountList = ExpandedForm::makeSelectListWithEmpty($crud->getAccountsByType([$account->accountType->type])); + $accountList = ExpandedForm::makeSelectListWithEmpty($repository->getAccountsByType([$account->accountType->type])); unset($accountList[$account->id]); // put previous url in session @@ -91,19 +93,19 @@ class AccountController extends Controller } /** - * @param AccountCrudInterface $crud - * @param Account $account + * @param ARI $repository + * @param Account $account * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ - public function destroy(AccountCrudInterface $crud, Account $account) + public function destroy(ARI $repository, Account $account) { $type = $account->accountType->type; $typeName = config('firefly.shortNamesByFullName.' . $type); $name = $account->name; - $moveTo = $crud->find(intval(Input::get('move_account_before_delete'))); + $moveTo = $repository->find(intval(Input::get('move_account_before_delete'))); - $crud->destroy($account, $moveTo); + $repository->destroy($account, $moveTo); Session::flash('success', strval(trans('firefly.' . $typeName . '_deleted', ['name' => $name]))); Preferences::mark(); @@ -120,10 +122,9 @@ class AccountController extends Controller public function edit(ARI $repository, Account $account) { - $what = config('firefly.shortNamesByFullName')[$account->accountType->type]; - $subTitle = trans('firefly.edit_' . $what . '_account', ['name' => $account->name]); - $subTitleIcon = config('firefly.subIconsByIdentifier.' . $what); - $openingBalance = $repository->openingBalanceTransaction($account); + $what = config('firefly.shortNamesByFullName')[$account->accountType->type]; + $subTitle = trans('firefly.edit_' . $what . '_account', ['name' => $account->name]); + $subTitleIcon = config('firefly.subIconsByIdentifier.' . $what); // put previous url in session if not redirect from store (not "return_to_edit"). if (session('accounts.edit.fromUpdate') !== true) { @@ -134,19 +135,17 @@ class AccountController extends Controller // pre fill some useful values. // the opening balance is tricky: - $openingBalanceAmount = null; - - if ($openingBalance->id) { - $transaction = $repository->getFirstTransaction($openingBalance, $account); - $openingBalanceAmount = $transaction->amount; - } + $openingBalanceAmount = $account->getOpeningBalanceAmount(); + $openingBalanceAmount = $account->getOpeningBalanceAmount() === '0' ? '' : $openingBalanceAmount; + $openingBalanceDate = $account->getOpeningBalanceDate(); + $openingBalanceDate = $openingBalanceDate->year === 1900 ? null : $openingBalanceDate->format('Y-m-d'); $preFilled = [ 'accountNumber' => $account->getMeta('accountNumber'), 'accountRole' => $account->getMeta('accountRole'), 'ccType' => $account->getMeta('ccType'), 'ccMonthlyPaymentDate' => $account->getMeta('ccMonthlyPaymentDate'), - 'openingBalanceDate' => $openingBalance->id ? $openingBalance->date->format('Y-m-d') : null, + 'openingBalanceDate' => $openingBalanceDate, 'openingBalance' => $openingBalanceAmount, 'virtualBalance' => round($account->virtual_balance, 2), ]; @@ -158,19 +157,19 @@ class AccountController extends Controller } /** - * @param AccountCrudInterface $crud - * @param string $what + * @param ARI $repository + * @param string $what * * @return View */ - public function index(AccountCrudInterface $crud, string $what) + public function index(ARI $repository, string $what) { $what = $what ?? 'asset'; $subTitle = trans('firefly.' . $what . '_accounts'); $subTitleIcon = config('firefly.subIconsByIdentifier.' . $what); $types = config('firefly.accountTypesByIdentifier.' . $what); - $accounts = $crud->getAccountsByType($types); + $accounts = $repository->getAccountsByType($types); /** @var Carbon $start */ $start = clone session('start', Carbon::now()->startOfMonth()); /** @var Carbon $end */ @@ -194,12 +193,13 @@ class AccountController extends Controller } /** - * @param ARI $repository - * @param Account $account + * @param AccountTaskerInterface $tasker + * @param ARI $repository + * @param Account $account * * @return View */ - public function show(ARI $repository, Account $account) + public function show(AccountTaskerInterface $tasker, ARI $repository, Account $account) { // show journals from current period only: $subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type); @@ -212,7 +212,7 @@ class AccountController extends Controller $page = intval(Input::get('page')); $pageSize = Preferences::get('transactionPageSize', 50)->data; $offset = ($page - 1) * $pageSize; - $set = $repository->journalsInPeriod(new Collection([$account]), [], $start, $end); + $set = $tasker->getJournalsInPeriod(new Collection([$account]), [], $start, $end); $count = $set->count(); $subSet = $set->splice($offset, $pageSize); $journals = new LengthAwarePaginator($subSet, $count, $pageSize, $page); @@ -220,10 +220,7 @@ class AccountController extends Controller // grouped other months thing: // oldest transaction in account: - $start = $repository->firstUseDate($account); - if ($start->year == 1900) { - $start = new Carbon; - } + $start = $repository->oldestJournalDate($account); $range = Preferences::get('viewRange', '1M')->data; $start = Navigation::startOfPeriod($start, $range); $end = Navigation::endOfX(new Carbon, $range); @@ -243,11 +240,17 @@ class AccountController extends Controller return view('accounts.show', compact('account', 'what', 'entries', 'subTitleIcon', 'journals', 'subTitle')); } + // only include asset accounts when this account is an asset: + $assets = new Collection; + if (in_array($account->accountType->type, [AccountType::ASSET, AccountType::DEFAULT])) { + $assets = $repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT]); + } + while ($end >= $start) { $end = Navigation::startOfPeriod($end, $range); $currentEnd = Navigation::endOfPeriod($end, $range); - $spent = $this->spentInPeriod($account, $end, $currentEnd); - $earned = $this->earnedInPeriod($account, $end, $currentEnd); + $spent = $tasker->amountOutInPeriod(new Collection([$account]), $assets, $end, $currentEnd); + $earned = $tasker->amountInInPeriod(new Collection([$account]), $assets, $end, $currentEnd); $dateStr = $end->format('Y-m-d'); $dateName = Navigation::periodShow($end, $range); $entries->push([$dateStr, $dateName, $spent, $earned]); @@ -260,13 +263,13 @@ class AccountController extends Controller } /** - * @param ARI $repository - * @param Account $account - * @param string $date + * @param AccountTaskerInterface $tasker + * @param Account $account + * @param string $date * * @return View */ - public function showWithDate(ARI $repository, Account $account, string $date) + public function showWithDate(AccountTaskerInterface $tasker, Account $account, string $date) { $carbon = new Carbon($date); $range = Preferences::get('viewRange', '1M')->data; @@ -277,7 +280,7 @@ class AccountController extends Controller $page = $page === 0 ? 1 : $page; $pageSize = Preferences::get('transactionPageSize', 50)->data; $offset = ($page - 1) * $pageSize; - $set = $repository->journalsInPeriod(new Collection([$account]), [], $start, $end); + $set = $tasker->getJournalsInPeriod(new Collection([$account]), [], $start, $end); $count = $set->count(); $subSet = $set->splice($offset, $pageSize); $journals = new LengthAwarePaginator($subSet, $count, $pageSize, $page); @@ -287,12 +290,13 @@ class AccountController extends Controller } /** - * @param AccountFormRequest $request - * @param AccountCrudInterface $crud + * @param AccountFormRequest $request + * @param ARI $repository * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + * */ - public function store(AccountFormRequest $request, AccountCrudInterface $crud) + public function store(AccountFormRequest $request, ARI $repository) { $accountData = [ 'name' => trim($request->input('name')), @@ -310,7 +314,7 @@ class AccountController extends Controller ]; - $account = $crud->store($accountData); + $account = $repository->store($accountData); Session::flash('success', strval(trans('firefly.stored_new_account', ['name' => $account->name]))); Preferences::mark(); @@ -334,13 +338,13 @@ class AccountController extends Controller } /** - * @param AccountFormRequest $request - * @param AccountCrudInterface $crud - * @param Account $account + * @param AccountFormRequest $request + * @param ARI $repository + * @param Account $account * - * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ - public function update(AccountFormRequest $request, AccountCrudInterface $crud, Account $account) + public function update(AccountFormRequest $request, ARI $repository, Account $account) { $accountData = [ @@ -357,7 +361,7 @@ class AccountController extends Controller 'ccType' => $request->input('ccType'), 'ccMonthlyPaymentDate' => $request->input('ccMonthlyPaymentDate'), ]; - $crud->update($account, $accountData); + $repository->update($account, $accountData); Session::flash('success', strval(trans('firefly.updated_account', ['name' => $account->name]))); Preferences::mark(); @@ -389,69 +393,4 @@ class AccountController extends Controller return ''; } - - /** - * Asset accounts actually earn money by being the destination of a deposit or the destination - * of a transfer. The money moves to them. - * - * A revenue account doesn't really earn money itself. Money is earned "from" the revenue account. - * So, the call to find out how many money has been earned by/from a revenue account is slightly different. - * - * - * - * @param Account $account - * @param Carbon $start - * @param Carbon $end - * - * @return string - */ - private function earnedInPeriod(Account $account, Carbon $start, Carbon $end) - { - /** @var ARI $repository */ - $repository = app(ARI::class); - $collection = new Collection([$account]); - $type = $account->accountType->type; - switch ($type) { - case AccountType::DEFAULT: - case AccountType::ASSET: - return $repository->earnedInPeriod($collection, $start, $end); - case AccountType::REVENUE: - return $repository->earnedFromInPeriod($collection, $start, $end); - default: - return '0'; - } - } - - /** - * Asset accounts actually spend money by being the source of a withdrawal or the source - * of a transfer. The money moves away from them. - * - * An expense account doesn't really spend money itself. Money is spent "at" the expense account. - * So, the call to find out how many money has been spent on/at an expense account is slightly different. - * - * - * - * @param Account $account - * @param Carbon $start - * @param Carbon $end - * - * @return string - */ - private function spentInPeriod(Account $account, Carbon $start, Carbon $end): string - { - /** @var ARI $repository */ - $repository = app(ARI::class); - $collection = new Collection([$account]); - $type = $account->accountType->type; - switch ($type) { - case AccountType::DEFAULT: - case AccountType::ASSET: - return $repository->spentInPeriod($collection, $start, $end); - case AccountType::EXPENSE: - return $repository->spentAtInPeriod($collection, $start, $end); - default: - return '0'; - } - } - } diff --git a/app/Http/Controllers/Admin/ConfigurationController.php b/app/Http/Controllers/Admin/ConfigurationController.php index 322068234e..5b6c256622 100644 --- a/app/Http/Controllers/Admin/ConfigurationController.php +++ b/app/Http/Controllers/Admin/ConfigurationController.php @@ -3,8 +3,10 @@ * ConfigurationController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -58,6 +60,8 @@ class ConfigurationController extends Controller /** * @param ConfigurationRequest $request + * + * @return \Illuminate\Http\RedirectResponse */ public function store(ConfigurationRequest $request) { diff --git a/app/Http/Controllers/Admin/DomainController.php b/app/Http/Controllers/Admin/DomainController.php index 51ca04b37d..31569eeba2 100644 --- a/app/Http/Controllers/Admin/DomainController.php +++ b/app/Http/Controllers/Admin/DomainController.php @@ -3,8 +3,10 @@ * DomainController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index 4ca5dafeb9..d2d32751fb 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -3,8 +3,10 @@ * HomeController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index c55b586188..ad91ad8c58 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -3,8 +3,10 @@ * UserController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index 2f62c3ba27..7063877e88 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -3,8 +3,10 @@ * AttachmentController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Auth/ConfirmationController.php b/app/Http/Controllers/Auth/ConfirmationController.php index 9acdb32d43..4e34c7dcb8 100644 --- a/app/Http/Controllers/Auth/ConfirmationController.php +++ b/app/Http/Controllers/Auth/ConfirmationController.php @@ -3,8 +3,10 @@ * ConfirmationController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 46a4bedf9a..7d6e12b3fc 100755 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -3,8 +3,10 @@ * ForgotPasswordController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 51544b9813..e805c6fc6c 100755 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -3,8 +3,10 @@ * LoginController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -110,6 +112,8 @@ class LoginController extends Controller /** * Show the application login form. * + * @param Request $request + * * @return \Illuminate\Http\Response */ public function showLoginForm(Request $request) diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index d91227f2c0..95a5c82132 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -3,8 +3,10 @@ * PasswordController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -23,7 +25,9 @@ use Illuminate\Support\Facades\Password; * Class PasswordController * * @package FireflyIII\Http\Controllers\Auth - * @method getEmailSubject + * @method getEmailSubject() + * @method getSendResetLinkEmailSuccessResponse() + * @method getSendResetLinkEmailFailureResponse() */ class PasswordController extends Controller { diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index f949166e88..bb87bd81e3 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -3,8 +3,10 @@ * RegisterController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -115,6 +117,8 @@ class RegisterController extends Controller * OLD * Show the application registration form. * + * @param Request $request + * * @return \Illuminate\Http\Response */ public function showRegistrationForm(Request $request) diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index f51a4aa70d..e9a3e7b3fc 100755 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -3,8 +3,10 @@ * ResetPasswordController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index 45b599b785..d310cc3bd7 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -3,8 +3,10 @@ * TwoFactorController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index 1aad01c385..fc0e907480 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -3,8 +3,10 @@ * BillController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index 46b1082a2f..93d9a35261 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -3,8 +3,10 @@ * BudgetController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -14,12 +16,12 @@ namespace FireflyIII\Http\Controllers; use Amount; use Carbon\Carbon; use Config; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Requests\BudgetFormRequest; use FireflyIII\Models\AccountType; use FireflyIII\Models\Budget; use FireflyIII\Models\LimitRepetition; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -156,12 +158,13 @@ class BudgetController extends Controller } /** - * @param BudgetRepositoryInterface $repository - * @param AccountCrudInterface $crud + * @param BudgetRepositoryInterface $repository + * @param AccountRepositoryInterface $accountRepository * * @return View + * */ - public function index(BudgetRepositoryInterface $repository, AccountCrudInterface $crud) + public function index(BudgetRepositoryInterface $repository, AccountRepositoryInterface $accountRepository) { $repository->cleanupBudgets(); @@ -185,7 +188,7 @@ class BudgetController extends Controller $period = Navigation::periodShow($start, $range); $periodStart = $start->formatLocalized($this->monthAndDayFormat); $periodEnd = $end->formatLocalized($this->monthAndDayFormat); - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); + $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); $startAsString = $start->format('Y-m-d'); $endAsString = $end->format('Y-m-d'); @@ -247,7 +250,7 @@ class BudgetController extends Controller $page = intval(Input::get('page')) == 0 ? 1 : intval(Input::get('page')); $pageSize = Preferences::get('transactionPageSize', 50)->data; $offset = ($page - 1) * $pageSize; - $journals = $repository->journalsInPeriodWithoutBudget(new Collection, $start, $end); + $journals = $repository->journalsInPeriodWithoutBudget(new Collection, $start, $end); // budget $count = $journals->count(); $journals = $journals->slice($offset, $pageSize); $list = new LengthAwarePaginator($journals, $count, $pageSize); @@ -293,7 +296,7 @@ class BudgetController extends Controller $page = intval(Input::get('page')) == 0 ? 1 : intval(Input::get('page')); $pageSize = Preferences::get('transactionPageSize', 50)->data; $offset = ($page - 1) * $pageSize; - $journals = $repository->journalsInPeriod(new Collection([$budget]), new Collection, $start, $end); + $journals = $repository->journalsInPeriod(new Collection([$budget]), new Collection, $start, $end); // budget $count = $journals->count(); $journals = $journals->slice($offset, $pageSize); $journals = new LengthAwarePaginator($journals, $count, $pageSize); @@ -332,7 +335,7 @@ class BudgetController extends Controller $page = intval(Input::get('page')) == 0 ? 1 : intval(Input::get('page')); $pageSize = Preferences::get('transactionPageSize', 50)->data; $offset = ($page - 1) * $pageSize; - $journals = $repository->journalsInPeriod(new Collection([$budget]), new Collection, $start, $end); + $journals = $repository->journalsInPeriod(new Collection([$budget]), new Collection, $start, $end); // budget $count = $journals->count(); $journals = $journals->slice($offset, $pageSize); $journals = new LengthAwarePaginator($journals, $count, $pageSize); diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index e9b05fd324..1a1fb3d787 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -3,8 +3,10 @@ * CategoryController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -12,10 +14,10 @@ declare(strict_types = 1); namespace FireflyIII\Http\Controllers; use Carbon\Carbon; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Http\Requests\CategoryFormRequest; use FireflyIII\Models\AccountType; use FireflyIII\Models\Category; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI; use FireflyIII\Support\CacheProperties; use Illuminate\Pagination\LengthAwarePaginator; @@ -147,7 +149,7 @@ class CategoryController extends Controller $start = session('start', Carbon::now()->startOfMonth()); /** @var Carbon $end */ $end = session('end', Carbon::now()->startOfMonth()); - $list = $repository->journalsInPeriodWithoutCategory(new Collection(), [], $start, $end); + $list = $repository->journalsInPeriodWithoutCategory(new Collection(), [], $start, $end); // category $subTitle = trans( 'firefly.without_category_between', ['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)] @@ -157,13 +159,13 @@ class CategoryController extends Controller } /** - * @param CRI $repository - * @param AccountCrudInterface $crud - * @param Category $category + * @param CRI $repository + * @param AccountRepositoryInterface $accountRepository + * @param Category $category * * @return View */ - public function show(CRI $repository, AccountCrudInterface $crud, Category $category) + public function show(CRI $repository, AccountRepositoryInterface $accountRepository, Category $category) { $range = Preferences::get('viewRange', '1M')->data; /** @var Carbon $start */ @@ -174,7 +176,7 @@ class CategoryController extends Controller $page = intval(Input::get('page')); $pageSize = Preferences::get('transactionPageSize', 50)->data; $offset = ($page - 1) * $pageSize; - $set = $repository->journalsInPeriod(new Collection([$category]), new Collection, [], $start, $end); + $set = $repository->journalsInPeriod(new Collection([$category]), new Collection, [], $start, $end); // category $count = $set->count(); $subSet = $set->splice($offset, $pageSize); $subTitle = $category->name; @@ -208,7 +210,7 @@ class CategoryController extends Controller $categoryCollection = new Collection([$category]); - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); while ($end >= $start) { $end = Navigation::startOfPeriod($end, $range); $currentEnd = Navigation::endOfPeriod($end, $range); @@ -245,7 +247,7 @@ class CategoryController extends Controller $page = intval(Input::get('page')); $pageSize = Preferences::get('transactionPageSize', 50)->data; $offset = ($page - 1) * $pageSize; - $set = $repository->journalsInPeriod(new Collection([$category]), new Collection, [], $start, $end); + $set = $repository->journalsInPeriod(new Collection([$category]), new Collection, [], $start, $end); // category $count = $set->count(); $subSet = $set->splice($offset, $pageSize); $journals = new LengthAwarePaginator($subSet, $count, $pageSize, $page); diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 10d90f4f31..e1a18afd09 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -3,8 +3,10 @@ * AccountController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,12 +15,12 @@ namespace FireflyIII\Http\Controllers\Chart; use Carbon\Carbon; use Exception; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Generator\Chart\Account\AccountChartGeneratorInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; use Log; @@ -51,11 +53,11 @@ class AccountController extends Controller /** * Shows the balances for all the user's expense accounts. * - * @param AccountCrudInterface $crud + * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\JsonResponse */ - public function expenseAccounts(AccountCrudInterface $crud) + public function expenseAccounts(AccountRepositoryInterface $repository) { $start = clone session('start', Carbon::now()->startOfMonth()); $end = clone session('end', Carbon::now()->endOfMonth()); @@ -67,7 +69,7 @@ class AccountController extends Controller if ($cache->has()) { return Response::json($cache->get()); } - $accounts = $crud->getAccountsByType([AccountType::EXPENSE, AccountType::BENEFICIARY]); + $accounts = $repository->getAccountsByType([AccountType::EXPENSE, AccountType::BENEFICIARY]); $start->subDay(); $ids = $accounts->pluck('id')->toArray(); @@ -100,11 +102,11 @@ class AccountController extends Controller /** * Shows the balances for all the user's frontpage accounts. * - * @param AccountCrudInterface $crud + * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\JsonResponse */ - public function frontpage(AccountCrudInterface $crud) + public function frontpage(AccountRepositoryInterface $repository) { $start = clone session('start', Carbon::now()->startOfMonth()); $end = clone session('end', Carbon::now()->endOfMonth()); @@ -120,8 +122,8 @@ class AccountController extends Controller return Response::json($cache->get()); } - $frontPage = Preferences::get('frontPageAccounts', $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray()); - $accounts = $crud->getAccountsById($frontPage->data); + $frontPage = Preferences::get('frontPageAccounts', $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray()); + $accounts = $repository->getAccountsById($frontPage->data); foreach ($accounts as $account) { $balances = []; diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index 9a30caa682..78385b915b 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -3,8 +3,10 @@ * BillController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index aed2622482..56eeb966ef 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -3,8 +3,10 @@ * BudgetController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -137,6 +139,8 @@ class BudgetController extends Controller /** * Shows a budget list with spent/left/overspent. * + * @param BudgetRepositoryInterface $repository + * * @return \Symfony\Component\HttpFoundation\Response */ public function frontpage(BudgetRepositoryInterface $repository) @@ -397,7 +401,7 @@ class BudgetController extends Controller */ private function spentInPeriodWithout(BudgetRepositoryInterface $repository, Carbon $start, Carbon $end):array { - $list = $repository->journalsInPeriodWithoutBudget(new Collection, $start, $end); + $list = $repository->journalsInPeriodWithoutBudget(new Collection, $start, $end); // budget $sum = '0'; /** @var TransactionJournal $entry */ foreach ($list as $entry) { diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index cd195ce859..98a8392ca4 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -3,8 +3,10 @@ * CategoryController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,11 +15,11 @@ namespace FireflyIII\Http\Controllers\Chart; use Carbon\Carbon; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Generator\Chart\Category\CategoryChartGeneratorInterface; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\AccountType; use FireflyIII\Models\Category; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; @@ -50,13 +52,13 @@ class CategoryController extends Controller /** * Show an overview for a category for all time, per month/week/year. * - * @param CRI $repository - * @param AccountCrudInterface $crud - * @param Category $category + * @param CRI $repository + * @param AccountRepositoryInterface $accountRepository + * @param Category $category * * @return \Symfony\Component\HttpFoundation\Response */ - public function all(CRI $repository, AccountCrudInterface $crud, Category $category) + public function all(CRI $repository, AccountRepositoryInterface $accountRepository, Category $category) { $start = $repository->firstUseDate($category); $range = Preferences::get('viewRange', '1M')->data; @@ -65,7 +67,7 @@ class CategoryController extends Controller $end = new Carbon; $entries = new Collection; $cache = new CacheProperties; - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $cache->addProperty($start); $cache->addProperty($end); $cache->addProperty('all'); @@ -108,12 +110,12 @@ class CategoryController extends Controller } /** - * @param CRI $repository - * @param AccountCrudInterface $crud + * @param CRI $repository + * @param AccountRepositoryInterface $accountRepository * * @return \Illuminate\Http\JsonResponse */ - public function frontpage(CRI $repository, AccountCrudInterface $crud) + public function frontpage(CRI $repository, AccountRepositoryInterface $accountRepository) { $start = session('start', Carbon::now()->startOfMonth()); $end = session('end', Carbon::now()->endOfMonth()); @@ -127,7 +129,7 @@ class CategoryController extends Controller return Response::json($cache->get()); } $categories = $repository->getCategories(); - $accounts = $crud->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT]); + $accounts = $accountRepository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT]); $set = new Collection; /** @var Category $category */ foreach ($categories as $category) { @@ -254,9 +256,10 @@ class CategoryController extends Controller { $categoryCollection = new Collection([$category]); $cache = new CacheProperties; - /** @var AccountCrudInterface $crud */ - $crud = app(AccountCrudInterface::class); - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $cache->addProperty($start); $cache->addProperty($end); diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index c80f2ba6ae..bdcf1408f5 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -3,8 +3,10 @@ * PiggyBankController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 3824bfccea..941d66da86 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -3,8 +3,10 @@ * ReportController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -15,7 +17,7 @@ namespace FireflyIII\Http\Controllers\Chart; use Carbon\Carbon; use FireflyIII\Generator\Chart\Report\ReportChartGeneratorInterface; use FireflyIII\Http\Controllers\Controller; -use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Support\Collection; use Navigation; @@ -90,15 +92,16 @@ class ReportController extends Controller /** - * @param AccountRepositoryInterface $repository - * @param string $reportType - * @param Carbon $start - * @param Carbon $end - * @param Collection $accounts + * @param AccountTaskerInterface $accountTasker + * @param string $reportType + * @param Carbon $start + * @param Carbon $end + * @param Collection $accounts * * @return \Illuminate\Http\JsonResponse + * @internal param AccountRepositoryInterface $repository */ - public function yearInOut(AccountRepositoryInterface $repository, string $reportType, Carbon $start, Carbon $end, Collection $accounts) + public function yearInOut(AccountTaskerInterface $accountTasker, string $reportType, Carbon $start, Carbon $end, Collection $accounts) { // chart properties for cache: $cache = new CacheProperties; @@ -118,8 +121,8 @@ class ReportController extends Controller while ($currentStart <= $end) { $currentEnd = Navigation::endOfPeriod($currentStart, '1M'); $date = $currentStart->format('Y-m'); - $spent = $repository->spentInPeriod($accounts, $currentStart, $currentEnd); - $earned = $repository->earnedInPeriod($accounts, $currentStart, $currentEnd); + $spent = $accountTasker->amountOutInPeriod($accounts, $accounts, $currentStart, $currentEnd); + $earned = $accountTasker->amountInInPeriod($accounts, $accounts, $currentStart, $currentEnd); $spentArray[$date] = bcmul($spent, '-1'); $earnedArray[$date] = $earned; $currentStart = Navigation::addPeriod($currentStart, '1M', 0); @@ -143,15 +146,16 @@ class ReportController extends Controller } /** - * @param AccountRepositoryInterface $repository - * @param string $reportType - * @param Carbon $start - * @param Carbon $end - * @param Collection $accounts + * @param AccountTaskerInterface $accountTasker + * @param string $reportType + * @param Carbon $start + * @param Carbon $end + * @param Collection $accounts * * @return \Illuminate\Http\JsonResponse + * @internal param AccountRepositoryInterface $repository */ - public function yearInOutSummarized(AccountRepositoryInterface $repository, string $reportType, Carbon $start, Carbon $end, Collection $accounts) + public function yearInOutSummarized(AccountTaskerInterface $accountTasker, string $reportType, Carbon $start, Carbon $end, Collection $accounts) { // chart properties for cache: @@ -172,8 +176,8 @@ class ReportController extends Controller while ($currentStart <= $end) { $currentEnd = Navigation::endOfPeriod($currentStart, '1M'); $date = $currentStart->format('Y-m'); - $spent = $repository->spentInPeriod($accounts, $currentStart, $currentEnd); - $earned = $repository->earnedInPeriod($accounts, $currentStart, $currentEnd); + $spent = $accountTasker->amountOutInPeriod($accounts, $accounts, $currentStart, $currentEnd); + $earned = $accountTasker->amountInInPeriod($accounts, $accounts, $currentStart, $currentEnd); $spentArray[$date] = bcmul($spent, '-1'); $earnedArray[$date] = $earned; $currentStart = Navigation::addPeriod($currentStart, '1M', 0); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index b1402eb54c..6101c947f6 100755 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -3,8 +3,10 @@ * Controller.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php index cb4483e9ac..1b3e817aa7 100644 --- a/app/Http/Controllers/CurrencyController.php +++ b/app/Http/Controllers/CurrencyController.php @@ -3,8 +3,10 @@ * CurrencyController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index 8d5808685a..832be8d57a 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -3,8 +3,10 @@ * ExportController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -14,13 +16,12 @@ namespace FireflyIII\Http\Controllers; use Carbon\Carbon; use ExpandedForm; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Export\Processor; use FireflyIII\Http\Requests\ExportFormRequest; use FireflyIII\Models\AccountType; use FireflyIII\Models\ExportJob; -use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface as EJRI; use Preferences; use Response; @@ -89,12 +90,12 @@ class ExportController extends Controller } /** - * @param AccountCrudInterface $crud - * @param EJRI $jobs + * @param AccountRepositoryInterface $repository + * @param EJRI $jobs * * @return View */ - public function index(AccountCrudInterface $crud, EJRI $jobs) + public function index(AccountRepositoryInterface $repository, EJRI $jobs) { // create new export job. $job = $jobs->create(); @@ -102,7 +103,7 @@ class ExportController extends Controller $jobs->cleanup(); // does the user have shared accounts? - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $accountList = ExpandedForm::makeSelectList($accounts); $checked = array_keys($accountList); $formats = array_keys(config('firefly.export_formats')); @@ -115,20 +116,19 @@ class ExportController extends Controller } /** - * @param ExportFormRequest $request - * @param ARI $repository - * - * @param EJRI $jobs + * @param ExportFormRequest $request + * @param AccountRepositoryInterface $repository + * @param EJRI $jobs * * @return string - * @throws \FireflyIII\Exceptions\FireflyException + * */ - public function postIndex(ExportFormRequest $request, ARI $repository, EJRI $jobs) + public function postIndex(ExportFormRequest $request, AccountRepositoryInterface $repository, EJRI $jobs) { set_time_limit(0); $job = $jobs->findByKey($request->get('job')); $settings = [ - 'accounts' => $repository->get($request->get('accounts')), + 'accounts' => $repository->getAccountsById($request->get('accounts')), 'startDate' => new Carbon($request->get('export_start_range')), 'endDate' => new Carbon($request->get('export_end_range')), 'exportFormat' => $request->get('exportFormat'), diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php index ca1ab22164..b813a4371e 100644 --- a/app/Http/Controllers/HelpController.php +++ b/app/Http/Controllers/HelpController.php @@ -3,8 +3,10 @@ * HelpController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 240a44846d..8f8d40a535 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -3,8 +3,10 @@ * HomeController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -12,11 +14,11 @@ namespace FireflyIII\Http\Controllers; use Artisan; use Carbon\Carbon; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\AccountType; use FireflyIII\Models\Tag; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface; use Illuminate\Http\Request; use Illuminate\Support\Collection; @@ -24,7 +26,6 @@ use Log; use Preferences; use Route; use Session; -use Steam; /** @@ -112,16 +113,16 @@ class HomeController extends Controller } /** - * @param ARI $repository - * @param AccountCrudInterface $crud + * @param ARI $repository + * @param AccountTaskerInterface $tasker * * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View */ - public function index(ARI $repository, AccountCrudInterface $crud) + public function index(ARI $repository, AccountTaskerInterface $tasker) { $types = config('firefly.accountTypesByIdentifier.asset'); - $count = $repository->countAccounts($types); + $count = $repository->count($types); if ($count == 0) { return redirect(route('new-user.index')); @@ -132,25 +133,17 @@ class HomeController extends Controller $mainTitleIcon = 'fa-fire'; $transactions = []; $frontPage = Preferences::get( - 'frontPageAccounts', $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray() + 'frontPageAccounts', $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray() ); /** @var Carbon $start */ $start = session('start', Carbon::now()->startOfMonth()); /** @var Carbon $end */ - $end = session('end', Carbon::now()->endOfMonth()); - $showTour = Preferences::get('tour', true)->data; - $accounts = $crud->getAccountsById($frontPage->data); - $savings = $repository->getSavingsAccounts($start, $end); - $piggyBankAccounts = $repository->getPiggyBankAccounts($start, $end); - - - $savingsTotal = '0'; - foreach ($savings as $savingAccount) { - $savingsTotal = bcadd($savingsTotal, Steam::balance($savingAccount, $end)); - } + $end = session('end', Carbon::now()->endOfMonth()); + $showTour = Preferences::get('tour', true)->data; + $accounts = $repository->getAccountsById($frontPage->data); foreach ($accounts as $account) { - $set = $repository->journalsInPeriod(new Collection([$account]), [], $start, $end); + $set = $tasker->getJournalsInPeriod(new Collection([$account]), [], $start, $end); $set = $set->splice(0, 10); if (count($set) > 0) { @@ -159,7 +152,7 @@ class HomeController extends Controller } return view( - 'index', compact('count', 'showTour', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts') + 'index', compact('count', 'showTour', 'title', 'subTitle', 'mainTitleIcon', 'transactions') ); } diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index c41a0b9f93..05047e0e81 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -3,8 +3,10 @@ * ImportController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -106,6 +108,7 @@ class ImportController extends Controller $config = $job->configuration; $config['column-roles-complete'] = false; $config['column-mapping-complete'] = false; + $config['delimiter'] = $config['delimiter'] === "\t" ? 'tab' : $config['delimiter']; $result = json_encode($config, JSON_PRETTY_PRINT); $name = sprintf('"%s"', addcslashes('import-configuration-' . date('Y-m-d') . '.json', '"\\')); diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index 7897d1cf83..65465a8e9f 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -3,8 +3,10 @@ * JsonController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -12,10 +14,10 @@ namespace FireflyIII\Http\Controllers; use Amount; use Carbon\Carbon; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\AccountType; -use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface as CRI; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; @@ -95,12 +97,14 @@ class JsonController extends Controller } /** - * @param ARI $accountRepository - * @param AccountCrudInterface $crud + * @param AccountTaskerInterface $accountTasker + * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\JsonResponse + * + * @internal param ARI $accountRepository */ - public function boxIn(ARI $accountRepository, AccountCrudInterface $crud) + public function boxIn(AccountTaskerInterface $accountTasker, AccountRepositoryInterface $repository) { $start = session('start', Carbon::now()->startOfMonth()); $end = session('end', Carbon::now()->endOfMonth()); @@ -113,8 +117,9 @@ class JsonController extends Controller if ($cache->has()) { return Response::json($cache->get()); } - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); - $amount = $accountRepository->earnedInPeriod($accounts, $start, $end); + $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); + $assets = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $amount = $accountTasker->amountInInPeriod($accounts, $assets, $start, $end); $data = ['box' => 'in', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]; $cache->store($data); @@ -122,12 +127,12 @@ class JsonController extends Controller } /** - * @param ARI $accountRepository - * @param AccountCrudInterface $crud + * @param AccountTaskerInterface $accountTasker + * @param AccountRepositoryInterface $repository * * @return \Symfony\Component\HttpFoundation\Response */ - public function boxOut(ARI $accountRepository, AccountCrudInterface $crud) + public function boxOut(AccountTaskerInterface $accountTasker, AccountRepositoryInterface $repository) { $start = session('start', Carbon::now()->startOfMonth()); $end = session('end', Carbon::now()->endOfMonth()); @@ -141,8 +146,9 @@ class JsonController extends Controller return Response::json($cache->get()); } - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); - $amount = $accountRepository->spentInPeriod($accounts, $start, $end); + $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]); + $assets = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $amount = $accountTasker->amountOutInPeriod($accounts, $assets, $start, $end); $data = ['box' => 'out', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]; $cache->store($data); @@ -181,13 +187,14 @@ class JsonController extends Controller /** * Returns a JSON list of all beneficiaries. * - * @param AccountCrudInterface $crud + * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\JsonResponse + * */ - public function expenseAccounts(AccountCrudInterface $crud) + public function expenseAccounts(AccountRepositoryInterface $repository) { - $list = $crud->getAccountsByType([AccountType::EXPENSE, AccountType::BENEFICIARY]); + $list = $repository->getAccountsByType([AccountType::EXPENSE, AccountType::BENEFICIARY]); $return = []; foreach ($list as $entry) { $return[] = $entry->name; @@ -198,13 +205,14 @@ class JsonController extends Controller } /** - * @param AccountCrudInterface $crud + * @param AccountRepositoryInterface $repository * * @return \Illuminate\Http\JsonResponse + * */ - public function revenueAccounts(AccountCrudInterface $crud) + public function revenueAccounts(AccountRepositoryInterface $repository) { - $list = $crud->getAccountsByType([AccountType::REVENUE]); + $list = $repository->getAccountsByType([AccountType::REVENUE]); $return = []; foreach ($list as $entry) { $return[] = $entry->name; diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index adc053e65b..c15d3ce88c 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -3,17 +3,18 @@ * NewUserController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Http\Controllers; use Carbon\Carbon; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Http\Requests\NewUserFormRequest; -use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Preferences; use Session; use View; @@ -35,11 +36,11 @@ class NewUserController extends Controller /** - * @param ARI $repository + * @param AccountRepositoryInterface $repository * - * @@return View + * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View */ - public function index(ARI $repository) + public function index(AccountRepositoryInterface $repository) { View::share('title', trans('firefly.welcome')); @@ -47,7 +48,7 @@ class NewUserController extends Controller $types = config('firefly.accountTypesByIdentifier.asset'); - $count = $repository->countAccounts($types); + $count = $repository->count($types); if ($count > 0) { return redirect(route('index')); @@ -58,27 +59,27 @@ class NewUserController extends Controller } /** - * @param NewUserFormRequest $request - * @param AccountCrudInterface $crud + * @param NewUserFormRequest $request + * @param AccountRepositoryInterface $repository * - * @return \Illuminate\Http\RedirectResponse + * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ - public function submit(NewUserFormRequest $request, AccountCrudInterface $crud) + public function submit(NewUserFormRequest $request, AccountRepositoryInterface $repository) { $count = 1; // create normal asset account: - $this->createAssetAccount($request, $crud); + $this->createAssetAccount($request, $repository); // create savings account if (strlen($request->get('savings_balance')) > 0) { - $this->createSavingsAccount($request, $crud); + $this->createSavingsAccount($request, $repository); $count++; } // create credit card. if (strlen($request->get('credit_card_limit')) > 0) { - $this->storeCreditCard($request, $crud); + $this->storeCreditCard($request, $repository); $count++; } $message = strval(trans('firefly.stored_new_accounts_new_user')); @@ -93,12 +94,12 @@ class NewUserController extends Controller } /** - * @param NewUserFormRequest $request - * @param AccountCrudInterface $crud + * @param NewUserFormRequest $request + * @param AccountRepositoryInterface $repository * * @return bool */ - private function createAssetAccount(NewUserFormRequest $request, AccountCrudInterface $crud): bool + private function createAssetAccount(NewUserFormRequest $request, AccountRepositoryInterface $repository): bool { $assetAccount = [ 'name' => $request->get('bank_name'), @@ -113,18 +114,18 @@ class NewUserController extends Controller 'openingBalanceCurrency' => intval($request->input('amount_currency_id_bank_balance')), ]; - $crud->store($assetAccount); + $repository->store($assetAccount); return true; } /** - * @param NewUserFormRequest $request - * @param AccountCrudInterface $crud + * @param NewUserFormRequest $request + * @param AccountRepositoryInterface $repository * * @return bool */ - private function createSavingsAccount(NewUserFormRequest $request, AccountCrudInterface $crud): bool + private function createSavingsAccount(NewUserFormRequest $request, AccountRepositoryInterface $repository): bool { $savingsAccount = [ 'name' => $request->get('bank_name') . ' savings account', @@ -138,18 +139,18 @@ class NewUserController extends Controller 'openingBalanceDate' => new Carbon, 'openingBalanceCurrency' => intval($request->input('amount_currency_id_savings_balance')), ]; - $crud->store($savingsAccount); + $repository->store($savingsAccount); return true; } /** - * @param NewUserFormRequest $request - * @param AccountCrudInterface $crud + * @param NewUserFormRequest $request + * @param AccountRepositoryInterface $repository * * @return bool */ - private function storeCreditCard(NewUserFormRequest $request, AccountCrudInterface $crud): bool + private function storeCreditCard(NewUserFormRequest $request, AccountRepositoryInterface $repository): bool { $creditAccount = [ 'name' => 'Credit card', @@ -162,12 +163,10 @@ class NewUserController extends Controller 'openingBalance' => null, 'openingBalanceDate' => null, 'openingBalanceCurrency' => intval($request->input('amount_currency_id_credit_card_limit')), + 'ccType' => 'monthlyFull', + 'ccMonthlyPaymentDate' => Carbon::now()->year . '-01-01', ]; - $creditCard = $crud->store($creditAccount); - - // store meta for CC: - $crud->storeMeta($creditCard, 'ccType', 'monthlyFull'); - $crud->storeMeta($creditCard, 'ccMonthlyPaymentDate', Carbon::now()->year . '-01-01'); + $repository->store($creditAccount); return true; } diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 5acc9a5a04..59e79a74c7 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -3,8 +3,10 @@ * PiggyBankController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,11 +15,10 @@ namespace FireflyIII\Http\Controllers; use Amount; use Carbon\Carbon; use ExpandedForm; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Http\Requests\PiggyBankFormRequest; use FireflyIII\Models\AccountType; use FireflyIII\Models\PiggyBank; -use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Support\Collection; use Input; @@ -51,16 +52,15 @@ class PiggyBankController extends Controller /** * Add money to piggy bank * - * @param ARI $repository * @param PiggyBank $piggyBank * * @return View */ - public function add(ARI $repository, PiggyBank $piggyBank) + public function add(PiggyBank $piggyBank) { /** @var Carbon $date */ $date = session('end', Carbon::now()->endOfMonth()); - $leftOnAccount = $repository->leftOnAccount($piggyBank->account, $date); + $leftOnAccount = $piggyBank->leftOnAccount($date); $savedSoFar = $piggyBank->currentRelevantRep()->currentamount ?? '0'; $leftToSave = bcsub($piggyBank->targetamount, $savedSoFar); $maxAmount = min($leftOnAccount, $leftToSave); @@ -71,16 +71,15 @@ class PiggyBankController extends Controller /** * Add money to piggy bank (for mobile devices) * - * @param ARI $repository * @param PiggyBank $piggyBank * * @return View */ - public function addMobile(ARI $repository, PiggyBank $piggyBank) + public function addMobile(PiggyBank $piggyBank) { /** @var Carbon $date */ $date = session('end', Carbon::now()->endOfMonth()); - $leftOnAccount = $repository->leftOnAccount($piggyBank->account, $date); + $leftOnAccount = $piggyBank->leftOnAccount($date); $savedSoFar = $piggyBank->currentRelevantRep()->currentamount?? '0'; $leftToSave = bcsub($piggyBank->targetamount, $savedSoFar); $maxAmount = min($leftOnAccount, $leftToSave); @@ -89,13 +88,14 @@ class PiggyBankController extends Controller } /** - * @param AccountCrudInterface $crud + * @param AccountRepositoryInterface $repository * * @return View + * */ - public function create(AccountCrudInterface $crud) + public function create(AccountRepositoryInterface $repository) { - $accounts = ExpandedForm::makeSelectList($crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); + $accounts = ExpandedForm::makeSelectList($repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); $subTitle = trans('firefly.new_piggy_bank'); $subTitleIcon = 'fa-plus'; @@ -145,15 +145,15 @@ class PiggyBankController extends Controller } /** - * @param AccountCrudInterface $crud - * @param PiggyBank $piggyBank + * @param AccountRepositoryInterface $repository + * @param PiggyBank $piggyBank * * @return View */ - public function edit(AccountCrudInterface $crud, PiggyBank $piggyBank) + public function edit(AccountRepositoryInterface $repository, PiggyBank $piggyBank) { - $accounts = ExpandedForm::makeSelectList($crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); + $accounts = ExpandedForm::makeSelectList($repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); $subTitle = trans('firefly.update_piggy_title', ['name' => $piggyBank->name]); $subTitleIcon = 'fa-pencil'; $targetDate = null; @@ -183,12 +183,11 @@ class PiggyBankController extends Controller } /** - * @param ARI $repository * @param PiggyBankRepositoryInterface $piggyRepository * * @return View */ - public function index(ARI $repository, PiggyBankRepositoryInterface $piggyRepository) + public function index(PiggyBankRepositoryInterface $piggyRepository) { /** @var Collection $piggyBanks */ $piggyBanks = $piggyRepository->getPiggyBanks(); @@ -211,7 +210,7 @@ class PiggyBankController extends Controller $accounts[$account->id] = [ 'name' => $account->name, 'balance' => Steam::balanceIgnoreVirtual($account, $end), - 'leftForPiggyBanks' => $repository->leftOnAccount($account, $end), + 'leftForPiggyBanks' => $piggyBank->leftOnAccount($end), 'sumOfSaved' => strval($piggyBank->savedSoFar), 'sumOfTargets' => strval(round($piggyBank->targetamount, 2)), 'leftToSave' => $piggyBank->leftToSave, @@ -246,17 +245,16 @@ class PiggyBankController extends Controller /** * @param PiggyBankRepositoryInterface $repository - * @param ARI $accounts * @param PiggyBank $piggyBank * * @return \Illuminate\Http\RedirectResponse */ - public function postAdd(PiggyBankRepositoryInterface $repository, ARI $accounts, PiggyBank $piggyBank) + public function postAdd(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank) { $amount = strval(round(Input::get('amount'), 2)); /** @var Carbon $date */ $date = session('end', Carbon::now()->endOfMonth()); - $leftOnAccount = $accounts->leftOnAccount($piggyBank->account, $date); + $leftOnAccount = $piggyBank->leftOnAccount($date); $savedSoFar = strval($piggyBank->currentRelevantRep()->currentamount); $leftToSave = bcsub($piggyBank->targetamount, $savedSoFar); $maxAmount = round(min($leftOnAccount, $leftToSave), 2); diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php index cc5a538139..c6893a6014 100644 --- a/app/Http/Controllers/Popup/ReportController.php +++ b/app/Http/Controllers/Popup/ReportController.php @@ -3,8 +3,10 @@ * ReportController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,13 +15,14 @@ namespace FireflyIII\Http\Controllers\Popup; use Carbon\Carbon; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collection\BalanceLine; use FireflyIII\Http\Controllers\Controller; +use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Support\Binder\AccountList; @@ -90,8 +93,11 @@ class ReportController extends Controller /** @var BudgetRepositoryInterface $budgetRepository */ $budgetRepository = app(BudgetRepositoryInterface::class); $budget = $budgetRepository->find(intval($attributes['budgetId'])); - $crud = app('FireflyIII\Crud\Account\AccountCrudInterface'); - $account = $crud->find(intval($attributes['accountId'])); + + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class); + + $account = $repository->find(intval($attributes['accountId'])); switch (true) { case ($role === BalanceLine::ROLE_DEFAULTROLE && !is_null($budget->id)): @@ -183,22 +189,24 @@ class ReportController extends Controller */ private function expenseEntry(array $attributes): string { + /** @var AccountTaskerInterface $tasker */ + $tasker = app(AccountTaskerInterface::class); /** @var AccountRepositoryInterface $repository */ $repository = app(AccountRepositoryInterface::class); - $crud = app(AccountCrudInterface::class); - $account = $crud->find(intval($attributes['accountId'])); - $types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER]; - $journals = $repository->journalsInPeriod($attributes['accounts'], $types, $attributes['startDate'], $attributes['endDate']); + + $account = $repository->find(intval($attributes['accountId'])); + $types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER]; + $journals = $tasker->getJournalsInPeriod(new Collection([$account]), $types, $attributes['startDate'], $attributes['endDate']); + $report = $attributes['accounts']->pluck('id')->toArray(); // accounts used in this report // filter for transfers and withdrawals TO the given $account $journals = $journals->filter( - function (TransactionJournal $journal) use ($account) { - $destinations = TransactionJournal::destinationAccountList($journal)->pluck('id')->toArray(); - if (in_array($account->id, $destinations)) { - return true; - } + function (Transaction $transaction) use ($report) { + // get the destinations: + $sources = TransactionJournal::sourceAccountList($transaction->transactionJournal)->pluck('id')->toArray(); - return false; + // do these intersect with the current list? + return !empty(array_intersect($report, $sources)); } ); @@ -217,27 +225,23 @@ class ReportController extends Controller */ private function incomeEntry(array $attributes): string { + /** @var AccountTaskerInterface $tasker */ + $tasker = app(AccountTaskerInterface::class); /** @var AccountRepositoryInterface $repository */ - $repository = app(AccountRepositoryInterface::class); - $crud = app('FireflyIII\Crud\Account\AccountCrudInterface'); - $account = $crud->find(intval($attributes['accountId'])); - $types = [TransactionType::DEPOSIT, TransactionType::TRANSFER]; - $journals = $repository->journalsInPeriod(new Collection([$account]), $types, $attributes['startDate'], $attributes['endDate']); - $destinations = $attributes['accounts']->pluck('id')->toArray(); - // filter for transfers and withdrawals FROM the given $account + $repository = app(AccountRepositoryInterface::class); + $account = $repository->find(intval($attributes['accountId'])); + $types = [TransactionType::DEPOSIT, TransactionType::TRANSFER]; + $journals = $tasker->getJournalsInPeriod(new Collection([$account]), $types, $attributes['startDate'], $attributes['endDate']); + $report = $attributes['accounts']->pluck('id')->toArray(); // accounts used in this report + // filter the set so the destinations outside of $attributes['accounts'] are not included. $journals = $journals->filter( - function (TransactionJournal $journal) use ($account, $destinations) { - $currentSources = TransactionJournal::sourceAccountList($journal)->pluck('id')->toArray(); - $currentDest = TransactionJournal::destinationAccountList($journal)->pluck('id')->toArray(); - if ( - !empty(array_intersect([$account->id], $currentSources)) - && !empty(array_intersect($destinations, $currentDest)) - ) { - return true; - } + function (Transaction $transaction) use ($report) { + // get the destinations: + $destinations = TransactionJournal::destinationAccountList($transaction->transactionJournal)->pluck('id')->toArray(); - return false; + // do these intersect with the current list? + return !empty(array_intersect($report, $destinations)); } ); diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index d3b47e5558..269eb9546b 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -3,16 +3,18 @@ * PreferencesController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Http\Controllers; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Http\Requests\TokenFormRequest; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Illuminate\Http\Request; use PragmaRX\Google2FA\Contracts\Google2FA; use Preferences; @@ -68,13 +70,13 @@ class PreferencesController extends Controller } /** - * @param AccountCrudInterface $crud + * @param AccountRepositoryInterface $repository * * @return View */ - public function index(AccountCrudInterface $crud) + public function index(AccountRepositoryInterface $repository) { - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $viewRangePref = Preferences::get('viewRange', '1M'); $viewRange = $viewRangePref->data; $frontPageAccounts = Preferences::get('frontPageAccounts', []); diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index e51948dd3e..24939b2406 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -3,8 +3,10 @@ * ProfileController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php new file mode 100644 index 0000000000..e2d6f01b31 --- /dev/null +++ b/app/Http/Controllers/Report/AccountController.php @@ -0,0 +1,44 @@ +getAccountReport($start, $end, $accounts); + + return view('reports.partials.accounts', compact('accountReport')); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 113f384f51..9834dab7c0 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -3,8 +3,10 @@ * ReportController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -12,16 +14,16 @@ declare(strict_types = 1); namespace FireflyIII\Http\Controllers; use Carbon\Carbon; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Exceptions\FireflyException; -use FireflyIII\Helpers\Report\AccountReportHelperInterface; use FireflyIII\Helpers\Report\BalanceReportHelperInterface; use FireflyIII\Helpers\Report\BudgetReportHelperInterface; use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; -use FireflyIII\Models\TransactionJournal; +use FireflyIII\Models\Transaction; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Account\AccountTaskerInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use Illuminate\Support\Collection; @@ -38,8 +40,6 @@ use View; class ReportController extends Controller { - /** @var AccountReportHelperInterface */ - protected $accountHelper; /** @var BalanceReportHelperInterface */ protected $balanceHelper; @@ -61,11 +61,11 @@ class ReportController extends Controller } /** - * @param AccountCrudInterface $crud + * @param AccountRepositoryInterface $repository * * @return View */ - public function index(AccountCrudInterface $crud) + public function index(AccountRepositoryInterface $repository) { $this->createRepositories(); /** @var Carbon $start */ @@ -74,7 +74,7 @@ class ReportController extends Controller $customFiscalYear = Preferences::get('customFiscalYear', 0)->data; // does the user have shared accounts? - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); // get id's for quick links: $accountIds = []; /** @var Account $account */ @@ -122,7 +122,7 @@ class ReportController extends Controller switch ($reportType) { default: - throw new FireflyException('Unfortunately, reports of the type "' . e($reportType) . '" are not yet available. '); + throw new FireflyException('Unfortunately, reports of the type "' . e($reportType) . '" are not available at this time.'); case 'default': // more than one year date difference means year report. @@ -154,54 +154,36 @@ class ReportController extends Controller private function auditReport(Carbon $start, Carbon $end, Collection $accounts) { /** @var ARI $repos */ - $repos = app(ARI::class); + $repos = app(ARI::class); + /** @var AccountTaskerInterface $tasker */ + $tasker = app(AccountTaskerInterface::class); $auditData = []; $dayBefore = clone $start; $dayBefore->subDay(); /** @var Account $account */ foreach ($accounts as $account) { - // balance the day before: $id = $account->id; - $first = $repos->oldestJournalDate($account); - $last = $repos->newestJournalDate($account); - $exists = false; - $journals = new Collection; $dayBeforeBalance = Steam::balance($account, $dayBefore); - /* - * Is there even activity on this account between the requested dates? - */ - if ($start->between($first, $last) || $end->between($first, $last)) { - $exists = true; - $journals = $repos->journalsInPeriod(new Collection([$account]), [], $start, $end); + $journals = $tasker->getJournalsInPeriod(new Collection([$account]), [], $start, $end); + $journals = $journals->reverse(); + $startBalance = $dayBeforeBalance; - } - /* - * Reverse set, get balances. - */ - $journals = $journals->reverse(); - $startBalance = $dayBeforeBalance; - /** @var TransactionJournal $journal */ - foreach ($journals as $journal) { - $journal->before = $startBalance; - $transactionAmount = $journal->source_amount; - - // get currently relevant transaction: - $destinations = TransactionJournal::destinationAccountList($journal)->pluck('id')->toArray(); - if (in_array($account->id, $destinations)) { - $transactionAmount = TransactionJournal::amountPositive($journal); - } - $newBalance = bcadd($startBalance, $transactionAmount); - $journal->after = $newBalance; - $startBalance = $newBalance; + /** @var Transaction $journal */ + foreach ($journals as $transaction) { + $transaction->before = $startBalance; + $transactionAmount = $transaction->transaction_amount; + $newBalance = bcadd($startBalance, $transactionAmount); + $transaction->after = $newBalance; + $startBalance = $newBalance; } /* * Reverse set again. */ $auditData[$id]['journals'] = $journals->reverse(); - $auditData[$id]['exists'] = $exists; + $auditData[$id]['exists'] = $journals->count() > 0; $auditData[$id]['end'] = $end->formatLocalized(strval(trans('config.month_and_day'))); $auditData[$id]['endBalance'] = Steam::balance($account, $end); $auditData[$id]['dayBefore'] = $dayBefore->formatLocalized(strval(trans('config.month_and_day'))); @@ -232,7 +214,6 @@ class ReportController extends Controller private function createRepositories() { $this->helper = app(ReportHelperInterface::class); - $this->accountHelper = app(AccountReportHelperInterface::class); $this->budgetHelper = app(BudgetReportHelperInterface::class); $this->balanceHelper = app(BalanceReportHelperInterface::class); } @@ -251,14 +232,13 @@ class ReportController extends Controller $expenseTopLength = 8; // get report stuff! - $accountReport = $this->accountHelper->getAccountReport($start, $end, $accounts); - $incomes = $this->helper->getIncomeReport($start, $end, $accounts); - $expenses = $this->helper->getExpenseReport($start, $end, $accounts); - $budgets = $this->budgetHelper->getBudgetReport($start, $end, $accounts); - $categories = $this->helper->getCategoryReport($start, $end, $accounts); - $balance = $this->balanceHelper->getBalanceReport($start, $end, $accounts); - $bills = $this->helper->getBillReport($start, $end, $accounts); - $tags = $this->helper->tagReport($start, $end, $accounts); + $incomes = $this->helper->getIncomeReport($start, $end, $accounts); + $expenses = $this->helper->getExpenseReport($start, $end, $accounts); + $budgets = $this->budgetHelper->getBudgetReport($start, $end, $accounts); + $categories = $this->helper->getCategoryReport($start, $end, $accounts); + $balance = $this->balanceHelper->getBalanceReport($start, $end, $accounts); + $bills = $this->helper->getBillReport($start, $end, $accounts); + $tags = $this->helper->tagReport($start, $end, $accounts); // and some id's, joined: $accountIds = join(',', $accounts->pluck('id')->toArray()); @@ -268,7 +248,7 @@ class ReportController extends Controller 'reports.default.month', compact( 'start', 'end', 'reportType', - 'accountReport', 'tags', + 'tags', 'incomes', 'incomeTopLength', 'expenses', 'expenseTopLength', 'budgets', 'balance', @@ -293,12 +273,11 @@ class ReportController extends Controller $incomeTopLength = 8; $expenseTopLength = 8; // list of users stuff: - $budgets = app(BudgetRepositoryInterface::class)->getActiveBudgets(); - $categories = app(CategoryRepositoryInterface::class)->getCategories(); - $accountReport = $this->accountHelper->getAccountReport($start, $end, $accounts); - $incomes = $this->helper->getIncomeReport($start, $end, $accounts); - $expenses = $this->helper->getExpenseReport($start, $end, $accounts); - $tags = $this->helper->tagReport($start, $end, $accounts); + $budgets = app(BudgetRepositoryInterface::class)->getActiveBudgets(); + $categories = app(CategoryRepositoryInterface::class)->getCategories(); + $incomes = $this->helper->getIncomeReport($start, $end, $accounts); + $expenses = $this->helper->getExpenseReport($start, $end, $accounts); + $tags = $this->helper->tagReport($start, $end, $accounts); // and some id's, joined: $accountIds = []; @@ -311,7 +290,8 @@ class ReportController extends Controller return view( 'reports.default.multi-year', compact( - 'budgets', 'accounts', 'categories', 'start', 'end', 'accountIds', 'reportType', 'accountReport', 'incomes', 'expenses', + 'budgets', 'accounts', 'categories', 'start', 'end', 'accountIds', 'reportType', + 'incomes', 'expenses', 'incomeTopLength', 'expenseTopLength', 'tags' ) ); @@ -330,11 +310,10 @@ class ReportController extends Controller $incomeTopLength = 8; $expenseTopLength = 8; - $accountReport = $this->accountHelper->getAccountReport($start, $end, $accounts); - $incomes = $this->helper->getIncomeReport($start, $end, $accounts); - $expenses = $this->helper->getExpenseReport($start, $end, $accounts); - $tags = $this->helper->tagReport($start, $end, $accounts); - $budgets = $this->budgetHelper->budgetYearOverview($start, $end, $accounts); + $incomes = $this->helper->getIncomeReport($start, $end, $accounts); + $expenses = $this->helper->getExpenseReport($start, $end, $accounts); + $tags = $this->helper->tagReport($start, $end, $accounts); + $budgets = $this->budgetHelper->budgetYearOverview($start, $end, $accounts); Session::flash('gaEventCategory', 'report'); Session::flash('gaEventAction', 'year'); @@ -351,7 +330,7 @@ class ReportController extends Controller return view( 'reports.default.year', compact( - 'start', 'accountReport', 'incomes', 'reportType', 'accountIds', 'end', + 'start', 'incomes', 'reportType', 'accountIds', 'end', 'expenses', 'incomeTopLength', 'expenseTopLength', 'tags', 'budgets' ) ); diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php index 1149c536f3..b6524dbc9e 100644 --- a/app/Http/Controllers/RuleController.php +++ b/app/Http/Controllers/RuleController.php @@ -3,8 +3,10 @@ * RuleController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php index a2a6cb70d9..0e07253ea7 100644 --- a/app/Http/Controllers/RuleGroupController.php +++ b/app/Http/Controllers/RuleGroupController.php @@ -3,8 +3,10 @@ * RuleGroupController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,7 +15,6 @@ namespace FireflyIII\Http\Controllers; use Carbon\Carbon; use ExpandedForm; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Http\Requests\RuleGroupFormRequest; use FireflyIII\Http\Requests\SelectTransactionsRequest; use FireflyIII\Jobs\ExecuteRuleGroupOnExistingTransactions; @@ -154,7 +155,7 @@ class RuleGroupController extends Controller public function execute(SelectTransactionsRequest $request, AccountRepositoryInterface $repository, RuleGroup $ruleGroup) { // Get parameters specified by the user - $accounts = $repository->get($request->get('accounts')); + $accounts = $repository->getAccountsById($request->get('accounts')); $startDate = new Carbon($request->get('start_date')); $endDate = new Carbon($request->get('end_date')); @@ -177,15 +178,15 @@ class RuleGroupController extends Controller } /** - * @param AccountCrudInterface $crud - * @param RuleGroup $ruleGroup + * @param AccountRepositoryInterface $repository + * @param RuleGroup $ruleGroup * * @return View */ - public function selectTransactions(AccountCrudInterface $crud, RuleGroup $ruleGroup) + public function selectTransactions(AccountRepositoryInterface $repository, RuleGroup $ruleGroup) { // does the user have shared accounts? - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $accountList = ExpandedForm::makeSelectList($accounts); $checkedAccounts = array_keys($accountList); $first = session('first')->format('Y-m-d'); diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 3f0b21041b..2066537371 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -3,8 +3,10 @@ * SearchController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index cc736a793e..8459a12af8 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -3,8 +3,10 @@ * TagController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index f7c164b5ac..55096119d9 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -3,8 +3,10 @@ * MassController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -18,6 +20,7 @@ use FireflyIII\Http\Requests\MassDeleteJournalRequest; use FireflyIII\Http\Requests\MassEditJournalRequest; use FireflyIII\Models\AccountType; use FireflyIII\Models\TransactionJournal; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use Illuminate\Support\Collection; use Preferences; @@ -105,9 +108,11 @@ class MassController extends Controller */ public function massEdit(Collection $journals) { - $subTitle = trans('firefly.mass_edit_journals'); - $crud = app('FireflyIII\Crud\Account\AccountCrudInterface'); - $accountList = ExpandedForm::makeSelectList($crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); + $subTitle = trans('firefly.mass_edit_journals'); + + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class); + $accountList = ExpandedForm::makeSelectList($repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); // skip transactions that have multiple destinations // or multiple sources: diff --git a/app/Http/Controllers/Transaction/SplitController.php b/app/Http/Controllers/Transaction/SplitController.php index 10cde184dd..17f5994d39 100644 --- a/app/Http/Controllers/Transaction/SplitController.php +++ b/app/Http/Controllers/Transaction/SplitController.php @@ -3,8 +3,10 @@ * SplitController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -22,6 +24,7 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Illuminate\Http\Request; use Illuminate\Support\Collection; use Log; @@ -59,17 +62,20 @@ class SplitController extends Controller $currencyRepository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); $budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); $piggyRepository = app('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface'); - $crud = app('FireflyIII\Crud\Account\AccountCrudInterface'); - $assetAccounts = ExpandedForm::makeSelectList($crud->getAccountsByType(['Default account', 'Asset account'])); - $sessionData = session('journal-data', []); - $uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size'))); - $currencies = ExpandedForm::makeSelectList($currencyRepository->get()); - $budgets = ExpandedForm::makeSelectListWithEmpty($budgetRepository->getActiveBudgets()); - $piggyBanks = ExpandedForm::makeSelectListWithEmpty($piggyRepository->getPiggyBanksWithAmount()); - $subTitle = trans('form.add_new_' . $sessionData['what']); - $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; - $subTitleIcon = 'fa-plus'; - $preFilled = [ + + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + + $assetAccounts = ExpandedForm::makeSelectList($accountRepository->getAccountsByType(['Default account', 'Asset account'])); + $sessionData = session('journal-data', []); + $uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size'))); + $currencies = ExpandedForm::makeSelectList($currencyRepository->get()); + $budgets = ExpandedForm::makeSelectListWithEmpty($budgetRepository->getActiveBudgets()); + $piggyBanks = ExpandedForm::makeSelectListWithEmpty($piggyRepository->getPiggyBanksWithAmount()); + $subTitle = trans('form.add_new_' . $sessionData['what']); + $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; + $subTitleIcon = 'fa-plus'; + $preFilled = [ 'what' => $sessionData['what'] ?? 'withdrawal', 'journal_amount' => $sessionData['amount'] ?? 0, 'journal_source_account_id' => $sessionData['source_account_id'] ?? 0, @@ -98,15 +104,18 @@ class SplitController extends Controller { $currencyRepository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); $budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); - $crud = app('FireflyIII\Crud\Account\AccountCrudInterface'); - $uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size'))); - $currencies = ExpandedForm::makeSelectList($currencyRepository->get()); - $assetAccounts = ExpandedForm::makeSelectList($crud->getAccountsByType(['Default account', 'Asset account'])); - $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; - $budgets = ExpandedForm::makeSelectListWithEmpty($budgetRepository->getActiveBudgets()); - $preFilled = $this->arrayFromJournal($request, $journal); - $subTitle = trans('breadcrumbs.edit_journal', ['description' => $journal->description]); - $subTitleIcon = 'fa-pencil'; + + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + + $uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size'))); + $currencies = ExpandedForm::makeSelectList($currencyRepository->get()); + $assetAccounts = ExpandedForm::makeSelectList($accountRepository->getAccountsByType(['Default account', 'Asset account'])); + $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; + $budgets = ExpandedForm::makeSelectListWithEmpty($budgetRepository->getActiveBudgets()); + $preFilled = $this->arrayFromJournal($request, $journal); + $subTitle = trans('breadcrumbs.edit_journal', ['description' => $journal->description]); + $subTitleIcon = 'fa-pencil'; Session::flash('gaEventCategory', 'transactions'); Session::flash('gaEventAction', 'edit-split-' . $preFilled['what']); diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 466e375119..98ce9f9317 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -3,8 +3,10 @@ * TransactionController.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,7 +15,6 @@ namespace FireflyIII\Http\Controllers; use Carbon\Carbon; use ExpandedForm; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Events\TransactionJournalStored; use FireflyIII\Events\TransactionJournalUpdated; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; @@ -21,6 +22,7 @@ use FireflyIII\Http\Requests\JournalFormRequest; use FireflyIII\Models\AccountType; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use Illuminate\Http\Request; use Preferences; @@ -60,19 +62,20 @@ class TransactionController extends Controller */ public function create(string $what = TransactionType::DEPOSIT) { - $crud = app(AccountCrudInterface::class); - $budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); - $piggyRepository = app('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface'); - $what = strtolower($what); - $uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size'))); - $assetAccounts = ExpandedForm::makeSelectList($crud->getActiveAccountsByType(['Default account', 'Asset account'])); - $budgets = ExpandedForm::makeSelectListWithEmpty($budgetRepository->getActiveBudgets()); - $piggyBanks = $piggyRepository->getPiggyBanksWithAmount(); - $piggies = ExpandedForm::makeSelectListWithEmpty($piggyBanks); - $preFilled = Session::has('preFilled') ? session('preFilled') : []; - $subTitle = trans('form.add_new_' . $what); - $subTitleIcon = 'fa-plus'; - $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + $budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); + $piggyRepository = app('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface'); + $what = strtolower($what); + $uploadSize = min(Steam::phpBytes(ini_get('upload_max_filesize')), Steam::phpBytes(ini_get('post_max_size'))); + $assetAccounts = ExpandedForm::makeSelectList($accountRepository->getActiveAccountsByType(['Default account', 'Asset account'])); + $budgets = ExpandedForm::makeSelectListWithEmpty($budgetRepository->getActiveBudgets()); + $piggyBanks = $piggyRepository->getPiggyBanksWithAmount(); + $piggies = ExpandedForm::makeSelectListWithEmpty($piggyBanks); + $preFilled = Session::has('preFilled') ? session('preFilled') : []; + $subTitle = trans('form.add_new_' . $what); + $subTitleIcon = 'fa-plus'; + $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; Session::put('preFilled', $preFilled); @@ -147,10 +150,13 @@ class TransactionController extends Controller // code to get list data: $budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); $piggyRepository = app('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface'); - $crud = app('FireflyIII\Crud\Account\AccountCrudInterface'); - $assetAccounts = ExpandedForm::makeSelectList($crud->getAccountsByType(['Default account', 'Asset account'])); - $budgetList = ExpandedForm::makeSelectListWithEmpty($budgetRepository->getActiveBudgets()); - $piggyBankList = ExpandedForm::makeSelectListWithEmpty($piggyRepository->getPiggyBanks()); + + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class); + + $assetAccounts = ExpandedForm::makeSelectList($repository->getAccountsByType(['Default account', 'Asset account'])); + $budgetList = ExpandedForm::makeSelectListWithEmpty($budgetRepository->getActiveBudgets()); + $piggyBankList = ExpandedForm::makeSelectListWithEmpty($piggyRepository->getPiggyBanks()); // view related code $subTitle = trans('breadcrumbs.edit_journal', ['description' => $journal->description]); @@ -242,6 +248,7 @@ class TransactionController extends Controller $date = new Carbon($request->get('date')); if (count($ids) > 0) { $order = 0; + $ids = array_unique($ids); foreach ($ids as $id) { $journal = $repository->find(intval($id)); if ($journal && $journal->date->format('Y-m-d') == $date->format('Y-m-d')) { diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 8732441d0f..b9f1190f10 100755 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -3,8 +3,10 @@ * Kernel.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 0c26c37041..529546437d 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -3,8 +3,10 @@ * Authenticate.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/AuthenticateTwoFactor.php b/app/Http/Middleware/AuthenticateTwoFactor.php index 6f4d3dcd26..7dbaa77505 100644 --- a/app/Http/Middleware/AuthenticateTwoFactor.php +++ b/app/Http/Middleware/AuthenticateTwoFactor.php @@ -3,8 +3,10 @@ * AuthenticateTwoFactor.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.php index c4ae645a99..79cf3267fd 100644 --- a/app/Http/Middleware/Binder.php +++ b/app/Http/Middleware/Binder.php @@ -3,8 +3,10 @@ * Binder.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index b61a40ea41..6475f4f6da 100755 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -3,8 +3,10 @@ * EncryptCookies.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/IsAdmin.php b/app/Http/Middleware/IsAdmin.php index 11addec25f..598de92d86 100644 --- a/app/Http/Middleware/IsAdmin.php +++ b/app/Http/Middleware/IsAdmin.php @@ -3,8 +3,10 @@ * IsAdmin.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/IsConfirmed.php b/app/Http/Middleware/IsConfirmed.php index df7638cbcb..bd6dfa1c02 100644 --- a/app/Http/Middleware/IsConfirmed.php +++ b/app/Http/Middleware/IsConfirmed.php @@ -3,8 +3,10 @@ * IsConfirmed.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/IsNotConfirmed.php b/app/Http/Middleware/IsNotConfirmed.php index e0fb82464f..62887408c0 100644 --- a/app/Http/Middleware/IsNotConfirmed.php +++ b/app/Http/Middleware/IsNotConfirmed.php @@ -3,8 +3,10 @@ * IsNotConfirmed.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index fe4526d3ad..f64f5939e0 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -3,8 +3,10 @@ * Range.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index a0486084c0..e7cf7f3bcf 100755 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -3,8 +3,10 @@ * RedirectIfAuthenticated.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php index df21bc9583..43cc865dc7 100644 --- a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php +++ b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php @@ -3,8 +3,10 @@ * RedirectIfTwoFactorAuthenticated.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index dd56e47a6b..6eb1050494 100755 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -3,8 +3,10 @@ * VerifyCsrfToken.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index 2522a9440d..3bad8d5ec6 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -3,8 +3,10 @@ * AccountFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/AttachmentFormRequest.php b/app/Http/Requests/AttachmentFormRequest.php index 2f3a6712c1..78cbda523b 100644 --- a/app/Http/Requests/AttachmentFormRequest.php +++ b/app/Http/Requests/AttachmentFormRequest.php @@ -3,8 +3,10 @@ * AttachmentFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/BillFormRequest.php b/app/Http/Requests/BillFormRequest.php index 02e7a2891e..3e1b5eb93b 100644 --- a/app/Http/Requests/BillFormRequest.php +++ b/app/Http/Requests/BillFormRequest.php @@ -3,8 +3,10 @@ * BillFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/BudgetFormRequest.php b/app/Http/Requests/BudgetFormRequest.php index 3dbb576214..6d1b8a02b1 100644 --- a/app/Http/Requests/BudgetFormRequest.php +++ b/app/Http/Requests/BudgetFormRequest.php @@ -3,8 +3,10 @@ * BudgetFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/CategoryFormRequest.php b/app/Http/Requests/CategoryFormRequest.php index 02b95cb14f..020777a827 100644 --- a/app/Http/Requests/CategoryFormRequest.php +++ b/app/Http/Requests/CategoryFormRequest.php @@ -3,8 +3,10 @@ * CategoryFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/ConfigurationRequest.php b/app/Http/Requests/ConfigurationRequest.php index fedd9ff04b..e45dd77f6c 100644 --- a/app/Http/Requests/ConfigurationRequest.php +++ b/app/Http/Requests/ConfigurationRequest.php @@ -3,8 +3,10 @@ * ConfigurationRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/CurrencyFormRequest.php b/app/Http/Requests/CurrencyFormRequest.php index 818597c3d1..6bfe964e65 100644 --- a/app/Http/Requests/CurrencyFormRequest.php +++ b/app/Http/Requests/CurrencyFormRequest.php @@ -3,8 +3,10 @@ * CurrencyFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/DeleteAccountFormRequest.php b/app/Http/Requests/DeleteAccountFormRequest.php index 137e718a30..9586af3767 100644 --- a/app/Http/Requests/DeleteAccountFormRequest.php +++ b/app/Http/Requests/DeleteAccountFormRequest.php @@ -3,8 +3,10 @@ * DeleteAccountFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/ExportFormRequest.php b/app/Http/Requests/ExportFormRequest.php index e20e38cf9a..028a3246cf 100644 --- a/app/Http/Requests/ExportFormRequest.php +++ b/app/Http/Requests/ExportFormRequest.php @@ -3,8 +3,10 @@ * ExportFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/ImportUploadRequest.php b/app/Http/Requests/ImportUploadRequest.php index 0884ed524f..62e4f117d8 100644 --- a/app/Http/Requests/ImportUploadRequest.php +++ b/app/Http/Requests/ImportUploadRequest.php @@ -3,8 +3,10 @@ * ImportUploadRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.php index abce71e17c..9f1a5fcdf5 100644 --- a/app/Http/Requests/JournalFormRequest.php +++ b/app/Http/Requests/JournalFormRequest.php @@ -3,8 +3,10 @@ * JournalFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/MassDeleteJournalRequest.php b/app/Http/Requests/MassDeleteJournalRequest.php index 167d8f306f..13283012d1 100644 --- a/app/Http/Requests/MassDeleteJournalRequest.php +++ b/app/Http/Requests/MassDeleteJournalRequest.php @@ -3,8 +3,10 @@ * MassDeleteJournalRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/MassEditJournalRequest.php b/app/Http/Requests/MassEditJournalRequest.php index 7f7ae97f89..03ae6ae6f7 100644 --- a/app/Http/Requests/MassEditJournalRequest.php +++ b/app/Http/Requests/MassEditJournalRequest.php @@ -3,8 +3,10 @@ * MassEditJournalRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/NewUserFormRequest.php b/app/Http/Requests/NewUserFormRequest.php index 24b094b48d..b8627cffa2 100644 --- a/app/Http/Requests/NewUserFormRequest.php +++ b/app/Http/Requests/NewUserFormRequest.php @@ -3,8 +3,10 @@ * NewUserFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/PiggyBankFormRequest.php b/app/Http/Requests/PiggyBankFormRequest.php index 0363a37f33..5ef35a1541 100644 --- a/app/Http/Requests/PiggyBankFormRequest.php +++ b/app/Http/Requests/PiggyBankFormRequest.php @@ -3,8 +3,10 @@ * PiggyBankFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/ProfileFormRequest.php b/app/Http/Requests/ProfileFormRequest.php index 0b20e398d3..02bce0c99c 100644 --- a/app/Http/Requests/ProfileFormRequest.php +++ b/app/Http/Requests/ProfileFormRequest.php @@ -3,8 +3,10 @@ * ProfileFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php index ad6dca8f33..84cb318d3e 100644 --- a/app/Http/Requests/Request.php +++ b/app/Http/Requests/Request.php @@ -3,8 +3,10 @@ * Request.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php index ffb057bcdd..975a331480 100644 --- a/app/Http/Requests/RuleFormRequest.php +++ b/app/Http/Requests/RuleFormRequest.php @@ -3,8 +3,10 @@ * RuleFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php index 6160d4fd58..675acec024 100644 --- a/app/Http/Requests/RuleGroupFormRequest.php +++ b/app/Http/Requests/RuleGroupFormRequest.php @@ -3,8 +3,10 @@ * RuleGroupFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/SelectTransactionsRequest.php b/app/Http/Requests/SelectTransactionsRequest.php index b11e2db6aa..097089ff79 100644 --- a/app/Http/Requests/SelectTransactionsRequest.php +++ b/app/Http/Requests/SelectTransactionsRequest.php @@ -3,8 +3,10 @@ * SelectTransactionsRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/SplitJournalFormRequest.php b/app/Http/Requests/SplitJournalFormRequest.php index 828a79b888..ea246fc2d1 100644 --- a/app/Http/Requests/SplitJournalFormRequest.php +++ b/app/Http/Requests/SplitJournalFormRequest.php @@ -3,8 +3,10 @@ * SplitJournalFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index bb69349675..086943d7f5 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -3,8 +3,10 @@ * TagFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/TestRuleFormRequest.php b/app/Http/Requests/TestRuleFormRequest.php index 9eba85b2f4..df76fd08a3 100644 --- a/app/Http/Requests/TestRuleFormRequest.php +++ b/app/Http/Requests/TestRuleFormRequest.php @@ -3,8 +3,10 @@ * TestRuleFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/Requests/TokenFormRequest.php b/app/Http/Requests/TokenFormRequest.php index bdf9410799..4c90a2539f 100644 --- a/app/Http/Requests/TokenFormRequest.php +++ b/app/Http/Requests/TokenFormRequest.php @@ -3,8 +3,10 @@ * TokenFormRequest.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index 3803ef08d9..284269215c 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -3,8 +3,10 @@ * breadcrumbs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/AccountId.php b/app/Import/Converter/AccountId.php index 1f07603f63..5b39999f2e 100644 --- a/app/Import/Converter/AccountId.php +++ b/app/Import/Converter/AccountId.php @@ -3,16 +3,18 @@ * AccountId.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** @@ -37,8 +39,9 @@ class AccountId extends BasicConverter implements ConverterInterface return new Account; } - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); + if (isset($this->mapping[$value])) { Log::debug('Found account in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); $account = $repository->find(intval($this->mapping[$value])); diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php index 9bb8663b1c..6b64a2b862 100644 --- a/app/Import/Converter/Amount.php +++ b/app/Import/Converter/Amount.php @@ -3,8 +3,10 @@ * Amount.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -39,7 +41,7 @@ class Amount extends BasicConverter implements ConverterInterface } if ($len > 2 && $value{$decimalPosition} == ',') { $decimal = ','; - } + } // if decimal is dot, replace all comma's and spaces with nothing. then parse as float (round to 4 pos) if ($decimal === '.') { diff --git a/app/Import/Converter/AssetAccountIban.php b/app/Import/Converter/AssetAccountIban.php index 97f1932e14..9ed749a781 100644 --- a/app/Import/Converter/AssetAccountIban.php +++ b/app/Import/Converter/AssetAccountIban.php @@ -3,17 +3,19 @@ * AssetAccountIban.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** @@ -40,8 +42,8 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface return new Account; } - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); if (isset($this->mapping[$value])) { diff --git a/app/Import/Converter/AssetAccountName.php b/app/Import/Converter/AssetAccountName.php index f20cd7b798..4785ae16d2 100644 --- a/app/Import/Converter/AssetAccountName.php +++ b/app/Import/Converter/AssetAccountName.php @@ -3,17 +3,19 @@ * AssetAccountName.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** @@ -40,8 +42,8 @@ class AssetAccountName extends BasicConverter implements ConverterInterface return new Account; } - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); if (isset($this->mapping[$value])) { diff --git a/app/Import/Converter/AssetAccountNumber.php b/app/Import/Converter/AssetAccountNumber.php index b19fce1433..5c71bf57f1 100644 --- a/app/Import/Converter/AssetAccountNumber.php +++ b/app/Import/Converter/AssetAccountNumber.php @@ -3,17 +3,19 @@ * AssetAccountNumber.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** @@ -38,8 +40,8 @@ class AssetAccountNumber extends BasicConverter implements ConverterInterface return new Account; } - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); if (isset($this->mapping[$value])) { diff --git a/app/Import/Converter/BasicConverter.php b/app/Import/Converter/BasicConverter.php index dbe7b56663..bce8b5e46b 100644 --- a/app/Import/Converter/BasicConverter.php +++ b/app/Import/Converter/BasicConverter.php @@ -3,8 +3,10 @@ * BasicConverter.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/BillId.php b/app/Import/Converter/BillId.php index edb8817a10..06713afaf4 100644 --- a/app/Import/Converter/BillId.php +++ b/app/Import/Converter/BillId.php @@ -3,8 +3,10 @@ * BillId.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/BillName.php b/app/Import/Converter/BillName.php index 04b48ea156..6c4aa2fc17 100644 --- a/app/Import/Converter/BillName.php +++ b/app/Import/Converter/BillName.php @@ -3,8 +3,10 @@ * BillName.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/BudgetId.php b/app/Import/Converter/BudgetId.php index 617bf487fc..0fe769f70e 100644 --- a/app/Import/Converter/BudgetId.php +++ b/app/Import/Converter/BudgetId.php @@ -3,8 +3,10 @@ * BudgetId.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/BudgetName.php b/app/Import/Converter/BudgetName.php index 36158c834d..fc5d5416fc 100644 --- a/app/Import/Converter/BudgetName.php +++ b/app/Import/Converter/BudgetName.php @@ -3,8 +3,10 @@ * BudgetName.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/CategoryId.php b/app/Import/Converter/CategoryId.php index 9f350f3fa6..5d538f4b90 100644 --- a/app/Import/Converter/CategoryId.php +++ b/app/Import/Converter/CategoryId.php @@ -3,8 +3,10 @@ * CategoryId.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/CategoryName.php b/app/Import/Converter/CategoryName.php index 9b79c33a1e..28e7650c1f 100644 --- a/app/Import/Converter/CategoryName.php +++ b/app/Import/Converter/CategoryName.php @@ -3,8 +3,10 @@ * CategoryName.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/ConverterInterface.php b/app/Import/Converter/ConverterInterface.php index 8e74c719e3..0cc0137a05 100644 --- a/app/Import/Converter/ConverterInterface.php +++ b/app/Import/Converter/ConverterInterface.php @@ -3,8 +3,10 @@ * ConverterInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/CurrencyCode.php b/app/Import/Converter/CurrencyCode.php index 57b7284765..48901cceaa 100644 --- a/app/Import/Converter/CurrencyCode.php +++ b/app/Import/Converter/CurrencyCode.php @@ -3,8 +3,10 @@ * CurrencyCode.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/CurrencyId.php b/app/Import/Converter/CurrencyId.php index 644ef6ff77..6622899264 100644 --- a/app/Import/Converter/CurrencyId.php +++ b/app/Import/Converter/CurrencyId.php @@ -3,8 +3,10 @@ * CurrencyId.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/CurrencyName.php b/app/Import/Converter/CurrencyName.php index cb750150ff..ad28107f4b 100644 --- a/app/Import/Converter/CurrencyName.php +++ b/app/Import/Converter/CurrencyName.php @@ -3,8 +3,10 @@ * CurrencyName.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/CurrencySymbol.php b/app/Import/Converter/CurrencySymbol.php index 7643087a0a..307d409cd0 100644 --- a/app/Import/Converter/CurrencySymbol.php +++ b/app/Import/Converter/CurrencySymbol.php @@ -3,8 +3,10 @@ * CurrencySymbol.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/Date.php b/app/Import/Converter/Date.php index 4cc9808291..e4b6cbb0e9 100644 --- a/app/Import/Converter/Date.php +++ b/app/Import/Converter/Date.php @@ -3,8 +3,10 @@ * Date.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/Description.php b/app/Import/Converter/Description.php index d7a2cde245..b9c3bdf807 100644 --- a/app/Import/Converter/Description.php +++ b/app/Import/Converter/Description.php @@ -3,8 +3,10 @@ * Description.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/ExternalId.php b/app/Import/Converter/ExternalId.php index 5f8c493fed..344e793be4 100644 --- a/app/Import/Converter/ExternalId.php +++ b/app/Import/Converter/ExternalId.php @@ -3,8 +3,10 @@ * ExternalId.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/INGDebetCredit.php b/app/Import/Converter/INGDebetCredit.php index b023e4c09d..1640e76d0c 100644 --- a/app/Import/Converter/INGDebetCredit.php +++ b/app/Import/Converter/INGDebetCredit.php @@ -3,8 +3,10 @@ * INGDebetCredit.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/Ignore.php b/app/Import/Converter/Ignore.php index e96b5fabb1..88f1c2c889 100644 --- a/app/Import/Converter/Ignore.php +++ b/app/Import/Converter/Ignore.php @@ -3,8 +3,10 @@ * Ignore.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/OpposingAccountIban.php b/app/Import/Converter/OpposingAccountIban.php index a0ccc57038..b1f8dc63e7 100644 --- a/app/Import/Converter/OpposingAccountIban.php +++ b/app/Import/Converter/OpposingAccountIban.php @@ -3,16 +3,18 @@ * OpposingAccountIban.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** @@ -39,8 +41,8 @@ class OpposingAccountIban extends BasicConverter implements ConverterInterface return new Account; } - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); if (isset($this->mapping[$value])) { diff --git a/app/Import/Converter/OpposingAccountName.php b/app/Import/Converter/OpposingAccountName.php index e035de8ad0..4516873a25 100644 --- a/app/Import/Converter/OpposingAccountName.php +++ b/app/Import/Converter/OpposingAccountName.php @@ -3,16 +3,18 @@ * OpposingAccountName.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** @@ -39,8 +41,8 @@ class OpposingAccountName extends BasicConverter implements ConverterInterface return new Account; } - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); if (isset($this->mapping[$value])) { diff --git a/app/Import/Converter/OpposingAccountNumber.php b/app/Import/Converter/OpposingAccountNumber.php index d8fbc02e62..86df680223 100644 --- a/app/Import/Converter/OpposingAccountNumber.php +++ b/app/Import/Converter/OpposingAccountNumber.php @@ -3,17 +3,19 @@ * OpposingAccountNumber.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Log; /** @@ -40,8 +42,8 @@ class OpposingAccountNumber extends BasicConverter implements ConverterInterface return new Account; } - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); if (isset($this->mapping[$value])) { diff --git a/app/Import/Converter/RabobankDebetCredit.php b/app/Import/Converter/RabobankDebetCredit.php index 2cd9e2ed98..dfa8363e2a 100644 --- a/app/Import/Converter/RabobankDebetCredit.php +++ b/app/Import/Converter/RabobankDebetCredit.php @@ -3,8 +3,10 @@ * RabobankDebetCredit.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/TagsComma.php b/app/Import/Converter/TagsComma.php index 2fb5981378..d4e4687e3a 100644 --- a/app/Import/Converter/TagsComma.php +++ b/app/Import/Converter/TagsComma.php @@ -3,8 +3,10 @@ * TagsComma.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Converter/TagsSpace.php b/app/Import/Converter/TagsSpace.php index 4f8c7e3196..d2d86eb8eb 100644 --- a/app/Import/Converter/TagsSpace.php +++ b/app/Import/Converter/TagsSpace.php @@ -3,8 +3,10 @@ * TagsSpace.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/ImportEntry.php b/app/Import/ImportEntry.php index 931079fc55..cd3f48b402 100644 --- a/app/Import/ImportEntry.php +++ b/app/Import/ImportEntry.php @@ -3,8 +3,10 @@ * ImportEntry.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/ImportProcedure.php b/app/Import/ImportProcedure.php index 9b26b1dff5..ae6b2cf910 100644 --- a/app/Import/ImportProcedure.php +++ b/app/Import/ImportProcedure.php @@ -3,17 +3,19 @@ * ImportProcedure.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import; -use FireflyIII\Crud\Account\AccountCrud; use FireflyIII\Import\Importer\ImporterInterface; use FireflyIII\Models\ImportJob; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Illuminate\Support\Collection; /** @@ -54,7 +56,9 @@ class ImportProcedure $validator->setUser($job->user); $validator->setJob($job); if ($job->configuration['import-account'] != 0) { - $repository = app(AccountCrud::class, [$job->user]); + + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$job->user]); $validator->setDefaultImportAccount($repository->find($job->configuration['import-account'])); } diff --git a/app/Import/ImportStorage.php b/app/Import/ImportStorage.php index 44be15d5e6..8b4986a9fe 100644 --- a/app/Import/ImportStorage.php +++ b/app/Import/ImportStorage.php @@ -3,8 +3,10 @@ * ImportStorage.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -183,7 +185,7 @@ class ImportStorage ->where('rules.active', 1) ->orderBy('rule_groups.order', 'ASC') ->orderBy('rules.order', 'ASC') - ->get(['rules.*']); + ->get(['rules.*', 'rule_groups.order']); Log::debug(sprintf('Found %d user rules.', $set->count())); return $set; diff --git a/app/Import/ImportValidator.php b/app/Import/ImportValidator.php index 65dfbbe96a..20705ca605 100644 --- a/app/Import/ImportValidator.php +++ b/app/Import/ImportValidator.php @@ -3,8 +3,10 @@ * ImportValidator.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -12,11 +14,11 @@ declare(strict_types = 1); namespace FireflyIII\Import; use Carbon\Carbon; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Models\ImportJob; use FireflyIII\Models\TransactionType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\User; use Illuminate\Support\Collection; @@ -173,9 +175,11 @@ class ImportValidator return $account; } // find it first by new type: - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); - $result = $repository->findByName($account->name, [$type]); + + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); + + $result = $repository->findByName($account->name, [$type]); if (is_null($result->id)) { // can convert account: Log::debug(sprintf('No account named %s of type %s, create new account.', $account->name, $type)); @@ -209,10 +213,11 @@ class ImportValidator private function fallbackExpenseAccount(): Account { - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); - $name = 'Unknown expense account'; - $result = $repository->findByName($name, [AccountType::EXPENSE]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); + + $name = 'Unknown expense account'; + $result = $repository->findByName($name, [AccountType::EXPENSE]); if (is_null($result->id)) { $result = $repository->store( ['name' => $name, 'iban' => null, 'openingBalance' => 0, 'user' => $this->user->id, 'accountType' => 'expense', 'virtualBalance' => 0, @@ -229,10 +234,13 @@ class ImportValidator private function fallbackRevenueAccount(): Account { - /** @var AccountCrudInterface $repository */ - $repository = app(AccountCrudInterface::class, [$this->user]); - $name = 'Unknown revenue account'; - $result = $repository->findByName($name, [AccountType::REVENUE]); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [$this->user]); + + $name = 'Unknown revenue account'; + $result = $repository->findByName($name, [AccountType::REVENUE]); + + if (is_null($result->id)) { $result = $repository->store( ['name' => $name, 'iban' => null, 'openingBalance' => 0, 'user' => $this->user->id, 'accountType' => 'revenue', 'virtualBalance' => 0, diff --git a/app/Import/Importer/CsvImporter.php b/app/Import/Importer/CsvImporter.php index efd1584e20..797335cb1d 100644 --- a/app/Import/Importer/CsvImporter.php +++ b/app/Import/Importer/CsvImporter.php @@ -3,8 +3,10 @@ * CsvImporter.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -97,6 +99,7 @@ class CsvImporter implements ImporterInterface * @param array $row * * @return ImportEntry + * @throws FireflyException */ private function importSingleRow(int $index, array $row): ImportEntry { diff --git a/app/Import/Importer/ImporterInterface.php b/app/Import/Importer/ImporterInterface.php index 2ebd905f09..9994faa205 100644 --- a/app/Import/Importer/ImporterInterface.php +++ b/app/Import/Importer/ImporterInterface.php @@ -3,8 +3,10 @@ * ImporterInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Logging/CommandHandler.php b/app/Import/Logging/CommandHandler.php index b76b683e66..56813cd2ad 100644 --- a/app/Import/Logging/CommandHandler.php +++ b/app/Import/Logging/CommandHandler.php @@ -1,10 +1,12 @@ getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); - $topList = []; - $list = []; + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + $set = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $topList = []; + $list = []; /** @var Account $account */ foreach ($set as $account) { diff --git a/app/Import/Mapper/AssetAccounts.php b/app/Import/Mapper/AssetAccounts.php index 21e4007361..dc6032dc7a 100644 --- a/app/Import/Mapper/AssetAccounts.php +++ b/app/Import/Mapper/AssetAccounts.php @@ -3,17 +3,19 @@ * AssetAccounts.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Mapper; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; /** * Class AssetAccounts @@ -28,10 +30,10 @@ class AssetAccounts implements MapperInterface */ public function getMap(): array { - /** @var AccountCrudInterface $crud */ - $crud = app(AccountCrudInterface::class); - $set = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); - $list = []; + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + $set = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $list = []; /** @var Account $account */ foreach ($set as $account) { diff --git a/app/Import/Mapper/Bills.php b/app/Import/Mapper/Bills.php index b1629d4865..2fddb31e4e 100644 --- a/app/Import/Mapper/Bills.php +++ b/app/Import/Mapper/Bills.php @@ -3,8 +3,10 @@ * Bills.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Mapper/Budgets.php b/app/Import/Mapper/Budgets.php index fad817ed32..b566568d25 100644 --- a/app/Import/Mapper/Budgets.php +++ b/app/Import/Mapper/Budgets.php @@ -3,8 +3,10 @@ * Budgets.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Mapper/Categories.php b/app/Import/Mapper/Categories.php index 784e748848..6e66964040 100644 --- a/app/Import/Mapper/Categories.php +++ b/app/Import/Mapper/Categories.php @@ -3,8 +3,10 @@ * Categories.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Mapper/MapperInterface.php b/app/Import/Mapper/MapperInterface.php index c285c9b31f..c80b71fa26 100644 --- a/app/Import/Mapper/MapperInterface.php +++ b/app/Import/Mapper/MapperInterface.php @@ -3,8 +3,10 @@ * MapperInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Mapper/OpposingAccountIbans.php b/app/Import/Mapper/OpposingAccountIbans.php index 8ab544e8df..dd2a3261ca 100644 --- a/app/Import/Mapper/OpposingAccountIbans.php +++ b/app/Import/Mapper/OpposingAccountIbans.php @@ -3,17 +3,19 @@ * OpposingAccountIbans.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Mapper; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; /** * Class OpposingAccounts @@ -28,17 +30,17 @@ class OpposingAccountIbans implements MapperInterface */ public function getMap(): array { - /** @var AccountCrudInterface $crud */ - $crud = app(AccountCrudInterface::class); - $set = $crud->getAccountsByType( + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + $set = $accountRepository->getAccountsByType( [ AccountType::DEFAULT, AccountType::ASSET, AccountType::EXPENSE, AccountType::BENEFICIARY, AccountType::REVENUE, ] ); - $topList = []; - $list = []; + $topList = []; + $list = []; /** @var Account $account */ foreach ($set as $account) { diff --git a/app/Import/Mapper/OpposingAccounts.php b/app/Import/Mapper/OpposingAccounts.php index 13392a8f66..8fbc20768e 100644 --- a/app/Import/Mapper/OpposingAccounts.php +++ b/app/Import/Mapper/OpposingAccounts.php @@ -3,17 +3,19 @@ * OpposingAccounts.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Import\Mapper; -use FireflyIII\Crud\Account\AccountCrudInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; /** * Class OpposingAccounts @@ -28,16 +30,16 @@ class OpposingAccounts implements MapperInterface */ public function getMap(): array { - /** @var AccountCrudInterface $crud */ - $crud = app(AccountCrudInterface::class); - $set = $crud->getAccountsByType( + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + $set = $accountRepository->getAccountsByType( [ AccountType::DEFAULT, AccountType::ASSET, AccountType::EXPENSE, AccountType::BENEFICIARY, AccountType::REVENUE, ] ); - $list = []; + $list = []; /** @var Account $account */ foreach ($set as $account) { diff --git a/app/Import/Mapper/Tags.php b/app/Import/Mapper/Tags.php index f38d1e0f08..ac8daa8f77 100644 --- a/app/Import/Mapper/Tags.php +++ b/app/Import/Mapper/Tags.php @@ -3,8 +3,10 @@ * Tags.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Mapper/TransactionCurrencies.php b/app/Import/Mapper/TransactionCurrencies.php index ff6d4a1feb..f5e157c5a3 100644 --- a/app/Import/Mapper/TransactionCurrencies.php +++ b/app/Import/Mapper/TransactionCurrencies.php @@ -3,8 +3,10 @@ * TransactionCurrencies.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/MapperPreProcess/PreProcessorInterface.php b/app/Import/MapperPreProcess/PreProcessorInterface.php index 3f6187a1eb..9c0c8a213f 100644 --- a/app/Import/MapperPreProcess/PreProcessorInterface.php +++ b/app/Import/MapperPreProcess/PreProcessorInterface.php @@ -3,8 +3,10 @@ * PreProcessorInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/MapperPreProcess/TagsComma.php b/app/Import/MapperPreProcess/TagsComma.php index 19ec5f60a9..ec2ed1013d 100644 --- a/app/Import/MapperPreProcess/TagsComma.php +++ b/app/Import/MapperPreProcess/TagsComma.php @@ -3,8 +3,10 @@ * TagsComma.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/MapperPreProcess/TagsSpace.php b/app/Import/MapperPreProcess/TagsSpace.php index c87108885d..bd3c18b660 100644 --- a/app/Import/MapperPreProcess/TagsSpace.php +++ b/app/Import/MapperPreProcess/TagsSpace.php @@ -3,8 +3,10 @@ * TagsSpace.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Setup/CsvSetup.php b/app/Import/Setup/CsvSetup.php index e1201a7782..2bb8dca422 100644 --- a/app/Import/Setup/CsvSetup.php +++ b/app/Import/Setup/CsvSetup.php @@ -3,8 +3,10 @@ * CsvSetup.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,7 +15,6 @@ namespace FireflyIII\Import\Setup; use ExpandedForm; -use FireflyIII\Crud\Account\AccountCrud; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Import\Mapper\MapperInterface; use FireflyIII\Import\MapperPreProcess\PreProcessorInterface; @@ -21,6 +22,7 @@ use FireflyIII\Import\Specifics\SpecificInterface; use FireflyIII\Models\Account; use FireflyIII\Models\AccountType; use FireflyIII\Models\ImportJob; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; use Illuminate\Http\Request; use League\Csv\Reader; use Log; @@ -72,9 +74,10 @@ class CsvSetup implements SetupInterface */ public function getConfigurationData(): array { - $crud = app('FireflyIII\Crud\Account\AccountCrudInterface'); - $accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); - $delimiters = [ + /** @var AccountRepositoryInterface $accountRepository */ + $accountRepository = app(AccountRepositoryInterface::class); + $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $delimiters = [ ',' => trans('form.csv_comma'), ';' => trans('form.csv_semicolon'), 'tab' => trans('form.csv_tab'), @@ -175,10 +178,11 @@ class CsvSetup implements SetupInterface */ public function saveImportConfiguration(array $data, FileBag $files): bool { - /** @var AccountCrud $repository */ - $repository = app(AccountCrud::class, [auth()->user()]); - $importId = $data['csv_import_account'] ?? 0; - $account = $repository->find(intval($importId)); + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepositoryInterface::class, [auth()->user()]); + + $importId = $data['csv_import_account'] ?? 0; + $account = $repository->find(intval($importId)); $hasHeaders = isset($data['has_headers']) && intval($data['has_headers']) === 1 ? true : false; $config = $this->job->configuration; @@ -382,6 +386,10 @@ class CsvSetup implements SetupInterface //do something here foreach ($indexes as $index) { // this is simply 1, 2, 3, etc. + if (!isset($row[$index])) { + // don't really know how to handle this. Just skip, for now. + continue; + } $value = $row[$index]; if (strlen($value) > 0) { diff --git a/app/Import/Setup/SetupInterface.php b/app/Import/Setup/SetupInterface.php index 747595fd71..995292b52f 100644 --- a/app/Import/Setup/SetupInterface.php +++ b/app/Import/Setup/SetupInterface.php @@ -3,8 +3,10 @@ * SetupInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Specifics/AbnAmroDescription.php b/app/Import/Specifics/AbnAmroDescription.php index 066a921dec..4931e6b327 100644 --- a/app/Import/Specifics/AbnAmroDescription.php +++ b/app/Import/Specifics/AbnAmroDescription.php @@ -3,8 +3,10 @@ * AbnAmroDescription.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -62,7 +64,7 @@ class AbnAmroDescription implements SpecificInterface // If the description could not be parsed, specify an unknown opposing // account, as an opposing account is required if (!$parsed) { - $this->row[7] = trans('firefly.unknown'); // opposing-account-name + $this->row[8] = trans('firefly.unknown'); // opposing-account-name } return $this->row; diff --git a/app/Import/Specifics/IngDescription.php b/app/Import/Specifics/IngDescription.php index 15595084f3..aa03ff06d1 100644 --- a/app/Import/Specifics/IngDescription.php +++ b/app/Import/Specifics/IngDescription.php @@ -1,10 +1,12 @@ row = $row; if (count($this->row) >= 8) { // check if the array is correct switch ($this->row[4]) { // Get value for the mutation type - case 'GT': // InternetBanieren + case 'GT': // InternetBankieren case 'OV': // Overschrijving case 'VZ': // Verzamelbetaling case 'IC': // Incasso $this->removeIBANIngDescription(); $this->removeNameIngDescription(); break; - case 'BA' : // Betaalautomaat + case 'BA': // Betaalautomaat $this->addNameIngDescription(); break; } @@ -70,6 +72,19 @@ class IngDescription implements SpecificInterface return $this->row; } + /** + * Add the Opposing name from cell 1 in the description for Betaalautomaten + * Otherwise the description is only: 'Pasvolgnr: Transactie: Term:' + * + * @return bool true + */ + protected function addNameIngDescription() + { + $this->row[8] = $this->row[1] . ' ' . $this->row[8]; + + return true; + } + /** * Remove IBAN number out of the description * Default description of Description is: Naam: Omschrijving: IBAN: @@ -79,11 +94,11 @@ class IngDescription implements SpecificInterface protected function removeIBANIngDescription() { // Try replace the iban number with nothing. The IBAN nr is found in the third row - $this->row[8] = preg_replace('/\sIBAN:\s'.$this->row[3].'/', '', $this->row[8]); + $this->row[8] = preg_replace('/\sIBAN:\s' . $this->row[3] . '/', '', $this->row[8]); + return true; } - /** * Remove name from the description (Remove everything before the description incl the word 'Omschrijving' ) * @@ -93,19 +108,7 @@ class IngDescription implements SpecificInterface { // Try remove everything bevore the 'Omschrijving' $this->row[8] = preg_replace('/.+Omschrijving: /', '', $this->row[8]); - return true; - } - - /** - * Add the Opposing name from cell 1 in the description for Betaalautomaten - * Otherwise the description is only: 'Pasvolgnr: Transactie: Term:' - * - * @return bool true - */ - protected function addNameIngDescription() - { - $this->row[8] = $this->row[1]. " " . $this->row[8]; return true; } diff --git a/app/Import/Specifics/PresidentsChoice.php b/app/Import/Specifics/PresidentsChoice.php index d4f704887a..4e5079a949 100644 --- a/app/Import/Specifics/PresidentsChoice.php +++ b/app/Import/Specifics/PresidentsChoice.php @@ -3,8 +3,10 @@ * PresidentsChoice.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Specifics/RabobankDescription.php b/app/Import/Specifics/RabobankDescription.php index 75e074acb9..a3988f2a61 100644 --- a/app/Import/Specifics/RabobankDescription.php +++ b/app/Import/Specifics/RabobankDescription.php @@ -3,8 +3,10 @@ * RabobankDescription.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Import/Specifics/SpecificInterface.php b/app/Import/Specifics/SpecificInterface.php index c1536110e4..56a11b9f6b 100644 --- a/app/Import/Specifics/SpecificInterface.php +++ b/app/Import/Specifics/SpecificInterface.php @@ -3,8 +3,10 @@ * SpecificInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php index 3c791ddeaf..e6437ec74d 100644 --- a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php +++ b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php @@ -3,8 +3,10 @@ * ExecuteRuleGroupOnExistingTransactions.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Jobs/Job.php b/app/Jobs/Job.php index 65794cc160..b5c465e455 100644 --- a/app/Jobs/Job.php +++ b/app/Jobs/Job.php @@ -3,8 +3,10 @@ * Job.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index fe01e3f2c4..a0974e694b 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -3,8 +3,10 @@ * MailError.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/Account.php b/app/Models/Account.php index ff3745af39..d9325d1dea 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -3,14 +3,17 @@ * Account.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); namespace FireflyIII\Models; +use Carbon\Carbon; use Crypt; use FireflyIII\Exceptions\FireflyException; use Illuminate\Contracts\Encryption\DecryptException; @@ -119,31 +122,6 @@ class Account extends Model } - /** - * @param array $fields - * - * @return Account|null - */ - public static function firstOrNullEncrypted(array $fields) - { - // everything but the name: - $query = Account::orderBy('id'); - $search = $fields; - unset($search['name']); - foreach ($search as $name => $value) { - $query->where($name, $value); - } - $set = $query->get(['accounts.*']); - /** @var Account $account */ - foreach ($set as $account) { - if ($account->name == $fields['name']) { - return $account; - } - } - - return null; - } - /** * @param Account $value * @@ -235,17 +213,55 @@ class Account extends Model } /** + * Returns the amount of the opening balance for this account. * * @return string + * @throws FireflyException */ - public function getNameForEditformAttribute(): string + public function getOpeningBalanceAmount(): string { - $name = $this->name; - if ($this->accountType->type == 'Cash account') { - $name = ''; + $journal = TransactionJournal + ::sortCorrectly() + ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->where('transactions.account_id', $this->id) + ->transactionTypes([TransactionType::OPENING_BALANCE]) + ->first(['transaction_journals.*']); + if (is_null($journal)) { + return '0'; } - return $name; + $count = $journal->transactions()->count(); + if ($count !== 2) { + throw new FireflyException(sprintf('Cannot use getFirstTransaction on journal #%d', $journal->id)); + } + $transaction = $journal->transactions()->where('account_id', $this->id)->first(); + if (is_null($transaction)) { + return '0'; + } + + return strval($transaction->amount); + } + + /** + * Returns the date of the opening balance for this account. If no date, will return 01-01-1900 + * + * @return Carbon + * @throws FireflyException + */ + public function getOpeningBalanceDate(): Carbon + { + $date = new Carbon('1900-01-01'); + $journal = TransactionJournal + ::sortCorrectly() + ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->where('transactions.account_id', $this->id) + ->transactionTypes([TransactionType::OPENING_BALANCE]) + ->first(['transaction_journals.*']); + if (is_null($journal)) { + return $date; + } + + return $journal->date; } /** diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index ccb01e5d73..c6a2c6004a 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -3,8 +3,10 @@ * AccountMeta.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 88bc502ff6..920b62a950 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -3,8 +3,10 @@ * AccountType.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index 81e067afb6..85d21c16c8 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -3,8 +3,10 @@ * Attachment.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 4003278f8e..d13f6d372e 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -3,8 +3,10 @@ * Bill.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -21,27 +23,27 @@ use Watson\Validating\ValidatingTrait; /** * FireflyIII\Models\Bill * - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property integer $user_id - * @property string $name - * @property string $match - * @property float $amount_min - * @property float $amount_max - * @property \Carbon\Carbon $date - * @property boolean $active - * @property boolean $automatch - * @property string $repeat_freq - * @property integer $skip - * @property boolean $name_encrypted - * @property boolean $match_encrypted - * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user - * @property \Carbon\Carbon $nextExpectedMatch - * @property \Carbon\Carbon $lastFoundMatch - * @property bool $paidInPeriod - * @property string $lastPaidAmount + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $user_id + * @property string $name + * @property string $match + * @property float $amount_min + * @property float $amount_max + * @property \Carbon\Carbon $date + * @property boolean $active + * @property boolean $automatch + * @property string $repeat_freq + * @property integer $skip + * @property boolean $name_encrypted + * @property boolean $match_encrypted + * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user + * @property \Carbon\Carbon $nextExpectedMatch + * @property \Carbon\Carbon $lastFoundMatch + * @property bool $paidInPeriod + * @property string $lastPaidAmount * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereUpdatedAt($value) @@ -58,8 +60,9 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereNameEncrypted($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereMatchEncrypted($value) * @mixin \Eloquent - * @property string $deleted_at + * @property string $deleted_at * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereDeletedAt($value) + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals */ class Bill extends Model { diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 656260bf47..db69a0da47 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -3,8 +3,10 @@ * Budget.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -21,21 +23,21 @@ use Watson\Validating\ValidatingTrait; /** * FireflyIII\Models\Budget * - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property string $name - * @property integer $user_id - * @property boolean $active - * @property boolean $encrypted - * @property-read \Illuminate\Database\Eloquent\Collection|BudgetLimit[] $budgetlimits - * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user - * @property string $dateFormatted - * @property string $budgeted - * @property float $amount - * @property \Carbon\Carbon $date + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property string $name + * @property integer $user_id + * @property boolean $active + * @property boolean $encrypted + * @property-read \Illuminate\Database\Eloquent\Collection|BudgetLimit[] $budgetlimits + * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user + * @property string $dateFormatted + * @property string $budgeted + * @property float $amount + * @property \Carbon\Carbon $date * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereUpdatedAt($value) @@ -45,8 +47,9 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereActive($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereEncrypted($value) * @mixin \Eloquent - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\LimitRepetition[] $limitrepetitions + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\LimitRepetition[] $limitrepetitions + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals */ class Budget extends Model { diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 40229622bf..fa1ab82f95 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -3,8 +3,10 @@ * BudgetLimit.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/Category.php b/app/Models/Category.php index 6ea3be8e99..c51dabc025 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -3,8 +3,10 @@ * Category.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -21,19 +23,19 @@ use Watson\Validating\ValidatingTrait; /** * FireflyIII\Models\Category * - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property string $name - * @property integer $user_id - * @property boolean $encrypted - * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user - * @property string $dateFormatted - * @property string $spent - * @property \Carbon\Carbon $lastActivity - * @property string $type + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property string $name + * @property integer $user_id + * @property boolean $encrypted + * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user + * @property string $dateFormatted + * @property string $spent + * @property \Carbon\Carbon $lastActivity + * @property string $type * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereUpdatedAt($value) @@ -42,7 +44,8 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereEncrypted($value) * @mixin \Eloquent - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals */ class Category extends Model { diff --git a/app/Models/Component.php b/app/Models/Component.php deleted file mode 100644 index 720f3a53a9..0000000000 --- a/app/Models/Component.php +++ /dev/null @@ -1,42 +0,0 @@ -currentRep = $rep; return $rep; - - } /** @@ -123,6 +125,27 @@ class PiggyBank extends Model return $value; } + /** + * + * @param Carbon $date + * + * @return string + */ + public function leftOnAccount(Carbon $date): string + { + + $balance = Steam::balanceIgnoreVirtual($this->account, $date); + /** @var PiggyBank $p */ + foreach ($this->account->piggyBanks as $piggyBank) { + $currentAmount = $piggyBank->currentRelevantRep()->currentamount ?? '0'; + + $balance = bcsub($balance, $currentAmount); + } + + return $balance; + + } + /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 7a2fe12d75..5e959c66c9 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -3,8 +3,10 @@ * PiggyBankEvent.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index cbe16a866f..57aff06279 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -3,8 +3,10 @@ * PiggyBankRepetition.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 5698a48306..cebb90f2c2 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -3,8 +3,10 @@ * Preference.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -42,7 +44,7 @@ class Preference extends Model { protected $dates = ['created_at', 'updated_at']; - protected $fillable = ['user_id', 'data', 'name','data']; + protected $fillable = ['user_id', 'data', 'name', 'data']; /** * @param $value diff --git a/app/Models/Role.php b/app/Models/Role.php index 390db24268..c560cd6e3c 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -3,8 +3,10 @@ * Role.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/Rule.php b/app/Models/Rule.php index c97e9f7f3b..43d3631773 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -3,8 +3,10 @@ * Rule.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/RuleAction.php b/app/Models/RuleAction.php index 720a7ec753..2e13c89b9f 100644 --- a/app/Models/RuleAction.php +++ b/app/Models/RuleAction.php @@ -3,8 +3,10 @@ * RuleAction.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index 27a1621d14..532ca0eba2 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -3,8 +3,10 @@ * RuleGroup.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php index a00f003742..684d9a9509 100644 --- a/app/Models/RuleTrigger.php +++ b/app/Models/RuleTrigger.php @@ -3,8 +3,10 @@ * RuleTrigger.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 1d87311a3d..a89220efea 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -3,8 +3,10 @@ * Tag.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -19,21 +21,21 @@ use Watson\Validating\ValidatingTrait; /** * FireflyIII\Models\Tag * - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property string $deleted_at - * @property integer $user_id - * @property string $tag - * @property string $tagMode - * @property \Carbon\Carbon $date - * @property string $description - * @property float $latitude - * @property float $longitude - * @property integer $zoomLevel - * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user - * @property int $account_id + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property string $deleted_at + * @property integer $user_id + * @property string $tag + * @property string $tagMode + * @property \Carbon\Carbon $date + * @property string $description + * @property float $latitude + * @property float $longitude + * @property integer $zoomLevel + * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user + * @property int $account_id * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Tag whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Tag whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Tag whereUpdatedAt($value) @@ -47,6 +49,7 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Tag whereLongitude($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Tag whereZoomLevel($value) * @mixin \Eloquent + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals */ class Tag extends TagSupport { diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 480c7f89f0..d2d82d17b4 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -3,8 +3,10 @@ * Transaction.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -46,6 +48,8 @@ use Watson\Validating\ValidatingTrait; * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction transactionTypes($types) + * @property integer $identifier + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction whereIdentifier($value) */ class Transaction extends Model { diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index aa6ac48eed..1cf89fc7de 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -3,8 +3,10 @@ * TransactionCurrency.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 59859cf3c2..e075cfb63b 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -3,8 +3,10 @@ * TransactionGroup.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -17,14 +19,14 @@ use Illuminate\Database\Eloquent\SoftDeletes; /** * FireflyIII\Models\TransactionGroup * - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property integer $user_id - * @property string $relation - * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property integer $user_id + * @property string $relation + * @property-read \Illuminate\Database\Eloquent\Collection|TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionGroup whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionGroup whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionGroup whereUpdatedAt($value) @@ -32,6 +34,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionGroup whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionGroup whereRelation($value) * @mixin \Eloquent + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals */ class TransactionGroup extends Model { diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index f38288e919..e4e7020d0f 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -3,8 +3,10 @@ * TransactionJournal.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -92,6 +94,7 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournal expanded() * @mixin \Eloquent * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournal sortCorrectly() + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournalMeta[] $transactionJournalMeta */ class TransactionJournal extends TransactionJournalSupport { diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index c868d2ad0d..d855897713 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -3,8 +3,10 @@ * TransactionJournalMeta.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index baf44372c5..84a1da7ccf 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -3,8 +3,10 @@ * TransactionType.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/AccountServiceProvider.php b/app/Providers/AccountServiceProvider.php index a41f4890bd..0ce5a90329 100644 --- a/app/Providers/AccountServiceProvider.php +++ b/app/Providers/AccountServiceProvider.php @@ -3,8 +3,10 @@ * AccountServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -39,6 +41,17 @@ class AccountServiceProvider extends ServiceProvider * @return void */ public function register() + { + $this->registerRepository(); + $this->registerTasker(); + + + } + + /** + * + */ + private function registerRepository() { $this->app->bind( 'FireflyIII\Repositories\Account\AccountRepositoryInterface', @@ -54,4 +67,24 @@ class AccountServiceProvider extends ServiceProvider } ); } + + /** + * + */ + private function registerTasker() + { + $this->app->bind( + 'FireflyIII\Repositories\Account\AccountTaskerInterface', + function (Application $app, array $arguments) { + if (!isset($arguments[0]) && $app->auth->check()) { + return app('FireflyIII\Repositories\Account\AccountTasker', [auth()->user()]); + } + if (!isset($arguments[0]) && !$app->auth->check()) { + throw new FireflyException('There is no user present.'); + } + + return app('FireflyIII\Repositories\Account\AccountTasker', $arguments); + } + ); + } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 8b4a758db2..56ff3467cf 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,8 +3,10 @@ * AppServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/AttachmentServiceProvider.php b/app/Providers/AttachmentServiceProvider.php index 0cd70ecc90..77debb7354 100644 --- a/app/Providers/AttachmentServiceProvider.php +++ b/app/Providers/AttachmentServiceProvider.php @@ -3,8 +3,10 @@ * AttachmentServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 1d69ceb777..c46b897aa5 100755 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -3,8 +3,10 @@ * AuthServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/BillServiceProvider.php b/app/Providers/BillServiceProvider.php index 20bdd0f6bc..7275348a8d 100644 --- a/app/Providers/BillServiceProvider.php +++ b/app/Providers/BillServiceProvider.php @@ -3,8 +3,10 @@ * BillServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 69878d22ab..76858e1e64 100755 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -3,8 +3,10 @@ * BroadcastServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/BudgetServiceProvider.php b/app/Providers/BudgetServiceProvider.php index aa7f6687f3..51408c5098 100644 --- a/app/Providers/BudgetServiceProvider.php +++ b/app/Providers/BudgetServiceProvider.php @@ -3,8 +3,10 @@ * BudgetServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/CategoryServiceProvider.php b/app/Providers/CategoryServiceProvider.php index fbea960b60..a3deb55f30 100644 --- a/app/Providers/CategoryServiceProvider.php +++ b/app/Providers/CategoryServiceProvider.php @@ -3,8 +3,10 @@ * CategoryServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/CrudServiceProvider.php b/app/Providers/CrudServiceProvider.php index 7deb62bab1..93acfa1412 100644 --- a/app/Providers/CrudServiceProvider.php +++ b/app/Providers/CrudServiceProvider.php @@ -3,8 +3,10 @@ * CrudServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -40,26 +42,6 @@ class CrudServiceProvider extends ServiceProvider public function register() { $this->registerJournal(); - $this->registerAccount(); - } - - private function registerAccount() - { - - $this->app->bind( - 'FireflyIII\Crud\Account\AccountCrudInterface', - function (Application $app, array $arguments) { - - if (!isset($arguments[0]) && auth()->check()) { - return app('FireflyIII\Crud\Account\AccountCrud', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); - } - - return app('FireflyIII\Crud\Account\AccountCrud', $arguments); - } - ); } private function registerJournal() diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index efc8f34d3f..d8373a2be6 100755 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -3,8 +3,10 @@ * EventServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/ExportJobServiceProvider.php b/app/Providers/ExportJobServiceProvider.php index cd908bc969..220a678623 100644 --- a/app/Providers/ExportJobServiceProvider.php +++ b/app/Providers/ExportJobServiceProvider.php @@ -3,8 +3,10 @@ * ExportJobServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 8380895404..b1530b08ca 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -3,8 +3,10 @@ * FireflyServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -17,11 +19,11 @@ use FireflyIII\Support\FireflyConfig; use FireflyIII\Support\Navigation; use FireflyIII\Support\Preferences; use FireflyIII\Support\Steam; -use FireflyIII\Support\Twig\Budget; use FireflyIII\Support\Twig\General; use FireflyIII\Support\Twig\Journal; use FireflyIII\Support\Twig\PiggyBank; use FireflyIII\Support\Twig\Rule; +use FireflyIII\Support\Twig\Transaction; use FireflyIII\Support\Twig\Translation; use FireflyIII\Validation\FireflyValidator; use Illuminate\Support\ServiceProvider; @@ -48,8 +50,8 @@ class FireflyServiceProvider extends ServiceProvider Twig::addExtension(new PiggyBank); Twig::addExtension(new General); Twig::addExtension(new Journal); - Twig::addExtension(new Budget); Twig::addExtension(new Translation); + Twig::addExtension(new Transaction); Twig::addExtension(new Rule); } diff --git a/app/Providers/JournalServiceProvider.php b/app/Providers/JournalServiceProvider.php index 4e82de187e..f7efb67dec 100644 --- a/app/Providers/JournalServiceProvider.php +++ b/app/Providers/JournalServiceProvider.php @@ -3,8 +3,10 @@ * JournalServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/PiggyBankServiceProvider.php b/app/Providers/PiggyBankServiceProvider.php index d662698511..11ba540e3c 100644 --- a/app/Providers/PiggyBankServiceProvider.php +++ b/app/Providers/PiggyBankServiceProvider.php @@ -3,8 +3,10 @@ * PiggyBankServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index e899134b7a..f8f1240557 100755 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -3,8 +3,10 @@ * RouteServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/RuleGroupServiceProvider.php b/app/Providers/RuleGroupServiceProvider.php index 4cff99454f..bddd6a8480 100644 --- a/app/Providers/RuleGroupServiceProvider.php +++ b/app/Providers/RuleGroupServiceProvider.php @@ -3,8 +3,10 @@ * RuleGroupServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/RuleServiceProvider.php b/app/Providers/RuleServiceProvider.php index 14d3163a53..a395e8cda3 100644 --- a/app/Providers/RuleServiceProvider.php +++ b/app/Providers/RuleServiceProvider.php @@ -3,8 +3,10 @@ * RuleServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Providers/TagServiceProvider.php b/app/Providers/TagServiceProvider.php index 34ef48591a..8889c9fbeb 100644 --- a/app/Providers/TagServiceProvider.php +++ b/app/Providers/TagServiceProvider.php @@ -3,8 +3,10 @@ * TagServiceProvider.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 62534384a9..8a507fb811 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -3,8 +3,10 @@ * AccountRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -14,16 +16,17 @@ namespace FireflyIII\Repositories\Account; use Carbon\Carbon; use DB; +use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Account; -use FireflyIII\Models\PiggyBank; +use FireflyIII\Models\AccountMeta; +use FireflyIII\Models\AccountType; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\User; use Illuminate\Database\Eloquent\Relations\HasMany; -use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; -use Steam; +use Log; /** @@ -37,6 +40,8 @@ class AccountRepository implements AccountRepositoryInterface /** @var User */ private $user; + /** @var array */ + private $validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType', 'accountNumber']; /** * AttachmentRepository constructor. @@ -49,11 +54,13 @@ class AccountRepository implements AccountRepositoryInterface } /** + * Moved here from account CRUD + * * @param array $types * * @return int */ - public function countAccounts(array $types): int + public function count(array $types):int { $count = $this->user->accounts()->accountTypeIn($types)->count(); @@ -61,155 +68,208 @@ class AccountRepository implements AccountRepositoryInterface } /** - * This method is almost the same as ::earnedInPeriod, but only works for revenue accounts - * instead of the implied asset accounts for ::earnedInPeriod. ::earnedInPeriod will tell you - * how much money was earned by the given asset accounts. This method will tell you how much money - * these given revenue accounts sent. Ie. how much money was made FROM these revenue accounts. + * Moved here from account CRUD. * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end + * @param Account $account + * @param Account $moveTo * - * @return string + * @return bool */ - public function earnedFromInPeriod(Collection $accounts, Carbon $start, Carbon $end): string + public function destroy(Account $account, Account $moveTo): bool { - $query = $this->user->transactionJournals()->expanded()->sortCorrectly() - ->transactionTypes([TransactionType::DEPOSIT]); - - if ($end >= $start) { - $query->before($end)->after($start); + if (!is_null($moveTo->id)) { + DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]); + } + if (!is_null($account)) { + $account->delete(); } - if ($accounts->count() > 0) { - $accountIds = $accounts->pluck('id')->toArray(); - $query->leftJoin( - 'transactions as source', function (JoinClause $join) { - $join->on('source.transaction_journal_id', '=', 'transaction_journals.id')->where('source.amount', '<', 0); - } - ); - $query->whereIn('source.account_id', $accountIds); - $query->whereNull('source.deleted_at'); - - } - // remove group by - $query->getQuery()->getQuery()->groups = null; - - // get id's - $ids = $query->get(['transaction_journals.id'])->pluck('id')->toArray(); - - // that should do it: - $sum = $this->user->transactions() - ->whereIn('transaction_journal_id', $ids) - ->where('amount', '>', '0') - ->whereNull('transactions.deleted_at') - ->sum('amount'); - - return strval($sum); - + return true; } /** - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end + * @param $accountId * - * @return string + * @return Account */ - public function earnedInPeriod(Collection $accounts, Carbon $start, Carbon $end): string + public function find(int $accountId): Account { - $query = $this->user->transactionJournals()->expanded()->sortCorrectly() - ->transactionTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER]); - - if ($end >= $start) { - $query->before($end)->after($start); + $account = $this->user->accounts()->find($accountId); + if (is_null($account)) { + return new Account; } - if ($accounts->count() > 0) { - $accountIds = $accounts->pluck('id')->toArray(); - $query->leftJoin( - 'transactions as destination', function (JoinClause $join) { - $join->on('destination.transaction_journal_id', '=', 'transaction_journals.id')->where('destination.amount', '>', 0); - } - ); - $query->leftJoin( - 'transactions as source', function (JoinClause $join) { - $join->on('source.transaction_journal_id', '=', 'transaction_journals.id')->where('source.amount', '<', 0); - } - ); - - $query->whereIn('destination.account_id', $accountIds); - $query->whereNotIn('source.account_id', $accountIds); - $query->whereNull('destination.deleted_at'); - $query->whereNull('source.deleted_at'); - - } - // remove group by - $query->getQuery()->getQuery()->groups = null; - - // get id's - $ids = $query->get(['transaction_journals.id'])->pluck('id')->toArray(); - - - // that should do it: - $sum = $this->user->transactions() - ->whereIn('transaction_journal_id', $ids) - ->where('amount', '>', '0') - ->whereNull('transactions.deleted_at') - ->sum('amount'); - - return strval($sum); - + return $account; } /** - * This method will call AccountRepositoryInterface::journalsInPeriod and get all withdrawaks made from the given $accounts, - * as well as the transfers that move away from those $accounts. This is a slightly sharper selection - * than made by journalsInPeriod itself. + * @param string $number + * @param array $types * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end + * @return Account + */ + public function findByAccountNumber(string $number, array $types): Account + { + $query = $this->user->accounts() + ->leftJoin('account_meta', 'account_meta.account_id', '=', 'accounts.id') + ->where('account_meta.name', 'accountNumber') + ->where('account_meta.data', json_encode($number)); + + if (count($types) > 0) { + $query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id'); + $query->whereIn('account_types.type', $types); + } + + /** @var Collection $accounts */ + $accounts = $query->get(['accounts.*']); + if ($accounts->count() > 0) { + return $accounts->first(); + } + + return new Account; + } + + /** + * @param string $iban + * @param array $types * - * @see AccountRepositoryInterface::journalsInPeriod + * @return Account + */ + public function findByIban(string $iban, array $types): Account + { + $query = $this->user->accounts()->where('iban', '!=', '')->whereNotNull('iban'); + + if (count($types) > 0) { + $query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id'); + $query->whereIn('account_types.type', $types); + } + + $accounts = $query->get(['accounts.*']); + /** @var Account $account */ + foreach ($accounts as $account) { + if ($account->iban === $iban) { + return $account; + } + } + + return new Account; + } + + /** + * @param string $name + * @param array $types + * + * @return Account + */ + public function findByName(string $name, array $types): Account + { + $query = $this->user->accounts(); + + if (count($types) > 0) { + $query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id'); + $query->whereIn('account_types.type', $types); + + } + Log::debug(sprintf('Searching for account named %s of the following type(s)', $name), ['types' => $types]); + + $accounts = $query->get(['accounts.*']); + /** @var Account $account */ + foreach ($accounts as $account) { + if ($account->name === $name) { + Log::debug(sprintf('Found #%d (%s) with type id %d', $account->id, $account->name, $account->account_type_id)); + + return $account; + } + } + Log::debug('Found nothing.'); + + return new Account; + } + + /** + * @param array $accountIds * * @return Collection */ - public function expensesInPeriod(Collection $accounts, Carbon $start, Carbon $end): Collection + public function getAccountsById(array $accountIds): Collection { - $types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER]; - $journals = $this->journalsInPeriod($accounts, $types, $start, $end); - $accountIds = $accounts->pluck('id')->toArray(); + /** @var Collection $result */ + $query = $this->user->accounts(); - // filter because some of these journals are still too much. - $journals = $journals->filter( - function (TransactionJournal $journal) use ($accountIds) { - if ($journal->transaction_type_type == TransactionType::WITHDRAWAL) { - return true; - } - /* - * The source of a transfer must be one of the $accounts in order to - * be included. Otherwise, it would not be an expense. - */ - if (in_array($journal->source_account_id, $accountIds)) { - return true; - } + if (count($accountIds) > 0) { + $query->whereIn('accounts.id', $accountIds); + } - return false; + $result = $query->get(['accounts.*']); + $result = $result->sortBy( + function (Account $account) { + return strtolower($account->name); } ); - return $journals; + return $result; } /** + * @param array $types + * + * @return Collection + */ + public function getAccountsByType(array $types): Collection + { + /** @var Collection $result */ + $query = $this->user->accounts(); + if (count($types) > 0) { + $query->accountTypeIn($types); + } + + $result = $query->get(['accounts.*']); + $result = $result->sortBy( + function (Account $account) { + return strtolower($account->name); + } + ); + + return $result; + } + + /** + * @param array $types + * + * @return Collection + */ + public function getActiveAccountsByType(array $types): Collection + { + /** @var Collection $result */ + $query = $this->user->accounts()->with( + ['accountmeta' => function (HasMany $query) { + $query->where('name', 'accountRole'); + }] + ); + if (count($types) > 0) { + $query->accountTypeIn($types); + } + $query->where('active', 1); + $result = $query->get(['accounts.*']); + $result = $result->sortBy( + function (Account $account) { + return strtolower($account->name); + } + ); + + return $result; + } + + /** + * Returns the date of the very first transaction in this account. + * * @param Account $account * * @return Carbon */ - public function firstUseDate(Account $account): Carbon + public function oldestJournalDate(Account $account): Carbon { - $first = new Carbon('1900-01-01'); + $first = new Carbon; /** @var Transaction $first */ $date = $account->transactions() @@ -226,280 +286,57 @@ class AccountRepository implements AccountRepositoryInterface } /** - * Gets all the accounts by ID, for a given set. + * @param array $data * - * @param array $ids - * - * @return \Illuminate\Support\Collection + * @return Account */ - public function get(array $ids): Collection + public function store(array $data): Account { - return $this->user->accounts()->whereIn('id', $ids)->get(['accounts.*']); - } + $newAccount = $this->storeAccount($data); + $this->updateMetadata($newAccount, $data); - /** - * @param TransactionJournal $journal - * @param Account $account - * - * @return Transaction - */ - public function getFirstTransaction(TransactionJournal $journal, Account $account): Transaction - { - $transaction = $journal->transactions()->where('account_id', $account->id)->first(); - if (is_null($transaction)) { - $transaction = new Transaction; + if ($this->validOpeningBalanceData($data)) { + $this->updateInitialBalance($newAccount, $data); + + return $newAccount; } + $this->deleteInitialBalance($newAccount); - return $transaction; - } - - /** - * Get the accounts of a user that have piggy banks connected to them. - * - * @param Carbon $start - * @param Carbon $end - * - * @return Collection - */ - public function getPiggyBankAccounts(Carbon $start, Carbon $end): Collection - { - $collection = new Collection(DB::table('piggy_banks')->distinct()->get(['piggy_banks.account_id'])); - $accountIds = $collection->pluck('account_id')->toArray(); - $accounts = new Collection; - $accountIds = array_unique($accountIds); - if (count($accountIds) > 0) { - $accounts = $this->user->accounts()->whereIn('id', $accountIds)->where('accounts.active', 1)->get(); - } - - $accounts->each( - function (Account $account) use ($start, $end) { - $account->startBalance = Steam::balanceIgnoreVirtual($account, $start); - $account->endBalance = Steam::balanceIgnoreVirtual($account, $end); - $account->piggyBalance = '0'; - /** @var PiggyBank $piggyBank */ - foreach ($account->piggyBanks as $piggyBank) { - $account->piggyBalance = bcadd($account->piggyBalance, $piggyBank->currentRelevantRep()->currentamount); - } - // sum of piggy bank amounts on this account: - // diff between endBalance and piggyBalance. - // then, percentage. - $difference = bcsub($account->endBalance, $account->piggyBalance); - $account->difference = $difference; - $account->percentage = $difference != 0 && $account->endBalance != 0 ? round((($difference / $account->endBalance) * 100)) : 100; - - } - ); - - - return $accounts; + return $newAccount; } /** - * Get savings accounts. - * - * @param Carbon $start - * @param Carbon $end - * - * @return Collection - */ - public function getSavingsAccounts(Carbon $start, Carbon $end): Collection - { - $accounts = $this->user->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC') - ->leftJoin('account_meta', 'account_meta.account_id', '=', 'accounts.id') - ->where('account_meta.name', 'accountRole') - ->where('accounts.active', 1) - ->where('account_meta.data', '"savingAsset"') - ->get(['accounts.*']); - - $accounts->each( - function (Account $account) use ($start, $end) { - $account->startBalance = Steam::balance($account, $start); - $account->endBalance = Steam::balance($account, $end); - - // diff (negative when lost, positive when gained) - $diff = bcsub($account->endBalance, $account->startBalance); - - if ($diff < 0 && $account->startBalance > 0) { - // percentage lost compared to start. - $pct = (($diff * -1) / $account->startBalance) * 100; - - $pct = $pct > 100 ? 100 : $pct; - $account->difference = $diff; - $account->percentage = round($pct); - - return; - } - if ($diff >= 0 && $account->startBalance > 0) { - $pct = ($diff / $account->startBalance) * 100; - $pct = $pct > 100 ? 100 : $pct; - $account->difference = $diff; - $account->percentage = round($pct); - - return; - } - $account->difference = $diff; - $account->percentage = 100; - - } - ); - - - return $accounts; - } - - /** - * This method will call AccountRepositoryInterface::journalsInPeriod and get all deposits made to the given $accounts, - * as well as the transfers that move away to those $accounts. This is a slightly sharper selection - * than made by journalsInPeriod itself. - * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @see AccountRepositoryInterface::journalsInPeriod - * - * @return Collection - */ - public function incomesInPeriod(Collection $accounts, Carbon $start, Carbon $end): Collection - { - $types = [TransactionType::DEPOSIT, TransactionType::TRANSFER]; - $journals = $this->journalsInPeriod($accounts, $types, $start, $end); - $accountIds = $accounts->pluck('id')->toArray(); - - // filter because some of these journals are still too much. - $journals = $journals->filter( - function (TransactionJournal $journal) use ($accountIds) { - if ($journal->transaction_type_type == TransactionType::DEPOSIT) { - return true; - } - /* - * The destination of a transfer must be one of the $accounts in order to - * be included. Otherwise, it would not be income. - */ - $destinations = TransactionJournal::destinationAccountList($journal)->pluck('id')->toArray(); - - if (count(array_intersect($destinations, $accountIds)) > 0) { - // at least one of $target is in $haystack - return true; - } - - return false; - } - ); - - return $journals; - } - - /** - * @param Collection $accounts - * @param array $types - * @param Carbon $start - * @param Carbon $end - * - * @return Collection - */ - public function journalsInPeriod(Collection $accounts, array $types, Carbon $start, Carbon $end): Collection - { - // first collect actual transaction journals (fairly easy) - $query = $this->user->transactionJournals()->expanded()->sortCorrectly(); - - if ($end >= $start) { - $query->before($end)->after($start); - } - - if (count($types) > 0) { - $query->transactionTypes($types); - } - if ($accounts->count() > 0) { - $accountIds = $accounts->pluck('id')->toArray(); - $query->leftJoin( - 'transactions as source', function (JoinClause $join) { - $join->on('source.transaction_journal_id', '=', 'transaction_journals.id')->where('source.amount', '<', 0); - } - ); - $query->leftJoin( - 'transactions as destination', function (JoinClause $join) { - $join->on('destination.transaction_journal_id', '=', 'transaction_journals.id')->where('destination.amount', '>', 0); - } - ); - $set = join(', ', $accountIds); - $query->whereRaw('(source.account_id in (' . $set . ') XOR destination.account_id in (' . $set . '))'); - - } - // that should do it: - $fields = TransactionJournal::queryFields(); - $complete = $query->get($fields); - - return $complete; - } - - /** - * * @param Account $account - * @param Carbon $date + * @param array $data * - * @return string + * @return Account */ - public function leftOnAccount(Account $account, Carbon $date): string + public function update(Account $account, array $data): Account { + // update the account: + $account->name = $data['name']; + $account->active = $data['active'] == '1' ? true : false; + $account->virtual_balance = $data['virtualBalance']; + $account->iban = $data['iban']; + $account->save(); - $balance = Steam::balanceIgnoreVirtual($account, $date); - /** @var PiggyBank $p */ - foreach ($account->piggyBanks()->get() as $p) { - $currentAmount = $p->currentRelevantRep()->currentamount ?? '0'; - - $balance = bcsub($balance, $currentAmount); - } - - return $balance; + $this->updateMetadata($account, $data); + $this->updateInitialBalance($account, $data); + return $account; } /** - * Returns the date of the very last transaction in this account. - * * @param Account $account - * - * @return Carbon */ - public function newestJournalDate(Account $account): Carbon + protected function deleteInitialBalance(Account $account) { - /** @var TransactionJournal $journal */ - $journal = TransactionJournal:: - leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->where('transactions.account_id', $account->id) - ->sortCorrectly() - ->first(['transaction_journals.*']); - if (is_null($journal)) { - return new Carbon('1900-01-01'); + $journal = $this->openingBalanceTransaction($account); + if (!is_null($journal->id)) { + $journal->delete(); } - return $journal->date; - } - - /** - * Returns the date of the very first transaction in this account. - * - * @param Account $account - * - * @return Carbon - */ - public function oldestJournalDate(Account $account): Carbon - { - /** @var TransactionJournal $journal */ - $journal = TransactionJournal:: - leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->where('transactions.account_id', $account->id) - ->orderBy('transaction_journals.date', 'ASC') - ->orderBy('transaction_journals.order', 'DESC') - ->orderBy('transaction_journals.id', 'ÅSC') - ->first(['transaction_journals.*']); - if (is_null($journal)) { - return new Carbon('1900-01-01'); - } - - return $journal->date; } /** @@ -507,7 +344,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return TransactionJournal|null */ - public function openingBalanceTransaction(Account $account): TransactionJournal + protected function openingBalanceTransaction(Account $account): TransactionJournal { $journal = TransactionJournal ::sortCorrectly() @@ -516,103 +353,257 @@ class AccountRepository implements AccountRepositoryInterface ->transactionTypes([TransactionType::OPENING_BALANCE]) ->first(['transaction_journals.*']); if (is_null($journal)) { + Log::debug('Could not find a opening balance journal, return empty one.'); + return new TransactionJournal; } + Log::debug(sprintf('Found opening balance: journal #%d.', $journal->id)); return $journal; } /** - * This method is almost the same as ::spentInPeriod, but only works for expense accounts - * instead of the implied asset accounts for ::spentInPeriod. ::spentInPeriod will tell you - * how much money was spent by the given asset accounts. This method will tell you how much money - * these given expense accounts received. Ie. how much money was spent AT these expense accounts. + * @param array $data * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return string + * @return Account + * @throws FireflyException */ - public function spentAtInPeriod(Collection $accounts, Carbon $start, Carbon $end): string + protected function storeAccount(array $data): Account { - /** @var HasMany $query */ - $query = $this->user->transactionJournals()->expanded() - ->transactionTypes([TransactionType::WITHDRAWAL]); - if ($end >= $start) { - $query->before($end)->after($start); + $data['accountType'] = $data['accountType'] ?? 'invalid'; + $type = config('firefly.accountTypeByIdentifier.' . $data['accountType']); + $accountType = AccountType::whereType($type)->first(); + + // verify account type + if (is_null($accountType)) { + throw new FireflyException(sprintf('Account type "%s" is invalid. Cannot create account.', $data['accountType'])); } - if ($accounts->count() > 0) { - $accountIds = $accounts->pluck('id')->toArray(); - $query->leftJoin( - 'transactions as destination', function (JoinClause $join) { - $join->on('destination.transaction_journal_id', '=', 'transaction_journals.id')->where('destination.amount', '>', 0); - } + // account may exist already: + $existingAccount = $this->findByName($data['name'], [$data['accountType']]); + if (!is_null($existingAccount->id)) { + throw new FireflyException(sprintf('There already is an account named "%s" of type "%s".', $data['name'], $data['accountType'])); + } + + // create it: + $newAccount = new Account( + [ + 'user_id' => $data['user'], + 'account_type_id' => $accountType->id, + 'name' => $data['name'], + 'virtual_balance' => $data['virtualBalance'], + 'active' => $data['active'] === true ? true : false, + 'iban' => $data['iban'], + ] + ); + $newAccount->save(); + // verify its creation: + if (is_null($newAccount->id)) { + Log::error( + sprintf('Could not create account "%s" (%d error(s))', $data['name'], $newAccount->getErrors()->count()), $newAccount->getErrors()->toArray() ); - $query->whereIn('destination.account_id', $accountIds); - + throw new FireflyException(sprintf('Tried to create account named "%s" but failed. The logs have more details.', $data['name'])); } - // remove group by - $query->getQuery()->getQuery()->groups = null; - // that should do it: - $sum = strval($query->sum('destination.amount')); - if (is_null($sum)) { - $sum = '0'; - } - $sum = bcmul($sum, '-1'); - - return $sum; + return $newAccount; } /** - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end + * @param Account $account + * @param array $data * - * @return string + * @return TransactionJournal */ - public function spentInPeriod(Collection $accounts, Carbon $start, Carbon $end): string + protected function storeInitialBalance(Account $account, array $data): TransactionJournal { - /** @var HasMany $query */ - $query = $this->user->transactionJournals()->expanded() - ->transactionTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER]); - if ($end >= $start) { - $query->before($end)->after($start); + $amount = $data['openingBalance']; + $user = $data['user']; + $name = $data['name']; + $opposing = $this->storeOpposingAccount($amount, $user, $name); + $transactionType = TransactionType::whereType(TransactionType::OPENING_BALANCE)->first(); + $journal = TransactionJournal::create( + [ + 'user_id' => $data['user'], + 'transaction_type_id' => $transactionType->id, + 'transaction_currency_id' => $data['openingBalanceCurrency'], + 'description' => 'Initial balance for "' . $account->name . '"', + 'completed' => true, + 'date' => $data['openingBalanceDate'], + 'encrypted' => true, + ] + ); + Log::debug(sprintf('Created new opening balance journal: #%d', $journal->id)); + + $firstAccount = $account; + $secondAccount = $opposing; + $firstAmount = $amount; + $secondAmount = $amount * -1; + + if ($data['openingBalance'] < 0) { + $firstAccount = $opposing; + $secondAccount = $account; + $firstAmount = $amount * -1; + $secondAmount = $amount; } - if ($accounts->count() > 0) { - $accountIds = $accounts->pluck('id')->toArray(); - $query->leftJoin( - 'transactions as source', function (JoinClause $join) { - $join->on('source.transaction_journal_id', '=', 'transaction_journals.id')->where('source.amount', '<', 0); - } - ); + $one = new Transaction(['account_id' => $firstAccount->id, 'transaction_journal_id' => $journal->id, 'amount' => $firstAmount]); + $one->save();// first transaction: from + $two = new Transaction(['account_id' => $secondAccount->id, 'transaction_journal_id' => $journal->id, 'amount' => $secondAmount]); + $two->save(); // second transaction: to - $query->leftJoin( - 'transactions as destination', function (JoinClause $join) { - $join->on('destination.transaction_journal_id', '=', 'transaction_journals.id')->where('destination.amount', '>', 0); - } - ); - $query->whereIn('source.account_id', $accountIds); - $query->whereNotIn('destination.account_id', $accountIds); - $query->whereNull('source.deleted_at'); - $query->whereNull('destination.deleted_at'); - $query->distinct(); + Log::debug(sprintf('Stored two transactions, #%d and #%d', $one->id, $two->id)); + return $journal; + } + + /** + * @param float $amount + * @param int $user + * @param string $name + * + * @return Account + */ + protected function storeOpposingAccount(float $amount, int $user, string $name):Account + { + $type = $amount < 0 ? 'expense' : 'revenue'; + $opposingData = [ + 'user' => $user, + 'accountType' => $type, + 'name' => $name . ' initial balance', + 'active' => false, + 'iban' => '', + 'virtualBalance' => 0, + ]; + Log::debug('Going to create an opening balance opposing account'); + + return $this->storeAccount($opposingData); + } + + /** + * @param Account $account + * @param array $data + * + * @return bool + */ + protected function updateInitialBalance(Account $account, array $data): bool + { + $openingBalance = $this->openingBalanceTransaction($account); + + // no opening balance journal? create it: + if (is_null($openingBalance->id)) { + Log::debug('No opening balance journal yet, create journal.'); + $this->storeInitialBalance($account, $data); + + return true; } - // remove group by - $query->getQuery()->getQuery()->groups = null; - $ids = $query->get(['transaction_journals.id'])->pluck('id')->toArray(); + // opening balance data? update it! + if (!is_null($openingBalance->id)) { + $date = $data['openingBalanceDate']; + $amount = $data['openingBalance']; - $sum = $this->user->transactions() - ->whereIn('transaction_journal_id', $ids) - ->where('amount', '<', '0') - ->whereNull('transactions.deleted_at') - ->sum('amount'); + Log::debug('Opening balance journal found, update journal.'); - return strval($sum); + $this->updateOpeningBalanceJournal($account, $openingBalance, $date, $amount); + + return true; + } + + return true; + } + + /** + * @param Account $account + * @param array $data + * + */ + protected function updateMetadata(Account $account, array $data) + { + foreach ($this->validFields as $field) { + /** @var AccountMeta $entry */ + $entry = $account->accountMeta()->where('name', $field)->first(); + + // if $data has field and $entry is null, create new one: + if (isset($data[$field]) && is_null($entry)) { + Log::debug( + sprintf( + 'Created meta-field "%s":"%s" for account #%d ("%s") ', + $field, $data[$field], $account->id, $account->name + ) + ); + AccountMeta::create( + [ + 'account_id' => $account->id, + 'name' => $field, + 'data' => $data[$field], + ] + ); + } + + // if $data has field and $entry is not null, update $entry: + if (isset($data[$field]) && !is_null($entry)) { + $entry->data = $data[$field]; + $entry->save(); + Log::debug( + sprintf( + 'Updated meta-field "%s":"%s" for account #%d ("%s") ', + $field, $data[$field], $account->id, $account->name + ) + ); + } + } + + } + + /** + * @param Account $account + * @param TransactionJournal $journal + * @param Carbon $date + * @param float $amount + * + * @return bool + */ + protected function updateOpeningBalanceJournal(Account $account, TransactionJournal $journal, Carbon $date, float $amount): bool + { + // update date: + $journal->date = $date; + $journal->save(); + // update transactions: + /** @var Transaction $transaction */ + foreach ($journal->transactions()->get() as $transaction) { + if ($account->id == $transaction->account_id) { + $transaction->amount = $amount; + $transaction->save(); + } + if ($account->id != $transaction->account_id) { + $transaction->amount = $amount * -1; + $transaction->save(); + } + } + Log::debug('Updated opening balance journal.'); + + return true; + + } + + /** + * @param array $data + * + * @return bool + */ + protected function validOpeningBalanceData(array $data): bool + { + if (isset($data['openingBalance']) + && isset($data['openingBalanceDate']) + && isset($data['openingBalanceCurrency']) + && bccomp(strval($data['openingBalance']), '0') !== 0 + ) { + Log::debug('Array has valid opening balance data.'); + + return true; + } + Log::debug('Array does not have valid opening balance data.'); + + return false; } } diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 288ae35d96..ab7b1f5dc9 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -3,8 +3,10 @@ * AccountRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,8 +15,6 @@ namespace FireflyIII\Repositories\Account; use Carbon\Carbon; use FireflyIII\Models\Account; -use FireflyIII\Models\Transaction; -use FireflyIII\Models\TransactionJournal; use Illuminate\Support\Collection; /** @@ -26,136 +26,75 @@ interface AccountRepositoryInterface { /** + * Moved here from account CRUD. + * * @param array $types * * @return int */ - public function countAccounts(array $types): int; - - /** - * This method is almost the same as ::earnedInPeriod, but only works for revenue accounts - * instead of the implied asset accounts for ::earnedInPeriod. ::earnedInPeriod will tell you - * how much money was earned by the given asset accounts. This method will tell you how much money - * these given revenue accounts sent. Ie. how much money was made FROM these revenue accounts. - * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return string - */ - public function earnedFromInPeriod(Collection $accounts, Carbon $start, Carbon $end): string; - - /** - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return string - */ - public function earnedInPeriod(Collection $accounts, Carbon $start, Carbon $end): string; - - /** - * This method will call AccountRepositoryInterface::journalsInPeriod and get all withdrawaks made from the given $accounts, - * as well as the transfers that move away from those $accounts. This is a slightly sharper selection - * than made by journalsInPeriod itself. - * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @see AccountRepositoryInterface::journalsInPeriod - * - * @return Collection - */ - public function expensesInPeriod(Collection $accounts, Carbon $start, Carbon $end): Collection; - - /** - * @param Account $account - * - * @return Carbon - */ - public function firstUseDate(Account $account): Carbon; - - /** - * Gets all the accounts by ID, for a given set. - * - * @param array $ids - * - * @return \Illuminate\Support\Collection - */ - public function get(array $ids): Collection; - - /** - * @param TransactionJournal $journal - * @param Account $account - * - * @return Transaction - */ - public function getFirstTransaction(TransactionJournal $journal, Account $account): Transaction; - - /** - * Get the accounts of a user that have piggy banks connected to them. - * - * @param Carbon $start - * @param Carbon $end - * - * @return Collection - */ - public function getPiggyBankAccounts(Carbon $start, Carbon $end): Collection; - - /** - * Get savings accounts. - * - * @param Carbon $start - * @param Carbon $end - * - * @return Collection - */ - public function getSavingsAccounts(Carbon $start, Carbon $end): Collection; - - /** - * This method will call AccountRepositoryInterface::journalsInPeriod and get all deposits made to the given $accounts, - * as well as the transfers that move to to those $accounts. This is a slightly sharper selection - * than made by journalsInPeriod itself. - * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @see AccountRepositoryInterface::journalsInPeriod - * - * @return Collection - */ - public function incomesInPeriod(Collection $accounts, Carbon $start, Carbon $end): Collection; - - /** - * @param Collection $accounts - * @param array $types - * @param Carbon $start - * @param Carbon $end - * - * @return Collection - */ - public function journalsInPeriod(Collection $accounts, array $types, Carbon $start, Carbon $end): Collection; + public function count(array $types): int; /** + * Moved here from account CRUD. * * @param Account $account - * @param Carbon $date + * @param Account $moveTo * - * @return string + * @return bool */ - public function leftOnAccount(Account $account, Carbon $date): string; + public function destroy(Account $account, Account $moveTo): bool; /** - * Returns the date of the very last transaction in this account. + * @param int $accountId * - * @param Account $account - * - * @return Carbon + * @return Account */ - public function newestJournalDate(Account $account): Carbon; + public function find(int $accountId): Account; + + /** + * @param string $number + * @param array $types + * + * @return Account + */ + public function findByAccountNumber(string $number, array $types): Account; + + /** + * @param string $iban + * @param array $types + * + * @return Account + */ + public function findByIban(string $iban, array $types): Account; + + /** + * @param string $name + * @param array $types + * + * @return Account + */ + public function findByName(string $name, array $types): Account; + + /** + * @param array $accountIds + * + * @return Collection + */ + public function getAccountsById(array $accountIds): Collection; + + /** + * @param array $types + * + * @return Collection + */ + public function getAccountsByType(array $types): Collection; + + /** + * @param array $types + * + * @return Collection + */ + public function getActiveAccountsByType(array $types): Collection; /** * Returns the date of the very first transaction in this account. @@ -167,34 +106,10 @@ interface AccountRepositoryInterface public function oldestJournalDate(Account $account): Carbon; /** + * @param array $data * - * @param Account $account - * - * @return TransactionJournal + * @return Account */ - public function openingBalanceTransaction(Account $account) : TransactionJournal; - - /** - * This method is almost the same as ::spentInPeriod, but only works for expense accounts - * instead of the implied asset accounts for ::spentInPeriod. ::spentInPeriod will tell you - * how much money was spent by the given asset accounts. This method will tell you how much money - * these given expense accounts received. Ie. how much money was spent AT these expense accounts. - * - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return string - */ - public function spentAtInPeriod(Collection $accounts, Carbon $start, Carbon $end): string; - - /** - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return string - */ - public function spentInPeriod(Collection $accounts, Carbon $start, Carbon $end): string; + public function store(array $data) : Account; } diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php new file mode 100644 index 0000000000..84d1c0b000 --- /dev/null +++ b/app/Repositories/Account/AccountTasker.php @@ -0,0 +1,432 @@ +user = $user; + } + + /** + * @see self::amountInPeriod + * + * @param Collection $accounts + * @param Collection $excluded + * @param Carbon $start + * @param Carbon $end + * + * @return string + */ + public function amountInInPeriod(Collection $accounts, Collection $excluded, Carbon $start, Carbon $end): string + { + $idList = [ + 'accounts' => $accounts->pluck('id')->toArray(), + 'exclude' => $excluded->pluck('id')->toArray(), + ]; + + Log::debug( + 'Now calling amountInInPeriod.', + ['accounts' => $idList['accounts'], 'excluded' => $idList['exclude'], + 'start' => $start->format('Y-m-d'), + 'end' => $end->format('Y-m-d'), + ] + ); + + return $this->amountInPeriod($idList, $start, $end, true); + + } + + /** + * @see self::amountInPeriod + * + * @param Collection $accounts + * @param Collection $excluded + * @param Carbon $start + * @param Carbon $end + * + * @return string + */ + public function amountOutInPeriod(Collection $accounts, Collection $excluded, Carbon $start, Carbon $end): string + { + $idList = [ + 'accounts' => $accounts->pluck('id')->toArray(), + 'exclude' => $excluded->pluck('id')->toArray(), + ]; + + Log::debug( + 'Now calling amountOutInPeriod.', + ['accounts' => $idList['accounts'], 'excluded' => $idList['exclude'], + 'start' => $start->format('Y-m-d'), + 'end' => $end->format('Y-m-d'), + ] + ); + + return $this->amountInPeriod($idList, $start, $end, false); + + } + + /** + * @param Collection $accounts + * @param Collection $excluded + * @param Carbon $start + * @param Carbon $end + * + * @return Collection + * @see self::financialReport + * + */ + public function expenseReport(Collection $accounts, Collection $excluded, Carbon $start, Carbon $end): Collection + { + $idList = [ + 'accounts' => $accounts->pluck('id')->toArray(), + 'exclude' => $excluded->pluck('id')->toArray(), + ]; + + Log::debug( + 'Now calling expenseReport.', + ['accounts' => $idList['accounts'], 'excluded' => $idList['exclude'], + 'start' => $start->format('Y-m-d'), + 'end' => $end->format('Y-m-d'), + ] + ); + + return $this->financialReport($idList, $start, $end, false); + + } + + /** + * @param Carbon $start + * @param Carbon $end + * @param Collection $accounts + * + * @return AccountCollection + */ + public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts): AccountCollection + { + $startAmount = '0'; + $endAmount = '0'; + $diff = '0'; + $ids = $accounts->pluck('id')->toArray(); + $yesterday = clone $start; + $yesterday->subDay(); + $startSet = Steam::balancesById($ids, $yesterday); + $backupSet = Steam::balancesById($ids, $start); + $endSet = Steam::balancesById($ids, $end); + + Log::debug( + sprintf( + 'getAccountReport from %s to %s for %d accounts.', + $start->format('Y-m-d'), + $end->format('Y-m-d'), + $accounts->count() + ) + ); + $accounts->each( + function (Account $account) use ($startSet, $endSet, $backupSet) { + $account->startBalance = $startSet[$account->id] ?? '0'; + $account->endBalance = $endSet[$account->id] ?? '0'; + + // check backup set just in case: + if ($account->startBalance === '0' && isset($backupSet[$account->id])) { + $account->startBalance = $backupSet[$account->id]; + } + } + ); + + // summarize: + foreach ($accounts as $account) { + $startAmount = bcadd($startAmount, $account->startBalance); + $endAmount = bcadd($endAmount, $account->endBalance); + $diff = bcadd($diff, bcsub($account->endBalance, $account->startBalance)); + } + + $object = new AccountCollection; + $object->setStart($startAmount); + $object->setEnd($endAmount); + $object->setDifference($diff); + $object->setAccounts($accounts); + + + return $object; + } + + /** + * It might be worth it to expand this query to include all account information required. + * + * @param Collection $accounts + * @param array $types + * @param Carbon $start + * @param Carbon $end + * + * @return Collection + */ + public function getJournalsInPeriod(Collection $accounts, array $types, Carbon $start, Carbon $end): Collection + { + $accountIds = $accounts->pluck('id')->toArray(); + $query = Transaction + ::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->leftJoin('transaction_currencies', 'transaction_currencies.id', 'transaction_journals.transaction_currency_id') + ->leftJoin('transaction_types', 'transaction_types.id', 'transaction_journals.transaction_type_id') + ->leftJoin('bills', 'bills.id', 'transaction_journals.bill_id') + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') + ->leftJoin('account_types', 'accounts.account_type_id', 'account_types.id') + ->whereIn('transactions.account_id', $accountIds) + ->whereNull('transactions.deleted_at') + ->whereNull('transaction_journals.deleted_at') + ->where('transaction_journals.date', '>=', $start->format('Y-m-d')) + ->where('transaction_journals.date', '<=', $end->format('Y-m-d')) + ->where('transaction_journals.user_id', $this->user->id) + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC'); + + if (count($types) > 0) { + $query->whereIn('transaction_types.type', $types); + } + + $set = $query->get( + [ + 'transaction_journals.id as journal_id', + 'transaction_journals.description', + 'transaction_journals.date', + 'transaction_journals.encrypted', + //'transaction_journals.transaction_currency_id', + 'transaction_currencies.code as transaction_currency_code', + //'transaction_currencies.symbol as transaction_currency_symbol', + 'transaction_types.type as transaction_type_type', + 'transaction_journals.bill_id', + 'bills.name as bill_name', + 'transactions.id as id', + 'transactions.amount as transaction_amount', + 'transactions.description as transaction_description', + 'transactions.account_id', + 'transactions.identifier', + 'transactions.transaction_journal_id', + 'accounts.name as account_name', + 'accounts.encrypted as account_encrypted', + 'account_types.type as account_type', + + ] + ); + + // loop for decryption. + $set->each( + function (Transaction $transaction) { + $transaction->date = new Carbon($transaction->date); + $transaction->description = intval($transaction->encrypted) === 1 ? Crypt::decrypt($transaction->description) : $transaction->description; + $transaction->bill_name = !is_null($transaction->bill_name) ? Crypt::decrypt($transaction->bill_name) : ''; + } + ); + + return $set; + } + + /** + * @param Collection $accounts + * @param Collection $excluded + * @param Carbon $start + * @param Carbon $end + * + * @see AccountTasker::financialReport() + * + * @return Collection + * + */ + public function incomeReport(Collection $accounts, Collection $excluded, Carbon $start, Carbon $end): Collection + { + $idList = [ + 'accounts' => $accounts->pluck('id')->toArray(), + 'exclude' => $excluded->pluck('id')->toArray(), + ]; + + Log::debug( + 'Now calling expenseReport.', + ['accounts' => $idList['accounts'], 'excluded' => $idList['exclude'], + 'start' => $start->format('Y-m-d'), + 'end' => $end->format('Y-m-d'), + ] + ); + + return $this->financialReport($idList, $start, $end, true); + } + + /** + * Will return how much money has been going out (ie. spent) by the given account(s). + * Alternatively, will return how much money has been coming in (ie. earned) by the given accounts. + * + * Enter $incoming=true for any money coming in (income) + * Enter $incoming=false for any money going out (expenses) + * + * This means any money going out or in. You can also submit accounts to exclude, + * so transfers between accounts are not included. + * + * As a general rule: + * + * - Asset accounts should return both expenses and earnings. But could return 0. + * - Expense accounts (where money is spent) should only return earnings (the account gets money). + * - Revenue accounts (where money comes from) should only return expenses (they spend money). + * + * @param array $accounts + * @param Carbon $start + * @param Carbon $end + * @param bool $incoming + * + * @return string + */ + protected function amountInPeriod(array $accounts, Carbon $start, Carbon $end, bool $incoming): string + { + $joinModifier = $incoming ? '<' : '>'; + $selection = $incoming ? '>' : '<'; + + $query = Transaction + ::distinct() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->leftJoin( + 'transactions as other_side', function (JoinClause $join) use ($joinModifier) { + $join->on('transaction_journals.id', '=', 'other_side.transaction_journal_id')->where('other_side.amount', $joinModifier, 0); + } + ) + ->where('transaction_journals.date', '>=', $start->format('Y-m-d')) + ->where('transaction_journals.date', '<=', $end->format('Y-m-d')) + ->where('transaction_journals.user_id', $this->user->id) + ->whereNull('transactions.deleted_at') + ->whereNull('transaction_journals.deleted_at') + ->whereIn('transactions.account_id', $accounts['accounts']) + ->where('transactions.amount', $selection, 0); + if (count($accounts['exclude']) > 0) { + $query->whereNotIn('other_side.account_id', $accounts['exclude']); + } + + $result = $query->get(['transactions.id', 'transactions.amount']); + $sum = strval($result->sum('amount')); + if (strlen($sum) === 0) { + Log::debug('Sum is empty.'); + $sum = '0'; + } + Log::debug(sprintf('Result is %s', $sum)); + + return $sum; + } + + /** + * + * This method will determin how much has flown (in the given period) from OR to $accounts to/from anywhere else, + * except $excluded. This could be a list of incomes, or a list of expenses. This method shows + * the name, the amount and the number of transactions. It is a summary, and only used in some reports. + * + * $incoming=true a list of incoming money (earnings) + * $incoming=false a list of outgoing money (expenses). + * + * @param array $accounts + * @param Carbon $start + * @param Carbon $end + * @param bool $incoming + * + * @return Collection + */ + protected function financialReport(array $accounts, Carbon $start, Carbon $end, bool $incoming): Collection + { + $collection = new Collection; + $joinModifier = $incoming ? '<' : '>'; + $selection = $incoming ? '>' : '<'; + $query = Transaction + ::distinct() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->leftJoin( + 'transactions as other_side', function (JoinClause $join) use ($joinModifier) { + $join->on('transaction_journals.id', '=', 'other_side.transaction_journal_id')->where('other_side.amount', $joinModifier, 0); + } + ) + ->leftJoin('accounts as other_account', 'other_account.id', '=', 'other_side.account_id') + ->where('transaction_journals.date', '>=', $start->format('Y-m-d')) + ->where('transaction_journals.date', '<=', $end->format('Y-m-d')) + ->where('transaction_journals.user_id', $this->user->id) + ->whereNull('transactions.deleted_at') + ->whereNull('transaction_journals.deleted_at') + ->whereIn('transactions.account_id', $accounts['accounts']) + ->where('other_side.amount', '=', DB::raw('transactions.amount * -1')) + ->where('transactions.amount', $selection, 0) + ->orderBy('transactions.amount'); + + if (count($accounts['exclude']) > 0) { + $query->whereNotIn('other_side.account_id', $accounts['exclude']); + } + $set = $query->get( + [ + 'transaction_journals.id', + 'other_side.account_id', + 'other_account.name', + 'other_account.encrypted', + 'transactions.amount', + ] + ); + // summarize ourselves: + $temp = []; + foreach ($set as $entry) { + // save into $temp: + $id = intval($entry->account_id); + if (isset($temp[$id])) { + $temp[$id]['count']++; + $temp[$id]['amount'] = bcadd($temp[$id]['amount'], $entry->amount); + } + if (!isset($temp[$id])) { + $temp[$id] = [ + 'name' => intval($entry->encrypted) === 1 ? Crypt::decrypt($entry->name) : $entry->name, + 'amount' => $entry->amount, + 'count' => 1, + ]; + } + } + + // loop $temp and create collection: + foreach ($temp as $key => $entry) { + $object = new stdClass(); + $object->id = $key; + $object->name = $entry['name']; + $object->count = $entry['count']; + $object->amount = $entry['amount']; + $collection->push($object); + } + + return $collection; + } +} \ No newline at end of file diff --git a/app/Repositories/Account/AccountTaskerInterface.php b/app/Repositories/Account/AccountTaskerInterface.php new file mode 100644 index 0000000000..61d3ebdbcc --- /dev/null +++ b/app/Repositories/Account/AccountTaskerInterface.php @@ -0,0 +1,99 @@ +get( [ 'bills.*', - DB::raw('((`bills`.`amount_min` + `bills`.`amount_max`) / 2) as `expectedAmount`'), + DB::raw('((bills.amount_min + bills.amount_max) / 2) AS expectedAmount'), ] )->sortBy('name'); @@ -139,7 +141,7 @@ class BillRepository implements BillRepositoryInterface [ 'transaction_journals.bill_id', 'transaction_journals.id', - DB::raw('SUM(`transactions`.`amount`) as `journalAmount`'), + DB::raw('SUM(transactions.amount) AS journalAmount'), ] ); @@ -245,7 +247,7 @@ class BillRepository implements BillRepositoryInterface $join->on('transactions.transaction_journal_id', '=', 'transaction_journals.id')->where('transactions.amount', '<', 0); } ) - ->first([DB::raw('SUM(`transactions`.`amount`) as `sum_amount`')]); + ->first([DB::raw('SUM(transactions.amount) AS sum_amount')]); $sumAmount = $paid->sum_amount ?? '0'; $amount = bcadd($amount, $sumAmount); } @@ -280,7 +282,7 @@ class BillRepository implements BillRepositoryInterface $join->on('transactions.transaction_journal_id', '=', 'transaction_journals.id')->where('transactions.amount', '>', 0); } ) - ->first([DB::raw('SUM(`transactions`.`amount`) as `sum_amount`')]); + ->first([DB::raw('SUM(transactions.amount) AS sum_amount')]); $sumAmount = $paid->sum_amount ?? '0'; $paidBill = bcadd($sumAmount, $paidBill); } diff --git a/app/Repositories/Bill/BillRepositoryInterface.php b/app/Repositories/Bill/BillRepositoryInterface.php index ff28c7b521..f740921cec 100644 --- a/app/Repositories/Bill/BillRepositoryInterface.php +++ b/app/Repositories/Bill/BillRepositoryInterface.php @@ -3,8 +3,10 @@ * BillRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index e80bf2e1c9..7d7e24dc52 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -3,8 +3,10 @@ * BudgetRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -20,6 +22,7 @@ use FireflyIII\Models\LimitRepetition; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\User; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; @@ -366,9 +369,22 @@ class BudgetRepository implements BudgetRepositoryInterface } if ($accounts->count() > 0) { $accountIds = $accounts->pluck('id')->toArray(); - $set = join(', ', $accountIds); - $query->whereRaw('(source.account_id in (' . $set . ') XOR destination.account_id in (' . $set . '))'); - + $query->where( + // source.account_id in accountIds XOR destination.account_id in accountIds + function (Builder $query) use ($accountIds) { + $query->where( + function (Builder $q1) use ($accountIds) { + $q1->whereIn('source.account_id', $accountIds) + ->whereNotIn('destination.account_id', $accountIds); + } + )->orWhere( + function (Builder $q2) use ($accountIds) { + $q2->whereIn('destination.account_id', $accountIds) + ->whereNotIn('source.account_id', $accountIds); + } + ); + } + ); } if ($budgets->count() > 0) { $budgetIds = $budgets->pluck('id')->toArray(); @@ -443,9 +459,22 @@ class BudgetRepository implements BudgetRepositoryInterface if ($accounts->count() > 0) { $accountIds = $accounts->pluck('id')->toArray(); - - $set = join(', ', $accountIds); - $query->whereRaw('(source.account_id in (' . $set . ') XOR destination.account_id in (' . $set . '))'); + $query->where( + // source.account_id in accountIds XOR destination.account_id in accountIds + function (Builder $sourceXorDestinationQuery) use ($accountIds) { + $sourceXorDestinationQuery->where( + function (Builder $inSourceButNotDestinationQuery) use ($accountIds) { + $inSourceButNotDestinationQuery->whereIn('source.account_id', $accountIds) + ->whereNotIn('destination.account_id', $accountIds); + } + )->orWhere( + function (Builder $inDestinationButNotSourceQuery) use ($accountIds) { + $inDestinationButNotSourceQuery->whereIn('destination.account_id', $accountIds) + ->whereNotIn('source.account_id', $accountIds); + } + ); + } + ); } $ids = $query->get(['transaction_journals.id'])->pluck('id')->toArray(); $sum = '0'; diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index ae5a07f3fc..0f6aba141e 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -3,8 +3,10 @@ * BudgetRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 8f4bce7e42..ac3ea1e285 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -3,8 +3,10 @@ * CategoryRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -16,6 +18,7 @@ use FireflyIII\Models\Category; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\User; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Query\JoinClause; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -485,9 +488,22 @@ class CategoryRepository implements CategoryRepositoryInterface } if ($accounts->count() > 0) { $accountIds = $accounts->pluck('id')->toArray(); - $set = join(', ', $accountIds); - $query->whereRaw('(source.account_id in (' . $set . ') XOR destination.account_id in (' . $set . '))'); - + $query->where( + // source.account_id in accountIds XOR destination.account_id in accountIds + function (Builder $query) use ($accountIds) { + $query->where( + function (Builder $q1) use ($accountIds) { + $q1->whereIn('source.account_id', $accountIds) + ->whereNotIn('destination.account_id', $accountIds); + } + )->orWhere( + function (Builder $q2) use ($accountIds) { + $q2->whereIn('destination.account_id', $accountIds) + ->whereNotIn('source.account_id', $accountIds); + } + ); + } + ); } if ($categories->count() > 0) { $categoryIds = $categories->pluck('id')->toArray(); diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index d6ad9e3407..d5aaff5bc2 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -3,8 +3,10 @@ * CategoryRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -69,7 +71,7 @@ interface CategoryRepositoryInterface public function findByName(string $name) : Category; /** - * @param Category $category + * @param Category $category * * @return Carbon */ diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index f713cc22ad..3b88e9ede4 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -3,8 +3,10 @@ * CurrencyRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php index b6d2a591a2..4bd01fa256 100644 --- a/app/Repositories/Currency/CurrencyRepositoryInterface.php +++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php @@ -3,8 +3,10 @@ * CurrencyRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index 009aadbf6e..1aae76d43e 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -3,8 +3,10 @@ * ExportJobRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php index 18ef2827f0..c9d6167873 100644 --- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php +++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php @@ -3,8 +3,10 @@ * ExportJobRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php index fbf6e67eda..d7f4ac30cf 100644 --- a/app/Repositories/ImportJob/ImportJobRepository.php +++ b/app/Repositories/ImportJob/ImportJobRepository.php @@ -3,8 +3,10 @@ * ImportJobRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -40,6 +42,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface * @param string $fileType * * @return ImportJob + * @throws FireflyException */ public function create(string $fileType): ImportJob { diff --git a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php index 3d6c46b94d..a17d9ca62c 100644 --- a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php +++ b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php @@ -3,8 +3,10 @@ * ImportJobRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index d7c7ed10fb..fce3033619 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -3,8 +3,10 @@ * JournalRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -227,7 +229,7 @@ class JournalRepository implements JournalRepositoryInterface $transactions = new Collection; $fields = ['transactions.id', 'transactions.created_at', 'transactions.updated_at', 'transactions.deleted_at', 'transactions.account_id', 'transactions.transaction_journal_id', 'transactions.description', 'transactions.amount', - DB::raw('SUM(`transactions`.`amount`) as `sum`')]; + DB::raw('SUM(transactions.amount) AS sum')]; $groupBy = ['transactions.id', 'transactions.created_at', 'transactions.updated_at', 'transactions.deleted_at', 'transactions.account_id', 'transactions.transaction_journal_id', 'transactions.description', 'transactions.amount']; switch ($journal->transactionType->type) { diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index 0b452ec64c..56c0af0347 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -3,8 +3,10 @@ * JournalRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index d9ce4660a7..9eca01a95a 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -3,8 +3,10 @@ * PiggyBankRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -198,6 +200,10 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface // remove money from the rep. $repetition = $piggyBank->currentRelevantRep(); if ($repetition->currentamount > $piggyBank->targetamount) { + + $diff = bcsub($piggyBank->targetamount, $repetition->currentamount); + $this->createEvent($piggyBank, $diff); + $repetition->currentamount = $piggyBank->targetamount; $repetition->save(); } diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php index 54f3dd655f..22eb0a4e9a 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php @@ -3,8 +3,10 @@ * PiggyBankRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index 6dcfca8e09..c1e26fec4b 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -3,8 +3,10 @@ * RuleRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/Rule/RuleRepositoryInterface.php b/app/Repositories/Rule/RuleRepositoryInterface.php index 2acf299b30..518417d94a 100644 --- a/app/Repositories/Rule/RuleRepositoryInterface.php +++ b/app/Repositories/Rule/RuleRepositoryInterface.php @@ -3,8 +3,10 @@ * RuleRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index a24dcf683c..d1292c7f72 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -3,8 +3,10 @@ * RuleGroupRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php index 5faab4fbe3..b283160ea3 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php +++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php @@ -3,8 +3,10 @@ * RuleGroupRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 39ad12bc9d..6c29921d88 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -3,8 +3,10 @@ * TagRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -143,7 +145,7 @@ class TagRepository implements TagRepositoryInterface ->transactionJournals() ->sortCorrectly() ->expanded() - ->groupBy(['tag_transaction_journal.tag_id','tag_transaction_journal.transaction_journal_id']) + ->groupBy(['tag_transaction_journal.tag_id', 'tag_transaction_journal.transaction_journal_id']) ->get(TransactionJournal::queryFields()); return $journals; diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index e0613d7cd1..b1676b2f03 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -3,8 +3,10 @@ * TagRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -33,13 +35,6 @@ interface TagRepositoryInterface */ public function connect(TransactionJournal $journal, Tag $tag): bool; - /** - * @param Tag $tag - * - * @return Collection - */ - public function getJournals(Tag $tag) : Collection; - /** * This method destroys a tag. * @@ -70,6 +65,13 @@ interface TagRepositoryInterface */ public function get(): Collection; + /** + * @param Tag $tag + * + * @return Collection + */ + public function getJournals(Tag $tag) : Collection; + /** * This method stores a tag. * diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index e2fec6aa11..b3551077b1 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -3,8 +3,10 @@ * UserRepository.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Repositories/User/UserRepositoryInterface.php b/app/Repositories/User/UserRepositoryInterface.php index 2d20707cd4..e37cd1a39d 100644 --- a/app/Repositories/User/UserRepositoryInterface.php +++ b/app/Repositories/User/UserRepositoryInterface.php @@ -3,8 +3,10 @@ * UserRepositoryInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/ActionInterface.php b/app/Rules/Actions/ActionInterface.php index c5fae472d6..0c66106d7f 100644 --- a/app/Rules/Actions/ActionInterface.php +++ b/app/Rules/Actions/ActionInterface.php @@ -3,8 +3,10 @@ * ActionInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/AddTag.php b/app/Rules/Actions/AddTag.php index c05b67461a..8dc7cb17a2 100644 --- a/app/Rules/Actions/AddTag.php +++ b/app/Rules/Actions/AddTag.php @@ -3,8 +3,10 @@ * AddTag.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/AppendDescription.php b/app/Rules/Actions/AppendDescription.php index ba5c9a37e4..4169399773 100644 --- a/app/Rules/Actions/AppendDescription.php +++ b/app/Rules/Actions/AppendDescription.php @@ -3,8 +3,10 @@ * AppendDescription.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/ClearBudget.php b/app/Rules/Actions/ClearBudget.php index 6caaa96f5d..fc29eb4aae 100644 --- a/app/Rules/Actions/ClearBudget.php +++ b/app/Rules/Actions/ClearBudget.php @@ -3,8 +3,10 @@ * ClearBudget.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/ClearCategory.php b/app/Rules/Actions/ClearCategory.php index 9133eeb9a6..5af30a1811 100644 --- a/app/Rules/Actions/ClearCategory.php +++ b/app/Rules/Actions/ClearCategory.php @@ -3,8 +3,10 @@ * ClearCategory.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/PrependDescription.php b/app/Rules/Actions/PrependDescription.php index 8841a8da7d..7e734873ee 100644 --- a/app/Rules/Actions/PrependDescription.php +++ b/app/Rules/Actions/PrependDescription.php @@ -3,8 +3,10 @@ * PrependDescription.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/RemoveAllTags.php b/app/Rules/Actions/RemoveAllTags.php index 5eb6bc504d..66ddbc4810 100644 --- a/app/Rules/Actions/RemoveAllTags.php +++ b/app/Rules/Actions/RemoveAllTags.php @@ -3,8 +3,10 @@ * RemoveAllTags.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/RemoveTag.php b/app/Rules/Actions/RemoveTag.php index a29a5e6751..c002c1ff21 100644 --- a/app/Rules/Actions/RemoveTag.php +++ b/app/Rules/Actions/RemoveTag.php @@ -3,8 +3,10 @@ * RemoveTag.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/SetBudget.php b/app/Rules/Actions/SetBudget.php index e85a8da1c4..90d7aa6d18 100644 --- a/app/Rules/Actions/SetBudget.php +++ b/app/Rules/Actions/SetBudget.php @@ -3,8 +3,10 @@ * SetBudget.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/SetCategory.php b/app/Rules/Actions/SetCategory.php index 3a836ec7d3..ff6e79fb66 100644 --- a/app/Rules/Actions/SetCategory.php +++ b/app/Rules/Actions/SetCategory.php @@ -3,8 +3,10 @@ * SetCategory.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Actions/SetDescription.php b/app/Rules/Actions/SetDescription.php index 64a6e965fb..8be7339f03 100644 --- a/app/Rules/Actions/SetDescription.php +++ b/app/Rules/Actions/SetDescription.php @@ -3,8 +3,10 @@ * SetDescription.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Factory/ActionFactory.php b/app/Rules/Factory/ActionFactory.php index 34ed948c19..a73c1c23b2 100644 --- a/app/Rules/Factory/ActionFactory.php +++ b/app/Rules/Factory/ActionFactory.php @@ -1,4 +1,14 @@ id, $fromAccountName, $search) + $journal->id, $fromAccountName, $search + ) ); return false; diff --git a/app/Rules/Triggers/FromAccountEnds.php b/app/Rules/Triggers/FromAccountEnds.php index 0360445580..54afb67808 100644 --- a/app/Rules/Triggers/FromAccountEnds.php +++ b/app/Rules/Triggers/FromAccountEnds.php @@ -3,8 +3,10 @@ * FromAccountEnds.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Triggers/FromAccountIs.php b/app/Rules/Triggers/FromAccountIs.php index e504c6532c..c3f494d48c 100644 --- a/app/Rules/Triggers/FromAccountIs.php +++ b/app/Rules/Triggers/FromAccountIs.php @@ -3,8 +3,10 @@ * FromAccountIs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Triggers/FromAccountStarts.php b/app/Rules/Triggers/FromAccountStarts.php index d5194a8793..f32ce2b545 100644 --- a/app/Rules/Triggers/FromAccountStarts.php +++ b/app/Rules/Triggers/FromAccountStarts.php @@ -3,8 +3,10 @@ * FromAccountStarts.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Triggers/ToAccountContains.php b/app/Rules/Triggers/ToAccountContains.php index ddba9e5597..d80c9ab4d5 100644 --- a/app/Rules/Triggers/ToAccountContains.php +++ b/app/Rules/Triggers/ToAccountContains.php @@ -3,8 +3,10 @@ * ToAccountContains.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -81,7 +83,8 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac Log::debug( sprintf( 'RuleTrigger ToAccountContains for journal #%d: "%s" does not contain "%s", return false.', - $journal->id, $toAccountName, $search) + $journal->id, $toAccountName, $search + ) ); return false; diff --git a/app/Rules/Triggers/ToAccountEnds.php b/app/Rules/Triggers/ToAccountEnds.php index e6d1714673..f4fd676422 100644 --- a/app/Rules/Triggers/ToAccountEnds.php +++ b/app/Rules/Triggers/ToAccountEnds.php @@ -3,8 +3,10 @@ * ToAccountEnds.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -84,6 +86,7 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface if ($part === $search) { Log::debug(sprintf('RuleTrigger ToAccountEnds for journal #%d: "%s" ends with "%s", return true.', $journal->id, $toAccountName, $search)); + return true; } diff --git a/app/Rules/Triggers/ToAccountIs.php b/app/Rules/Triggers/ToAccountIs.php index 57a66adb81..0a2fdd8ca9 100644 --- a/app/Rules/Triggers/ToAccountIs.php +++ b/app/Rules/Triggers/ToAccountIs.php @@ -3,8 +3,10 @@ * ToAccountIs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Triggers/ToAccountStarts.php b/app/Rules/Triggers/ToAccountStarts.php index 3fc80c0e30..f5f162c283 100644 --- a/app/Rules/Triggers/ToAccountStarts.php +++ b/app/Rules/Triggers/ToAccountStarts.php @@ -3,8 +3,10 @@ * ToAccountStarts.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -73,6 +75,7 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface if ($part === $search) { Log::debug(sprintf('RuleTrigger ToAccountStarts for journal #%d: "%s" starts with "%s", return true.', $journal->id, $toAccountName, $search)); + return true; } Log::debug(sprintf('RuleTrigger ToAccountStarts for journal #%d: "%s" does not start with "%s", return false.', $journal->id, $toAccountName, $search)); diff --git a/app/Rules/Triggers/TransactionType.php b/app/Rules/Triggers/TransactionType.php index 71a9676c6d..691a16ff9d 100644 --- a/app/Rules/Triggers/TransactionType.php +++ b/app/Rules/Triggers/TransactionType.php @@ -3,8 +3,10 @@ * TransactionType.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Triggers/TriggerInterface.php b/app/Rules/Triggers/TriggerInterface.php index 3f102a2890..df05a331b6 100644 --- a/app/Rules/Triggers/TriggerInterface.php +++ b/app/Rules/Triggers/TriggerInterface.php @@ -3,8 +3,10 @@ * TriggerInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Rules/Triggers/UserAction.php b/app/Rules/Triggers/UserAction.php index aecd5332bd..576ddfe6aa 100644 --- a/app/Rules/Triggers/UserAction.php +++ b/app/Rules/Triggers/UserAction.php @@ -3,8 +3,10 @@ * UserAction.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Amount.php b/app/Support/Amount.php index f98dca1857..7937ae148a 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -3,8 +3,10 @@ * Amount.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -117,6 +119,41 @@ class Amount return $this->formatAnything($currency, strval($transaction->amount), $coloured); } + /** + * This method will properly format the given number, in color or "black and white", + * as a currency, given two things: the currency required and the currency code. + * + * @param string $code + * @param string $amount + * @param bool $coloured + * + * @return string + */ + public function formatWithCode(string $code, string $amount, bool $coloured = true): string + { + $locale = setlocale(LC_MONETARY, 0); + $float = round($amount, 2); + $formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY); + $result = $formatter->formatCurrency($float, $code); + + if ($coloured === true) { + + if ($amount > 0) { + return '' . $result . ''; + } else { + if ($amount < 0) { + return '' . $result . ''; + } + } + + return '' . $result . ''; + + + } + + return $result; + } + /** * @return Collection */ diff --git a/app/Support/Binder/AccountList.php b/app/Support/Binder/AccountList.php index 264cbea26a..1512f0bbfa 100644 --- a/app/Support/Binder/AccountList.php +++ b/app/Support/Binder/AccountList.php @@ -3,8 +3,10 @@ * AccountList.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Binder/BinderInterface.php b/app/Support/Binder/BinderInterface.php index 85237ac816..f75ae11ee6 100644 --- a/app/Support/Binder/BinderInterface.php +++ b/app/Support/Binder/BinderInterface.php @@ -3,8 +3,10 @@ * BinderInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Binder/BudgetList.php b/app/Support/Binder/BudgetList.php index 9f848304d7..eb617a0ac3 100644 --- a/app/Support/Binder/BudgetList.php +++ b/app/Support/Binder/BudgetList.php @@ -3,8 +3,10 @@ * BudgetList.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Binder/CategoryList.php b/app/Support/Binder/CategoryList.php index ecaefd37a0..852ac1e396 100644 --- a/app/Support/Binder/CategoryList.php +++ b/app/Support/Binder/CategoryList.php @@ -3,8 +3,10 @@ * CategoryList.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Binder/Date.php b/app/Support/Binder/Date.php index caecb1d7a2..be03cc14d2 100644 --- a/app/Support/Binder/Date.php +++ b/app/Support/Binder/Date.php @@ -3,8 +3,10 @@ * Date.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Binder/JournalList.php b/app/Support/Binder/JournalList.php index b1961fa3e3..b36af5149c 100644 --- a/app/Support/Binder/JournalList.php +++ b/app/Support/Binder/JournalList.php @@ -3,8 +3,10 @@ * JournalList.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Binder/UnfinishedJournal.php b/app/Support/Binder/UnfinishedJournal.php index 727d865484..607f442e46 100644 --- a/app/Support/Binder/UnfinishedJournal.php +++ b/app/Support/Binder/UnfinishedJournal.php @@ -3,8 +3,10 @@ * UnfinishedJournal.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 90d469d476..7ed1c1fdfb 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -3,8 +3,10 @@ * CacheProperties.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Domain.php b/app/Support/Domain.php index ca46acc3a4..427bd4628c 100644 --- a/app/Support/Domain.php +++ b/app/Support/Domain.php @@ -3,8 +3,10 @@ * Domain.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Events/BillScanner.php b/app/Support/Events/BillScanner.php index c219972396..7d1d362783 100644 --- a/app/Support/Events/BillScanner.php +++ b/app/Support/Events/BillScanner.php @@ -3,8 +3,10 @@ * BillScanner.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index c93c603ef2..36682352d3 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -3,8 +3,10 @@ * ExpandedForm.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Facades/Amount.php b/app/Support/Facades/Amount.php index 84eadc9dbe..b7a4d53304 100644 --- a/app/Support/Facades/Amount.php +++ b/app/Support/Facades/Amount.php @@ -3,8 +3,10 @@ * Amount.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Facades/ExpandedForm.php b/app/Support/Facades/ExpandedForm.php index 6e356aa329..fe6afa5af9 100644 --- a/app/Support/Facades/ExpandedForm.php +++ b/app/Support/Facades/ExpandedForm.php @@ -3,8 +3,10 @@ * ExpandedForm.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Facades/FireflyConfig.php b/app/Support/Facades/FireflyConfig.php index 0b1b47cff8..8a1a5ff617 100644 --- a/app/Support/Facades/FireflyConfig.php +++ b/app/Support/Facades/FireflyConfig.php @@ -3,8 +3,10 @@ * FireflyConfig.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Facades/Navigation.php b/app/Support/Facades/Navigation.php index c7e709a603..b59fce49fb 100644 --- a/app/Support/Facades/Navigation.php +++ b/app/Support/Facades/Navigation.php @@ -3,8 +3,10 @@ * Navigation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Facades/Preferences.php b/app/Support/Facades/Preferences.php index 5efe07666e..d0155f6375 100644 --- a/app/Support/Facades/Preferences.php +++ b/app/Support/Facades/Preferences.php @@ -3,8 +3,10 @@ * Preferences.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Facades/Steam.php b/app/Support/Facades/Steam.php index 4eb147f6ff..da00e57317 100644 --- a/app/Support/Facades/Steam.php +++ b/app/Support/Facades/Steam.php @@ -3,8 +3,10 @@ * Steam.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.php index 2a82f03034..32ff7958c3 100644 --- a/app/Support/FireflyConfig.php +++ b/app/Support/FireflyConfig.php @@ -3,8 +3,10 @@ * FireflyConfig.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -13,7 +15,6 @@ namespace FireflyIII\Support; use Cache; use FireflyIII\Models\Configuration; -use FireflyIII\Models\Preference; use Log; /** @@ -31,11 +32,11 @@ class FireflyConfig */ public function delete($name): bool { - $fullName = 'preference' . auth()->user()->id . $name; + $fullName = 'ff-config-' . $name; if (Cache::has($fullName)) { Cache::forget($fullName); } - Preference::where('user_id', auth()->user()->id)->where('name', $name)->delete(); + Configuration::where('name', $name)->delete(); return true; } diff --git a/app/Support/Migration/TestData.php b/app/Support/Migration/TestData.php index e8ea752208..97c46c98d0 100644 --- a/app/Support/Migration/TestData.php +++ b/app/Support/Migration/TestData.php @@ -3,8 +3,10 @@ * TestData.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -465,7 +467,7 @@ class TestData private function createMultiDeposits() { foreach ($this->data['multi-deposits'] as $deposit) { - $journalId = DB::table('transaction_journals')->insertGetId( + $journalId = DB::table('transaction_journals')->insertGetId( [ 'created_at' => $this->time, 'updated_at' => $this->time, @@ -483,6 +485,7 @@ class TestData 'tag_count' => 0, ] ); + $identifier = 0; foreach ($deposit['source_ids'] as $index => $source) { $description = $deposit['description'] . ' (#' . ($index + 1) . ')'; $amount = $deposit['amounts'][$index]; @@ -494,6 +497,7 @@ class TestData 'transaction_journal_id' => $journalId, 'description' => $description, 'amount' => $amount, + 'identifier' => $identifier, ] ); $second = DB::table('transactions')->insertGetId( @@ -504,8 +508,10 @@ class TestData 'transaction_journal_id' => $journalId, 'description' => $description, 'amount' => $amount * -1, + 'identifier' => $identifier, ] ); + $identifier++; // link first and second to budget and category, if present. if (isset($deposit['category_ids'][$index])) { @@ -529,7 +535,7 @@ class TestData private function createMultiTransfers() { foreach ($this->data['multi-transfers'] as $transfer) { - $journalId = DB::table('transaction_journals')->insertGetId( + $journalId = DB::table('transaction_journals')->insertGetId( [ 'created_at' => $this->time, 'updated_at' => $this->time, @@ -547,6 +553,7 @@ class TestData 'tag_count' => 0, ] ); + $identifier = 0; foreach ($transfer['destination_ids'] as $index => $destination) { $description = $transfer['description'] . ' (#' . ($index + 1) . ')'; $amount = $transfer['amounts'][$index]; @@ -559,6 +566,7 @@ class TestData 'transaction_journal_id' => $journalId, 'description' => $description, 'amount' => $amount * -1, + 'identifier' => $identifier, ] ); $second = DB::table('transactions')->insertGetId( @@ -569,9 +577,10 @@ class TestData 'transaction_journal_id' => $journalId, 'description' => $description, 'amount' => $amount, + 'identifier' => $identifier, ] ); - + $identifier++; if (isset($transfer['category_ids'][$index])) { DB::table('category_transaction')->insert( [ @@ -596,7 +605,7 @@ class TestData private function createMultiWithdrawals() { foreach ($this->data['multi-withdrawals'] as $withdrawal) { - $journalId = DB::table('transaction_journals')->insertGetId( + $journalId = DB::table('transaction_journals')->insertGetId( [ 'created_at' => $this->time, 'updated_at' => $this->time, @@ -614,6 +623,7 @@ class TestData 'tag_count' => 0, ] ); + $identifier = 0; foreach ($withdrawal['destination_ids'] as $index => $destination) { $description = $withdrawal['description'] . ' (#' . ($index + 1) . ')'; $amount = $withdrawal['amounts'][$index]; @@ -625,6 +635,7 @@ class TestData 'transaction_journal_id' => $journalId, 'description' => $description, 'amount' => $amount * -1, + 'identifier' => $identifier, ] ); $second = DB::table('transactions')->insertGetId( @@ -635,8 +646,10 @@ class TestData 'transaction_journal_id' => $journalId, 'description' => $description, 'amount' => $amount, + 'identifier' => $identifier, ] ); + $identifier++; // link first and second to budget and category, if present. if (isset($withdrawal['budget_ids'][$index])) { DB::table('budget_transaction')->insert( diff --git a/app/Support/Models/TagSupport.php b/app/Support/Models/TagSupport.php index a0decf17e4..f053ef42cf 100644 --- a/app/Support/Models/TagSupport.php +++ b/app/Support/Models/TagSupport.php @@ -3,8 +3,10 @@ * TagSupport.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -31,9 +33,9 @@ class TagSupport extends Model public static function tagAllowAdvance(Tag $tag): bool { /* - * If this tag is a balancing act, and it contains transfers, it cannot be - * changes to an advancePayment. - */ + * If this tag is a balancing act, and it contains transfers, it cannot be + * changes to an advancePayment. + */ if ($tag->tagMode == 'balancingAct' || $tag->tagMode == 'nothing') { foreach ($tag->transactionjournals as $journal) { diff --git a/app/Support/Models/TransactionJournalSupport.php b/app/Support/Models/TransactionJournalSupport.php index 7b59c20d2d..49901f7119 100644 --- a/app/Support/Models/TransactionJournalSupport.php +++ b/app/Support/Models/TransactionJournalSupport.php @@ -3,8 +3,10 @@ * TransactionJournalSupport.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 063f04be03..4ea2318acb 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -3,8 +3,10 @@ * Navigation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -41,7 +43,7 @@ class Navigation '1W' => 'addWeeks', 'weekly' => 'addWeeks', 'week' => 'addWeeks', '1M' => 'addMonths', 'month' => 'addMonths', 'monthly' => 'addMonths', '3M' => 'addMonths', 'quarter' => 'addMonths', 'quarterly' => 'addMonths', '6M' => 'addMonths', 'half-year' => 'addMonths', - 'year' => 'addYears', 'yearly' => 'addYears', + 'year' => 'addYears', 'yearly' => 'addYears', '1Y' => 'addYears', ]; $modifierMap = [ 'quarter' => 3, diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index 2f17d809eb..8471745dbc 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -3,8 +3,10 @@ * Preferences.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.php index facd842df2..d20e83413f 100644 --- a/app/Support/Search/Search.php +++ b/app/Support/Search/Search.php @@ -3,8 +3,10 @@ * Search.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Search/SearchInterface.php b/app/Support/Search/SearchInterface.php index f9914d1a50..bd16c78853 100644 --- a/app/Support/Search/SearchInterface.php +++ b/app/Support/Search/SearchInterface.php @@ -3,8 +3,10 @@ * SearchInterface.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Steam.php b/app/Support/Steam.php index e52eb70118..d94b7af230 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -3,8 +3,10 @@ * Steam.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -122,7 +124,7 @@ class Steam ->where('transaction_journals.date', '>=', $start->format('Y-m-d')) ->where('transaction_journals.date', '<=', $end->format('Y-m-d')) ->groupBy('transaction_journals.date') - ->get(['transaction_journals.date', DB::raw('SUM(`transactions`.`amount`) as `modified`')]); + ->get(['transaction_journals.date', DB::raw('SUM(transactions.amount) AS modified')]); $currentBalance = $startBalance; foreach ($set as $entry) { $modified = is_null($entry->modified) ? '0' : strval($entry->modified); @@ -162,7 +164,7 @@ class Steam ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) ->groupBy('transactions.account_id') ->whereIn('transactions.account_id', $ids) - ->get(['transactions.account_id', DB::raw('sum(`transactions`.`amount`) as aggregate')]); + ->get(['transactions.account_id', DB::raw('sum(transactions.amount) AS aggregate')]); $result = []; foreach ($balances as $entry) { @@ -189,7 +191,7 @@ class Steam $set = auth()->user()->transactions() ->whereIn('transactions.account_id', $accounts) ->groupBy(['transactions.account_id', 'transaction_journals.user_id']) - ->get(['transactions.account_id', DB::raw('MAX(`transaction_journals`.`date`) as `max_date`')]); + ->get(['transactions.account_id', DB::raw('MAX(transaction_journals.date) AS max_date')]); foreach ($set as $entry) { $list[intval($entry->account_id)] = new Carbon($entry->max_date); diff --git a/app/Support/Twig/Budget.php b/app/Support/Twig/Budget.php deleted file mode 100644 index dca3d1eaeb..0000000000 --- a/app/Support/Twig/Budget.php +++ /dev/null @@ -1,66 +0,0 @@ -addProperty($repetition->id); - $cache->addProperty('spentInRepetition'); - if ($cache->has()) { - return $cache->get(); - } - $sum - = auth()->user()->transactionJournals() - ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') - ->leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budget_transaction_journal.budget_id') - ->leftJoin('limit_repetitions', 'limit_repetitions.budget_limit_id', '=', 'budget_limits.id') - ->before($repetition->enddate) - ->after($repetition->startdate) - ->where('limit_repetitions.id', '=', $repetition->id) - ->get(['transaction_journals.*'])->sum('amount'); - $cache->store($sum); - - return $sum; - } - ); - - return $functions; - - } - - /** - * {@inheritDoc} - */ - public function getName(): string - { - return 'FireflyIII\Support\Twig\Budget'; - } -} diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index d937f51863..b2dfda8831 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -3,8 +3,10 @@ * General.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -38,7 +40,6 @@ class General extends Twig_Extension { return [ $this->formatAmount(), - $this->formatTransaction(), $this->formatAmountPlain(), $this->formatJournal(), $this->balance(), @@ -234,18 +235,6 @@ class General extends Twig_Extension ); } - /** - * @return Twig_SimpleFilter - */ - protected function formatTransaction(): Twig_SimpleFilter - { - return new Twig_SimpleFilter( - 'formatTransaction', function (Transaction $transaction) : string { - return app('amount')->formatTransaction($transaction); - }, ['is_safe' => ['html']] - ); - } - /** * @return Twig_SimpleFilter */ diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php index fd4158cf49..62f99d89a6 100644 --- a/app/Support/Twig/Journal.php +++ b/app/Support/Twig/Journal.php @@ -3,8 +3,10 @@ * Journal.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -16,7 +18,6 @@ use Amount; use FireflyIII\Models\Account; use FireflyIII\Models\Budget as ModelBudget; use FireflyIII\Models\Category; -use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Support\CacheProperties; use Twig_Extension; @@ -162,7 +163,9 @@ class Journal extends Twig_Extension */ public function getFilters(): array { - $filters = [$this->typeIcon()]; + $filters = [ + $this->typeIcon(), + ]; return $filters; } @@ -179,8 +182,6 @@ class Journal extends Twig_Extension $this->formatBudgetPerspective(), $this->journalBudgets(), $this->journalCategories(), - $this->transactionBudgets(), - $this->transactionCategories(), ]; return $functions; @@ -311,68 +312,6 @@ class Journal extends Twig_Extension ); } - /** - * @return Twig_SimpleFunction - */ - public function transactionBudgets(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'transactionBudgets', function (Transaction $transaction): string { - $cache = new CacheProperties; - $cache->addProperty($transaction->id); - $cache->addProperty('transaction'); - $cache->addProperty('budget-string'); - if ($cache->has()) { - return $cache->get(); - } - - $budgets = []; - // get all budgets: - foreach ($transaction->budgets as $budget) { - $budgets[] = '' . e($budget->name) . ''; - } - $string = join(', ', array_unique($budgets)); - $cache->store($string); - - return $string; - - - } - ); - } - - /** - * @return Twig_SimpleFunction - */ - public function transactionCategories(): Twig_SimpleFunction - { - return new Twig_SimpleFunction( - 'transactionCategories', function (Transaction $transaction): string { - $cache = new CacheProperties; - $cache->addProperty($transaction->id); - $cache->addProperty('transaction'); - $cache->addProperty('category-string'); - if ($cache->has()) { - return $cache->get(); - } - - - $categories = []; - // get all budgets: - foreach ($transaction->categories as $category) { - $categories[] = '' . e($category->name) . ''; - } - - $string = join(', ', array_unique($categories)); - $cache->store($string); - - return $string; - - - } - ); - } - /** * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's 5. * @@ -405,4 +344,5 @@ class Journal extends Twig_Extension }, ['is_safe' => ['html']] ); } + } diff --git a/app/Support/Twig/PiggyBank.php b/app/Support/Twig/PiggyBank.php index e124fc5256..8a11fb546e 100644 --- a/app/Support/Twig/PiggyBank.php +++ b/app/Support/Twig/PiggyBank.php @@ -3,8 +3,10 @@ * PiggyBank.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php index 36806aa0c9..630cddc408 100644 --- a/app/Support/Twig/Rule.php +++ b/app/Support/Twig/Rule.php @@ -3,8 +3,10 @@ * Rule.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/Support/Twig/Transaction.php b/app/Support/Twig/Transaction.php new file mode 100644 index 0000000000..1e4105bf2f --- /dev/null +++ b/app/Support/Twig/Transaction.php @@ -0,0 +1,301 @@ + ['html']] + ); + } + + /** + * @return array + */ + public function getFilters(): array + { + $filters = [ + $this->typeIconTransaction(), + ]; + + return $filters; + } + + /** + * @return array + */ + public function getFunctions(): array + { + $functions = [ + $this->formatAmountWithCode(), + $this->transactionSourceAccount(), + $this->transactionDestinationAccount(), + $this->optionalJournalAmount(), + $this->transactionBudgets(), + $this->transactionCategories(), + $this->splitJournalIndicator(), + ]; + + return $functions; + } + + /** + * Returns the name of the extension. + * + * @return string The extension name + */ + public function getName(): string + { + return 'transaction'; + } + + /** + * @return Twig_SimpleFunction + */ + public function optionalJournalAmount(): Twig_SimpleFunction + { + return new Twig_SimpleFunction( + 'optionalJournalAmount', function (int $journalId, string $transactionAmount, string $code, string $type): string { + + $amount = strval( + TransactionModel + ::where('transaction_journal_id', $journalId) + ->whereNull('deleted_at') + ->where('amount', '<', 0) + ->sum('amount') + ); + + if ($type === TransactionType::DEPOSIT || $type === TransactionType::TRANSFER) { + $amount = bcmul($amount, '-1'); + } + + if ( + bccomp($amount, $transactionAmount) !== 0 + && bccomp($amount, bcmul($transactionAmount, '-1')) !== 0 + ) { + // not equal? + return ' (' . Amount::formatWithCode($code, $amount, true) . ')'; + } + + return ''; + + + }, ['is_safe' => ['html']] + ); + } + + /** + * @return Twig_SimpleFunction + */ + public function splitJournalIndicator(): Twig_SimpleFunction + { + return new Twig_SimpleFunction( + 'splitJournalIndicator', function (int $journalId) { + $count = TransactionModel::where('transaction_journal_id', $journalId)->whereNull('deleted_at')->count(); + if ($count > 2) { + return ''; + } + + return ''; + + + }, ['is_safe' => ['html']] + ); + } + + /** + * @return Twig_SimpleFunction + */ + public function transactionBudgets(): Twig_SimpleFunction + { + return new Twig_SimpleFunction( + 'transactionBudgets', function (TransactionModel $transaction): string { + // see if the transaction has a budget: + $budgets = $transaction->budgets()->get(); + if ($budgets->count() === 0) { + $budgets = $transaction->transactionJournal()->first()->budgets()->get(); + } + if ($budgets->count() > 0) { + $str = []; + foreach ($budgets as $budget) { + $str[] = sprintf('%s', route('budgets.show', [$budget->id]), $budget->name, $budget->name); + } + + return join(', ', $str); + } + + + return ''; + }, ['is_safe' => ['html']] + ); + } + + /** + * @return Twig_SimpleFunction + */ + public function transactionCategories(): Twig_SimpleFunction + { + return new Twig_SimpleFunction( + 'transactionCategories', function (TransactionModel $transaction): string { + // see if the transaction has a category: + $categories = $transaction->categories()->get(); + if ($categories->count() === 0) { + $categories = $transaction->transactionJournal()->first()->categories()->get(); + } + if ($categories->count() > 0) { + $str = []; + foreach ($categories as $category) { + $str[] = sprintf('%s', route('categories.show', [$category->id]), $category->name, $category->name); + } + + return join(', ', $str); + } + + return ''; + }, ['is_safe' => ['html']] + ); + } + + /** + * @return Twig_SimpleFunction + */ + public function transactionDestinationAccount(): Twig_SimpleFunction + { + return new Twig_SimpleFunction( + 'transactionDestinationAccount', function (TransactionModel $transaction): string { + + $name = intval($transaction->account_encrypted) === 1 ? Crypt::decrypt($transaction->account_name) : $transaction->account_name; + $id = intval($transaction->account_id); + $type = $transaction->account_type; + // if the amount is positive, assume that the current account (the one in $transaction) is indeed the destination account. + + if (bccomp($transaction->transaction_amount, '0') === -1) { + // if the amount is negative, find the opposing account and use that one: + $journalId = $transaction->journal_id; + /** @var TransactionModel $other */ + $other = TransactionModel + ::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) + ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where('identifier', $transaction->identifier) + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') + ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') + ->first(['transactions.account_id', 'accounts.encrypted', 'accounts.name', 'account_types.type']); + $name = intval($other->encrypted) === 1 ? Crypt::decrypt($other->name) : $other->name; + $id = $other->account_id; + $type = $other->type; + } + + if ($type === AccountType::CASH) { + return '(cash)'; + } + + return '' . e($name) . ''; + + }, ['is_safe' => ['html']] + ); + } + + /** + * @return Twig_SimpleFunction + */ + public function transactionSourceAccount(): Twig_SimpleFunction + { + return new Twig_SimpleFunction( + 'transactionSourceAccount', function (TransactionModel $transaction): string { + + $name = intval($transaction->account_encrypted) === 1 ? Crypt::decrypt($transaction->account_name) : $transaction->account_name; + $id = intval($transaction->account_id); + $type = $transaction->account_type; + // if the amount is negative, assume that the current account (the one in $transaction) is indeed the source account. + + if (bccomp($transaction->transaction_amount, '0') === 1) { + // if the amount is positive, find the opposing account and use that one: + $journalId = $transaction->journal_id; + /** @var TransactionModel $other */ + $other = TransactionModel + ::where('transaction_journal_id', $journalId)->where('transactions.id', '!=', $transaction->id) + ->where('amount', '=', bcmul($transaction->transaction_amount, '-1'))->where('identifier', $transaction->identifier) + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') + ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') + ->first(['transactions.account_id', 'accounts.encrypted', 'accounts.name', 'account_types.type']); + $name = intval($other->encrypted) === 1 ? Crypt::decrypt($other->name) : $other->name; + $id = $other->account_id; + $type = $other->type; + } + + if ($type === AccountType::CASH) { + return '(cash)'; + } + + return '' . e($name) . ''; + + }, ['is_safe' => ['html']] + ); + } + + /** + * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's 5. + * + * @return Twig_SimpleFilter + */ + public function typeIconTransaction(): Twig_SimpleFilter + { + return new Twig_SimpleFilter( + 'typeIconTransaction', function (TransactionModel $transaction): string { + + switch ($transaction->transaction_type_type) { + case TransactionType::WITHDRAWAL: + $txt = ''; + break; + case TransactionType::DEPOSIT: + $txt = ''; + break; + case TransactionType::TRANSFER: + $txt = ''; + break; + case TransactionType::OPENING_BALANCE: + $txt = ''; + break; + default: + $txt = ''; + break; + } + + return $txt; + }, ['is_safe' => ['html']] + ); + } +} \ No newline at end of file diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php index ced31b189d..f9401eee52 100644 --- a/app/Support/Twig/Translation.php +++ b/app/Support/Twig/Translation.php @@ -3,8 +3,10 @@ * Translation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/app/User.php b/app/User.php index 7760cc2587..72ccc2f8b8 100755 --- a/app/User.php +++ b/app/User.php @@ -3,8 +3,10 @@ * User.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -22,6 +24,42 @@ use Illuminate\Notifications\Notifiable; * Class User * * @package FireflyIII + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property string $email + * @property string $password + * @property string $remember_token + * @property string $reset + * @property boolean $blocked + * @property string $blocked_code + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\ExportJob[] $exportJobs + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\ImportJob[] $importJobs + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Role[] $roles + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\RuleGroup[] $ruleGroups + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Rule[] $rules + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $unreadNotifications + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereId($value) + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereCreatedAt($value) + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereUpdatedAt($value) + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereEmail($value) + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User wherePassword($value) + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereRememberToken($value) + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereReset($value) + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereBlocked($value) + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereBlockedCode($value) + * @mixin \Eloquent */ class User extends Authenticatable { diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 8742ea9880..6d569fd3e4 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -3,8 +3,10 @@ * FireflyValidator.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/bootstrap/app.php b/bootstrap/app.php index 3cf8f7e7fd..dd875c174b 100755 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -3,8 +3,10 @@ * app.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index bb7347844e..984638501e 100755 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -3,8 +3,10 @@ * autoload.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/composer.json b/composer.json index 9c405065f7..5bfe78718a 100755 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ ], "require": { "php": ">=7.0.0", + "ext-intl": "*", "laravel/framework": "5.3.*", "davejamesmiller/laravel-breadcrumbs": "^3.0", "watson/validating": "^3.0", diff --git a/config/app.php b/config/app.php index 83b08e5a92..0dfd97b9f8 100755 --- a/config/app.php +++ b/config/app.php @@ -1,4 +1,14 @@ true, ], 'chart' => 'chartjs', - 'version' => '4.0.1', + 'version' => '4.0.2', 'csv_import_enabled' => true, 'maxUploadSize' => 5242880, 'allowedMimes' => ['image/png', 'image/jpeg', 'application/pdf'], @@ -96,11 +106,12 @@ return [ 'languages' => [ 'de_DE' => ['name_locale' => 'Deutsch', 'name_english' => 'German', 'complete' => false], 'en_US' => ['name_locale' => 'English', 'name_english' => 'English', 'complete' => true], + 'fr_FR' => ['name_locale' => 'Français', 'name_english' => 'French', 'complete' => false], + 'hr_HR' => ['name_locale' => 'hrvatski', 'name_english' => 'Croatian', 'complete' => false], 'nl_NL' => ['name_locale' => 'Nederlands', 'name_english' => 'Dutch', 'complete' => true], 'pt_BR' => ['name_locale' => 'Português do Brasil', 'name_english' => 'Portuguese (Brazil)', 'complete' => true], - 'fr_FR' => ['name_locale' => 'Français', 'name_english' => 'French', 'complete' => false], - 'zh-HK' => ['name_locale' => 'Chinese Traditional, Hong Kong', 'name_english' => 'Chinese Traditional, Hong Kong', 'complete' => false], - 'zh-TW' => ['name_locale' => 'Chinese Traditional', 'name_english' => 'Chinese Traditional', 'complete' => false], + 'zh-HK' => ['name_locale' => '繁體中文(香港)', 'name_english' => 'Chinese Traditional, Hong Kong', 'complete' => false], + 'zh-TW' => ['name_locale' => '正體中文', 'name_english' => 'Chinese Traditional', 'complete' => false], ], 'transactionTypesByWhat' => [ 'expenses' => ['Withdrawal'], diff --git a/config/mail.php b/config/mail.php index 61d362d3fc..219084ef83 100755 --- a/config/mail.php +++ b/config/mail.php @@ -1,4 +1,13 @@ smallInteger('identifier', false, true)->default(0); + } + ); + } +} diff --git a/database/seeds/AccountTypeSeeder.php b/database/seeds/AccountTypeSeeder.php index 6948f2da2c..64422f3a5d 100644 --- a/database/seeds/AccountTypeSeeder.php +++ b/database/seeds/AccountTypeSeeder.php @@ -3,8 +3,10 @@ * AccountTypeSeeder.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 5f358902f0..7902ac315b 100755 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -3,8 +3,10 @@ * DatabaseSeeder.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/database/seeds/PermissionSeeder.php b/database/seeds/PermissionSeeder.php index 7699f88e4e..1bf36c21e7 100644 --- a/database/seeds/PermissionSeeder.php +++ b/database/seeds/PermissionSeeder.php @@ -3,8 +3,10 @@ * PermissionSeeder.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php index 903c7ee3ec..334b4725dd 100644 --- a/database/seeds/TestDataSeeder.php +++ b/database/seeds/TestDataSeeder.php @@ -3,8 +3,10 @@ * TestDataSeeder.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/database/seeds/TransactionCurrencySeeder.php b/database/seeds/TransactionCurrencySeeder.php index 1f9a891f6c..887ce75f4a 100644 --- a/database/seeds/TransactionCurrencySeeder.php +++ b/database/seeds/TransactionCurrencySeeder.php @@ -3,8 +3,10 @@ * TransactionCurrencySeeder.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/database/seeds/TransactionTypeSeeder.php b/database/seeds/TransactionTypeSeeder.php index a20897e62f..690d333aba 100644 --- a/database/seeds/TransactionTypeSeeder.php +++ b/database/seeds/TransactionTypeSeeder.php @@ -3,8 +3,10 @@ * TransactionTypeSeeder.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/public/css/firefly.css b/public/css/firefly.css index a33f04a936..354ea0b15b 100644 --- a/public/css/firefly.css +++ b/public/css/firefly.css @@ -73,4 +73,9 @@ body.waiting * { .bootstrap-tagsinput { margin-bottom: 10px; width: 100%; +} + +.loading { + background:url('/images/loading-small.gif') no-repeat center center; + min-height:30px; } \ No newline at end of file diff --git a/public/images/loading-small.gif b/public/images/loading-small.gif new file mode 100644 index 0000000000..5c4758cc12 Binary files /dev/null and b/public/images/loading-small.gif differ diff --git a/public/js/ff/reports/default/all.js b/public/js/ff/reports/default/all.js index 30810842eb..e92203fee9 100644 --- a/public/js/ff/reports/default/all.js +++ b/public/js/ff/reports/default/all.js @@ -17,8 +17,26 @@ $(function () { // find the little info buttons and respond to them. $('.firefly-info-button').click(clickInfoButton); + // load the account report, which this report shows: + loadAccountReport(); + }); +function loadAccountReport() { + "use strict"; + $.get(accountReportUrl).done(placeAccountReport).fail(failAccountReport); +} + +function placeAccountReport(data) { + "use strict"; + $('#accountReport').removeClass('loading').html(data); +} + +function failAccountReport(data) { + "use strict"; + $('#accountReport').removeClass('loading').addClass('general-chart-error'); +} + function clickInfoButton(e) { "use strict"; // find all data tags, regardless of what they are: diff --git a/resources/lang/de_DE/auth.php b/resources/lang/de_DE/auth.php new file mode 100644 index 0000000000..7319a9d7b8 --- /dev/null +++ b/resources/lang/de_DE/auth.php @@ -0,0 +1,28 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/resources/lang/de_DE/breadcrumbs.php b/resources/lang/de_DE/breadcrumbs.php index 084a5c5430..fc7a874e16 100644 --- a/resources/lang/de_DE/breadcrumbs.php +++ b/resources/lang/de_DE/breadcrumbs.php @@ -4,36 +4,38 @@ * breadcrumbs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ - 'home' => 'Home', - 'edit_currency' => 'Bearbeite die Währung ":name"', - 'delete_currency' => 'Lösche die Währung ":name"', - 'newPiggyBank' => 'Erstellen Sie ein neues Sparschwein', - 'edit_piggyBank' => 'Bearbeite Sparschwein ":name"', - 'preferences' => 'Einstellungen', - 'profile' => 'Profil', - 'changePassword' => 'Passwort ändern', - 'bills' => 'Rechnungen', - 'newBill' => 'Neue Rechnung', - 'edit_bill' => 'Bearbeite Rechnung ":name"', - 'delete_bill' => 'Lösche Rechnung ":name"', - 'reports' => 'Berichte', - 'searchResult' => 'Suche nach ":query"', - 'withdrawal_list' => 'Ausgaben', - 'deposit_list' => 'Umsatz, Einkommen und Einlagen', - 'transfer_list' => 'Überweisungen', - 'transfers_list' => 'Überweisungen', - 'create_withdrawal' => 'Erstelle eine neue Ausgabe', - 'create_deposit' => 'Erstelle ein neues Einkommen', - 'create_transfer' => 'Erstelle eine neue Überweisung', - 'edit_journal' => 'Bearbeite Transaktion ":description"', - 'delete_journal' => 'Lösche Transaktion ":description"', - 'tags' => 'Tags', - 'createTag' => 'Neuen Tag erstellen', - 'edit_tag' => 'Bearbeite Tag ":tag"', - 'delete_tag' => 'Lösche Tag ":tag"', + 'home' => 'Home', + 'edit_currency' => 'Bearbeite die Währung ":name"', + 'delete_currency' => 'Lösche die Währung ":name"', + 'newPiggyBank' => 'Erstellen Sie ein neues Sparschwein', + 'edit_piggyBank' => 'Bearbeite Sparschwein ":name"', + 'preferences' => 'Einstellungen', + 'profile' => 'Profil', + 'changePassword' => 'Passwort ändern', + 'bills' => 'Rechnungen', + 'newBill' => 'Neue Rechnung', + 'edit_bill' => 'Bearbeite Rechnung ":name"', + 'delete_bill' => 'Lösche Rechnung ":name"', + 'reports' => 'Berichte', + 'searchResult' => 'Suche nach ":query"', + 'withdrawal_list' => 'Ausgaben', + 'deposit_list' => 'Umsatz, Einkommen und Einlagen', + 'transfer_list' => 'Überweisungen', + 'transfers_list' => 'Überweisungen', + 'create_withdrawal' => 'Erstelle eine neue Ausgabe', + 'create_deposit' => 'Erstelle ein neues Einkommen', + 'create_transfer' => 'Erstelle eine neue Überweisung', + 'edit_journal' => 'Bearbeite Transaktion ":description"', + 'delete_journal' => 'Lösche Transaktion ":description"', + 'tags' => 'Tags', + 'createTag' => 'Neuen Tag erstellen', + 'edit_tag' => 'Bearbeite Tag ":tag"', + 'delete_tag' => 'Lösche Tag ":tag"', ]; diff --git a/resources/lang/de_DE/config.php b/resources/lang/de_DE/config.php index b9a9a5f26e..9232e9d4ea 100644 --- a/resources/lang/de_DE/config.php +++ b/resources/lang/de_DE/config.php @@ -3,8 +3,10 @@ * config.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/de_DE/csv.php b/resources/lang/de_DE/csv.php index 8bc37ef080..0eb74b1341 100644 --- a/resources/lang/de_DE/csv.php +++ b/resources/lang/de_DE/csv.php @@ -3,8 +3,10 @@ * csv.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/resources/lang/de_DE/firefly.php b/resources/lang/de_DE/firefly.php index 665a72cb22..c7e2595631 100644 --- a/resources/lang/de_DE/firefly.php +++ b/resources/lang/de_DE/firefly.php @@ -3,8 +3,10 @@ * firefly.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -762,7 +764,7 @@ return [ 'no_edit_multiple_left' => 'You have selected no valid transactions to edit.', // import - 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you.', + 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', 'import_data_index' => 'Index', 'import_file_type_csv' => 'CSV (comma separated values)', 'import_file_type_help' => 'Select the type of file you will upload', @@ -780,7 +782,10 @@ return [ 'import_data' => 'Import data', 'import_data_full' => 'Import data into Firefly III', 'import' => 'Import', - 'import_intro_text' => 'Welcome to the Firefly III data import routine. At the moment, this routine can help you import files into Firefly. To do so, you must download or export transactions from other systems or software, and upload them here. The next steps will let you help Firefly III determin what the content is of your file, and how to handle it. Please select a file, and read all instructions carefully.', + 'import_intro_what_it_does' => 'This page allows you to import data into Firefly III. To do so, export data from your bank, or from another financial management system. Upload that file here. Firefly III will convert the data. You need to give it some directions. Please select a file and follow the instructions.', + 'import_intro_import_conf_title' => 'Import "configuration"', + 'import_intro_beta_warning' => 'Warning', + 'import_intro_import_conf_text' => 'As you will discover over the next few pages, this import routine has a lot of settings. These settings are mainly dependent on the bank (or financial management software) your file comes from. There is a good chance somebody else already imported such a file and has shared their configuration file. Please visit the import configuration center to see if there already is a configuration available for your bank or system. If there is, you should download this configuration file and upload it here as well. It will save you a lot of time!', 'import_file_help' => 'Select your file', 'import_status_settings_complete' => 'The import is ready to start.', 'import_status_import_complete' => 'The import has completed.', @@ -796,8 +801,11 @@ return [ 'import_double' => 'Row #:row: This row has been imported before, and is stored in :description.', 'import_finished_all' => 'The import has finished. Please check out the results below.', 'import_with_key' => 'Import with key \':key\'', - 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', - 'import_finished_link' => 'The transactions imported can be found in tag :tag.', + + 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', + + 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', + 'import_finished_link' => 'The transactions imported can be found in tag :tag.', ]; diff --git a/resources/lang/de_DE/form.php b/resources/lang/de_DE/form.php index 54f70f77b3..893c15f4d4 100644 --- a/resources/lang/de_DE/form.php +++ b/resources/lang/de_DE/form.php @@ -3,8 +3,10 @@ * form.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/de_DE/help.php b/resources/lang/de_DE/help.php index a65979b607..ebfbae53a9 100644 --- a/resources/lang/de_DE/help.php +++ b/resources/lang/de_DE/help.php @@ -3,83 +3,31 @@ * help.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // tour! - 'main-content-title' => 'Willkommen bei Firefly III', - 'main-content-text' => 'Tun Sie sich selbst einen Gefallen und folgen Sie dieser kurzen Tour, damit Sie wissen wie alles funktioniert.', - 'sidebar-toggle-title' => 'Sidebar um neuen Dinge zu erstellen', - 'sidebar-toggle-text' => 'Versteckt unter dem Plus-Icon sind alle Schaltflächen zum Erstellen von neuen Dingen. Konten, Überweisungen, Alles!', - 'account-menu-title' => 'Alle Ihre Konten', - 'account-menu-text' => 'Hier finden Sie alle Konten, die Sie erstellt haben.', - 'budget-menu-title' => 'Budgets', - 'budget-menu-text' => 'Nutzen Sie diese Seite um ihre Finanzen und Ausgabelimits zu organisieren.', - 'report-menu-title' => 'Berichte', - 'report-menu-text' => 'Schauen Sie hier nach, wenn Sie einen grundlegenden Überblick über ihre Finanzen erhalten wollen.', - 'transaction-menu-title' => 'Überweisungen', - 'transaction-menu-text' => 'Alle Überweisungen, die Sie erstellt haben, finden Sie hier.', - 'option-menu-title' => 'Optionen', - 'option-menu-text' => 'Dies ist ziemlich selbsterklärend.', - 'main-content-end-title' => 'Ende!', - 'main-content-end-text' => 'Denken Sie daran, dass jede Seite ein kleines Fragezeichen in der oberen rechten Ecke hat. Klicken Sie darauf um Hilfe zur aktuellen Seite zu erhalten.', - 'index' => 'index', - 'home' => 'home', - 'accounts-index' => 'konten.index', - 'accounts-create' => 'konten.erstellen', - 'accounts-edit' => 'Konten bearbeiten', - 'accounts-delete' => 'Konten löschen', - 'accounts-show' => 'Konten anzeigen', - 'attachments-edit' => 'Anhänge bearbeiten', - 'attachments-delete' => 'anhänge.löschen', - 'attachments-show' => 'Anhänge anzeigen', - 'attachments-preview' => 'Vorschau der Anhänge', - 'bills-index' => 'Rechnungen', - 'bills-create' => 'Rechnungen erstellen', - 'bills-edit' => 'Rechnungen bearbeiten', - 'bills-delete' => 'Rechnungen löschen', - 'bills-show' => 'Rechnungen anzeigen', - 'budgets-index' => 'Budgets', - 'budgets-create' => 'Budgets erstellen', - 'budgets-edit' => 'Budgets bearbeiten', - 'budgets-delete' => 'Budgets löschen', - 'budgets-show' => 'Budgets anzeigen', - 'budgets-noBudget' => 'Überweisungen ohne Budget', - 'categories-index' => 'Kategorien', - 'categories-create' => 'Kategorien erstellen', - 'categories-edit' => 'Kategorien bearbeiten', - 'categories-delete' => 'Kategorien löschen', - 'categories-show' => 'Kategorien anzeigen', - 'categories-show-date' => 'Kategorien anzeigen', - 'categories-noCategory' => 'Überweisungen ohne Kategorie', - 'currency-index' => 'Währungen', - 'currency-create' => 'Währungen erstellen', - 'currency-edit' => 'Währungen bearbeiten', - 'currency-delete' => 'Währungen löschen', - 'new-user-index' => 'Neuer Benutzer', - 'piggy-banks-index' => 'Sparschweine', - 'piggy-banks-create' => 'Sparschweine erstellen', - 'piggy-banks-edit' => 'Sparschweine bearbeiten', - 'piggy-banks-delete' => 'Sparschweine löschen', - 'piggy-banks-show' => 'Sparschweine anzeigen', - 'preferences' => 'Einstellungen', - 'profile' => 'Profile', - 'profile-change-password' => 'Passwort ändern', - 'profile-delete-account' => 'Benutzerkonto löschen', - 'reports-index' => 'Berichte', - 'reports-report' => 'Berichte', - 'search' => 'suchen', - 'tags-index' => 'Tags', - 'tags-create' => 'Tags erstellen', - 'tags-show' => 'Tags anzeigen', - 'tags-edit' => 'Tags bearbeiten', - 'tags-delete' => 'Tags löschen', - 'transactions-index' => 'Überweisungen', - 'transactions-create' => 'Überweisungen erstellen', - 'transactions-edit' => 'Überweisungen bearbeiten', - 'transactions-delete' => 'Überweisungen löschen', - 'transactions-show' => 'Überweisungen anzeigen', + 'main-content-title' => 'Willkommen bei Firefly III', + 'main-content-text' => 'Tun Sie sich selbst einen Gefallen und folgen Sie dieser kurzen Tour, damit Sie wissen wie alles funktioniert.', + 'sidebar-toggle-title' => 'Sidebar um neuen Dinge zu erstellen', + 'sidebar-toggle-text' => 'Versteckt unter dem Plus-Icon sind alle Schaltflächen zum Erstellen von neuen Dingen. Konten, Überweisungen, Alles!', + 'account-menu-title' => 'Alle Ihre Konten', + 'account-menu-text' => 'Hier finden Sie alle Konten, die Sie erstellt haben.', + 'budget-menu-title' => 'Budgets', + 'budget-menu-text' => 'Nutzen Sie diese Seite um ihre Finanzen und Ausgabelimits zu organisieren.', + 'report-menu-title' => 'Berichte', + 'report-menu-text' => 'Schauen Sie hier nach, wenn Sie einen grundlegenden Überblick über ihre Finanzen erhalten wollen.', + 'transaction-menu-title' => 'Überweisungen', + 'transaction-menu-text' => 'Alle Überweisungen, die Sie erstellt haben, finden Sie hier.', + 'option-menu-title' => 'Optionen', + 'option-menu-text' => 'Dies ist ziemlich selbsterklärend.', + 'main-content-end-title' => 'Ende!', + 'main-content-end-text' => 'Denken Sie daran, dass jede Seite ein kleines Fragezeichen in der oberen rechten Ecke hat. Klicken Sie darauf um Hilfe zur aktuellen Seite zu erhalten.', + 'index' => 'index', + 'home' => 'home', ]; diff --git a/resources/lang/de_DE/list.php b/resources/lang/de_DE/list.php index 39f0c04e67..d8044920cf 100644 --- a/resources/lang/de_DE/list.php +++ b/resources/lang/de_DE/list.php @@ -3,8 +3,10 @@ * list.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -35,6 +37,7 @@ return [ 'repeat_freq' => 'Wiederholungen', 'description' => 'Beschreibung', 'amount' => 'Betrag', + 'internal_reference' => 'Internal reference', 'date' => 'Datum', 'interest_date' => 'Zinstermin', 'book_date' => 'Buchungsdatum', diff --git a/resources/lang/de_DE/pagination.php b/resources/lang/de_DE/pagination.php index 5ec866e0ea..2d2efd2bd0 100644 --- a/resources/lang/de_DE/pagination.php +++ b/resources/lang/de_DE/pagination.php @@ -3,11 +3,15 @@ * pagination.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ + 'previous' => '« Vorherige', 'next' => 'Nächste »', + ]; diff --git a/resources/lang/de_DE/passwords.php b/resources/lang/de_DE/passwords.php index 6fa7285fc6..b9deea7fd9 100644 --- a/resources/lang/de_DE/passwords.php +++ b/resources/lang/de_DE/passwords.php @@ -3,8 +3,10 @@ * passwords.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/de_DE/validation.php b/resources/lang/de_DE/validation.php index b06f020c25..79ae91194c 100644 --- a/resources/lang/de_DE/validation.php +++ b/resources/lang/de_DE/validation.php @@ -3,8 +3,10 @@ * validation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -77,4 +79,9 @@ return [ 'url' => ':attribute Format ist ungültig.', 'timezone' => ':attribute muss in einem gültigen Bereich liegen.', '2fa_code' => ':attribute Feld ist ungültig.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'file' => 'The :attribute must be a file.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'present' => 'The :attribute field must be present.', ]; diff --git a/resources/lang/en_US/auth.php b/resources/lang/en_US/auth.php index 6ef1a73308..7319a9d7b8 100755 --- a/resources/lang/en_US/auth.php +++ b/resources/lang/en_US/auth.php @@ -1,4 +1,13 @@ 'You have selected no valid transactions to edit.', // import - 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', + 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', 'import_data_index' => 'Index', 'import_file_type_csv' => 'CSV (comma separated values)', 'import_file_type_help' => 'Select the type of file you will upload', @@ -780,7 +782,10 @@ return [ 'import_data' => 'Import data', 'import_data_full' => 'Import data into Firefly III', 'import' => 'Import', - 'import_intro_text' => 'Welcome to the Firefly III data import routine. At the moment, this routine can help you import files into Firefly. To do so, you must download or export transactions from other systems or software, and upload them here. The next steps will let you help Firefly III determin what the content is of your file, and how to handle it. Please select a file, and read all instructions carefully.', + 'import_intro_what_it_does' => 'This page allows you to import data into Firefly III. To do so, export data from your bank, or from another financial management system. Upload that file here. Firefly III will convert the data. You need to give it some directions. Please select a file and follow the instructions.', + 'import_intro_import_conf_title' => 'Import "configuration"', + 'import_intro_beta_warning' => 'Warning', + 'import_intro_import_conf_text' => 'As you will discover over the next few pages, this import routine has a lot of settings. These settings are mainly dependent on the bank (or financial management software) your file comes from. There is a good chance somebody else already imported such a file and has shared their configuration file. Please visit the import configuration center to see if there already is a configuration available for your bank or system. If there is, you should download this configuration file and upload it here as well. It will save you a lot of time!', 'import_file_help' => 'Select your file', 'import_status_settings_complete' => 'The import is ready to start.', 'import_status_import_complete' => 'The import has completed.', @@ -796,8 +801,11 @@ return [ 'import_double' => 'Row #:row: This row has been imported before, and is stored in :description.', 'import_finished_all' => 'The import has finished. Please check out the results below.', 'import_with_key' => 'Import with key \':key\'', - 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', - 'import_finished_link' => 'The transactions imported can be found in tag :tag.', + + 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', + + 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', + 'import_finished_link' => 'The transactions imported can be found in tag :tag.', ]; diff --git a/resources/lang/en_US/form.php b/resources/lang/en_US/form.php index 62c4971ac6..2f7f5ad581 100644 --- a/resources/lang/en_US/form.php +++ b/resources/lang/en_US/form.php @@ -3,8 +3,10 @@ * form.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/en_US/help.php b/resources/lang/en_US/help.php index c1183ad87c..5198e5510f 100644 --- a/resources/lang/en_US/help.php +++ b/resources/lang/en_US/help.php @@ -3,83 +3,31 @@ * help.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // tour! - 'main-content-title' => 'Welcome to Firefly III', - 'main-content-text' => 'Do yourself a favor and follow this short guide to make sure you know your way around.', - 'sidebar-toggle-title' => 'Sidebar to create stuff', - 'sidebar-toggle-text' => 'Hidden under the plus icon are all the buttons to create new stuff. Accounts, transactions, everything!', - 'account-menu-title' => 'All your accounts', - 'account-menu-text' => 'Here you can find all the accounts you\'ve made.', - 'budget-menu-title' => 'Budgets', - 'budget-menu-text' => 'Use this page to organise your finances and limit spending.', - 'report-menu-title' => 'Reports', - 'report-menu-text' => 'Check this out when you want a solid overview of your finances.', - 'transaction-menu-title' => 'Transactions', - 'transaction-menu-text' => 'All transactions you\'ve created can be found here.', - 'option-menu-title' => 'Options', - 'option-menu-text' => 'This is pretty self-explanatory.', - 'main-content-end-title' => 'The end!', - 'main-content-end-text' => 'Remember that every page has a small question mark at the right top. Click it to get help about the page you\'re on.', - 'index' => 'index', - 'home' => 'home', - 'accounts-index' => 'accounts.index', - 'accounts-create' => 'accounts.create', - 'accounts-edit' => 'accounts.edit', - 'accounts-delete' => 'accounts.delete', - 'accounts-show' => 'accounts.show', - 'attachments-edit' => 'attachments.edit', - 'attachments-delete' => 'attachments.delete', - 'attachments-show' => 'attachments.show', - 'attachments-preview' => 'attachments.preview', - 'bills-index' => 'bills.index', - 'bills-create' => 'bills.create', - 'bills-edit' => 'bills.edit', - 'bills-delete' => 'bills.delete', - 'bills-show' => 'bills.show', - 'budgets-index' => 'budgets.index', - 'budgets-create' => 'budgets.create', - 'budgets-edit' => 'budgets.edit', - 'budgets-delete' => 'budgets.delete', - 'budgets-show' => 'budgets.show', - 'budgets-noBudget' => 'budgets.noBudget', - 'categories-index' => 'categories.index', - 'categories-create' => 'categories.create', - 'categories-edit' => 'categories.edit', - 'categories-delete' => 'categories.delete', - 'categories-show' => 'categories.show', - 'categories-show-date' => 'categories.show.date', - 'categories-noCategory' => 'categories.noCategory', - 'currency-index' => 'currency.index', - 'currency-create' => 'currency.create', - 'currency-edit' => 'currency.edit', - 'currency-delete' => 'currency.delete', - 'new-user-index' => 'new-user.index', - 'piggy-banks-index' => 'piggy-banks.index', - 'piggy-banks-create' => 'piggy-banks.create', - 'piggy-banks-edit' => 'piggy-banks.edit', - 'piggy-banks-delete' => 'piggy-banks.delete', - 'piggy-banks-show' => 'piggy-banks.show', - 'preferences' => 'preferences', - 'profile' => 'profile', - 'profile-change-password' => 'profile.change-password', - 'profile-delete-account' => 'profile.delete-account', - 'reports-index' => 'reports.index', - 'reports-report' => 'reports.report', - 'search' => 'search', - 'tags-index' => 'tags.index', - 'tags-create' => 'tags.create', - 'tags-show' => 'tags.show', - 'tags-edit' => 'tags.edit', - 'tags-delete' => 'tags.delete', - 'transactions-index' => 'transactions.index', - 'transactions-create' => 'transactions.create', - 'transactions-edit' => 'transactions.edit', - 'transactions-delete' => 'transactions.delete', - 'transactions-show' => 'transactions.show', + 'main-content-title' => 'Welcome to Firefly III', + 'main-content-text' => 'Do yourself a favor and follow this short guide to make sure you know your way around.', + 'sidebar-toggle-title' => 'Sidebar to create stuff', + 'sidebar-toggle-text' => 'Hidden under the plus icon are all the buttons to create new stuff. Accounts, transactions, everything!', + 'account-menu-title' => 'All your accounts', + 'account-menu-text' => 'Here you can find all the accounts you\'ve made.', + 'budget-menu-title' => 'Budgets', + 'budget-menu-text' => 'Use this page to organise your finances and limit spending.', + 'report-menu-title' => 'Reports', + 'report-menu-text' => 'Check this out when you want a solid overview of your finances.', + 'transaction-menu-title' => 'Transactions', + 'transaction-menu-text' => 'All transactions you\'ve created can be found here.', + 'option-menu-title' => 'Options', + 'option-menu-text' => 'This is pretty self-explanatory.', + 'main-content-end-title' => 'The end!', + 'main-content-end-text' => 'Remember that every page has a small question mark at the right top. Click it to get help about the page you\'re on.', + 'index' => 'index', + 'home' => 'home', ]; diff --git a/resources/lang/en_US/list.php b/resources/lang/en_US/list.php index c150b284b2..1892c99f76 100644 --- a/resources/lang/en_US/list.php +++ b/resources/lang/en_US/list.php @@ -3,8 +3,10 @@ * list.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -35,6 +37,7 @@ return [ 'repeat_freq' => 'Repeats', 'description' => 'Description', 'amount' => 'Amount', + 'internal_reference' => 'Internal reference', 'date' => 'Date', 'interest_date' => 'Interest date', 'book_date' => 'Book date', diff --git a/resources/lang/en_US/pagination.php b/resources/lang/en_US/pagination.php index 4f16acdc88..9e61a6cfcc 100755 --- a/resources/lang/en_US/pagination.php +++ b/resources/lang/en_US/pagination.php @@ -3,8 +3,10 @@ * pagination.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/en_US/passwords.php b/resources/lang/en_US/passwords.php index 6c382f830f..8e1b72506b 100755 --- a/resources/lang/en_US/passwords.php +++ b/resources/lang/en_US/passwords.php @@ -3,8 +3,10 @@ * passwords.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/en_US/validation.php b/resources/lang/en_US/validation.php index 651f88e32b..030e6a72c5 100644 --- a/resources/lang/en_US/validation.php +++ b/resources/lang/en_US/validation.php @@ -3,8 +3,10 @@ * validation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/fr_FR/auth.php b/resources/lang/fr_FR/auth.php new file mode 100644 index 0000000000..7319a9d7b8 --- /dev/null +++ b/resources/lang/fr_FR/auth.php @@ -0,0 +1,28 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/resources/lang/fr_FR/breadcrumbs.php b/resources/lang/fr_FR/breadcrumbs.php index b9ae7c1dd0..d70ff6b313 100644 --- a/resources/lang/fr_FR/breadcrumbs.php +++ b/resources/lang/fr_FR/breadcrumbs.php @@ -4,36 +4,38 @@ * breadcrumbs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ - 'home' => 'Accueil', - 'edit_currency' => 'Edit currency ":name"', - 'delete_currency' => 'Delete currency ":name"', - 'newPiggyBank' => 'Créer une nouvelle tirelire', - 'edit_piggyBank' => 'Modifier la tirelire ":name"', - 'preferences' => 'Préférences', - 'profile' => 'Profil', - 'changePassword' => 'Modifier le mot de passe', - 'bills' => 'Factures', - 'newBill' => 'Nouvelle facture', - 'edit_bill' => 'Editer la facture : ":name"', - 'delete_bill' => 'Supprimer la facture ":name"', - 'reports' => 'Rapport', - 'searchResult' => 'Resultat de recherche pour ":query"', - 'withdrawal_list' => 'Dépenses', - 'deposit_list' => 'Revenue, Salaire et depots ', - 'transfer_list' => 'Transferts', - 'transfers_list' => 'Transferts', - 'create_withdrawal' => 'Creer un nouveau retrait', - 'create_deposit' => 'Créer un nouveau dépôt', - 'create_transfer' => 'Creer un nouveau transfert', - 'edit_journal' => 'Editer la transaction ":description"', - 'delete_journal' => 'Supprimer la transaction ":description"', - 'tags' => 'Tags', - 'createTag' => 'Créer un nouveau tag', - 'edit_tag' => 'Editer le tag ":tag"', - 'delete_tag' => 'Supprimer le tag ":tag"', + 'home' => 'Accueil', + 'edit_currency' => 'Modifier la devise "%name"', + 'delete_currency' => 'Supprimer la devise ":name"', + 'newPiggyBank' => 'Créer une nouvelle tirelire', + 'edit_piggyBank' => 'Modifier la tirelire ":name"', + 'preferences' => 'Préférences', + 'profile' => 'Profil', + 'changePassword' => 'Modifier le mot de passe', + 'bills' => 'Factures', + 'newBill' => 'Nouvelle facture', + 'edit_bill' => 'Editer la facture : ":name"', + 'delete_bill' => 'Supprimer la facture ":name"', + 'reports' => 'Rapport', + 'searchResult' => 'Résultat de recherche pour ":query"', + 'withdrawal_list' => 'Dépenses', + 'deposit_list' => 'Revenu, salaire et versements', + 'transfer_list' => 'Virements', + 'transfers_list' => 'Virements', + 'create_withdrawal' => 'Créer un nouveau retrait', + 'create_deposit' => 'Créer un nouveau versement', + 'create_transfer' => 'Creer un nouveau virement', + 'edit_journal' => 'Éditer la transaction ":description"', + 'delete_journal' => 'Supprimer la transaction ":description"', + 'tags' => 'Tags', + 'createTag' => 'Créer un nouveau tag', + 'edit_tag' => 'Éditer le tag ":tag"', + 'delete_tag' => 'Supprimer le tag ":tag"', ]; diff --git a/resources/lang/fr_FR/config.php b/resources/lang/fr_FR/config.php index 3a7bf091bf..a04e54e24b 100644 --- a/resources/lang/fr_FR/config.php +++ b/resources/lang/fr_FR/config.php @@ -3,8 +3,10 @@ * config.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/fr_FR/csv.php b/resources/lang/fr_FR/csv.php index 6287810764..bd4121d373 100644 --- a/resources/lang/fr_FR/csv.php +++ b/resources/lang/fr_FR/csv.php @@ -3,77 +3,79 @@ * csv.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); return [ - 'import_configure_title' => 'Configure your import', - 'import_configure_intro' => 'There are some options for your CSV import. Please indicate if your CSV file contains headers on the first column, and what the date format of your date-fields is. That might require some experimentation. The field delimiter is usually a ",", but could also be a ";". Check this carefully.', - 'import_configure_form' => 'Form', - 'header_help' => 'Check this if the first row of your CSV file are the column titles', - 'date_help' => 'Date time format in your CSV. Follow the format like this page indicates. The default value will parse dates that look like this: :dateExample.', - 'delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.', - 'import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.', - 'upload_not_writeable' => 'The grey box contains a file path. It should be writeable. Please make sure it is.', + 'import_configure_title' => 'Configurer l\'import', + 'import_configure_intro' => 'Il y a des options pour l\'import CSV. Veuillez indiquer si votre fichier CSV contient les en-têtes dans la première colonne, et quel est le format de la date de votre champs date. Cela peut nécessiter quelques essais. Le délimiteur de champ est généralement un «, », mais pourrait également être un « ; ». Cochez cette case avec soin.', + 'import_configure_form' => 'Formulaire', + 'header_help' => 'Cochez cette case si la première ligne de votre fichier CSV contient les entêtes des colonnes', + 'date_help' => 'Le format de la date et de l’heure dans votre fichier CSV. Utiliser les formats comme indiqué sur cette page. La valeur par défaut va extraire les dates qui ressemblent à ceci: :dateExample.', + 'delimiter_help' => 'Choisissez le délimiteur de champ qui est utilisé dans votre fichier d’entrée. Si vous n’êtes pas certain, la virgule est l’option la plus sûre.', + 'import_account_help' => 'Si votre fichier CSV ne contient AUCUNE informations concernant vos compte(s) actif, utilisez cette liste déroulante pour choisir à quel compte les opérations contenues dans le CSV font référence.', + 'upload_not_writeable' => 'La case grise contient un chemin d’accès. Il devrait être accessible en écriture. Veuillez vous en assurer.', // roles - 'column_roles_title' => 'Define column roles', + 'column_roles_title' => 'Définir le rôle des colonnes', 'column_roles_text' => '

Firefly III cannot guess what data each column contains. You must tell Firefly which kinds of data to expect. The example data can guide you into picking the correct type from the dropdown. If a column cannot be matched to a useful data type, please let me know by creating an issue.

Some values in your CSV file, such as account names or categories, may already exist in your Firefly III database. If you select "map these values" Firefly will not attempt to search for matching values itself but allow you to match the CSV values against the values in your database. This allows you to fine-tune the import.

', - 'column_roles_table' => 'Table', - 'column_name' => 'Name of column', - 'column_example' => 'Column example data', - 'column_role' => 'Column data meaning', - 'do_map_value' => 'Map these values', - 'column' => 'Column', - 'no_example_data' => 'No example data available', - 'store_column_roles' => 'Continue import', - 'do_not_map' => '(do not map)', - 'map_title' => 'Connect import data to Firefly III data', + 'column_roles_table' => 'Tableau', + 'column_name' => 'Nom de colonne', + 'column_example' => 'Exemple', + 'column_role' => 'Sens de la donnée', + 'do_map_value' => 'Mapper ces valeurs', + 'column' => 'Colonne', + 'no_example_data' => 'Pas de données disponibles', + 'store_column_roles' => 'Continuer l\'import', + 'do_not_map' => '(Ne pas mapper)', + 'map_title' => 'Lier les données importées aux données Firefly III', 'map_text' => 'In the following tables, the left value shows you information found in your uploaded CSV file. It is your task to map this value, if possible, to a value already present in your database. Firefly will stick to this mapping. If there is no value to map to, or you do not wish to map the specific value, select nothing.', - 'field_value' => 'Field value', - 'field_mapped_to' => 'Mapped to', - 'store_column_mapping' => 'Store mapping', + 'field_value' => 'Valeur du champ', + 'field_mapped_to' => 'Mappé à', + 'store_column_mapping' => 'Sauvegarder le mapping', // map things. - 'column__ignore' => '(ignore this column)', - 'column_account-iban' => 'Asset account (IBAN)', - 'column_account-id' => 'Asset account ID (matching Firefly)', - 'column_account-name' => 'Asset account (name)', - 'column_amount' => 'Amount', - 'column_amount-comma-separated' => 'Amount (comma as decimal separator)', - 'column_bill-id' => 'Bill ID (matching Firefly)', - 'column_bill-name' => 'Bill name', - 'column_budget-id' => 'Budget ID (matching Firefly)', - 'column_budget-name' => 'Budget name', - 'column_category-id' => 'Category ID (matching Firefly)', - 'column_category-name' => 'Category name', - 'column_currency-code' => 'Currency code (ISO 4217)', - 'column_currency-id' => 'Currency ID (matching Firefly)', - 'column_currency-name' => 'Currency name (matching Firefly)', - 'column_currency-symbol' => 'Currency symbol (matching Firefly)', - 'column_date-interest' => 'Interest calculation date', - 'column_date-book' => 'Transaction booking date', - 'column_date-process' => 'Transaction process date', + 'column__ignore' => '(ignorer cette colonne)', + 'column_account-iban' => 'Compte d’actif (IBAN)', + 'column_account-id' => 'Compte d\'actif (ID correspondant à Firefly)', + 'column_account-name' => 'Compte d’actif (nom)', + 'column_amount' => 'Montant', + 'column_amount-comma-separated' => 'Montant (virgule comme séparateur décimal)', + 'column_bill-id' => 'Facture (ID correspondant à Firefly)', + 'column_bill-name' => 'Nom de la facture', + 'column_budget-id' => 'Budget (ID correspondant à Firefly)', + 'column_budget-name' => 'Nom du budget', + 'column_category-id' => 'Catégorie (ID correspondant à Firefly)', + 'column_category-name' => 'Nom de la catégorie', + 'column_currency-code' => 'Code des monnaies (ISO 4217)', + 'column_currency-id' => 'Devise (ID correspondant à Firefly)', + 'column_currency-name' => 'Nom de la devise (correspondant à Firefly)', + 'column_currency-symbol' => 'Symbole de la devise (correspondant à Firefly)', + 'column_date-interest' => 'Date de calcul des intérêts', + 'column_date-book' => 'Date de valeur de la transaction', + 'column_date-process' => 'Date de traitement de la transaction', 'column_date-transaction' => 'Date', 'column_description' => 'Description', - 'column_opposing-iban' => 'Opposing account (IBAN)', - 'column_opposing-id' => 'Opposing account ID (matching Firefly)', - 'column_external-id' => 'External ID', - 'column_opposing-name' => 'Opposing account (name)', + 'column_opposing-iban' => 'Compte destination(IBAN)', + 'column_opposing-id' => 'Compte destination(ID correspondant Firefly)', + 'column_external-id' => 'Identifiant externe', + 'column_opposing-name' => 'Compte destination (nom)', 'column_rabo-debet-credit' => 'Rabobank specific debet/credit indicator', 'column_ing-debet-credit' => 'ING specific debet/credit indicator', 'column_sepa-ct-id' => 'SEPA Credit Transfer end-to-end ID', 'column_sepa-ct-op' => 'SEPA Credit Transfer opposing account', 'column_sepa-db' => 'SEPA Direct Debet', - 'column_tags-comma' => 'Tags (comma separated)', - 'column_tags-space' => 'Tags (space separated)', - 'column_account-number' => 'Asset account (account number)', - 'column_opposing-number' => 'Opposing account (account number)', + 'column_tags-comma' => 'Tags (séparé par des virgules)', + 'column_tags-space' => 'Tags(séparé par des espaces)', + 'column_account-number' => 'Compte d’actif (numéro de compte)', + 'column_opposing-number' => 'Compte destination (numéro de compte)', ]; diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php index d1b88f9f92..02d0ff3f2d 100644 --- a/resources/lang/fr_FR/firefly.php +++ b/resources/lang/fr_FR/firefly.php @@ -3,13 +3,15 @@ * firefly.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // general stuff: - 'language_incomplete' => 'incomplete translation', + 'language_incomplete' => 'traduction incomplète', 'close' => 'Fermer', 'actions' => 'Actions', 'edit' => 'Modifier', @@ -123,7 +125,7 @@ return [ 'rules_explanation' => 'Ici vous pouvez gérer les règles. Les règles sont déclenchées lorsqu’une opération est créée ou mise à jour. Ensuite, si l\'opération a certaines propriétés (appelées "déclencheurs" ) Firefly exécutera des "actions". Combiné, vous pouvez faire réagir Firefly d’une certaine façon aux nouvelles opérations.', 'rule_name' => 'Nom de la règle', 'rule_triggers' => 'La règle se déclenchera lorsque', - 'rule_actions' => 'Rule will', + 'rule_actions' => 'La règle va', 'new_rule' => 'Nouvelle règle', 'new_rule_group' => 'Nouveau groupe de règles', 'rule_priority_up' => 'Donner à la règle plus de priorité', @@ -153,7 +155,7 @@ return [ 'default_rule_description' => 'Cette règle est un exemple. Vous pouvez la supprimer en toute sécurité.', 'default_rule_trigger_description' => 'L’homme qui a vendu le monde', 'default_rule_trigger_from_account' => 'David Bowie', - 'default_rule_action_prepend' => 'Bought the world from ', + 'default_rule_action_prepend' => 'Achat du Monde de ', 'default_rule_action_set_category' => 'Grandes dépenses', 'trigger' => 'Déclencheur', 'trigger_value' => 'Déclenchement sur valeur', @@ -173,8 +175,8 @@ return [ 'execute_on_existing_transactions' => 'Exécuter des opérations existantes', 'execute_on_existing_transactions_intro' => 'Lorsqu’une règle ou un groupe a été modifié ou ajouté, vous pouvez l’exécuter pour des opérations existantes', 'execute_on_existing_transactions_short' => 'Opérations existantes', - 'executed_group_on_existing_transactions' => 'Executed group ":title" for existing transactions', - 'execute_group_on_existing_transactions' => 'Execute group ":title" for existing transactions', + 'executed_group_on_existing_transactions' => 'Exécution groupe « : titre » pour les transactions existantes', + 'execute_group_on_existing_transactions' => 'Exécutez groupe « : titre » pour les transactions existantes', 'include_transactions_from_accounts' => 'Iclure les opérations depuis ces comptes', 'execute' => 'Executer', @@ -272,27 +274,27 @@ return [ 'pref_save_settings' => 'Enregistrer les paramètres', 'saved_preferences' => 'Préférences enregistrées!', 'transaction_page_size_title' => 'Taille de la page', - 'transaction_page_size_help' => 'Any list of transactions shows at most this many transactions', + 'transaction_page_size_help' => 'N’importe quelle liste de transactions montre au plus ce nombre de transactions', 'transaction_page_size_label' => 'Taille de la page', 'between_dates' => '(:start et :end)', - 'pref_optional_fields_transaction' => 'Optional fields for transactions', + 'pref_optional_fields_transaction' => 'Champs optionnels pour les transactions', 'pref_optional_fields_transaction_help' => 'By default not all fields are enabled when creating a new transaction (because of the clutter). Below, you can enable these fields if you think they could be useful for you. Of course, any field that is disabled, but already filled in, will be visible regardless of the setting.', - 'optional_tj_date_fields' => 'Date fields', - 'optional_tj_business_fields' => 'Business fields', + 'optional_tj_date_fields' => 'Champ date', + 'optional_tj_business_fields' => 'Champs professionnels', 'optional_tj_attachment_fields' => 'Attachment fields', - 'pref_optional_tj_interest_date' => 'Interest date', - 'pref_optional_tj_book_date' => 'Book date', - 'pref_optional_tj_process_date' => 'Processing date', - 'pref_optional_tj_due_date' => 'Due date', - 'pref_optional_tj_payment_date' => 'Payment date', - 'pref_optional_tj_invoice_date' => 'Invoice date', - 'pref_optional_tj_internal_reference' => 'Internal reference', + 'pref_optional_tj_interest_date' => 'Date des intérêts', + 'pref_optional_tj_book_date' => 'Date de réservation', + 'pref_optional_tj_process_date' => 'Date de traitement', + 'pref_optional_tj_due_date' => 'Échéance', + 'pref_optional_tj_payment_date' => 'Date de paiement', + 'pref_optional_tj_invoice_date' => 'Date de facturation', + 'pref_optional_tj_internal_reference' => 'Référence interne', 'pref_optional_tj_notes' => 'Notes', - 'pref_optional_tj_attachments' => 'Attachments', + 'pref_optional_tj_attachments' => 'Pièces jointes', 'optional_field_meta_dates' => 'Dates', 'optional_field_meta_business' => 'Business', - 'optional_field_attachments' => 'Attachments', - 'optional_field_meta_data' => 'Optional meta data', + 'optional_field_attachments' => 'Pièces jointes', + 'optional_field_meta_data' => 'Métadonnées facultatives', // profile: @@ -351,8 +353,8 @@ return [ 'create_currency' => 'Créer une nouvelle devise', 'store_currency' => 'Créer une nouvelle devise', 'update_currency' => 'Mise à jour de la balance', - 'new_default_currency' => ':name is now the default currency.', - 'cannot_delete_currency' => 'Cannot delete :name because it is still in use.', + 'new_default_currency' => ':name est maintenant la devise par défaut.', + 'cannot_delete_currency' => 'Impossible de supprimer :name car il est encore utilisé.', 'deleted_currency' => 'Devise ":name" supprimée', 'created_currency' => 'Devise ":name" créée', 'updated_currency' => 'Devise ":name" mise à jour', @@ -379,7 +381,7 @@ return [ 'create_new_budget' => 'Créer un nouveau budget', 'store_new_budget' => 'Créer un nouveau budget', 'stored_new_budget' => 'Nouveau budget ":name" créé', - 'available_between' => 'Available between :start and :end', + 'available_between' => 'Disponible entre le :start et le :end', 'transactionsWithoutBudget' => 'Dépenses non budgétisées', 'transactions_no_budget' => 'Dépenses non budgetisées entre le :start et le :end', 'spent_between' => 'Dépensé entre le :start et le :end', @@ -415,7 +417,7 @@ return [ 'cannot_scan_inactive_bill' => 'Les factures inactives ne peuvent pas être analysées.', 'rescanned_bill' => 'Réanalyser tout.', 'bill_date_little_relevance' => 'La seule partie de cette date utilisée par Firefly est le jour. Il n’est utile que lorsque votre facture arrive à exactement la même date chaque mois. Si la date de paiement de vos factures varie, il suffit d’utiliser le premier jour du mois.', - 'average_bill_amount_year' => 'Average bill amount (:year)', + 'average_bill_amount_year' => 'Montant moyen des factures ( :year)', 'average_bill_amount_overall' => 'Average bill amount (overall)', // accounts: @@ -486,7 +488,7 @@ return [ 'stop_selection' => 'Stop selecting transactions', 'edit_selected' => 'Modifier la sélection', 'delete_selected' => 'Supprimer la sélection', - 'mass_delete_journals' => 'Delete a number of transactions', + 'mass_delete_journals' => 'Supprimer un certain nombre de transactions', 'mass_edit_journals' => 'Modifier un certain nombre d’opérations', 'cannot_edit_other_fields' => 'Vous ne peut pas modifier en masse d\'autres champs que ceux ici, car il n’y a pas de place pour tous les montrer. S’il vous plaît suivez le lien et modifiez les par un par un, si vous devez modifier ces champs.', 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', @@ -553,7 +555,7 @@ return [ 'daily' => 'Journalier', 'monthly' => 'Mensuel', 'profile' => 'Profil', - 'errors' => 'Errors', + 'errors' => 'Erreurs', // reports: 'report_default' => 'Rapport financier par défaut du :start au :end', @@ -565,22 +567,22 @@ return [ 'report_this_year_quick' => 'Année en cours, tous les comptes', 'report_this_fiscal_year_quick' => 'Année fiscale en cours, tous les comptes', 'report_all_time_quick' => 'All-time, all accounts', - 'reports_can_bookmark' => 'Remember that reports can be bookmarked.', + 'reports_can_bookmark' => 'N’oubliez pas que les rapports peuvent être mis en signet.', 'incomeVsExpenses' => 'Revenus vs dépenses', 'accountBalances' => 'Solde du compte', 'balanceStartOfYear' => 'Solde au début de l\'année', 'balanceEndOfYear' => 'Solde à la fin de l\'année', 'balanceStartOfMonth' => 'Solde au début du mois', 'balanceEndOfMonth' => 'Solde à la fin du mois', - 'balanceStart' => 'Balance at start of period', - 'balanceEnd' => 'Balance at end of period', + 'balanceStart' => 'Solde au début de la période', + 'balanceEnd' => 'Solde à la fin de la période', 'reportsOwnAccounts' => 'Rapport pour vos propres comptes', 'reportsOwnAccountsAndShared' => 'Rapport pour vos comptes et ceux partagés', 'splitByAccount' => 'Split by account', 'balancedByTransfersAndTags' => 'Balanced by transfers and tags', 'coveredWithTags' => 'Covered with tags', 'leftUnbalanced' => 'Left unbalanced', - 'expectedBalance' => 'Expected balance', + 'expectedBalance' => 'Solde attendu', 'outsideOfBudgets' => 'Outside of budgets', 'leftInBudget' => 'Budget restant', 'sumOfSums' => 'Montant des sommes', @@ -604,8 +606,8 @@ return [ 'report_type_default' => 'Rapport financier par défaut', 'report_type_audit' => 'Historique des transactions', 'report_type_meta-history' => 'Vue d’ensemble des budgets, des catégories et des factures', - 'more_info_help' => 'More information about these types of reports can be found in the help pages. Press the (?) icon in the top right corner.', - 'report_included_accounts' => 'Included accounts', + 'more_info_help' => 'Plus d’informations sur ces types de rapports se trouvent dans les pages d’aide. Appuyez sur l’icône ( ?) dans le coin supérieur droit.', + 'report_included_accounts' => 'Comptes inclus', 'report_date_range' => 'Intervalle de dates', 'report_include_help' => 'Dans tous les cas, les transferts vers des comptes partagés comptes comme des dépenses, et les transferts depuis les comptes partagés comme un revenu.', 'report_preset_ranges' => 'Pré-configurer les étendues', @@ -762,7 +764,7 @@ return [ 'no_edit_multiple_left' => 'You have selected no valid transactions to edit.', // import - 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you.', + 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', 'import_data_index' => 'Index', 'import_file_type_csv' => 'CSV (comma separated values)', 'import_file_type_help' => 'Select the type of file you will upload', @@ -780,7 +782,10 @@ return [ 'import_data' => 'Import data', 'import_data_full' => 'Import data into Firefly III', 'import' => 'Import', - 'import_intro_text' => 'Welcome to the Firefly III data import routine. At the moment, this routine can help you import files into Firefly. To do so, you must download or export transactions from other systems or software, and upload them here. The next steps will let you help Firefly III determin what the content is of your file, and how to handle it. Please select a file, and read all instructions carefully.', + 'import_intro_what_it_does' => 'This page allows you to import data into Firefly III. To do so, export data from your bank, or from another financial management system. Upload that file here. Firefly III will convert the data. You need to give it some directions. Please select a file and follow the instructions.', + 'import_intro_import_conf_title' => 'Import "configuration"', + 'import_intro_beta_warning' => 'Warning', + 'import_intro_import_conf_text' => 'As you will discover over the next few pages, this import routine has a lot of settings. These settings are mainly dependent on the bank (or financial management software) your file comes from. There is a good chance somebody else already imported such a file and has shared their configuration file. Please visit the import configuration center to see if there already is a configuration available for your bank or system. If there is, you should download this configuration file and upload it here as well. It will save you a lot of time!', 'import_file_help' => 'Select your file', 'import_status_settings_complete' => 'The import is ready to start.', 'import_status_import_complete' => 'The import has completed.', @@ -796,8 +801,11 @@ return [ 'import_double' => 'Row #:row: This row has been imported before, and is stored in :description.', 'import_finished_all' => 'The import has finished. Please check out the results below.', 'import_with_key' => 'Import with key \':key\'', - 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', - 'import_finished_link' => 'The transactions imported can be found in tag :tag.', + + 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', + + 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', + 'import_finished_link' => 'The transactions imported can be found in tag :tag.', ]; diff --git a/resources/lang/fr_FR/form.php b/resources/lang/fr_FR/form.php index 3b1ed687ac..be7447215c 100644 --- a/resources/lang/fr_FR/form.php +++ b/resources/lang/fr_FR/form.php @@ -3,8 +3,10 @@ * form.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -59,7 +61,7 @@ return [ 'date' => 'Date', 'interest_date' => 'Interest date', 'book_date' => 'Book date', - 'process_date' => 'Processing date', + 'process_date' => 'Date de traitement', 'category' => 'Catégorie', 'tags' => 'Tags', 'deletePermanently' => 'Supprimer définitivement', @@ -132,13 +134,13 @@ return [ 'tag_keep_transactions' => 'La seule opération liée à ce tag ne sera pas supprimée.|Les :count opérations liées à ce tag ne seront pas supprimées.', // admin - 'domain' => 'Domain', - 'single_user_mode' => 'Single user mode', + 'domain' => 'Domaine', + 'single_user_mode' => 'Mode utilisateur unique', // import - 'import_file' => 'Import file', - 'configuration_file' => 'Configuration file', - 'import_file_type' => 'Import file type', + 'import_file' => 'Fichier à importer', + 'configuration_file' => 'Fichier de configuration', + 'import_file_type' => 'Type de fichier de configuration', 'csv_comma' => 'Une virgule (,)', 'csv_semicolon' => 'Un point-virgule (;)', 'csv_tab' => 'Un onglet (invisible)', @@ -148,7 +150,7 @@ return [ 'due_date' => 'Due date', - 'payment_date' => 'Payment date', - 'invoice_date' => 'Invoice date', - 'internal_reference' => 'Internal reference', + 'payment_date' => 'Date de paiement', + 'invoice_date' => 'Date de facturation', + 'internal_reference' => 'Référence interne', ]; diff --git a/resources/lang/fr_FR/help.php b/resources/lang/fr_FR/help.php index 77facb6918..466fe59547 100644 --- a/resources/lang/fr_FR/help.php +++ b/resources/lang/fr_FR/help.php @@ -3,83 +3,31 @@ * help.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // tour! - 'main-content-title' => 'Bienvenue sur Firefly III', - 'main-content-text' => 'Rendez-vous service et suivez ce petit guide. Vous saurez exactement comment tout fonctionne.', - 'sidebar-toggle-title' => 'Barre latérale pour créer quelque chose', - 'sidebar-toggle-text' => 'Sous l\'icone plus sont cachés tous les boutons permettant de créer quelque chose. Comptes, opérations, tous!', - 'account-menu-title' => 'Tous vos comptes', - 'account-menu-text' => 'Vous trouverez ici tous les comptes que vous avez fait.', - 'budget-menu-title' => 'Budgets', - 'budget-menu-text' => 'Utilisez cette page pour organiser vos finances et limiter les dépenses.', - 'report-menu-title' => 'Rapports', - 'report-menu-text' => 'Cochez cette case si vous voulez un aperçu complet de vos finances.', - 'transaction-menu-title' => 'Opérations', - 'transaction-menu-text' => 'Toutes les transactions que vous avez créé peuvent être trouvées ici.', - 'option-menu-title' => 'Options', - 'option-menu-text' => 'C\'est assez explicite.', - 'main-content-end-title' => 'Fin !', - 'main-content-end-text' => 'N\'oubliez pas que chaque page a un petit point d\'interrogation en haut à droite. Cliquez dessus pour obtenir de l\'aide concernant la page actuelle.', - 'index' => 'index', - 'home' => 'accueil', - 'accounts-index' => 'comptes', - 'accounts-create' => 'créer un compte', - 'accounts-edit' => 'éditer un compte', - 'accounts-delete' => 'supprimer un compte', - 'accounts-show' => 'visualiser un compte', - 'attachments-edit' => 'modifier la pièce jointe', - 'attachments-delete' => 'supprimer la pièce jointe', - 'attachments-show' => 'visualiser la pièce jointe', - 'attachments-preview' => 'prévisualiser les pièces jointes', - 'bills-index' => 'factures', - 'bills-create' => 'créer une facture', - 'bills-edit' => 'éditer une facture', - 'bills-delete' => 'supprimer une facture', - 'bills-show' => 'visualiser une facture', - 'budgets-index' => 'budgets', - 'budgets-create' => 'créer un budget', - 'budgets-edit' => 'éditer un budget', - 'budgets-delete' => 'supprimer un budget', - 'budgets-show' => 'visualiser un budget', - 'budgets-noBudget' => 'opérations sans budgets', - 'categories-index' => 'catégories', - 'categories-create' => 'créer des catégories', - 'categories-edit' => 'éditer les catégories', - 'categories-delete' => 'supprimer des catégories', - 'categories-show' => 'visualiser une catégorie', - 'categories-show-date' => 'voir la catégorie', - 'categories-noCategory' => 'opérations sans catégories', - 'currency-index' => 'devises', - 'currency-create' => 'créer une devise', - 'currency-edit' => 'éditer une devise', - 'currency-delete' => 'supprimer une devise', - 'new-user-index' => 'nouvel utilisateur', - 'piggy-banks-index' => 'tirelires', - 'piggy-banks-create' => 'créer une tirelire', - 'piggy-banks-edit' => 'éditer une tirelire', - 'piggy-banks-delete' => 'supprimer une tirelire', - 'piggy-banks-show' => 'visualiser une tire-lire', - 'preferences' => 'préférences', - 'profile' => 'profile', - 'profile-change-password' => 'changez votre mot de passe', - 'profile-delete-account' => 'supprimer votre compte', - 'reports-index' => 'rapports', - 'reports-report' => 'rapports', - 'search' => 'recherche', - 'tags-index' => 'tags', - 'tags-create' => 'créer un tag', - 'tags-show' => 'visualiser un tag', - 'tags-edit' => 'éditer un tag', - 'tags-delete' => 'supprimer un tag', - 'transactions-index' => 'opérations', - 'transactions-create' => 'créer une opération', - 'transactions-edit' => 'éditer une opération', - 'transactions-delete' => 'supprimer une opération', - 'transactions-show' => 'visualiser une opération', + 'main-content-title' => 'Bienvenue sur Firefly III', + 'main-content-text' => 'Rendez-vous service et suivez ce petit guide. Vous saurez exactement comment tout fonctionne.', + 'sidebar-toggle-title' => 'Barre latérale pour créer quelque chose', + 'sidebar-toggle-text' => 'Sous l\'icone plus sont cachés tous les boutons permettant de créer quelque chose. Comptes, opérations, tous!', + 'account-menu-title' => 'Tous vos comptes', + 'account-menu-text' => 'Vous trouverez ici tous les comptes que vous avez fait.', + 'budget-menu-title' => 'Budgets', + 'budget-menu-text' => 'Utilisez cette page pour organiser vos finances et limiter les dépenses.', + 'report-menu-title' => 'Rapports', + 'report-menu-text' => 'Cochez cette case si vous voulez un aperçu complet de vos finances.', + 'transaction-menu-title' => 'Opérations', + 'transaction-menu-text' => 'Toutes les transactions que vous avez créé peuvent être trouvées ici.', + 'option-menu-title' => 'Options', + 'option-menu-text' => 'C\'est assez explicite.', + 'main-content-end-title' => 'Fin !', + 'main-content-end-text' => 'N\'oubliez pas que chaque page a un petit point d\'interrogation en haut à droite. Cliquez dessus pour obtenir de l\'aide concernant la page actuelle.', + 'index' => 'index', + 'home' => 'accueil', ]; diff --git a/resources/lang/fr_FR/list.php b/resources/lang/fr_FR/list.php index c49a7dd48f..3310c65b98 100644 --- a/resources/lang/fr_FR/list.php +++ b/resources/lang/fr_FR/list.php @@ -3,8 +3,10 @@ * list.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -35,14 +37,15 @@ return [ 'repeat_freq' => 'Répétitions', 'description' => 'Description', 'amount' => 'Montant', + 'internal_reference' => 'Internal reference', 'date' => 'Date', 'interest_date' => 'Date des intérêts', 'book_date' => 'Book date', 'process_date' => 'Date de traitement', 'due_date' => 'Due date', - 'payment_date' => 'Payment date', - 'invoice_date' => 'Invoice date', - 'interal_reference' => 'Internal reference', + 'payment_date' => 'Date de paiement', + 'invoice_date' => 'Date de facturation', + 'interal_reference' => 'Référence interne', 'notes' => 'Notes', 'from' => 'Depuis', 'piggy_bank' => 'Tirelire', @@ -66,6 +69,6 @@ return [ 'confirmed_from' => 'Confirmed from', 'registered_from' => 'Registered from', 'blocked_code' => 'Code de blocage', - 'domain' => 'Domain', + 'domain' => 'Domaine', 'registration_attempts' => 'Registration attempts', ]; diff --git a/resources/lang/fr_FR/pagination.php b/resources/lang/fr_FR/pagination.php index 5bc42dd296..8adc2767a1 100644 --- a/resources/lang/fr_FR/pagination.php +++ b/resources/lang/fr_FR/pagination.php @@ -3,11 +3,15 @@ * pagination.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ - 'previous' => '« Precedent', + + 'previous' => '« Précédent', 'next' => 'Suivant »', + ]; diff --git a/resources/lang/fr_FR/passwords.php b/resources/lang/fr_FR/passwords.php index 6d64931122..b9b998ec31 100644 --- a/resources/lang/fr_FR/passwords.php +++ b/resources/lang/fr_FR/passwords.php @@ -3,14 +3,16 @@ * passwords.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ 'password' => 'Les mots de passe doivent contenir au moins six caractères et correspondre à la confirmation.', - 'user' => 'Nous ne pouvons pas trouver un utilisateur avec cette adresse e-mail.', - 'token' => 'Le jeton de réinitialisation de mot de passe est invalide.', + 'user' => 'Nous ne pouvons pas trouver d\'utilisateur avec cette adresse e-mail.', + 'token' => 'Le jeton de réinitialisation du mot de passe est invalide.', 'sent' => 'Nous vous avons envoyé par e-mail un lien de réinitialisation de votre mot de passe !', 'reset' => 'Votre mot de passe a été réinitialisé !', 'blocked' => 'Bien essayé cependant.', diff --git a/resources/lang/fr_FR/validation.php b/resources/lang/fr_FR/validation.php index 4d34c2bdba..a62301ec99 100644 --- a/resources/lang/fr_FR/validation.php +++ b/resources/lang/fr_FR/validation.php @@ -3,8 +3,10 @@ * validation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -12,7 +14,7 @@ return [ 'unique_account_number_for_user' => 'Il semble que ce numéro de compte est déjà utilisé.', 'rule_trigger_value' => 'Cette valeur n’est pas valide pour le déclencheur sélectionné.', 'rule_action_value' => 'Cette valeur n’est pas valide pour l’action sélectionnée.', - 'invalid_domain' => 'Compte tenu des contraintes de sécurité, vous ne peut pas vous enregistrer depuis ce domaine.', + 'invalid_domain' => 'Compte tenu des contraintes de sécurité, vous ne pouvez pas vous enregistrer depuis ce domaine.', 'file_already_attached' => 'Le fichier téléchargé ":name" est déjà attaché à cet objet.', 'file_attached' => 'Envoi du fichier ":name" avec succès.', 'file_invalid_mime' => 'Le fichier ":name" est du type ":mime" ce qui n\'est pas accepté pour un nouvel envoi.', @@ -20,13 +22,13 @@ return [ 'belongs_to_user' => 'La valeur de :attribute est inconnue', 'accepted' => 'Le champ :attribute doit être accepté.', 'active_url' => 'Le champ :attribute n\'est pas une URL valide.', - 'after' => 'Le champ :attribute doit être une date postérieure au :date.', + 'after' => 'Le champ :attribute doit être une date postérieure à :date.', 'alpha' => 'Le champ :attribute doit seulement contenir des lettres.', - 'alpha_dash' => 'Le champ :attribute doit seulement contenir des lettres, des chiffres et des tirets.', - 'alpha_num' => 'Le champ :attribute doit seulement contenir des chiffres et des lettres.', + 'alpha_dash' => 'Le champ :attribute peut seulement contenir des lettres, des chiffres et des tirets.', + 'alpha_num' => 'Le champ :attribute peut seulement contenir des chiffres et des lettres.', 'array' => 'Le champ :attribute doit être un tableau.', 'unique_for_user' => 'Il existe déjà une entrée avec ceci :attribute.', - 'before' => 'Le champ :attribute doit être une date antérieure au :date.', + 'before' => 'Le champ :attribute doit être une date antérieure à :date.', 'unique_object_for_user' => 'Ce nom est déjà utilisé', 'unique_account_for_user' => 'Ce nom de compte est déjà utilisé', 'between.numeric' => 'La valeur de :attribute doit être comprise entre :min et :max.', @@ -77,4 +79,9 @@ return [ 'url' => 'Le format de l\'URL de :attribute n\'est pas valide.', 'timezone' => 'Le champ :attribute doit être un fuseau horaire valide.', '2fa_code' => 'Le champ :attribute est invalide.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'file' => 'The :attribute must be a file.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'present' => 'The :attribute field must be present.', ]; diff --git a/resources/lang/hr_HR/auth.php b/resources/lang/hr_HR/auth.php new file mode 100644 index 0000000000..7319a9d7b8 --- /dev/null +++ b/resources/lang/hr_HR/auth.php @@ -0,0 +1,28 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/resources/lang/hr_HR/breadcrumbs.php b/resources/lang/hr_HR/breadcrumbs.php new file mode 100644 index 0000000000..b6c21030e4 --- /dev/null +++ b/resources/lang/hr_HR/breadcrumbs.php @@ -0,0 +1,41 @@ + 'Početna', + 'edit_currency' => 'Uredi valutu ":name"', + 'delete_currency' => 'Obriši valutu ":name"', + 'newPiggyBank' => 'Kreiraj novu kasicu prasicu', + 'edit_piggyBank' => 'Uredi kasicu prasicu ":name"', + 'preferences' => 'Postavke', + 'profile' => 'Profil', + 'changePassword' => 'Promijeni lozinku', + 'bills' => 'Bills', + 'newBill' => 'New bill', + 'edit_bill' => 'Edit bill ":name"', + 'delete_bill' => 'Delete bill ":name"', + 'reports' => 'Izvještaji', + 'searchResult' => 'Pretraživanje za ":query"', + 'withdrawal_list' => 'Troškovi', + 'deposit_list' => 'Revenue, income and deposits', + 'transfer_list' => 'Transfers', + 'transfers_list' => 'Transfers', + 'create_withdrawal' => 'Create new withdrawal', + 'create_deposit' => 'Create new deposit', + 'create_transfer' => 'Create new transfer', + 'edit_journal' => 'Uredi transakciju ":description"', + 'delete_journal' => 'Obriši transakciju ":description"', + 'tags' => 'Oznake', + 'createTag' => 'Kreiraj novu oznaku', + 'edit_tag' => 'Uredi oznaku ":tag"', + 'delete_tag' => 'Obriši oznaku ":tag"', +]; diff --git a/resources/lang/hr_HR/config.php b/resources/lang/hr_HR/config.php new file mode 100644 index 0000000000..1c612ab51c --- /dev/null +++ b/resources/lang/hr_HR/config.php @@ -0,0 +1,23 @@ + 'hr, Croatian, hr_HR, hr_HR.utf8', + 'month' => '%B %Y', + 'month_and_day' => '%e %B %Y', + 'date_time' => '%e %B %Y, @ %T', + 'specific_day' => '%e %B %Y', + 'week_in_year' => 'Tjedan %W, %Y', + 'quarter_of_year' => '%B %Y', + 'year' => '%Y', + 'half_year' => '%B %Y', + +]; diff --git a/resources/lang/hr_HR/csv.php b/resources/lang/hr_HR/csv.php new file mode 100644 index 0000000000..fe83034aa2 --- /dev/null +++ b/resources/lang/hr_HR/csv.php @@ -0,0 +1,81 @@ + 'Configure your import', + 'import_configure_intro' => 'There are some options for your CSV import. Please indicate if your CSV file contains headers on the first column, and what the date format of your date-fields is. That might require some experimentation. The field delimiter is usually a ",", but could also be a ";". Check this carefully.', + 'import_configure_form' => 'Form', + 'header_help' => 'Check this if the first row of your CSV file are the column titles', + 'date_help' => 'Date time format in your CSV. Follow the format like this page indicates. The default value will parse dates that look like this: :dateExample.', + 'delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.', + 'import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.', + 'upload_not_writeable' => 'The grey box contains a file path. It should be writeable. Please make sure it is.', + + // roles + 'column_roles_title' => 'Define column roles', + 'column_roles_text' => '

Firefly III cannot guess what data each column contains. You must tell Firefly which kinds of data to expect. The example data can guide you into picking the correct type from the dropdown. If a column cannot be matched to a useful data type, please let me know by creating an issue.

Some values in your CSV file, such as account names or categories, may already exist in your Firefly III database. If you select "map these values" Firefly will not attempt to search for matching values itself but allow you to match the CSV values against the values in your database. This allows you to fine-tune the import.

', + 'column_roles_table' => 'Table', + 'column_name' => 'Name of column', + 'column_example' => 'Column example data', + 'column_role' => 'Column data meaning', + 'do_map_value' => 'Map these values', + 'column' => 'Column', + 'no_example_data' => 'No example data available', + 'store_column_roles' => 'Continue import', + 'do_not_map' => '(do not map)', + 'map_title' => 'Connect import data to Firefly III data', + 'map_text' => 'In the following tables, the left value shows you information found in your uploaded CSV file. It is your task to map this value, if possible, to a value already present in your database. Firefly will stick to this mapping. If there is no value to map to, or you do not wish to map the specific value, select nothing.', + + 'field_value' => 'Field value', + 'field_mapped_to' => 'Mapped to', + 'store_column_mapping' => 'Store mapping', + + // map things. + + + 'column__ignore' => '(ignore this column)', + 'column_account-iban' => 'Asset account (IBAN)', + 'column_account-id' => 'Asset account ID (matching Firefly)', + 'column_account-name' => 'Asset account (name)', + 'column_amount' => 'Amount', + 'column_amount-comma-separated' => 'Amount (comma as decimal separator)', + 'column_bill-id' => 'Bill ID (matching Firefly)', + 'column_bill-name' => 'Bill name', + 'column_budget-id' => 'Budget ID (matching Firefly)', + 'column_budget-name' => 'Budget name', + 'column_category-id' => 'Category ID (matching Firefly)', + 'column_category-name' => 'Category name', + 'column_currency-code' => 'Currency code (ISO 4217)', + 'column_currency-id' => 'Currency ID (matching Firefly)', + 'column_currency-name' => 'Currency name (matching Firefly)', + 'column_currency-symbol' => 'Currency symbol (matching Firefly)', + 'column_date-interest' => 'Interest calculation date', + 'column_date-book' => 'Transaction booking date', + 'column_date-process' => 'Transaction process date', + 'column_date-transaction' => 'Date', + 'column_description' => 'Description', + 'column_opposing-iban' => 'Opposing account (IBAN)', + 'column_opposing-id' => 'Opposing account ID (matching Firefly)', + 'column_external-id' => 'External ID', + 'column_opposing-name' => 'Opposing account (name)', + 'column_rabo-debet-credit' => 'Rabobank specific debet/credit indicator', + 'column_ing-debet-credit' => 'ING specific debet/credit indicator', + 'column_sepa-ct-id' => 'SEPA Credit Transfer end-to-end ID', + 'column_sepa-ct-op' => 'SEPA Credit Transfer opposing account', + 'column_sepa-db' => 'SEPA Direct Debet', + 'column_tags-comma' => 'Tags (comma separated)', + 'column_tags-space' => 'Tags (space separated)', + 'column_account-number' => 'Asset account (account number)', + 'column_opposing-number' => 'Opposing account (account number)', +]; diff --git a/resources/lang/hr_HR/firefly.php b/resources/lang/hr_HR/firefly.php new file mode 100644 index 0000000000..4530d8b6cd --- /dev/null +++ b/resources/lang/hr_HR/firefly.php @@ -0,0 +1,811 @@ + 'incomplete translation', + 'close' => 'Close', + 'actions' => 'Actions', + 'edit' => 'Edit', + 'delete' => 'Delete', + 'welcomeBack' => 'What\'s playing?', + 'everything' => 'Everything', + 'customRange' => 'Custom range', + 'apply' => 'Apply', + 'cancel' => 'Cancel', + 'from' => 'From', + 'to' => 'To', + 'showEverything' => 'Show everything', + 'never' => 'Never', + 'search_results_for' => 'Search results for ":query"', + 'bounced_error' => 'The message sent to :email bounced, so no access for you.', + 'deleted_error' => 'These credentials do not match our records.', + 'general_blocked_error' => 'Your account has been disabled, so you cannot login.', + 'expired_error' => 'Your account has expired, and can no longer be used.', + 'removed_amount' => 'Removed :amount', + 'added_amount' => 'Added :amount', + 'asset_account_role_help' => 'Any extra options resulting from your choice can be set later.', + 'Opening balance' => 'Opening balance', + 'create_new_stuff' => 'Create new stuff', + 'new_withdrawal' => 'New withdrawal', + 'new_deposit' => 'New deposit', + 'new_transfer' => 'New transfer', + 'new_asset_account' => 'New asset account', + 'new_expense_account' => 'New expense account', + 'new_revenue_account' => 'New revenue account', + 'new_budget' => 'New budget', + 'new_bill' => 'New bill', + 'block_account_logout' => 'You have been logged out. Blocked accounts cannot use this site. Did you register with a valid email address?', + 'flash_success' => 'Success!', + 'flash_info' => 'Message', + 'flash_warning' => 'Warning!', + 'flash_error' => 'Error!', + 'flash_info_multiple' => 'There is one message|There are :count messages', + 'flash_error_multiple' => 'There is one error|There are :count errors', + 'net_worth' => 'Net worth', + 'route_has_no_help' => 'There is no help for this route, or there is no help available in your language.', + 'two_factor_welcome' => 'Hello, :user!', + 'two_factor_enter_code' => 'To continue, please enter your two factor authentication code. Your application can generate it for you.', + 'two_factor_code_here' => 'Enter code here', + 'two_factor_title' => 'Two factor authentication', + 'authenticate' => 'Authenticate', + 'two_factor_forgot_title' => 'Lost two factor authentication', + 'two_factor_forgot' => 'I forgot my two-factor thing.', + 'two_factor_lost_header' => 'Lost your two factor authentication?', + 'two_factor_lost_intro' => 'Unfortunately, this is not something you can reset from the web interface. You have two choices.', + 'two_factor_lost_fix_self' => 'If you run your own instance of Firefly III, check the logs in storage/logs for instructions.', + 'two_factor_lost_fix_owner' => 'Otherwise, email the site owner, :site_owner and ask them to reset your two factor authentication.', + 'warning_much_data' => ':days days of data may take a while to load.', + 'registered' => 'You have registered successfully!', + 'search' => 'Search', + 'no_budget_pointer' => 'You seem to have no budgets yet. You should create some on the budgets-page. Budgets can help you keep track of expenses.', + 'source_accounts' => 'Source account(s)', + 'destination_accounts' => 'Destination account(s)', + + // repeat frequencies: + 'repeat_freq_monthly' => 'monthly', + 'weekly' => 'weekly', + 'quarterly' => 'quarterly', + 'half-year' => 'every half year', + 'yearly' => 'yearly', + // account confirmation: + 'confirm_account_header' => 'Please confirm your account', + 'confirm_account_intro' => 'An email has been sent to the address you used during your registration. Please check it out for further instructions. If you did not get this message, you can have Firefly send it again.', + 'confirm_account_resend_email' => 'Send me the confirmation message I need to activate my account.', + 'account_is_confirmed' => 'Your account has been confirmed!', + 'invalid_activation_code' => 'It seems the code you are using is not valid, or has expired.', + 'confirm_account_is_resent_header' => 'The confirmation has been resent', + 'confirm_account_is_resent_text' => 'The confirmation message has been resent. If you still did not receive the confirmation message, please contact the site owner at :owner or check the log files to see what went wrong.', + 'confirm_account_is_resent_go_home' => 'Go to the index page of Firefly', + 'confirm_account_not_resent_header' => 'Something went wrong :(', + 'confirm_account_not_resent_intro' => 'The confirmation message has been not resent. If you still did not receive the confirmation message, please contact the site owner at :owner instead. Possibly, you have tried to resend the activation message too often. You can have Firefly III try to resend the confirmation message every hour.', + 'confirm_account_not_resent_go_home' => 'Go to the index page of Firefly', + + // export data: + 'import_and_export' => 'Import and export', + 'export_data' => 'Export data', + 'export_data_intro' => 'For backup purposes, when migrating to another system or when migrating to another Firefly III installation.', + 'export_format' => 'Export format', + 'export_format_csv' => 'Comma separated values (CSV file)', + 'export_format_mt940' => 'MT940 compatible format', + 'export_included_accounts' => 'Export transactions from these accounts', + 'include_config_help' => 'For easy re-import into Firefly III', + 'include_old_uploads_help' => 'Firefly III does not throw away the original CSV files you have imported in the past. You can include them in your export.', + 'do_export' => 'Export', + 'export_status_never_started' => 'The export has not started yet', + 'export_status_make_exporter' => 'Creating exporter thing...', + 'export_status_collecting_journals' => 'Collecting your transactions...', + 'export_status_collected_journals' => 'Collected your transactions!', + 'export_status_converting_to_export_format' => 'Converting your transactions...', + 'export_status_converted_to_export_format' => 'Converted your transactions!', + 'export_status_creating_journal_file' => 'Creating the export file...', + 'export_status_created_journal_file' => 'Created the export file!', + 'export_status_collecting_attachments' => 'Collecting all your attachments...', + 'export_status_collected_attachments' => 'Collected all your attachments!', + 'export_status_collecting_old_uploads' => 'Collecting all your previous uploads...', + 'export_status_collected_old_uploads' => 'Collected all your previous uploads!', + 'export_status_creating_config_file' => 'Creating a configuration file...', + 'export_status_created_config_file' => 'Created a configuration file!', + 'export_status_creating_zip_file' => 'Creating a zip file...', + 'export_status_created_zip_file' => 'Created a zip file!', + 'export_status_finished' => 'Export has succesfully finished! Yay!', + 'export_data_please_wait' => 'Please wait...', + 'attachment_explanation' => 'The file called \':attachment_name\' (#:attachment_id) was originally uploaded to :type \':description\' (#:journal_id) dated :date for the amount of :amount.', + + // rules + 'rules' => 'Rules', + 'rules_explanation' => 'Here you can manage rules. Rules are triggered when a transaction is created or updated. Then, if the transaction has certain properties (called "triggers") Firefly will execute the "actions". Combined, you can make Firefly respond in a certain way to new transactions.', + 'rule_name' => 'Name of rule', + 'rule_triggers' => 'Rule triggers when', + 'rule_actions' => 'Rule will', + 'new_rule' => 'New rule', + 'new_rule_group' => 'New rule group', + 'rule_priority_up' => 'Give rule more priority', + 'rule_priority_down' => 'Give rule less priority', + 'make_new_rule_group' => 'Make new rule group', + 'store_new_rule_group' => 'Store new rule group', + 'created_new_rule_group' => 'New rule group ":title" stored!', + 'updated_rule_group' => 'Successfully updated rule group ":title".', + 'edit_rule_group' => 'Edit rule group ":title"', + 'delete_rule_group' => 'Delete rule group ":title"', + 'deleted_rule_group' => 'Deleted rule group ":title"', + 'update_rule_group' => 'Update rule group', + 'no_rules_in_group' => 'There are no rules in this group', + 'move_rule_group_up' => 'Move rule group up', + 'move_rule_group_down' => 'Move rule group down', + 'save_rules_by_moving' => 'Save these rule(s) by moving them to another rule group:', + 'make_new_rule' => 'Make new rule in rule group ":title"', + 'rule_help_stop_processing' => 'When you check this box, later rules in this group will not be executed.', + 'rule_help_active' => 'Inactive rules will never fire.', + 'stored_new_rule' => 'Stored new rule with title ":title"', + 'deleted_rule' => 'Deleted rule with title ":title"', + 'store_new_rule' => 'Store new rule', + 'updated_rule' => 'Updated rule with title ":title"', + 'default_rule_group_name' => 'Default rules', + 'default_rule_group_description' => 'All your rules not in a particular group.', + 'default_rule_name' => 'Your first default rule', + 'default_rule_description' => 'This rule is an example. You can safely delete it.', + 'default_rule_trigger_description' => 'The Man Who Sold the World', + 'default_rule_trigger_from_account' => 'David Bowie', + 'default_rule_action_prepend' => 'Bought the world from ', + 'default_rule_action_set_category' => 'Large expenses', + 'trigger' => 'Trigger', + 'trigger_value' => 'Trigger on value', + 'stop_processing_other_triggers' => 'Stop processing other triggers', + 'add_rule_trigger' => 'Add new trigger', + 'action' => 'Action', + 'action_value' => 'Action value', + 'stop_executing_other_actions' => 'Stop executing other actions', + 'add_rule_action' => 'Add new action', + 'edit_rule' => 'Edit rule ":title"', + 'delete_rule' => 'Delete rule ":title"', + 'update_rule' => 'Update rule', + 'test_rule_triggers' => 'See matching transactions', + 'warning_transaction_subset' => 'For performance reasons this list is limited to :max_num_transactions and may only show a subset of matching transactions', + 'warning_no_matching_transactions' => 'No matching transactions found. Please note that for performance reasons, only the last :num_transactions transactions have been checked.', + 'warning_no_valid_triggers' => 'No valid triggers provided.', + 'execute_on_existing_transactions' => 'Execute for existing transactions', + 'execute_on_existing_transactions_intro' => 'When a rule or group has been changed or added, you can execute it for existing transactions', + 'execute_on_existing_transactions_short' => 'Existing transactions', + 'executed_group_on_existing_transactions' => 'Executed group ":title" for existing transactions', + 'execute_group_on_existing_transactions' => 'Execute group ":title" for existing transactions', + 'include_transactions_from_accounts' => 'Include transactions from these accounts', + 'execute' => 'Execute', + + // actions and triggers + 'rule_trigger_user_action' => 'User action is ":trigger_value"', + 'rule_trigger_from_account_starts' => 'Source account starts with ":trigger_value"', + 'rule_trigger_from_account_ends' => 'Source account ends with ":trigger_value"', + 'rule_trigger_from_account_is' => 'Source account is ":trigger_value"', + 'rule_trigger_from_account_contains' => 'Source account contains ":trigger_value"', + 'rule_trigger_to_account_starts' => 'Destination account starts with ":trigger_value"', + 'rule_trigger_to_account_ends' => 'Destination account ends with ":trigger_value"', + 'rule_trigger_to_account_is' => 'Destination account is ":trigger_value"', + 'rule_trigger_to_account_contains' => 'Destination account contains ":trigger_value"', + 'rule_trigger_transaction_type' => 'Transaction is of type ":trigger_value"', + 'rule_trigger_amount_less' => 'Amount is less than :trigger_value', + 'rule_trigger_amount_exactly' => 'Amount is :trigger_value', + 'rule_trigger_amount_more' => 'Amount is more than :trigger_value', + 'rule_trigger_description_starts' => 'Description starts with ":trigger_value"', + 'rule_trigger_description_ends' => 'Description ends with ":trigger_value"', + 'rule_trigger_description_contains' => 'Description contains ":trigger_value"', + 'rule_trigger_description_is' => 'Description is ":trigger_value"', + 'rule_trigger_from_account_starts_choice' => 'Source account starts with..', + 'rule_trigger_from_account_ends_choice' => 'Source account ends with..', + 'rule_trigger_from_account_is_choice' => 'Source account is..', + 'rule_trigger_from_account_contains_choice' => 'Source account contains..', + 'rule_trigger_to_account_starts_choice' => 'Destination account starts with..', + 'rule_trigger_to_account_ends_choice' => 'Destination account ends with..', + 'rule_trigger_to_account_is_choice' => 'Destination account is..', + 'rule_trigger_to_account_contains_choice' => 'Destination account contains..', + 'rule_trigger_transaction_type_choice' => 'Transaction is of type..', + 'rule_trigger_amount_less_choice' => 'Amount is less than..', + 'rule_trigger_amount_exactly_choice' => 'Amount is..', + 'rule_trigger_amount_more_choice' => 'Amount is more than..', + 'rule_trigger_description_starts_choice' => 'Description starts with..', + 'rule_trigger_description_ends_choice' => 'Description ends with..', + 'rule_trigger_description_contains_choice' => 'Description contains..', + 'rule_trigger_description_is_choice' => 'Description is..', + 'rule_trigger_store_journal' => 'When a journal is created', + 'rule_trigger_update_journal' => 'When a journal is updated', + 'rule_action_set_category' => 'Set category to ":action_value"', + 'rule_action_clear_category' => 'Clear category', + 'rule_action_set_budget' => 'Set budget to ":action_value"', + 'rule_action_clear_budget' => 'Clear budget', + 'rule_action_add_tag' => 'Add tag ":action_value"', + 'rule_action_remove_tag' => 'Remove tag ":action_value"', + 'rule_action_remove_all_tags' => 'Remove all tags', + 'rule_action_set_description' => 'Set description to ":action_value"', + 'rule_action_append_description' => 'Append description with ":action_value"', + 'rule_action_prepend_description' => 'Prepend description with ":action_value"', + 'rule_action_set_category_choice' => 'Set category to..', + 'rule_action_clear_category_choice' => 'Clear any category', + 'rule_action_set_budget_choice' => 'Set budget to..', + 'rule_action_clear_budget_choice' => 'Clear any budget', + 'rule_action_add_tag_choice' => 'Add tag..', + 'rule_action_remove_tag_choice' => 'Remove tag..', + 'rule_action_remove_all_tags_choice' => 'Remove all tags', + 'rule_action_set_description_choice' => 'Set description to..', + 'rule_action_append_description_choice' => 'Append description with..', + 'rule_action_prepend_description_choice' => 'Prepend description with..', + + // tags + 'store_new_tag' => 'Store new tag', + 'update_tag' => 'Update tag', + 'no_location_set' => 'No location set.', + 'meta_data' => 'Meta data', + 'location' => 'Location', + + // preferences + 'pref_home_screen_accounts' => 'Home screen accounts', + 'pref_home_screen_accounts_help' => 'Which accounts should be displayed on the home page?', + 'pref_view_range' => 'View range', + 'pref_view_range_help' => 'Some charts are automatically grouped in periods. What period would you prefer?', + 'pref_1D' => 'One day', + 'pref_1W' => 'One week', + 'pref_1M' => 'One month', + 'pref_3M' => 'Three months (quarter)', + 'pref_6M' => 'Six months', + 'pref_1Y' => 'One year', + 'pref_languages' => 'Languages', + 'pref_languages_help' => 'Firefly III supports several languages. Which one do you prefer?', + 'pref_custom_fiscal_year' => 'Fiscal year settings', + 'pref_custom_fiscal_year_label' => 'Enabled', + 'pref_custom_fiscal_year_help' => 'In countries that use a financial year other than January 1 to December 31, you can switch this on and specify start / end days of the fiscal year', + 'pref_fiscal_year_start_label' => 'Fiscal year start date', + 'pref_two_factor_auth' => '2-step verification', + 'pref_two_factor_auth_help' => 'When you enable 2-step verification (also known as two-factor authentication), you add an extra layer of security to your account. You sign in with something you know (your password) and something you have (a verification code). Verification codes are generated by an application on your phone, such as Authy or Google Authenticator.', + 'pref_enable_two_factor_auth' => 'Enable 2-step verification', + 'pref_two_factor_auth_disabled' => '2-step verification code removed and disabled', + 'pref_two_factor_auth_remove_it' => 'Don\'t forget to remove the account from your authentication app!', + 'pref_two_factor_auth_code' => 'Verify code', + 'pref_two_factor_auth_code_help' => 'Scan the QR code with an application on your phone such as Authy or Google Authenticator and enter the generated code.', + 'pref_two_factor_auth_reset_code' => 'Reset verification code', + 'pref_two_factor_auth_remove_code' => 'Remove verification code', + 'pref_two_factor_auth_remove_will_disable' => '(this will also disable two-factor authentication)', + 'pref_save_settings' => 'Save settings', + 'saved_preferences' => 'Preferences saved!', + 'transaction_page_size_title' => 'Page size', + 'transaction_page_size_help' => 'Any list of transactions shows at most this many transactions', + 'transaction_page_size_label' => 'Page size', + 'between_dates' => '(:start and :end)', + 'pref_optional_fields_transaction' => 'Optional fields for transactions', + 'pref_optional_fields_transaction_help' => 'By default not all fields are enabled when creating a new transaction (because of the clutter). Below, you can enable these fields if you think they could be useful for you. Of course, any field that is disabled, but already filled in, will be visible regardless of the setting.', + 'optional_tj_date_fields' => 'Date fields', + 'optional_tj_business_fields' => 'Business fields', + 'optional_tj_attachment_fields' => 'Attachment fields', + 'pref_optional_tj_interest_date' => 'Interest date', + 'pref_optional_tj_book_date' => 'Book date', + 'pref_optional_tj_process_date' => 'Processing date', + 'pref_optional_tj_due_date' => 'Due date', + 'pref_optional_tj_payment_date' => 'Payment date', + 'pref_optional_tj_invoice_date' => 'Invoice date', + 'pref_optional_tj_internal_reference' => 'Internal reference', + 'pref_optional_tj_notes' => 'Notes', + 'pref_optional_tj_attachments' => 'Attachments', + 'optional_field_meta_dates' => 'Dates', + 'optional_field_meta_business' => 'Business', + 'optional_field_attachments' => 'Attachments', + 'optional_field_meta_data' => 'Optional meta data', + + + // profile: + 'change_your_password' => 'Change your password', + 'delete_account' => 'Delete account', + 'current_password' => 'Current password', + 'new_password' => 'New password', + 'new_password_again' => 'New password (again)', + 'delete_your_account' => 'Delete your account', + 'delete_your_account_help' => 'Deleting your account will also delete any accounts, transactions, anything you might have saved into Firefly III. It\'ll be GONE.', + 'delete_your_account_password' => 'Enter your password to continue.', + 'password' => 'Password', + 'are_you_sure' => 'Are you sure? You cannot undo this.', + 'delete_account_button' => 'DELETE your account', + 'invalid_current_password' => 'Invalid current password!', + 'password_changed' => 'Password changed!', + 'should_change' => 'The idea is to change your password.', + 'invalid_password' => 'Invalid password!', + + + // attachments + 'nr_of_attachments' => 'One attachment|:count attachments', + 'attachments' => 'Attachments', + 'edit_attachment' => 'Edit attachment ":name"', + 'update_attachment' => 'Update attachment', + 'delete_attachment' => 'Delete attachment ":name"', + 'attachment_deleted' => 'Deleted attachment ":name"', + 'attachment_updated' => 'Updated attachment ":name"', + 'upload_max_file_size' => 'Maximum file size: :size', + + // tour: + 'prev' => 'Prev', + 'next' => 'Next', + 'end-tour' => 'End tour', + 'pause' => 'Pause', + + // transaction index + 'title_expenses' => 'Expenses', + 'title_withdrawal' => 'Expenses', + 'title_revenue' => 'Revenue / income', + 'title_deposit' => 'Revenue / income', + 'title_transfer' => 'Transfers', + 'title_transfers' => 'Transfers', + + // create new stuff: + 'create_new_withdrawal' => 'Create new withdrawal', + 'create_new_deposit' => 'Create new deposit', + 'create_new_transfer' => 'Create new transfer', + 'create_new_asset' => 'Create new asset account', + 'create_new_expense' => 'Create new expense account', + 'create_new_revenue' => 'Create new revenue account', + 'create_new_piggy_bank' => 'Create new piggy bank', + 'create_new_bill' => 'Create new bill', + + // currencies: + 'create_currency' => 'Create a new currency', + 'store_currency' => 'Store new currency', + 'update_currency' => 'Update currency', + 'new_default_currency' => ':name is now the default currency.', + 'cannot_delete_currency' => 'Cannot delete :name because it is still in use.', + 'deleted_currency' => 'Currency :name deleted', + 'created_currency' => 'Currency :name created', + 'updated_currency' => 'Currency :name updated', + 'ask_site_owner' => 'Please ask :owner to add, remove or edit currencies.', + 'currencies_intro' => 'Firefly III supports various currencies which you can set and enable here.', + 'make_default_currency' => 'make default', + 'default_currency' => 'default', + + // new user: + 'submit' => 'Submit', + 'getting_started' => 'Getting started', + 'to_get_started' => 'To get started with Firefly, please enter your current bank\'s name, and the balance of your checking account:', + 'savings_balance_text' => 'If you have a savings account, please enter the current balance of your savings account:', + 'cc_balance_text' => 'If you have a credit card, please enter your credit card\'s limit.', + 'stored_new_account_new_user' => 'Yay! Your new account has been stored.', + 'stored_new_accounts_new_user' => 'Yay! Your new accounts have been stored.', + + // forms: + 'mandatoryFields' => 'Mandatory fields', + 'optionalFields' => 'Optional fields', + 'options' => 'Options', + + // budgets: + 'create_new_budget' => 'Create a new budget', + 'store_new_budget' => 'Store new budget', + 'stored_new_budget' => 'Stored new budget ":name"', + 'available_between' => 'Available between :start and :end', + 'transactionsWithoutBudget' => 'Expenses without budget', + 'transactions_no_budget' => 'Expenses without budget between :start and :end', + 'spent_between' => 'Spent between :start and :end', + 'createBudget' => 'New budget', + 'inactiveBudgets' => 'Inactive budgets', + 'without_budget_between' => 'Transactions without a budget between :start and :end', + 'budget_in_month' => ':name in :month', + 'delete_budget' => 'Delete budget ":name"', + 'deleted_budget' => 'Deleted budget ":name"', + 'edit_budget' => 'Edit budget ":name"', + 'updated_budget' => 'Updated budget ":name"', + 'update_amount' => 'Update amount', + 'update_budget' => 'Update budget', + 'update_budget_amount_range' => 'Update (expected) available amount between :start and :end', + + // bills: + 'matching_on' => 'Matching on', + 'between_amounts' => 'between :low and :high.', + 'repeats' => 'Repeats', + 'connected_journals' => 'Connected transactions', + 'auto_match_on' => 'Automatically matched by Firefly', + 'auto_match_off' => 'Not automatically matched by Firefly', + 'next_expected_match' => 'Next expected match', + 'delete_bill' => 'Delete bill ":name"', + 'deleted_bill' => 'Deleted bill ":name"', + 'edit_bill' => 'Edit bill ":name"', + 'more' => 'More', + 'rescan_old' => 'Rescan old transactions', + 'update_bill' => 'Update bill', + 'updated_bill' => 'Updated bill ":name"', + 'store_new_bill' => 'Store new bill', + 'stored_new_bill' => 'Stored new bill ":name"', + 'cannot_scan_inactive_bill' => 'Inactive bills cannot be scanned.', + 'rescanned_bill' => 'Rescanned everything.', + 'bill_date_little_relevance' => 'The only part of this date used by Firefly is the day. It is only useful when your bill arrives at exactly the same date every month. If the payment date of your bills varies, simply use the first of the month.', + 'average_bill_amount_year' => 'Average bill amount (:year)', + 'average_bill_amount_overall' => 'Average bill amount (overall)', + + // accounts: + 'details_for_asset' => 'Details for asset account ":name"', + 'details_for_expense' => 'Details for expense account ":name"', + 'details_for_revenue' => 'Details for revenue account ":name"', + 'details_for_cash' => 'Details for cash account ":name"', + 'store_new_asset_account' => 'Store new asset account', + 'store_new_expense_account' => 'Store new expense account', + 'store_new_revenue_account' => 'Store new revenue account', + 'edit_asset_account' => 'Edit asset account ":name"', + 'edit_expense_account' => 'Edit expense account ":name"', + 'edit_revenue_account' => 'Edit revenue account ":name"', + 'delete_asset_account' => 'Delete asset account ":name"', + 'delete_expense_account' => 'Delete expense account ":name"', + 'delete_revenue_account' => 'Delete revenue account ":name"', + 'asset_deleted' => 'Successfully deleted asset account ":name"', + 'expense_deleted' => 'Successfully deleted expense account ":name"', + 'revenue_deleted' => 'Successfully deleted revenue account ":name"', + 'update_asset_account' => 'Update asset account', + 'update_expense_account' => 'Update expense account', + 'update_revenue_account' => 'Update revenue account', + 'make_new_asset_account' => 'Create a new asset account', + 'make_new_expense_account' => 'Create a new expense account', + 'make_new_revenue_account' => 'Create a new revenue account', + 'asset_accounts' => 'Asset accounts', + 'expense_accounts' => 'Expense accounts', + 'revenue_accounts' => 'Revenue accounts', + 'cash_accounts' => 'Cash accounts', + 'Cash account' => 'Cash account', + 'account_type' => 'Account type', + 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', + 'stored_new_account' => 'New account ":name" stored!', + 'updated_account' => 'Updated account ":name"', + 'credit_card_options' => 'Credit card options', + + // categories: + 'new_category' => 'New category', + 'create_new_category' => 'Create a new category', + 'without_category' => 'Without a category', + 'update_category' => 'Update category', + 'updated_category' => 'Updated category ":name"', + 'categories' => 'Categories', + 'edit_category' => 'Edit category ":name"', + 'no_category' => '(no category)', + 'category' => 'Category', + 'delete_category' => 'Delete category ":name"', + 'deleted_category' => 'Deleted category ":name"', + 'store_category' => 'Store new category', + 'stored_category' => 'Stored new category ":name"', + 'without_category_between' => 'Without category between :start and :end', + + // transactions: + 'update_withdrawal' => 'Update withdrawal', + 'update_deposit' => 'Update deposit', + 'update_transfer' => 'Update transfer', + 'updated_withdrawal' => 'Updated withdrawal ":description"', + 'updated_deposit' => 'Updated deposit ":description"', + 'updated_transfer' => 'Updated transfer ":description"', + 'delete_withdrawal' => 'Delete withdrawal ":description"', + 'delete_deposit' => 'Delete deposit ":description"', + 'delete_transfer' => 'Delete transfer ":description"', + 'deleted_withdrawal' => 'Successfully deleted withdrawal ":description"', + 'deleted_deposit' => 'Successfully deleted deposit ":description"', + 'deleted_transfer' => 'Successfully deleted transfer ":description"', + 'stored_journal' => 'Successfully created new transaction ":description"', + 'select_transactions' => 'Select transactions', + 'stop_selection' => 'Stop selecting transactions', + 'edit_selected' => 'Edit selected', + 'delete_selected' => 'Delete selected', + 'mass_delete_journals' => 'Delete a number of transactions', + 'mass_edit_journals' => 'Edit a number of transactions', + 'cannot_edit_other_fields' => 'You cannot mass-edit other fields than the ones here, because there is no room to show them. Please follow the link and edit them by one-by-one, if you need to edit these fields.', + 'perm-delete-many' => 'Deleting many items in one go can be very disruptive. Please be cautious.', + 'mass_deleted_transactions_success' => 'Deleted :amount transaction(s).', + 'mass_edited_transactions_success' => 'Updated :amount transaction(s)', + + + // new user: + 'welcome' => 'Welcome to Firefly!', + + // home page: + 'yourAccounts' => 'Your accounts', + 'budgetsAndSpending' => 'Budgets and spending', + 'savings' => 'Savings', + 'markAsSavingsToContinue' => 'Mark your asset accounts as "Savings account" to fill this panel', + 'createPiggyToContinue' => 'Create piggy banks to fill this panel.', + 'newWithdrawal' => 'New expense', + 'newDeposit' => 'New deposit', + 'newTransfer' => 'New transfer', + 'moneyIn' => 'Money in', + 'moneyOut' => 'Money out', + 'billsToPay' => 'Bills to pay', + 'billsPaid' => 'Bills paid', + 'divided' => 'divided', + 'toDivide' => 'left to divide', + + // menu and titles, should be recycled as often as possible: + 'currency' => 'Currency', + 'preferences' => 'Preferences', + 'logout' => 'Logout', + 'searchPlaceholder' => 'Search...', + 'dashboard' => 'Dashboard', + 'currencies' => 'Currencies', + 'accounts' => 'Accounts', + 'Asset account' => 'Asset account', + 'Default account' => 'Asset account', + 'Expense account' => 'Expense account', + 'Revenue account' => 'Revenue account', + 'Initial balance account' => 'Initial balance account', + 'budgets' => 'Budgets', + 'tags' => 'Tags', + 'reports' => 'Reports', + 'transactions' => 'Transactions', + 'expenses' => 'Expenses', + 'income' => 'Revenue / income', + 'transfers' => 'Transfers', + 'moneyManagement' => 'Money management', + 'piggyBanks' => 'Piggy banks', + 'bills' => 'Bills', + 'withdrawal' => 'Withdrawal', + 'deposit' => 'Deposit', + 'account' => 'Account', + 'transfer' => 'Transfer', + 'Withdrawal' => 'Withdrawal', + 'Deposit' => 'Deposit', + 'Transfer' => 'Transfer', + 'bill' => 'Bill', + 'yes' => 'Yes', + 'no' => 'No', + 'amount' => 'Amount', + 'overview' => 'Overview', + 'saveOnAccount' => 'Save on account', + 'unknown' => 'Unknown', + 'daily' => 'Daily', + 'monthly' => 'Monthly', + 'profile' => 'Profile', + 'errors' => 'Errors', + + // reports: + 'report_default' => 'Default financial report for :start until :end', + 'report_audit' => 'Transaction history overview for :start until :end', + 'quick_link_reports' => 'Quick links', + 'quick_link_default_report' => 'Default financial report', + 'quick_link_audit_report' => 'Transaction history overview', + 'report_this_month_quick' => 'Current month, all accounts', + 'report_this_year_quick' => 'Current year, all accounts', + 'report_this_fiscal_year_quick' => 'Current fiscal year, all accounts', + 'report_all_time_quick' => 'All-time, all accounts', + 'reports_can_bookmark' => 'Remember that reports can be bookmarked.', + 'incomeVsExpenses' => 'Income vs. expenses', + 'accountBalances' => 'Account balances', + 'balanceStartOfYear' => 'Balance at start of year', + 'balanceEndOfYear' => 'Balance at end of year', + 'balanceStartOfMonth' => 'Balance at start of month', + 'balanceEndOfMonth' => 'Balance at end of month', + 'balanceStart' => 'Balance at start of period', + 'balanceEnd' => 'Balance at end of period', + 'reportsOwnAccounts' => 'Reports for your own accounts', + 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts', + 'splitByAccount' => 'Split by account', + 'balancedByTransfersAndTags' => 'Balanced by transfers and tags', + 'coveredWithTags' => 'Covered with tags', + 'leftUnbalanced' => 'Left unbalanced', + 'expectedBalance' => 'Expected balance', + 'outsideOfBudgets' => 'Outside of budgets', + 'leftInBudget' => 'Left in budget', + 'sumOfSums' => 'Sum of sums', + 'noCategory' => '(no category)', + 'notCharged' => 'Not charged (yet)', + 'inactive' => 'Inactive', + 'active' => 'Active', + 'difference' => 'Difference', + 'in' => 'In', + 'out' => 'Out', + 'topX' => 'top :number', + 'showTheRest' => 'Show everything', + 'hideTheRest' => 'Show only the top :number', + 'sum_of_year' => 'Sum of year', + 'sum_of_years' => 'Sum of years', + 'average_of_year' => 'Average of year', + 'average_of_years' => 'Average of years', + 'categories_earned_in_year' => 'Categories (by earnings)', + 'categories_spent_in_year' => 'Categories (by spendings)', + 'report_type' => 'Report type', + 'report_type_default' => 'Default financial report', + 'report_type_audit' => 'Transaction history overview (audit)', + 'report_type_meta-history' => 'Categories, budgets and bills overview', + 'more_info_help' => 'More information about these types of reports can be found in the help pages. Press the (?) icon in the top right corner.', + 'report_included_accounts' => 'Included accounts', + 'report_date_range' => 'Date range', + 'report_include_help' => 'In all cases, transfers to shared accounts count as expenses, and transfers from shared accounts count as income.', + 'report_preset_ranges' => 'Pre-set ranges', + 'shared' => 'Shared', + 'fiscal_year' => 'Fiscal year', + 'income_entry' => 'Income from account ":name" between :start and :end', + 'expense_entry' => 'Expenses to account ":name" between :start and :end', + 'category_entry' => 'Expenses in category ":name" between :start and :end', + 'budget_spent_amount' => 'Expenses in budget ":budget" between :start and :end', + 'balance_amount' => 'Expenses in budget ":budget" paid from account ":account" between :start and :end', + 'no_audit_activity' => 'No activity was recorded on account :account_name between :start and :end.', + 'audit_end_balance' => 'Account balance of :account_name at the end of :end was: :balance', + + // charts: + 'chart' => 'Chart', + 'dayOfMonth' => 'Day of the month', + 'month' => 'Month', + 'budget' => 'Budget', + 'spent' => 'Spent', + 'earned' => 'Earned', + 'overspent' => 'Overspent', + 'left' => 'Left', + 'no_budget' => '(no budget)', + 'maxAmount' => 'Maximum amount', + 'minAmount' => 'Minumum amount', + 'billEntry' => 'Current bill entry', + 'name' => 'Name', + 'date' => 'Date', + 'paid' => 'Paid', + 'unpaid' => 'Unpaid', + 'day' => 'Day', + 'budgeted' => 'Budgeted', + 'period' => 'Period', + 'balance' => 'Balance', + 'summary' => 'Summary', + 'sum' => 'Sum', + 'average' => 'Average', + 'balanceFor' => 'Balance for :name', + + // piggy banks: + 'add_money_to_piggy' => 'Add money to piggy bank ":name"', + 'piggy_bank' => 'Piggy bank', + 'new_piggy_bank' => 'Create new piggy bank', + 'store_piggy_bank' => 'Store new piggy bank', + 'stored_piggy_bank' => 'Store new piggy bank ":name"', + 'account_status' => 'Account status', + 'left_for_piggy_banks' => 'Left for piggy banks', + 'sum_of_piggy_banks' => 'Sum of piggy banks', + 'saved_so_far' => 'Saved so far', + 'left_to_save' => 'Left to save', + 'add_money_to_piggy_title' => 'Add money to piggy bank ":name"', + 'remove_money_from_piggy_title' => 'Remove money from piggy bank ":name"', + 'add' => 'Add', + 'remove' => 'Remove', + 'max_amount_add' => 'The maximum amount you can add is', + 'max_amount_remove' => 'The maximum amount you can remove is', + 'update_piggy_button' => 'Update piggy bank', + 'update_piggy_title' => 'Update piggy bank ":name"', + 'updated_piggy_bank' => 'Updated piggy bank ":name"', + 'details' => 'Details', + 'events' => 'Events', + 'target_amount' => 'Target amount', + 'start_date' => 'Start date', + 'target_date' => 'Target date', + 'no_target_date' => 'No target date', + 'todo' => 'to do', + 'table' => 'Table', + 'piggy_bank_not_exists' => 'Piggy bank no longer exists.', + 'add_any_amount_to_piggy' => 'Add money to this piggy bank to reach your target of :amount.', + 'add_set_amount_to_piggy' => 'Add :amount to fill this piggy bank on :date', + 'delete_piggy_bank' => 'Delete piggy bank ":name"', + 'cannot_add_amount_piggy' => 'Could not add :amount to ":name".', + 'deleted_piggy_bank' => 'Deleted piggy bank ":name"', + 'added_amount_to_piggy' => 'Added :amount to ":name"', + 'removed_amount_from_piggy' => 'Removed :amount from ":name"', + 'cannot_remove_amount_piggy' => 'Could not remove :amount from ":name".', + + // tags + 'regular_tag' => 'Just a regular tag.', + 'balancing_act' => 'The tag takes at most two transactions; an expense and a transfer. They\'ll balance each other out.', + 'advance_payment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.', + 'delete_tag' => 'Delete tag ":tag"', + 'deleted_tag' => 'Deleted tag ":tag"', + 'new_tag' => 'Make new tag', + 'edit_tag' => 'Edit tag ":tag"', + 'updated_tag' => 'Updated tag ":tag"', + 'created_tag' => 'Tag ":tag" has been created!', + 'no_year' => 'No year set', + 'no_month' => 'No month set', + 'tag_title_nothing' => 'Default tags', + 'tag_title_balancingAct' => 'Balancing act tags', + 'tag_title_advancePayment' => 'Advance payment tags', + 'tags_introduction' => 'Usually tags are singular words, designed to quickly band items together using things like expensive, bill or for-party. In Firefly III, tags can have more properties such as a date, description and location. This allows you to join transactions together in a more meaningful way. For example, you could make a tag called Christmas dinner with friends and add information about the restaurant. Such tags are "singular", you would only use them for a single occasion, perhaps with multiple transactions.', + 'tags_group' => 'Tags group transactions together, which makes it possible to store reimbursements (in case you front money for others) and other "balancing acts" where expenses are summed up (the payments on your new TV) or where expenses and deposits are cancelling each other out (buying something with saved money). It\'s all up to you. Using tags the old-fashioned way is of course always possible.', + 'tags_start' => 'Create a tag to get started or enter tags when creating new transactions.', + + + // administration + 'administration' => 'Administration', + 'user_administration' => 'User administration', + 'list_all_users' => 'All users', + 'all_users' => 'All users', + 'all_blocked_domains' => 'All blocked domains', + 'blocked_domains' => 'Blocked domains', + 'no_domains_banned' => 'No domains blocked', + 'all_user_domains' => 'All user email address domains', + 'all_domains_is_filtered' => 'This list does not include already blocked domains.', + 'domain_now_blocked' => 'Domain :domain is now blocked', + 'domain_now_unblocked' => 'Domain :domain is now unblocked', + 'manual_block_domain' => 'Block a domain by hand', + 'block_domain' => 'Block domain', + 'no_domain_filled_in' => 'No domain filled in', + 'domain_already_blocked' => 'Domain :domain is already blocked', + 'domain_is_now_blocked' => 'Domain :domain is now blocked', + 'instance_configuration' => 'Configuration', + 'firefly_instance_configuration' => 'Configuration options for Firefly III', + 'setting_single_user_mode' => 'Single user mode', + 'setting_single_user_mode_explain' => 'By default, Firefly III only accepts one (1) registration: you. This is a security measure, preventing others from using your instance unless you allow them to. Future registrations are blocked. When you uncheck this box, others can use your instance as wel, assuming they can reach it (when it is connected to the internet).', + 'store_configuration' => 'Store configuration', + 'hidden_fields_preferences' => 'Not all fields are visible right now. You must enable them in your settings.', + + // split a transaction: + 'transaction_meta_data' => 'Transaction meta-data', + 'transaction_dates' => 'Transaction dates', + 'splits' => 'Splits', + 'split_title_withdrawal' => 'Split your new withdrawal', + 'split_intro_one_withdrawal' => 'Firefly supports the "splitting" of a withdrawal.', + 'split_intro_two_withdrawal' => 'It means that the amount of money you\'ve spent is divided between several destination expense accounts, budgets or categories.', + 'split_intro_three_withdrawal' => 'For example: you could split your :total groceries so you pay :split_one from your "daily groceries" budget and :split_two from your "cigarettes" budget.', + 'split_table_intro_withdrawal' => 'Split your withdrawal in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', + 'store_splitted_withdrawal' => 'Store splitted withdrawal', + 'update_splitted_withdrawal' => 'Update splitted withdrawal', + 'split_title_deposit' => 'Split your new deposit', + 'split_intro_one_deposit' => 'Firefly supports the "splitting" of a deposit.', + 'split_intro_two_deposit' => 'It means that the amount of money you\'ve earned is divided between several source revenue accounts or categories.', + 'split_intro_three_deposit' => 'For example: you could split your :total salary so you get :split_one as your base salary and :split_two as a reimbursment for expenses made.', + 'split_table_intro_deposit' => 'Split your deposit in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', + 'store_splitted_deposit' => 'Store splitted deposit', + 'split_title_transfer' => 'Split your new transfer', + 'split_intro_one_transfer' => 'Firefly supports the "splitting" of a transfer.', + 'split_intro_two_transfer' => 'It means that the amount of money you\'re moving is divided between several categories or piggy banks.', + 'split_intro_three_transfer' => 'For example: you could split your :total move so you get :split_one in one piggy bank and :split_two in another.', + 'split_table_intro_transfer' => 'Split your transfer in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', + 'store_splitted_transfer' => 'Store splitted transfer', + 'add_another_split' => 'Add another split', + 'split-transactions' => 'Split transactions', + 'split-new-transaction' => 'Split a new transaction', + 'do_split' => 'Do a split', + 'split_this_withdrawal' => 'Split this withdrawal', + 'split_this_deposit' => 'Split this deposit', + 'split_this_transfer' => 'Split this transfer', + 'cannot_edit_multiple_source' => 'You cannot edit splitted transaction #:id with description ":description" because it contains multiple source accounts.', + 'cannot_edit_multiple_dest' => 'You cannot edit splitted transaction #:id with description ":description" because it contains multiple destination accounts.', + 'no_edit_multiple_left' => 'You have selected no valid transactions to edit.', + + // import + 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', + 'import_data_index' => 'Index', + 'import_file_type_csv' => 'CSV (comma separated values)', + 'import_file_type_help' => 'Select the type of file you will upload', + 'import_start' => 'Start the import', + 'configure_import' => 'Further configure your import', + 'import_finish_configuration' => 'Finish configuration', + 'settings_for_import' => 'Settings', + 'import_status' => 'Import status', + 'import_status_text' => 'The import is currently running, or will start momentarily.', + 'import_complete' => 'Import configuration complete!', + 'import_complete_text' => 'The import is ready to start. All the configuration you needed to do has been done. Please download the configuration file. It will help you with the import should it not go as planned. To actually run the import, you can either execute the following command in your console, or run the web-based import. Depending on your configuration, the console import will give you more feedback.', + 'import_download_config' => 'Download configuration', + 'import_start_import' => 'Start import', + 'import_intro_beta' => 'The import function of Firefly III is in beta. Many users of Firefly III have tried many different files. Although each individual compontent of this import routine works (really), the combination might break. If your file cannot be imported by Firefly, please read this wiki page so I can fix the problem you have run into.', + 'import_data' => 'Import data', + 'import_data_full' => 'Import data into Firefly III', + 'import' => 'Import', + 'import_intro_what_it_does' => 'This page allows you to import data into Firefly III. To do so, export data from your bank, or from another financial management system. Upload that file here. Firefly III will convert the data. You need to give it some directions. Please select a file and follow the instructions.', + 'import_intro_import_conf_title' => 'Import "configuration"', + 'import_intro_beta_warning' => 'Warning', + 'import_intro_import_conf_text' => 'As you will discover over the next few pages, this import routine has a lot of settings. These settings are mainly dependent on the bank (or financial management software) your file comes from. There is a good chance somebody else already imported such a file and has shared their configuration file. Please visit the import configuration center to see if there already is a configuration available for your bank or system. If there is, you should download this configuration file and upload it here as well. It will save you a lot of time!', + 'import_file_help' => 'Select your file', + 'import_status_settings_complete' => 'The import is ready to start.', + 'import_status_import_complete' => 'The import has completed.', + 'import_status_import_running' => 'The import is currently running. Please be patient.', + 'import_status_header' => 'Import status and progress', + 'import_status_errors' => 'Import errors', + 'import_status_report' => 'Import report', + 'import_finished' => 'Import has finished', + 'import_error_single' => 'An error has occured during the import.', + 'import_error_multi' => 'Some errors occured during the import.', + 'import_error_fatal' => 'There was an error during the import routine. Please check the log files. The error seems to be:', + 'import_error_timeout' => 'The import seems to have timed out. If this error persists, please import your data using the console command.', + 'import_double' => 'Row #:row: This row has been imported before, and is stored in :description.', + 'import_finished_all' => 'The import has finished. Please check out the results below.', + 'import_with_key' => 'Import with key \':key\'', + + 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', + + 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', + 'import_finished_link' => 'The transactions imported can be found in tag :tag.', + + +]; diff --git a/resources/lang/hr_HR/form.php b/resources/lang/hr_HR/form.php new file mode 100644 index 0000000000..2f7f5ad581 --- /dev/null +++ b/resources/lang/hr_HR/form.php @@ -0,0 +1,156 @@ + 'Bank name', + 'bank_balance' => 'Balance', + 'savings_balance' => 'Savings balance', + 'credit_card_limit' => 'Credit card limit', + 'automatch' => 'Match automatically', + 'skip' => 'Skip', + 'name' => 'Name', + 'active' => 'Active', + 'amount_min' => 'Minimum amount', + 'amount_max' => 'Maximum amount', + 'match' => 'Matches on', + 'repeat_freq' => 'Repeats', + 'journal_currency_id' => 'Currency', + 'journal_amount' => 'Amount', + 'journal_asset_source_account' => 'Asset account (source)', + 'journal_source_account_name' => 'Revenue account (source)', + 'journal_source_account_id' => 'Asset account (source)', + 'account_from_id' => 'From account', + 'account_to_id' => 'To account', + 'journal_destination_account_id' => 'Asset account (destination)', + 'asset_destination_account' => 'Asset account (destination)', + 'asset_source_account' => 'Asset account (source)', + 'journal_description' => 'Description', + 'split_journal' => 'Split this transaction', + 'split_journal_explanation' => 'Split this transaction in multiple parts', + 'currency' => 'Currency', + 'account_id' => 'Asset account', + 'budget_id' => 'Budget', + 'openingBalance' => 'Opening balance', + 'tagMode' => 'Tag mode', + 'tagPosition' => 'Tag location', + 'virtualBalance' => 'Virtual balance', + 'longitude_latitude' => 'Location', + 'targetamount' => 'Target amount', + 'accountRole' => 'Account role', + 'openingBalanceDate' => 'Opening balance date', + 'ccType' => 'Credit card payment plan', + 'ccMonthlyPaymentDate' => 'Credit card monthly payment date', + 'piggy_bank_id' => 'Piggy bank', + 'returnHere' => 'Return here', + 'returnHereExplanation' => 'After storing, return here to create another one.', + 'returnHereUpdateExplanation' => 'After updating, return here.', + 'description' => 'Description', + 'expense_account' => 'Expense account', + 'revenue_account' => 'Revenue account', + 'amount' => 'Amount', + 'date' => 'Date', + 'interest_date' => 'Interest date', + 'book_date' => 'Book date', + 'process_date' => 'Processing date', + 'category' => 'Category', + 'tags' => 'Tags', + 'deletePermanently' => 'Delete permanently', + 'cancel' => 'Cancel', + 'targetdate' => 'Target date', + 'tag' => 'Tag', + 'under' => 'Under', + 'symbol' => 'Symbol', + 'code' => 'Code', + 'iban' => 'IBAN', + 'accountNumber' => 'Account number', + 'has_headers' => 'Headers', + 'date_format' => 'Date format', + 'specifix' => 'Bank- or file specific fixes', + 'attachments[]' => 'Attachments', + 'store_new_withdrawal' => 'Store new withdrawal', + 'store_new_deposit' => 'Store new deposit', + 'store_new_transfer' => 'Store new transfer', + 'add_new_withdrawal' => 'Add a new withdrawal', + 'add_new_deposit' => 'Add a new deposit', + 'add_new_transfer' => 'Add a new transfer', + 'noPiggybank' => '(no piggy bank)', + 'title' => 'Title', + 'notes' => 'Notes', + 'filename' => 'File name', + 'mime' => 'Mime type', + 'size' => 'Size', + 'trigger' => 'Trigger', + 'stop_processing' => 'Stop processing', + 'start_date' => 'Start of range', + 'end_date' => 'End of range', + 'export_start_range' => 'Start of export range', + 'export_end_range' => 'End of export range', + 'export_format' => 'File format', + 'include_attachments' => 'Include uploaded attachments', + 'include_config' => 'Include configuration file', + 'include_old_uploads' => 'Include imported data', + 'accounts' => 'Export transactions from these accounts', + 'delete_account' => 'Delete account ":name"', + 'delete_bill' => 'Delete bill ":name"', + 'delete_budget' => 'Delete budget ":name"', + 'delete_category' => 'Delete category ":name"', + 'delete_currency' => 'Delete currency ":name"', + 'delete_journal' => 'Delete transaction with description ":description"', + 'delete_attachment' => 'Delete attachment ":name"', + 'delete_rule' => 'Delete rule ":title"', + 'delete_rule_group' => 'Delete rule group ":title"', + 'attachment_areYouSure' => 'Are you sure you want to delete the attachment named ":name"?', + 'account_areYouSure' => 'Are you sure you want to delete the account named ":name"?', + 'bill_areYouSure' => 'Are you sure you want to delete the bill named ":name"?', + 'rule_areYouSure' => 'Are you sure you want to delete the rule titled ":title"?', + 'ruleGroup_areYouSure' => 'Are you sure you want to delete the rule group titled ":title"?', + 'budget_areYouSure' => 'Are you sure you want to delete the budget named ":name"?', + 'category_areYouSure' => 'Are you sure you want to delete the category named ":name"?', + 'currency_areYouSure' => 'Are you sure you want to delete the currency named ":name"?', + 'piggyBank_areYouSure' => 'Are you sure you want to delete the piggy bank named ":name"?', + 'journal_areYouSure' => 'Are you sure you want to delete the transaction described ":description"?', + 'mass_journal_are_you_sure' => 'Are you sure you want to delete these transactions?', + 'tag_areYouSure' => 'Are you sure you want to delete the tag ":tag"?', + 'permDeleteWarning' => 'Deleting stuff from Firely is permanent and cannot be undone.', + 'mass_make_selection' => 'You can still prevent items from being deleted by removing the checkbox.', + 'delete_all_permanently' => 'Delete selected permanently', + 'update_all_journals' => 'Update these transactions', + 'also_delete_transactions' => 'The only transaction connected to this account will be deleted as well.|All :count transactions connected to this account will be deleted as well.', + 'also_delete_rules' => 'The only rule connected to this rule group will be deleted as well.|All :count rules connected to this rule group will be deleted as well.', + 'also_delete_piggyBanks' => 'The only piggy bank connected to this account will be deleted as well.|All :count piggy bank connected to this account will be deleted as well.', + 'bill_keep_transactions' => 'The only transaction connected to this bill will not be deleted.|All :count transactions connected to this bill will spared deletion.', + 'budget_keep_transactions' => 'The only transaction connected to this budget will not be deleted.|All :count transactions connected to this budget will spared deletion.', + 'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.|All :count transactions connected to this category will spared deletion.', + 'tag_keep_transactions' => 'The only transaction connected to this tag will not be deleted.|All :count transactions connected to this tag will spared deletion.', + + // admin + 'domain' => 'Domain', + 'single_user_mode' => 'Single user mode', + + // import + 'import_file' => 'Import file', + 'configuration_file' => 'Configuration file', + 'import_file_type' => 'Import file type', + 'csv_comma' => 'A comma (,)', + 'csv_semicolon' => 'A semicolon (;)', + 'csv_tab' => 'A tab (invisible)', + 'csv_delimiter' => 'CSV field delimiter', + 'csv_import_account' => 'Default import account', + 'csv_config' => 'CSV import configuration', + + + 'due_date' => 'Due date', + 'payment_date' => 'Payment date', + 'invoice_date' => 'Invoice date', + 'internal_reference' => 'Internal reference', +]; diff --git a/resources/lang/hr_HR/help.php b/resources/lang/hr_HR/help.php new file mode 100644 index 0000000000..5198e5510f --- /dev/null +++ b/resources/lang/hr_HR/help.php @@ -0,0 +1,33 @@ + 'Welcome to Firefly III', + 'main-content-text' => 'Do yourself a favor and follow this short guide to make sure you know your way around.', + 'sidebar-toggle-title' => 'Sidebar to create stuff', + 'sidebar-toggle-text' => 'Hidden under the plus icon are all the buttons to create new stuff. Accounts, transactions, everything!', + 'account-menu-title' => 'All your accounts', + 'account-menu-text' => 'Here you can find all the accounts you\'ve made.', + 'budget-menu-title' => 'Budgets', + 'budget-menu-text' => 'Use this page to organise your finances and limit spending.', + 'report-menu-title' => 'Reports', + 'report-menu-text' => 'Check this out when you want a solid overview of your finances.', + 'transaction-menu-title' => 'Transactions', + 'transaction-menu-text' => 'All transactions you\'ve created can be found here.', + 'option-menu-title' => 'Options', + 'option-menu-text' => 'This is pretty self-explanatory.', + 'main-content-end-title' => 'The end!', + 'main-content-end-text' => 'Remember that every page has a small question mark at the right top. Click it to get help about the page you\'re on.', + 'index' => 'index', + 'home' => 'home', +]; diff --git a/resources/lang/hr_HR/list.php b/resources/lang/hr_HR/list.php new file mode 100644 index 0000000000..1892c99f76 --- /dev/null +++ b/resources/lang/hr_HR/list.php @@ -0,0 +1,74 @@ + 'Buttons', + 'icon' => 'Icon', + 'create_date' => 'Created at', + 'update_date' => 'Updated at', + 'balance_before' => 'Balance before', + 'balance_after' => 'Balance after', + 'name' => 'Name', + 'role' => 'Role', + 'currentBalance' => 'Current balance', + 'active' => 'Is active?', + 'lastActivity' => 'Last activity', + 'balanceDiff' => 'Balance difference between :start and :end', + 'matchedOn' => 'Matched on', + 'matchesOn' => 'Matched on', + 'account_type' => 'Account type', + 'new_balance' => 'New balance', + 'account' => 'Account', + 'matchingAmount' => 'Amount', + 'lastMatch' => 'Last match', + 'split_number' => 'Split #', + 'destination' => 'Destination', + 'source' => 'Source', + 'expectedMatch' => 'Expected match', + 'automatch' => 'Auto match?', + 'repeat_freq' => 'Repeats', + 'description' => 'Description', + 'amount' => 'Amount', + 'internal_reference' => 'Internal reference', + 'date' => 'Date', + 'interest_date' => 'Interest date', + 'book_date' => 'Book date', + 'process_date' => 'Processing date', + 'due_date' => 'Due date', + 'payment_date' => 'Payment date', + 'invoice_date' => 'Invoice date', + 'interal_reference' => 'Internal reference', + 'notes' => 'Notes', + 'from' => 'From', + 'piggy_bank' => 'Piggy bank', + 'to' => 'To', + 'budget' => 'Budget', + 'category' => 'Category', + 'bill' => 'Bill', + 'withdrawal' => 'Withdrawal', + 'deposit' => 'Deposit', + 'transfer' => 'Transfer', + 'type' => 'Type', + 'completed' => 'Completed', + 'iban' => 'IBAN', + 'paid_current_period' => 'Paid this period', + 'email' => 'Email', + 'registered_at' => 'Registered at', + 'is_activated' => 'Is activated', + 'is_blocked' => 'Is blocked', + 'is_admin' => 'Is admin', + 'has_two_factor' => 'Has 2FA', + 'confirmed_from' => 'Confirmed from', + 'registered_from' => 'Registered from', + 'blocked_code' => 'Block code', + 'domain' => 'Domain', + 'registration_attempts' => 'Registration attempts', +]; diff --git a/resources/lang/hr_HR/pagination.php b/resources/lang/hr_HR/pagination.php new file mode 100644 index 0000000000..0d6df7e178 --- /dev/null +++ b/resources/lang/hr_HR/pagination.php @@ -0,0 +1,17 @@ + '« Prethodna', + 'next' => 'Sljedeća »', + +]; diff --git a/resources/lang/hr_HR/passwords.php b/resources/lang/hr_HR/passwords.php new file mode 100644 index 0000000000..93f1918c4e --- /dev/null +++ b/resources/lang/hr_HR/passwords.php @@ -0,0 +1,19 @@ + 'Passwords must be at least six characters and match the confirmation.', + 'user' => 'Ne možemo naći korisnika s tom e-mail adresom.', + 'token' => 'Token za promjenu lozinke je nevažeći.', + 'sent' => 'Na e-mail smo ti poslali poveznicu za promjenu lozinke!', + 'reset' => 'Tvoja lozinka je promijenjena!', + 'blocked' => 'Lijep pokušaj.', +]; diff --git a/resources/lang/hr_HR/validation.php b/resources/lang/hr_HR/validation.php new file mode 100644 index 0000000000..030e6a72c5 --- /dev/null +++ b/resources/lang/hr_HR/validation.php @@ -0,0 +1,87 @@ + 'This is not a valid IBAN.', + 'unique_account_number_for_user' => 'It looks like this account number is already in use.', + 'rule_trigger_value' => 'This value is invalid for the selected trigger.', + 'rule_action_value' => 'This value is invalid for the selected action.', + 'invalid_domain' => 'Due to security constraints, you cannot register from this domain.', + 'file_already_attached' => 'Uploaded file ":name" is already attached to this object.', + 'file_attached' => 'Succesfully uploaded file ":name".', + 'file_invalid_mime' => 'File ":name" is of type ":mime" which is not accepted as a new upload.', + 'file_too_large' => 'File ":name" is too large.', + 'belongs_to_user' => 'The value of :attribute is unknown', + 'accepted' => 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'unique_for_user' => 'There already is an entry with this :attribute.', + 'before' => 'The :attribute must be a date before :date.', + 'unique_object_for_user' => 'This name is already in use', + 'unique_account_for_user' => 'This account name is already in use', + 'between.numeric' => 'The :attribute must be between :min and :max.', + 'between.file' => 'The :attribute must be between :min and :max kilobytes.', + 'between.string' => 'The :attribute must be between :min and :max characters.', + 'between.array' => 'The :attribute must have between :min and :max items.', + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'email' => 'The :attribute must be a valid email address.', + 'filled' => 'The :attribute field is required.', + 'exists' => 'The selected :attribute is invalid.', + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'json' => 'The :attribute must be a valid JSON string.', + 'max.numeric' => 'The :attribute may not be greater than :max.', + 'max.file' => 'The :attribute may not be greater than :max kilobytes.', + 'max.string' => 'The :attribute may not be greater than :max characters.', + 'max.array' => 'The :attribute may not have more than :max items.', + 'mimes' => 'The :attribute must be a file of type: :values.', + 'min.numeric' => 'The :attribute must be at least :min.', + 'min.file' => 'The :attribute must be at least :min kilobytes.', + 'min.string' => 'The :attribute must be at least :min characters.', + 'min.array' => 'The :attribute must have at least :min items.', + 'not_in' => 'The selected :attribute is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute and :other must match.', + 'size.numeric' => 'The :attribute must be :size.', + 'size.file' => 'The :attribute must be :size kilobytes.', + 'size.string' => 'The :attribute must be :size characters.', + 'size.array' => 'The :attribute must contain :size items.', + 'unique' => 'The :attribute has already been taken.', + 'string' => 'The :attribute must be a string.', + 'url' => 'The :attribute format is invalid.', + 'timezone' => 'The :attribute must be a valid zone.', + '2fa_code' => 'The :attribute field is invalid.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'file' => 'The :attribute must be a file.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'present' => 'The :attribute field must be present.', +]; diff --git a/resources/lang/nl_NL/auth.php b/resources/lang/nl_NL/auth.php new file mode 100644 index 0000000000..ea6e4eba7f --- /dev/null +++ b/resources/lang/nl_NL/auth.php @@ -0,0 +1,28 @@ + 'Deze gegevens zijn niet correct.', + 'throttle' => 'Te veel inlogpogingen. Probeer opnieuw in: seconden seconden.', + +]; diff --git a/resources/lang/nl_NL/breadcrumbs.php b/resources/lang/nl_NL/breadcrumbs.php index a25c0630d0..b163e9ed68 100644 --- a/resources/lang/nl_NL/breadcrumbs.php +++ b/resources/lang/nl_NL/breadcrumbs.php @@ -4,36 +4,38 @@ * breadcrumbs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ - 'home' => 'Home', - 'edit_currency' => 'Wijzig valuta ":name"', - 'delete_currency' => 'Verwijder valuta ":name"', - 'newPiggyBank' => 'Nieuw spaarpotje', - 'edit_piggyBank' => 'Wijzig spaarpotje ":name"', - 'preferences' => 'Voorkeuren', - 'profile' => 'Profiel', - 'changePassword' => 'Verander je wachtwoord', - 'bills' => 'Contracten', - 'newBill' => 'Nieuw contract', - 'edit_bill' => 'Wijzig contract ":name"', - 'delete_bill' => 'Verwijder contract ":name"', - 'reports' => 'Overzichten', - 'searchResult' => 'Zoeken naar ":query"', - 'withdrawal_list' => 'Uitgaven', - 'deposit_list' => 'Inkomsten', - 'transfer_list' => 'Overschrijvingen', - 'transfers_list' => 'Overschrijvingen', - 'create_withdrawal' => 'Sla nieuwe uitgave op', - 'create_deposit' => 'Sla nieuwe inkomsten op', - 'create_transfer' => 'Sla nieuwe overschrijving op', - 'edit_journal' => 'Wijzig transactie ":description"', - 'delete_journal' => 'Verwijder transactie ":description"', - 'tags' => 'Tags', - 'createTag' => 'Maak nieuwe tag', - 'edit_tag' => 'Wijzig tag ":tag"', - 'delete_tag' => 'Verwijder tag ":tag"', + 'home' => 'Home', + 'edit_currency' => 'Wijzig valuta ":name"', + 'delete_currency' => 'Verwijder valuta ":name"', + 'newPiggyBank' => 'Nieuw spaarpotje', + 'edit_piggyBank' => 'Wijzig spaarpotje ":name"', + 'preferences' => 'Voorkeuren', + 'profile' => 'Profiel', + 'changePassword' => 'Verander je wachtwoord', + 'bills' => 'Contracten', + 'newBill' => 'Nieuw contract', + 'edit_bill' => 'Wijzig contract ":name"', + 'delete_bill' => 'Verwijder contract ":name"', + 'reports' => 'Overzichten', + 'searchResult' => 'Zoeken naar ":query"', + 'withdrawal_list' => 'Uitgaven', + 'deposit_list' => 'Inkomsten', + 'transfer_list' => 'Overschrijvingen', + 'transfers_list' => 'Overschrijvingen', + 'create_withdrawal' => 'Sla nieuwe uitgave op', + 'create_deposit' => 'Sla nieuwe inkomsten op', + 'create_transfer' => 'Sla nieuwe overschrijving op', + 'edit_journal' => 'Wijzig transactie ":description"', + 'delete_journal' => 'Verwijder transactie ":description"', + 'tags' => 'Tags', + 'createTag' => 'Maak nieuwe tag', + 'edit_tag' => 'Wijzig tag ":tag"', + 'delete_tag' => 'Verwijder tag ":tag"', ]; diff --git a/resources/lang/nl_NL/config.php b/resources/lang/nl_NL/config.php index 2deb526a72..1680ae558a 100644 --- a/resources/lang/nl_NL/config.php +++ b/resources/lang/nl_NL/config.php @@ -3,8 +3,10 @@ * config.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/nl_NL/csv.php b/resources/lang/nl_NL/csv.php index c6bf63ef26..c3a3a7644c 100644 --- a/resources/lang/nl_NL/csv.php +++ b/resources/lang/nl_NL/csv.php @@ -3,8 +3,10 @@ * csv.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index f9cc78c167..500f346ae3 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -3,8 +3,10 @@ * firefly.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -758,11 +760,11 @@ return [ 'split_this_deposit' => 'Splits deze inkomsten', 'split_this_transfer' => 'Splits deze overboeking', 'cannot_edit_multiple_source' => 'Je kan transactie #:id met omschrijving ":description" niet splitsen, want deze bevat meerdere bronrekeningen.', - 'cannot_edit_multiple_dest' => 'Je kan transactie #:id met omschrijving ":description" niet splitsen, want deze bevat meerdere doelrekeningen.', + 'cannot_edit_multiple_dest' => 'Je kan transactie #:id met omschrijving ":description" niet wijzigen, want deze bevat meerdere doelrekeningen.', 'no_edit_multiple_left' => 'Je hebt geen geldige transacties geselecteerd.', // import - 'configuration_file_help' => 'Als je eerder gegevens in Firefly III hebt geïmporteerd, heb je een configuratiebestand, dat voor jou de instellingen zal doen.', + 'configuration_file_help' => 'Als je eerder gegevens hebt geïmporteerd in Firefly III, heb je wellicht een configuratiebestand, dat een aantal zaken alvast voor je kan instellen. Voor bepaalde banken hebben andere gebruikers uit de liefde van hun hart het benodigde configuratiebestand gedeeld.', 'import_data_index' => 'Index', 'import_file_type_csv' => 'CSV (kommagescheiden waardes)', 'import_file_type_help' => 'Selecteer het type bestand dat je zal uploaden', @@ -780,7 +782,10 @@ return [ 'import_data' => 'Importeer data', 'import_data_full' => 'Gegevens importeren in Firefly III', 'import' => 'Import', - 'import_intro_text' => 'Welkom bij de import-routine van Firefly III. Deze pagina\'s helpen je data in Firefly III te importeren. Om dat te doen, download of exporteer je transacties uit andere systemen, en upload ze hier. In de volgende stappen help je Firefly met het bepalen wat de inhoud is van de bestanden die je upload, en hoe er mee om te gaan. Selecteer een bestand, en lees alle instructies zorgvuldig.', + 'import_intro_what_it_does' => 'Vanaf deze pagina kan je gegevens importeren in Firefly III. Exporteer ze eerst vanuit je internetbankieren of financiële software. Upload dat bestandje hier. Firefly III zal de transacties omzetten. Je zult wel wat hints moeten geven. Selecteer alsjeblieft een bestand en volg de instructies.', + 'import_intro_import_conf_title' => 'Importconfiguratie', + 'import_intro_beta_warning' => 'Waarschuwing', + 'import_intro_import_conf_text' => 'Zoals je wel zult ontdekken heeft de import-routine veel opties. Deze opties verschillen voornamelijk per bank (of softwarepakket). Grote kans dat iemand anders je al voor was en zijn of haar configuratiebestand heeft gedeeld. Kijk vlug op de configuratiebestand-wiki of er al een bestand is voor jouw bank (of softwarepakket). Als die er is, download dit bestand dan en selecteer deze. Het kan veel tijd schelen!', 'import_file_help' => 'Selecteer je bestand', 'import_status_settings_complete' => 'De import is klaar om te beginnen.', 'import_status_import_complete' => 'Het importeren is voltooid.', @@ -796,8 +801,11 @@ return [ 'import_double' => 'Rij: #:row: Deze rij is al geimporteerd en is opgeslagen als :description.', 'import_finished_all' => 'Het importeren is voltooid. Hieronder zie je de resultaten.', 'import_with_key' => 'Import met code \':key\'', - 'import_finished_report' => 'Het importeren is voltooid. Kijk naar eventuele fouten in het blok hierboven. Alle geimporteerde transacties hebben een tag, en die kan je hieronder bekijken. ', - 'import_finished_link' => 'De geimporteerde transacties kan je vinden onder tag :tag.', + + 'import_share_configuration' => 'Overweeg om je configuratiebestand te downloaden en te delen op de configuratiebestand-wiki. Hiermee kan je het andere Firefly III gebruikers weer makkelijker maken.', + + 'import_finished_report' => 'Het importeren is voltooid. Kijk naar eventuele fouten in het blok hierboven. Alle geimporteerde transacties hebben een tag, en die kan je hieronder bekijken. ', + 'import_finished_link' => 'De geimporteerde transacties kan je vinden onder tag :tag.', ]; diff --git a/resources/lang/nl_NL/form.php b/resources/lang/nl_NL/form.php index f67804bbd3..156f38e432 100644 --- a/resources/lang/nl_NL/form.php +++ b/resources/lang/nl_NL/form.php @@ -3,8 +3,10 @@ * form.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/nl_NL/help.php b/resources/lang/nl_NL/help.php index 76184e52fe..b11148cf0b 100644 --- a/resources/lang/nl_NL/help.php +++ b/resources/lang/nl_NL/help.php @@ -3,83 +3,31 @@ * help.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // tour! - 'main-content-title' => 'Welkom bij Firefly III', - 'main-content-text' => 'Doe jezelf een lol en volg deze korte tour. Je weet dan precies hoe alles werkt.', - 'sidebar-toggle-title' => 'Sidebar om nieuwe dingen te maken', - 'sidebar-toggle-text' => 'Verstopt onder het plusje vind je de knoppen die je nodig hebt om nieuwe dingen te maken.', - 'account-menu-title' => 'Alle rekeningen', - 'account-menu-text' => 'Hier vind je al je rekeningen.', - 'budget-menu-title' => 'Budgetten', - 'budget-menu-text' => 'Gebruik deze pagina voor budgetten.', - 'report-menu-title' => 'Overzichten', - 'report-menu-text' => 'Bekijk dit als je een goed overzicht van je financiën wil.', - 'transaction-menu-title' => 'Transacties', - 'transaction-menu-text' => 'Hier vind je al je bijschrijvingen, afschrijvingen en overboekingen.', - 'option-menu-title' => 'Opties', - 'option-menu-text' => 'Hier vind je alle opties.', - 'main-content-end-title' => 'Einde!', - 'main-content-end-text' => 'Elke pagina heeft een vraagtekentje rechtsboven. Gebruik deze voor meer hulp. Veel plezier!', - 'index' => 'index', - 'home' => 'home', - 'accounts-index' => 'rekeningen', - 'accounts-create' => 'maak nieuwe rekening', - 'accounts-edit' => 'rekening wijzigen', - 'accounts-delete' => 'rekening verwijderen', - 'accounts-show' => 'rekening bekijken', - 'attachments-edit' => 'wijzig bijlage', - 'attachments-delete' => 'verwijder bijlage', - 'attachments-show' => 'bekijk bijlage', - 'attachments-preview' => 'bekijik bijlage', - 'bills-index' => 'contracten', - 'bills-create' => 'maak contract', - 'bills-edit' => 'wijzig contract', - 'bills-delete' => 'verwijder contract', - 'bills-show' => 'bekijk contract', - 'budgets-index' => 'budgetten', - 'budgets-create' => 'maak een nieuw budget', - 'budgets-edit' => 'wijzig een budget', - 'budgets-delete' => 'verwijder een budget', - 'budgets-show' => 'bekijk een budget', - 'budgets-noBudget' => 'transacties zonder budget', - 'categories-index' => 'categorieën', - 'categories-create' => 'maak nieuwe categorie', - 'categories-edit' => 'wijzig een categorie', - 'categories-delete' => 'verwijder een categorie', - 'categories-show' => 'bekijk een categorie', - 'categories-show-date' => 'bekijk categorie', - 'categories-noCategory' => 'transacties zonder categorie', - 'currency-index' => 'valuta\'s', - 'currency-create' => 'maak een nieuwe munteenheid', - 'currency-edit' => 'wijzig een munteenheid', - 'currency-delete' => 'verwijder een munteenheid', - 'new-user-index' => 'nieuwe gebruiker', - 'piggy-banks-index' => 'spaarpotjes', - 'piggy-banks-create' => 'maak nieuw spaarpotje', - 'piggy-banks-edit' => 'wijzig spaarpotje', - 'piggy-banks-delete' => 'verwijder spaarpotje', - 'piggy-banks-show' => 'bekijk spaarportje', - 'preferences' => 'voorkeuren', - 'profile' => 'profiel', - 'profile-change-password' => 'verander je wachtwoord', - 'profile-delete-account' => 'verwijder je account', - 'reports-index' => 'rapporten', - 'reports-report' => 'rapport', - 'search' => 'zoeken', - 'tags-index' => 'tags', - 'tags-create' => 'maak nieuwe tag', - 'tags-show' => 'bekijk tag', - 'tags-edit' => 'wijzig tag', - 'tags-delete' => 'verwijder tag', - 'transactions-index' => 'transacties', - 'transactions-create' => 'maak nieuwe transactie', - 'transactions-edit' => 'wijzig transactie', - 'transactions-delete' => 'verwijder transactie', - 'transactions-show' => 'bekijk transactie', + 'main-content-title' => 'Welkom bij Firefly III', + 'main-content-text' => 'Doe jezelf een lol en volg deze korte tour. Je weet dan precies hoe alles werkt.', + 'sidebar-toggle-title' => 'Sidebar om nieuwe dingen te maken', + 'sidebar-toggle-text' => 'Verstopt onder het plusje vind je de knoppen die je nodig hebt om nieuwe dingen te maken.', + 'account-menu-title' => 'Alle rekeningen', + 'account-menu-text' => 'Hier vind je al je rekeningen.', + 'budget-menu-title' => 'Budgetten', + 'budget-menu-text' => 'Gebruik deze pagina voor budgetten.', + 'report-menu-title' => 'Overzichten', + 'report-menu-text' => 'Bekijk dit als je een goed overzicht van je financiën wil.', + 'transaction-menu-title' => 'Transacties', + 'transaction-menu-text' => 'Hier vind je al je bijschrijvingen, afschrijvingen en overboekingen.', + 'option-menu-title' => 'Opties', + 'option-menu-text' => 'Hier vind je alle opties.', + 'main-content-end-title' => 'Einde!', + 'main-content-end-text' => 'Elke pagina heeft een vraagtekentje rechtsboven. Gebruik deze voor meer hulp. Veel plezier!', + 'index' => 'index', + 'home' => 'home', ]; diff --git a/resources/lang/nl_NL/list.php b/resources/lang/nl_NL/list.php index c16e8496f9..691779b26b 100644 --- a/resources/lang/nl_NL/list.php +++ b/resources/lang/nl_NL/list.php @@ -3,8 +3,10 @@ * list.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -35,6 +37,7 @@ return [ 'repeat_freq' => 'Herhaling', 'description' => 'Omschrijving', 'amount' => 'Bedrag', + 'internal_reference' => 'Interne referentie', 'date' => 'Datum', 'interest_date' => 'Rentedatum', 'book_date' => 'Boekdatum', diff --git a/resources/lang/nl_NL/pagination.php b/resources/lang/nl_NL/pagination.php index 7acb5cc2c5..df407a1708 100644 --- a/resources/lang/nl_NL/pagination.php +++ b/resources/lang/nl_NL/pagination.php @@ -3,11 +3,15 @@ * pagination.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ + 'previous' => '« Vorige', 'next' => 'Volgende »', + ]; diff --git a/resources/lang/nl_NL/passwords.php b/resources/lang/nl_NL/passwords.php index f3b00be726..0e6bcd3176 100644 --- a/resources/lang/nl_NL/passwords.php +++ b/resources/lang/nl_NL/passwords.php @@ -3,8 +3,10 @@ * passwords.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/nl_NL/validation.php b/resources/lang/nl_NL/validation.php index 075279714f..7e18e7d853 100644 --- a/resources/lang/nl_NL/validation.php +++ b/resources/lang/nl_NL/validation.php @@ -3,8 +3,10 @@ * validation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -77,4 +79,9 @@ return [ 'url' => ':attribute is geen geldige URL.', 'timezone' => 'Het :attribute moet een geldige zone zijn.', '2fa_code' => 'De waarde in het :attribute-veld is niet geldig.', + 'dimensions' => 'Het :attribute heeft het verkeerde afbeeldingsformaat.', + 'distinct' => 'Het :attribute veld heeft een dubbele waarde.', + 'file' => ':attribute moet een bestand zijn.', + 'in_array' => 'Het :attribute veld bestaat niet in :other.', + 'present' => 'Het :attribute veld moet aanwezig zijn.', ]; diff --git a/resources/lang/pt_BR/auth.php b/resources/lang/pt_BR/auth.php new file mode 100644 index 0000000000..7319a9d7b8 --- /dev/null +++ b/resources/lang/pt_BR/auth.php @@ -0,0 +1,28 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/resources/lang/pt_BR/breadcrumbs.php b/resources/lang/pt_BR/breadcrumbs.php index d7b9910d9c..b252bb80d1 100644 --- a/resources/lang/pt_BR/breadcrumbs.php +++ b/resources/lang/pt_BR/breadcrumbs.php @@ -4,36 +4,38 @@ * breadcrumbs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ - 'home' => 'Início', - 'edit_currency' => 'Edit currency ":name"', - 'delete_currency' => 'Delete currency ":name"', - 'newPiggyBank' => 'Criar um novo cofrinho', - 'edit_piggyBank' => 'Editar cofrinho ":name"', - 'preferences' => 'Preferências', - 'profile' => 'Perfil', - 'changePassword' => 'Alterar sua senha', - 'bills' => 'Faturas', - 'newBill' => 'Nova fatura', - 'edit_bill' => 'Editar fatura ":name"', - 'delete_bill' => 'Apagar fatura ":name"', - 'reports' => 'Relatórios', - 'searchResult' => 'Pesquisa por ":query"', - 'withdrawal_list' => 'Despesas', - 'deposit_list' => 'Receitas, renda e depósitos', - 'transfer_list' => 'Transferências', - 'transfers_list' => 'Transferências', - 'create_withdrawal' => 'Criar uma nova retirada', - 'create_deposit' => 'Criar um novo depósito', - 'create_transfer' => 'Criar nova transferência', - 'edit_journal' => 'Editar transação ":description"', - 'delete_journal' => 'Apagar transação ":description"', - 'tags' => 'Etiquetas', - 'createTag' => 'Criar nova etiqueta', - 'edit_tag' => 'Editar etiqueta ":tag"', - 'delete_tag' => 'Apagar etiqueta ":tag"', + 'home' => 'Início', + 'edit_currency' => 'Edit currency ":name"', + 'delete_currency' => 'Delete currency ":name"', + 'newPiggyBank' => 'Criar um novo cofrinho', + 'edit_piggyBank' => 'Editar cofrinho ":name"', + 'preferences' => 'Preferências', + 'profile' => 'Perfil', + 'changePassword' => 'Alterar sua senha', + 'bills' => 'Faturas', + 'newBill' => 'Nova fatura', + 'edit_bill' => 'Editar fatura ":name"', + 'delete_bill' => 'Apagar fatura ":name"', + 'reports' => 'Relatórios', + 'searchResult' => 'Pesquisa por ":query"', + 'withdrawal_list' => 'Despesas', + 'deposit_list' => 'Receitas, renda e depósitos', + 'transfer_list' => 'Transferências', + 'transfers_list' => 'Transferências', + 'create_withdrawal' => 'Criar uma nova retirada', + 'create_deposit' => 'Criar um novo depósito', + 'create_transfer' => 'Criar nova transferência', + 'edit_journal' => 'Editar transação ":description"', + 'delete_journal' => 'Apagar transação ":description"', + 'tags' => 'Etiquetas', + 'createTag' => 'Criar nova etiqueta', + 'edit_tag' => 'Editar etiqueta ":tag"', + 'delete_tag' => 'Apagar etiqueta ":tag"', ]; diff --git a/resources/lang/pt_BR/config.php b/resources/lang/pt_BR/config.php index 808415797c..3a6582b8d2 100644 --- a/resources/lang/pt_BR/config.php +++ b/resources/lang/pt_BR/config.php @@ -3,8 +3,10 @@ * config.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/pt_BR/csv.php b/resources/lang/pt_BR/csv.php index 2cafbca8b2..9b8edc1604 100644 --- a/resources/lang/pt_BR/csv.php +++ b/resources/lang/pt_BR/csv.php @@ -3,8 +3,10 @@ * csv.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index c07f10ae89..9c8bb17c10 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -3,8 +3,10 @@ * firefly.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -762,7 +764,7 @@ return [ 'no_edit_multiple_left' => 'Você não selecionou nenhuma transação válida para editar.', // import - 'configuration_file_help' => 'Se você importou anteriormente dados para Firefly III, você pode ter um arquivo de configuração, que pre-definirá valores de configuração para você.', + 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', 'import_data_index' => 'Index', 'import_file_type_csv' => 'CSV (valores separados por vírgula)', 'import_file_type_help' => 'Selecione o tipo de arquivo que você fará o upload', @@ -780,7 +782,10 @@ return [ 'import_data' => 'Importar dados', 'import_data_full' => 'Importar dados para o Firefly III', 'import' => 'Importar', - 'import_intro_text' => 'Bem-vindo à rotina de importação de dados do Firefly III. Neste momento, essa rotina pode ajudá-lo a importar arquivos para o Firefly. Para fazer isso, você deve baixar ou exportar suas transações de outros sistemas ou software e enviá-los aqui. As próximas etapas permitirá que você ajude Firefly III determine qual é o conteúdo do seu arquivo e como lidar com ele. Por favor, selecione um arquivo e leia todas as instruções cuidadosamente.', + 'import_intro_what_it_does' => 'This page allows you to import data into Firefly III. To do so, export data from your bank, or from another financial management system. Upload that file here. Firefly III will convert the data. You need to give it some directions. Please select a file and follow the instructions.', + 'import_intro_import_conf_title' => 'Import "configuration"', + 'import_intro_beta_warning' => 'Warning', + 'import_intro_import_conf_text' => 'As you will discover over the next few pages, this import routine has a lot of settings. These settings are mainly dependent on the bank (or financial management software) your file comes from. There is a good chance somebody else already imported such a file and has shared their configuration file. Please visit the import configuration center to see if there already is a configuration available for your bank or system. If there is, you should download this configuration file and upload it here as well. It will save you a lot of time!', 'import_file_help' => 'Selecione seu arquivo', 'import_status_settings_complete' => 'The import is ready to start.', 'import_status_import_complete' => 'The import has completed.', @@ -796,8 +801,11 @@ return [ 'import_double' => 'Row #:row: This row has been imported before, and is stored in :description.', 'import_finished_all' => 'The import has finished. Please check out the results below.', 'import_with_key' => 'Import with key \':key\'', - 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', - 'import_finished_link' => 'The transactions imported can be found in tag :tag.', + + 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', + + 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', + 'import_finished_link' => 'The transactions imported can be found in tag :tag.', ]; diff --git a/resources/lang/pt_BR/form.php b/resources/lang/pt_BR/form.php index 0c73a4a8b6..12b979cf32 100644 --- a/resources/lang/pt_BR/form.php +++ b/resources/lang/pt_BR/form.php @@ -3,8 +3,10 @@ * form.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/pt_BR/help.php b/resources/lang/pt_BR/help.php index c0ce893390..877259b46b 100644 --- a/resources/lang/pt_BR/help.php +++ b/resources/lang/pt_BR/help.php @@ -3,83 +3,31 @@ * help.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // tour! - 'main-content-title' => 'Bem Vindo ao Firefly III', - 'main-content-text' => 'Faça um favor a você mesmo e siga este pequeno guia para certificar-se de que sabe o caminho de volta.', - 'sidebar-toggle-title' => 'Barra lateral para criar coisas', - 'sidebar-toggle-text' => 'Escondido sob o ícone de adição são todos os botões para criar coisas novas. Contas, transações, tudo!', - 'account-menu-title' => 'Todas suas contas', - 'account-menu-text' => 'Aqui você pode encontrar todas as contas que você fez.', - 'budget-menu-title' => 'Orçamentos', - 'budget-menu-text' => 'Use esta página para organizar suas finanças e limitar as despesas.', - 'report-menu-title' => 'Relatórios', - 'report-menu-text' => 'Retire isso quando você quiser uma visão geral de suas finanças.', - 'transaction-menu-title' => 'Transações', - 'transaction-menu-text' => 'Todas as transações que você criou podem ser encontradas aqui.', - 'option-menu-title' => 'Opções', - 'option-menu-text' => 'Isto é bastante auto-explicativo.', - 'main-content-end-title' => 'Fim!', - 'main-content-end-text' => 'Lembre-se que cada página tem um pequeno ponto de interrogação na parte superior direita. Clique nele para obter ajuda sobre a página que você está.', - 'index' => 'índice', - 'home' => 'casa', - 'accounts-index' => 'Contas', - 'accounts-create' => 'Criando Contas', - 'accounts-edit' => 'Editando Contas', - 'accounts-delete' => 'Apagando Contas', - 'accounts-show' => 'Detalhes de Contas', - 'attachments-edit' => 'Editando Anexos', - 'attachments-delete' => 'Apagando Anexos', - 'attachments-show' => 'Detalhes de Anexos', - 'attachments-preview' => 'Previsualisação de Anexos', - 'bills-index' => 'Faturas', - 'bills-create' => 'Criando Faturas', - 'bills-edit' => 'Editando Faturas', - 'bills-delete' => 'Apagando Faturas', - 'bills-show' => 'Detalhes da Fatura', - 'budgets-index' => 'Orçamentos', - 'budgets-create' => 'Criando Orçamentos', - 'budgets-edit' => 'Editando Orçamentos', - 'budgets-delete' => 'Apagando Orçamentos', - 'budgets-show' => 'Detalhes de Orçamentos', - 'budgets-noBudget' => 'Sem Orçamentos', - 'categories-index' => 'Categorias', - 'categories-create' => 'Criando Categorias', - 'categories-edit' => 'Editando Categorias', - 'categories-delete' => 'Apagando Categorias', - 'categories-show' => 'Detalhes de Categorias', - 'categories-show-date' => 'Detalhes da Categoria por Data', - 'categories-noCategory' => 'Sem Categorias', - 'currency-index' => 'Moedas', - 'currency-create' => 'Criando Moedas', - 'currency-edit' => 'Editando Moedas', - 'currency-delete' => 'Apagando Moedas', - 'new-user-index' => 'Novo Usuário', - 'piggy-banks-index' => 'Cofrinhos', - 'piggy-banks-create' => 'Criando Cofrinhos', - 'piggy-banks-edit' => 'Editando Cofrinhos', - 'piggy-banks-delete' => 'Apagando Cofrinhos', - 'piggy-banks-show' => 'Detalhes do Cofrinho', - 'preferences' => 'preferências', - 'profile' => 'perfil', - 'profile-change-password' => 'Alterando Senha', - 'profile-delete-account' => 'Apagando Perfil', - 'reports-index' => 'Relatórios', - 'reports-report' => 'Relatório', - 'search' => 'pesquisa', - 'tags-index' => 'Tags', - 'tags-create' => 'Criando Tags', - 'tags-show' => 'Detalhes da Tag', - 'tags-edit' => 'Editando Tags', - 'tags-delete' => 'Apagando Tags', - 'transactions-index' => 'Transações', - 'transactions-create' => 'Criando Transações', - 'transactions-edit' => 'Editando Transações', - 'transactions-delete' => 'Apagando Transações', - 'transactions-show' => 'Detalhes da Transação', + 'main-content-title' => 'Bem Vindo ao Firefly III', + 'main-content-text' => 'Faça um favor a você mesmo e siga este pequeno guia para certificar-se de que sabe o caminho de volta.', + 'sidebar-toggle-title' => 'Barra lateral para criar coisas', + 'sidebar-toggle-text' => 'Escondido sob o ícone de adição são todos os botões para criar coisas novas. Contas, transações, tudo!', + 'account-menu-title' => 'Todas suas contas', + 'account-menu-text' => 'Aqui você pode encontrar todas as contas que você fez.', + 'budget-menu-title' => 'Orçamentos', + 'budget-menu-text' => 'Use esta página para organizar suas finanças e limitar as despesas.', + 'report-menu-title' => 'Relatórios', + 'report-menu-text' => 'Retire isso quando você quiser uma visão geral de suas finanças.', + 'transaction-menu-title' => 'Transações', + 'transaction-menu-text' => 'Todas as transações que você criou podem ser encontradas aqui.', + 'option-menu-title' => 'Opções', + 'option-menu-text' => 'Isto é bastante auto-explicativo.', + 'main-content-end-title' => 'Fim!', + 'main-content-end-text' => 'Lembre-se que cada página tem um pequeno ponto de interrogação na parte superior direita. Clique nele para obter ajuda sobre a página que você está.', + 'index' => 'índice', + 'home' => 'casa', ]; diff --git a/resources/lang/pt_BR/list.php b/resources/lang/pt_BR/list.php index 60b5854638..365efa1809 100644 --- a/resources/lang/pt_BR/list.php +++ b/resources/lang/pt_BR/list.php @@ -3,8 +3,10 @@ * list.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -35,6 +37,7 @@ return [ 'repeat_freq' => 'Repetições', 'description' => 'Descrição', 'amount' => 'Total', + 'internal_reference' => 'Internal reference', 'date' => 'Data', 'interest_date' => 'Data de interesse', 'book_date' => 'Data reserva', diff --git a/resources/lang/pt_BR/pagination.php b/resources/lang/pt_BR/pagination.php index 76c9cc0063..7849521349 100644 --- a/resources/lang/pt_BR/pagination.php +++ b/resources/lang/pt_BR/pagination.php @@ -3,11 +3,15 @@ * pagination.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ + 'previous' => '« Anterior', 'next' => 'Próximo »', + ]; diff --git a/resources/lang/pt_BR/passwords.php b/resources/lang/pt_BR/passwords.php index f630caad31..24863232a1 100644 --- a/resources/lang/pt_BR/passwords.php +++ b/resources/lang/pt_BR/passwords.php @@ -3,8 +3,10 @@ * passwords.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/pt_BR/validation.php b/resources/lang/pt_BR/validation.php index 2817960330..1a1685b89f 100644 --- a/resources/lang/pt_BR/validation.php +++ b/resources/lang/pt_BR/validation.php @@ -3,8 +3,10 @@ * validation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -77,4 +79,9 @@ return [ 'url' => 'O formato do URL indicado para o campo :attribute é inválido.', 'timezone' => 'O campo :attribute deverá ter um fuso horário válido.', '2fa_code' => 'O campo :attribute é inválido.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'file' => 'The :attribute must be a file.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'present' => 'The :attribute field must be present.', ]; diff --git a/resources/lang/zh-HK/auth.php b/resources/lang/zh-HK/auth.php new file mode 100644 index 0000000000..7319a9d7b8 --- /dev/null +++ b/resources/lang/zh-HK/auth.php @@ -0,0 +1,28 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/resources/lang/zh-HK/breadcrumbs.php b/resources/lang/zh-HK/breadcrumbs.php index bc151fba45..54cb260179 100644 --- a/resources/lang/zh-HK/breadcrumbs.php +++ b/resources/lang/zh-HK/breadcrumbs.php @@ -4,36 +4,38 @@ * breadcrumbs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ - 'home' => 'Home', - 'edit_currency' => 'Edit currency ":name"', - 'delete_currency' => 'Delete currency ":name"', - 'newPiggyBank' => 'Create a new piggy bank', - 'edit_piggyBank' => 'Edit piggy bank ":name"', - 'preferences' => 'Preferences', - 'profile' => 'Profile', - 'changePassword' => 'Change your password', - 'bills' => 'Bills', - 'newBill' => 'New bill', - 'edit_bill' => 'Edit bill ":name"', - 'delete_bill' => 'Delete bill ":name"', - 'reports' => 'Reports', - 'searchResult' => 'Search for ":query"', - 'withdrawal_list' => 'Expenses', - 'deposit_list' => 'Revenue, income and deposits', - 'transfer_list' => 'Transfers', - 'transfers_list' => 'Transfers', - 'create_withdrawal' => 'Create new withdrawal', - 'create_deposit' => 'Create new deposit', - 'create_transfer' => 'Create new transfer', - 'edit_journal' => 'Edit transaction ":description"', - 'delete_journal' => 'Delete transaction ":description"', - 'tags' => 'Tags', - 'createTag' => 'Create new tag', - 'edit_tag' => 'Edit tag ":tag"', - 'delete_tag' => 'Delete tag ":tag"', + 'home' => 'Home', + 'edit_currency' => 'Edit currency ":name"', + 'delete_currency' => 'Delete currency ":name"', + 'newPiggyBank' => 'Create a new piggy bank', + 'edit_piggyBank' => 'Edit piggy bank ":name"', + 'preferences' => 'Preferences', + 'profile' => 'Profile', + 'changePassword' => 'Change your password', + 'bills' => 'Bills', + 'newBill' => 'New bill', + 'edit_bill' => 'Edit bill ":name"', + 'delete_bill' => 'Delete bill ":name"', + 'reports' => 'Reports', + 'searchResult' => 'Search for ":query"', + 'withdrawal_list' => 'Expenses', + 'deposit_list' => 'Revenue, income and deposits', + 'transfer_list' => 'Transfers', + 'transfers_list' => 'Transfers', + 'create_withdrawal' => 'Create new withdrawal', + 'create_deposit' => 'Create new deposit', + 'create_transfer' => 'Create new transfer', + 'edit_journal' => 'Edit transaction ":description"', + 'delete_journal' => 'Delete transaction ":description"', + 'tags' => 'Tags', + 'createTag' => 'Create new tag', + 'edit_tag' => 'Edit tag ":tag"', + 'delete_tag' => 'Delete tag ":tag"', ]; diff --git a/resources/lang/zh-HK/config.php b/resources/lang/zh-HK/config.php index b8ed029a46..0c23d3f6cd 100644 --- a/resources/lang/zh-HK/config.php +++ b/resources/lang/zh-HK/config.php @@ -3,8 +3,10 @@ * config.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/zh-HK/csv.php b/resources/lang/zh-HK/csv.php index 6287810764..fe83034aa2 100644 --- a/resources/lang/zh-HK/csv.php +++ b/resources/lang/zh-HK/csv.php @@ -3,8 +3,10 @@ * csv.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); diff --git a/resources/lang/zh-HK/firefly.php b/resources/lang/zh-HK/firefly.php index 56d965ede9..4530d8b6cd 100644 --- a/resources/lang/zh-HK/firefly.php +++ b/resources/lang/zh-HK/firefly.php @@ -3,8 +3,10 @@ * firefly.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -762,7 +764,7 @@ return [ 'no_edit_multiple_left' => 'You have selected no valid transactions to edit.', // import - 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you.', + 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', 'import_data_index' => 'Index', 'import_file_type_csv' => 'CSV (comma separated values)', 'import_file_type_help' => 'Select the type of file you will upload', @@ -780,7 +782,10 @@ return [ 'import_data' => 'Import data', 'import_data_full' => 'Import data into Firefly III', 'import' => 'Import', - 'import_intro_text' => 'Welcome to the Firefly III data import routine. At the moment, this routine can help you import files into Firefly. To do so, you must download or export transactions from other systems or software, and upload them here. The next steps will let you help Firefly III determin what the content is of your file, and how to handle it. Please select a file, and read all instructions carefully.', + 'import_intro_what_it_does' => 'This page allows you to import data into Firefly III. To do so, export data from your bank, or from another financial management system. Upload that file here. Firefly III will convert the data. You need to give it some directions. Please select a file and follow the instructions.', + 'import_intro_import_conf_title' => 'Import "configuration"', + 'import_intro_beta_warning' => 'Warning', + 'import_intro_import_conf_text' => 'As you will discover over the next few pages, this import routine has a lot of settings. These settings are mainly dependent on the bank (or financial management software) your file comes from. There is a good chance somebody else already imported such a file and has shared their configuration file. Please visit the import configuration center to see if there already is a configuration available for your bank or system. If there is, you should download this configuration file and upload it here as well. It will save you a lot of time!', 'import_file_help' => 'Select your file', 'import_status_settings_complete' => 'The import is ready to start.', 'import_status_import_complete' => 'The import has completed.', @@ -796,8 +801,11 @@ return [ 'import_double' => 'Row #:row: This row has been imported before, and is stored in :description.', 'import_finished_all' => 'The import has finished. Please check out the results below.', 'import_with_key' => 'Import with key \':key\'', - 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', - 'import_finished_link' => 'The transactions imported can be found in tag :tag.', + + 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', + + 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', + 'import_finished_link' => 'The transactions imported can be found in tag :tag.', ]; diff --git a/resources/lang/zh-HK/form.php b/resources/lang/zh-HK/form.php index 62c4971ac6..2f7f5ad581 100644 --- a/resources/lang/zh-HK/form.php +++ b/resources/lang/zh-HK/form.php @@ -3,8 +3,10 @@ * form.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/zh-HK/help.php b/resources/lang/zh-HK/help.php index d1fa572177..5198e5510f 100644 --- a/resources/lang/zh-HK/help.php +++ b/resources/lang/zh-HK/help.php @@ -3,83 +3,31 @@ * help.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // tour! - 'main-content-title' => 'Welcome to Firefly III', - 'main-content-text' => 'Do yourself a favor and follow this short guide to make sure you know your way around.', - 'sidebar-toggle-title' => 'Sidebar to create stuff', - 'sidebar-toggle-text' => 'Hidden under the plus icon are all the buttons to create new stuff. Accounts, transactions, everything!', - 'account-menu-title' => 'All your accounts', - 'account-menu-text' => 'Here you can find all the accounts you\'ve made.', - 'budget-menu-title' => 'Budgets', - 'budget-menu-text' => 'Use this page to organise your finances and limit spending.', - 'report-menu-title' => 'Reports', - 'report-menu-text' => 'Check this out when you want a solid overview of your finances.', - 'transaction-menu-title' => 'Transactions', - 'transaction-menu-text' => 'All transactions you\'ve created can be found here.', - 'option-menu-title' => 'Options', - 'option-menu-text' => 'This is pretty self-explanatory.', - 'main-content-end-title' => 'The end!', - 'main-content-end-text' => 'Remember that every page has a small question mark at the right top. Click it to get help about the page you\'re on.', - 'index' => 'index', - 'home' => 'home', - 'accounts-index' => 'accounts.index', - 'accounts-create' => 'accounts.create', - 'accounts-edit' => 'accounts.edit', - 'accounts-delete' => 'accounts.delete', - 'accounts-show' => 'accounts.show', - 'attachments-edit' => 'attachments.edit', - 'attachments-delete' => 'attachments.delete', - 'attachments-show' => 'attachments.show', - 'attachments-preview' => 'attachments.preview', - 'bills-index' => 'bills.index', - 'bills-create' => 'bills.create', - 'bills-edit' => 'bills.edit', - 'bills-delete' => 'bills.delete', - 'bills-show' => 'bills.show', - 'budgets-index' => 'budgets.index', - 'budgets-create' => 'budgets.create', - 'budgets-edit' => 'budgets.edit', - 'budgets-delete' => 'budgets.delete', - 'budgets-show' => 'budgets.show', - 'budgets-noBudget' => 'budgets.noBudget', - 'categories-index' => 'categories.index', - 'categories-create' => 'categories.create', - 'categories-edit' => 'categories.edit', - 'categories-delete' => 'categories.delete', - 'categories-show' => 'categories.show', - 'categories-show-date' => 'categories.show.date', - 'categories-noCategory' => 'categories.noCategory', - 'currency-index' => 'currency.index', - 'currency-create' => 'currency.create', - 'currency-edit' => 'currency.edit', - 'currency-delete' => 'currency.delete', - 'new-user-index' => 'new-user.index', - 'piggy-banks-index' => 'piggy-banks.index', - 'piggy-banks-create' => 'piggy-banks.create', - 'piggy-banks-edit' => 'piggy-banks.edit', - 'piggy-banks-delete' => 'piggy-banks.delete', - 'piggy-banks-show' => 'piggy-banks.show', - 'preferences' => 'preferences', - 'profile' => 'profile', - 'profile-change-password' => 'profile.change-password', - 'profile-delete-account' => 'profile.delete-account', - 'reports-index' => 'reports.index', - 'reports-report' => 'reports.report', - 'search' => 'search', - 'tags-index' => 'tags.index', - 'tags-create' => 'tags.create', - 'tags-show' => 'tags.show', - 'tags-edit' => 'tags.edit', - 'tags-delete' => 'tags.delete', - 'transactions-index' => 'transactions.index', - 'transactions-create' => 'transactions.create', - 'transactions-edit' => 'transactions.edit', - 'transactions-delete' => 'transactions.delete', - 'transactions-show' => 'transactions.show', + 'main-content-title' => 'Welcome to Firefly III', + 'main-content-text' => 'Do yourself a favor and follow this short guide to make sure you know your way around.', + 'sidebar-toggle-title' => 'Sidebar to create stuff', + 'sidebar-toggle-text' => 'Hidden under the plus icon are all the buttons to create new stuff. Accounts, transactions, everything!', + 'account-menu-title' => 'All your accounts', + 'account-menu-text' => 'Here you can find all the accounts you\'ve made.', + 'budget-menu-title' => 'Budgets', + 'budget-menu-text' => 'Use this page to organise your finances and limit spending.', + 'report-menu-title' => 'Reports', + 'report-menu-text' => 'Check this out when you want a solid overview of your finances.', + 'transaction-menu-title' => 'Transactions', + 'transaction-menu-text' => 'All transactions you\'ve created can be found here.', + 'option-menu-title' => 'Options', + 'option-menu-text' => 'This is pretty self-explanatory.', + 'main-content-end-title' => 'The end!', + 'main-content-end-text' => 'Remember that every page has a small question mark at the right top. Click it to get help about the page you\'re on.', + 'index' => 'index', + 'home' => 'home', ]; diff --git a/resources/lang/zh-HK/list.php b/resources/lang/zh-HK/list.php index c150b284b2..1892c99f76 100644 --- a/resources/lang/zh-HK/list.php +++ b/resources/lang/zh-HK/list.php @@ -3,8 +3,10 @@ * list.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -35,6 +37,7 @@ return [ 'repeat_freq' => 'Repeats', 'description' => 'Description', 'amount' => 'Amount', + 'internal_reference' => 'Internal reference', 'date' => 'Date', 'interest_date' => 'Interest date', 'book_date' => 'Book date', diff --git a/resources/lang/zh-HK/pagination.php b/resources/lang/zh-HK/pagination.php index b1cf416ae8..9e61a6cfcc 100644 --- a/resources/lang/zh-HK/pagination.php +++ b/resources/lang/zh-HK/pagination.php @@ -3,11 +3,15 @@ * pagination.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ + 'previous' => '« Previous', 'next' => 'Next »', + ]; diff --git a/resources/lang/zh-HK/passwords.php b/resources/lang/zh-HK/passwords.php index 6c382f830f..8e1b72506b 100644 --- a/resources/lang/zh-HK/passwords.php +++ b/resources/lang/zh-HK/passwords.php @@ -3,8 +3,10 @@ * passwords.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/zh-HK/validation.php b/resources/lang/zh-HK/validation.php index fa086c9fbb..030e6a72c5 100644 --- a/resources/lang/zh-HK/validation.php +++ b/resources/lang/zh-HK/validation.php @@ -3,8 +3,10 @@ * validation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -77,4 +79,9 @@ return [ 'url' => 'The :attribute format is invalid.', 'timezone' => 'The :attribute must be a valid zone.', '2fa_code' => 'The :attribute field is invalid.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'file' => 'The :attribute must be a file.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'present' => 'The :attribute field must be present.', ]; diff --git a/resources/lang/zh-TW/auth.php b/resources/lang/zh-TW/auth.php new file mode 100644 index 0000000000..7319a9d7b8 --- /dev/null +++ b/resources/lang/zh-TW/auth.php @@ -0,0 +1,28 @@ + 'These credentials do not match our records.', + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', + +]; diff --git a/resources/lang/zh-TW/breadcrumbs.php b/resources/lang/zh-TW/breadcrumbs.php index 2fb800ce62..a5fe3d1755 100644 --- a/resources/lang/zh-TW/breadcrumbs.php +++ b/resources/lang/zh-TW/breadcrumbs.php @@ -4,36 +4,38 @@ * breadcrumbs.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ - 'home' => '首頁', - 'edit_currency' => 'Edit currency ":name"', - 'delete_currency' => 'Delete currency ":name"', - 'newPiggyBank' => '創建一個新的存錢筒', - 'edit_piggyBank' => '編輯存錢筒 ":name"', - 'preferences' => '設定', - 'profile' => '個人設定', - 'changePassword' => '更改密碼', - 'bills' => '賬單', - 'newBill' => '新增賬單', - 'edit_bill' => '編輯賬單 ":name"', - 'delete_bill' => '刪除賬單 ":name"', - 'reports' => '報表', - 'searchResult' => '搜尋 ":query"', - 'withdrawal_list' => '支出', - 'deposit_list' => 'Revenue, income and deposits', - 'transfer_list' => '轉帳', - 'transfers_list' => '轉帳', - 'create_withdrawal' => 'Create new withdrawal', - 'create_deposit' => 'Create new deposit', - 'create_transfer' => 'Create new transfer', - 'edit_journal' => '編緝交易 ":description"', - 'delete_journal' => '刪除交易 ":description"', - 'tags' => '標籤', - 'createTag' => '建立新標籤', - 'edit_tag' => '編輯標籤 ":tag"', - 'delete_tag' => '刪除標籤 ":tag"', + 'home' => '首頁', + 'edit_currency' => '編輯貨幣 ":name"', + 'delete_currency' => '刪除貨幣 ":name"', + 'newPiggyBank' => '創建一個新的存錢筒', + 'edit_piggyBank' => '編輯存錢筒 ":name"', + 'preferences' => '設定', + 'profile' => '個人設定', + 'changePassword' => '更改密碼', + 'bills' => '賬單', + 'newBill' => '新增賬單', + 'edit_bill' => '編輯賬單 ":name"', + 'delete_bill' => '刪除賬單 ":name"', + 'reports' => '報表', + 'searchResult' => '搜尋 ":query"', + 'withdrawal_list' => '支出', + 'deposit_list' => '收入、薪金與存款', + 'transfer_list' => '轉帳', + 'transfers_list' => '轉帳', + 'create_withdrawal' => '新增提款', + 'create_deposit' => '新增存款', + 'create_transfer' => '新增轉帳', + 'edit_journal' => '編緝交易 ":description"', + 'delete_journal' => '刪除交易 ":description"', + 'tags' => '標籤', + 'createTag' => '建立新標籤', + 'edit_tag' => '編輯標籤 ":tag"', + 'delete_tag' => '刪除標籤 ":tag"', ]; diff --git a/resources/lang/zh-TW/config.php b/resources/lang/zh-TW/config.php index b8ed029a46..0c23d3f6cd 100644 --- a/resources/lang/zh-TW/config.php +++ b/resources/lang/zh-TW/config.php @@ -3,8 +3,10 @@ * config.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/zh-TW/csv.php b/resources/lang/zh-TW/csv.php index c94cebceba..d9c355fddc 100644 --- a/resources/lang/zh-TW/csv.php +++ b/resources/lang/zh-TW/csv.php @@ -3,8 +3,10 @@ * csv.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ declare(strict_types = 1); @@ -21,30 +23,30 @@ return [ 'upload_not_writeable' => '不能寫入檔案。灰色框內包含檔案的路徑,伺服器需要寫入該檔案的權限。請調整伺服器權限設定後再試。', // roles - 'column_roles_title' => 'Define column roles', - 'column_roles_text' => '

Firefly III cannot guess what data each column contains. You must tell Firefly which kinds of data to expect. The example data can guide you into picking the correct type from the dropdown. If a column cannot be matched to a useful data type, please let me know by creating an issue.

Some values in your CSV file, such as account names or categories, may already exist in your Firefly III database. If you select "map these values" Firefly will not attempt to search for matching values itself but allow you to match the CSV values against the values in your database. This allows you to fine-tune the import.

', + 'column_roles_title' => '定義欄的內容', + 'column_roles_text' => '

Firefly III 猜不出每一欄中儲存了什麼資料。你必須告訴 Firefly 每一欄中有什麼資料。 下列的示範資料可以幫助你從列表中選擇正確類型。如果有欄位不能配對到有用的類型,請告訴我 (只有英語版本)

你的 CSV 檔中某些欄位可能已經存在於 Firefly III 的資料庫內,例如帳號名稱,或類別。如果你選擇「配對這些資料」, Firefly 會請你手動配對 CSV 檔和資料庫內的資料。這容許你微調你的匯入設定。

', 'column_roles_table' => '表格', - 'column_name' => 'Name of column', + 'column_name' => '欄位名稱', 'column_example' => '欄的示例資料', 'column_role' => '欄內資料的含義', - 'do_map_value' => '對應這些值', + 'do_map_value' => '配對這些資料', 'column' => '欄', 'no_example_data' => '沒有可用的示例資料', 'store_column_roles' => '繼續匯入', - 'do_not_map' => '(不要映射)', - 'map_title' => '連接匯入資料到 Firefly III', - 'map_text' => 'In the following tables, the left value shows you information found in your uploaded CSV file. It is your task to map this value, if possible, to a value already present in your database. Firefly will stick to this mapping. If there is no value to map to, or you do not wish to map the specific value, select nothing.', + 'do_not_map' => '(不要配對)', + 'map_title' => '配對匯入了的資料到 Firefly III 的資料', + 'map_text' => '在下表中,左邊的是在你的CSV 檔中的資料。而你現在要把這些資料配對到資料庫中的資料(如有的話)。如果沒有資料能夠進行配對,或者你不想進行配對,請選擇不進行配對。', 'field_value' => '欄位值', - 'field_mapped_to' => '映射到', - 'store_column_mapping' => 'Store mapping', + 'field_mapped_to' => '配對到', + 'store_column_mapping' => '存儲配對', // map things. 'column__ignore' => '(忽略此欄)', - 'column_account-iban' => 'Asset account (IBAN)', - 'column_account-id' => 'Asset account ID (matching Firefly)', + 'column_account-iban' => '資產帳戶 (IBAN)', + 'column_account-id' => '資產帳戶 ID (與 Firefly 匹配)', 'column_account-name' => '資產帳戶 (名稱)', 'column_amount' => '金額', 'column_amount-comma-separated' => '金額 (逗號作為小數分隔符號)', @@ -54,26 +56,26 @@ return [ 'column_budget-name' => '預算名稱', 'column_category-id' => '類別 ID (與 Firefly 匹配)', 'column_category-name' => '類別名稱', - 'column_currency-code' => 'Currency code (ISO 4217)', - 'column_currency-id' => 'Currency ID (matching Firefly)', - 'column_currency-name' => 'Currency name (matching Firefly)', - 'column_currency-symbol' => 'Currency symbol (matching Firefly)', - 'column_date-interest' => 'Interest calculation date', + 'column_currency-code' => '貨幣代碼 (ISO 4217)', + 'column_currency-id' => '貨幣 ID (與 Firefly 匹配)', + 'column_currency-name' => '貨幣名稱(與 Firefly 匹配)', + 'column_currency-symbol' => '貨幣符號 (與 Firefly 匹配)', + 'column_date-interest' => '利息計算日', 'column_date-book' => 'Transaction booking date', 'column_date-process' => '交易處理日期', 'column_date-transaction' => '日期', 'column_description' => '描述', - 'column_opposing-iban' => 'Opposing account (IBAN)', - 'column_opposing-id' => 'Opposing account ID (matching Firefly)', + 'column_opposing-iban' => '抵銷的帳戶 (IBAN)', + 'column_opposing-id' => '抵銷的帳戶 ID (與 Firefly 匹配)', 'column_external-id' => '外部 ID', - 'column_opposing-name' => 'Opposing account (name)', - 'column_rabo-debet-credit' => 'Rabobank specific debet/credit indicator', - 'column_ing-debet-credit' => 'ING specific debet/credit indicator', + 'column_opposing-name' => '抵銷的帳戶 (名稱)', + 'column_rabo-debet-credit' => '荷蘭合作銀行獨有的借記/貸記指標', + 'column_ing-debet-credit' => 'ING 集團獨有的借記/貸記指標', 'column_sepa-ct-id' => 'SEPA Credit Transfer end-to-end ID', - 'column_sepa-ct-op' => 'SEPA Credit Transfer opposing account', - 'column_sepa-db' => 'SEPA Direct Debet', - 'column_tags-comma' => 'Tags (comma separated)', - 'column_tags-space' => 'Tags (space separated)', - 'column_account-number' => 'Asset account (account number)', - 'column_opposing-number' => 'Opposing account (account number)', + 'column_sepa-ct-op' => 'SEPA 貸記劃撥抵銷的帳戶', + 'column_sepa-db' => 'SEPA 直接付款', + 'column_tags-comma' => '標籤 (逗號分隔)', + 'column_tags-space' => '標籤 (空格分隔)', + 'column_account-number' => '資產帳戶 (帳號號碼)', + 'column_opposing-number' => '抵銷的帳戶 (帳號號碼)', ]; diff --git a/resources/lang/zh-TW/firefly.php b/resources/lang/zh-TW/firefly.php index 772cdfa84a..42cc26f22d 100644 --- a/resources/lang/zh-TW/firefly.php +++ b/resources/lang/zh-TW/firefly.php @@ -3,13 +3,15 @@ * firefly.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // general stuff: - 'language_incomplete' => 'incomplete translation', + 'language_incomplete' => '翻譯不完整', 'close' => '關閉', 'actions' => '操作', 'edit' => '編輯', @@ -27,12 +29,12 @@ return [ 'bounced_error' => '無法傳送電郵至 :email ,因此無法訪問。', 'deleted_error' => '帳號或密碼錯誤。', 'general_blocked_error' => '您的帳戶已被禁用,所以您不能登錄。', - 'expired_error' => 'Your account has expired, and can no longer be used.', - 'removed_amount' => 'Removed :amount', - 'added_amount' => 'Added :amount', - 'asset_account_role_help' => 'Any extra options resulting from your choice can be set later.', + 'expired_error' => '你的帳戶已過期,不能使用。', + 'removed_amount' => '移除了 :amount', + 'added_amount' => '添加了 :amount', + 'asset_account_role_help' => '你可以稍後再設置其他選項。', 'Opening balance' => '開戶金額', - 'create_new_stuff' => 'Create new stuff', + 'create_new_stuff' => '創建新的東西', 'new_withdrawal' => '新提款', 'new_deposit' => '新存款', 'new_transfer' => '新的轉帳', @@ -41,12 +43,12 @@ return [ 'new_revenue_account' => '新的收入帳戶', 'new_budget' => '新增預算', 'new_bill' => '新增賬單', - 'block_account_logout' => 'You have been logged out. Blocked accounts cannot use this site. Did you register with a valid email address?', - 'flash_success' => 'Success!', - 'flash_info' => 'Message', - 'flash_warning' => 'Warning!', - 'flash_error' => 'Error!', - 'flash_info_multiple' => 'There is one message|There are :count messages', + 'block_account_logout' => '你已被登出。被封禁的帳戶不能使用本網站。你沒有以有效的電子郵件地址註冊嗎?', + 'flash_success' => '成功!', + 'flash_info' => '訊息', + 'flash_warning' => '警告!', + 'flash_error' => '錯誤!', + 'flash_info_multiple' => '有一個訊息|有 :count 個訊息', 'flash_error_multiple' => '出現了一個錯誤|出現了 :count 個錯誤', 'net_worth' => '淨值', 'route_has_no_help' => '目前沒有說明,或沒有中文的說明可用。', @@ -55,17 +57,17 @@ return [ 'two_factor_code_here' => '在此輸入代碼', 'two_factor_title' => '雙重身份驗證', 'authenticate' => '認證', - 'two_factor_forgot_title' => 'Lost two factor authentication', - 'two_factor_forgot' => 'I forgot my two-factor thing.', - 'two_factor_lost_header' => 'Lost your two factor authentication?', - 'two_factor_lost_intro' => 'Unfortunately, this is not something you can reset from the web interface. You have two choices.', - 'two_factor_lost_fix_self' => 'If you run your own instance of Firefly III, check the logs in storage/logs for instructions.', - 'two_factor_lost_fix_owner' => 'Otherwise, email the site owner, :site_owner and ask them to reset your two factor authentication.', + 'two_factor_forgot_title' => '丟失雙重身份驗證', + 'two_factor_forgot' => '我忘記了我的雙重身份驗證 (2FA) 。', + 'two_factor_lost_header' => '丟失了雙重身份驗證 (2FA) 嗎?', + 'two_factor_lost_intro' => '很不幸,這不可以從 web 介面中重置。你有兩個選擇。', + 'two_factor_lost_fix_self' => '如果你在自己的伺服器上運行 Firefly III,請檢查 storage/logs 中的日誌。', + 'two_factor_lost_fix_owner' => '否則,請電郵網站擁有者,:site_owner 並要求他們重置你的雙重身份驗證。', 'warning_much_data' => ':days 天的資料需要一點時間載入。', 'registered' => '您已成功註冊 !', 'search' => '搜尋', 'no_budget_pointer' => '你還沒有預算。你可以在預算頁來建立預算。預算可以幫助你跟蹤支出情況。', - 'source_accounts' => 'Source account(s)', + 'source_accounts' => '來源帳戶', 'destination_accounts' => '目標帳戶', // repeat frequencies: @@ -78,17 +80,17 @@ return [ 'confirm_account_header' => '請確認你的帳戶', 'confirm_account_intro' => 'An email has been sent to the address you used during your registration. Please check it out for further instructions. If you did not get this message, you can have Firefly send it again.', 'confirm_account_resend_email' => 'Send me the confirmation message I need to activate my account.', - 'account_is_confirmed' => 'Your account has been confirmed!', + 'account_is_confirmed' => '你的帳戶已通過驗證。', 'invalid_activation_code' => 'It seems the code you are using is not valid, or has expired.', - 'confirm_account_is_resent_header' => 'The confirmation has been resent', + 'confirm_account_is_resent_header' => '已重新發送確認郵件', 'confirm_account_is_resent_text' => 'The confirmation message has been resent. If you still did not receive the confirmation message, please contact the site owner at :owner or check the log files to see what went wrong.', - 'confirm_account_is_resent_go_home' => 'Go to the index page of Firefly', - 'confirm_account_not_resent_header' => 'Something went wrong :(', + 'confirm_account_is_resent_go_home' => '轉到 Firefly 的首頁', + 'confirm_account_not_resent_header' => '有些事不對勁 :(', 'confirm_account_not_resent_intro' => 'The confirmation message has been not resent. If you still did not receive the confirmation message, please contact the site owner at :owner instead. Possibly, you have tried to resend the activation message too often. You can have Firefly III try to resend the confirmation message every hour.', - 'confirm_account_not_resent_go_home' => 'Go to the index page of Firefly', + 'confirm_account_not_resent_go_home' => '轉到 Firefly 的首頁', // export data: - 'import_and_export' => 'Import and export', + 'import_and_export' => '匯入與匯出', 'export_data' => 'Export data', 'export_data_intro' => 'For backup purposes, when migrating to another system or when migrating to another Firefly III installation.', 'export_format' => 'Export format', @@ -116,7 +118,7 @@ return [ 'export_status_created_zip_file' => 'Created a zip file!', 'export_status_finished' => 'Export has succesfully finished! Yay!', 'export_data_please_wait' => 'Please wait...', - 'attachment_explanation' => 'The file called \':attachment_name\' (#:attachment_id) was originally uploaded to :type \':description\' (#:journal_id) dated :date for the amount of :amount.', + 'attachment_explanation' => '檔案 \':attachment_name\' (#:attachment_id) 本來於 :date 上傳到 :type \':description\' (#:journal_id) ,而其金額為 :amount 。', // rules 'rules' => 'Rules', @@ -148,12 +150,12 @@ return [ 'store_new_rule' => 'Store new rule', 'updated_rule' => 'Updated rule with title ":title"', 'default_rule_group_name' => 'Default rules', - 'default_rule_group_description' => 'All your rules not in a particular group.', + 'default_rule_group_description' => '所有不屬於任何組別的規則', 'default_rule_name' => 'Your first default rule', - 'default_rule_description' => 'This rule is an example. You can safely delete it.', - 'default_rule_trigger_description' => 'The Man Who Sold the World', + 'default_rule_description' => '這是一個例子。你可以把這個規則刪除。', + 'default_rule_trigger_description' => '賣世界的小男孩', 'default_rule_trigger_from_account' => 'David Bowie', - 'default_rule_action_prepend' => 'Bought the world from ', + 'default_rule_action_prepend' => '買下了整個世界。錢給了', 'default_rule_action_set_category' => 'Large expenses', 'trigger' => 'Trigger', 'trigger_value' => 'Trigger on value', @@ -180,10 +182,10 @@ return [ // actions and triggers 'rule_trigger_user_action' => 'User action is ":trigger_value"', - 'rule_trigger_from_account_starts' => 'Source account starts with ":trigger_value"', - 'rule_trigger_from_account_ends' => 'Source account ends with ":trigger_value"', - 'rule_trigger_from_account_is' => 'Source account is ":trigger_value"', - 'rule_trigger_from_account_contains' => 'Source account contains ":trigger_value"', + 'rule_trigger_from_account_starts' => '以 ":trigger_value" 開頭的來源帳戶', + 'rule_trigger_from_account_ends' => '以 ":trigger_value" 為結尾的來源帳戶', + 'rule_trigger_from_account_is' => '來源帳戶是 ":trigger_value"', + 'rule_trigger_from_account_contains' => '含 ":trigger_value" 的來源帳戶', 'rule_trigger_to_account_starts' => 'Destination account starts with ":trigger_value"', 'rule_trigger_to_account_ends' => 'Destination account ends with ":trigger_value"', 'rule_trigger_to_account_is' => 'Destination account is ":trigger_value"', @@ -192,14 +194,14 @@ return [ 'rule_trigger_amount_less' => 'Amount is less than :trigger_value', 'rule_trigger_amount_exactly' => 'Amount is :trigger_value', 'rule_trigger_amount_more' => 'Amount is more than :trigger_value', - 'rule_trigger_description_starts' => 'Description starts with ":trigger_value"', - 'rule_trigger_description_ends' => 'Description ends with ":trigger_value"', - 'rule_trigger_description_contains' => 'Description contains ":trigger_value"', - 'rule_trigger_description_is' => 'Description is ":trigger_value"', - 'rule_trigger_from_account_starts_choice' => 'Source account starts with..', - 'rule_trigger_from_account_ends_choice' => 'Source account ends with..', - 'rule_trigger_from_account_is_choice' => 'Source account is..', - 'rule_trigger_from_account_contains_choice' => 'Source account contains..', + 'rule_trigger_description_starts' => '以 ":trigger_value" 開頭的描述', + 'rule_trigger_description_ends' => '以 ":trigger_value" 為結尾的描述', + 'rule_trigger_description_contains' => '含 ":trigger_value" 的描述', + 'rule_trigger_description_is' => '描述是 ":trigger_value"', + 'rule_trigger_from_account_starts_choice' => '來源帳戶以…開頭', + 'rule_trigger_from_account_ends_choice' => '來源帳戶以…結尾', + 'rule_trigger_from_account_is_choice' => '來源帳戶是…', + 'rule_trigger_from_account_contains_choice' => '來源帳戶含有…', 'rule_trigger_to_account_starts_choice' => 'Destination account starts with..', 'rule_trigger_to_account_ends_choice' => 'Destination account ends with..', 'rule_trigger_to_account_is_choice' => 'Destination account is..', @@ -208,36 +210,36 @@ return [ 'rule_trigger_amount_less_choice' => 'Amount is less than..', 'rule_trigger_amount_exactly_choice' => 'Amount is..', 'rule_trigger_amount_more_choice' => 'Amount is more than..', - 'rule_trigger_description_starts_choice' => 'Description starts with..', - 'rule_trigger_description_ends_choice' => 'Description ends with..', - 'rule_trigger_description_contains_choice' => 'Description contains..', - 'rule_trigger_description_is_choice' => 'Description is..', + 'rule_trigger_description_starts_choice' => '描述以…開頭', + 'rule_trigger_description_ends_choice' => '描述以…結尾', + 'rule_trigger_description_contains_choice' => '描述包含…', + 'rule_trigger_description_is_choice' => '描述是…', 'rule_trigger_store_journal' => 'When a journal is created', 'rule_trigger_update_journal' => 'When a journal is updated', 'rule_action_set_category' => 'Set category to ":action_value"', 'rule_action_clear_category' => 'Clear category', 'rule_action_set_budget' => 'Set budget to ":action_value"', 'rule_action_clear_budget' => 'Clear budget', - 'rule_action_add_tag' => 'Add tag ":action_value"', - 'rule_action_remove_tag' => 'Remove tag ":action_value"', - 'rule_action_remove_all_tags' => 'Remove all tags', - 'rule_action_set_description' => 'Set description to ":action_value"', - 'rule_action_append_description' => 'Append description with ":action_value"', - 'rule_action_prepend_description' => 'Prepend description with ":action_value"', + 'rule_action_add_tag' => '新增標籤 ":action_value"', + 'rule_action_remove_tag' => '刪除標籤 ":action_value"', + 'rule_action_remove_all_tags' => '移除所有標籤', + 'rule_action_set_description' => '設置描述為 ":action_value"', + 'rule_action_append_description' => '描述後加上 ":action_value"', + 'rule_action_prepend_description' => '描述前加上 ":action_value"', 'rule_action_set_category_choice' => 'Set category to..', 'rule_action_clear_category_choice' => 'Clear any category', 'rule_action_set_budget_choice' => 'Set budget to..', 'rule_action_clear_budget_choice' => 'Clear any budget', - 'rule_action_add_tag_choice' => 'Add tag..', - 'rule_action_remove_tag_choice' => 'Remove tag..', - 'rule_action_remove_all_tags_choice' => 'Remove all tags', - 'rule_action_set_description_choice' => 'Set description to..', - 'rule_action_append_description_choice' => 'Append description with..', - 'rule_action_prepend_description_choice' => 'Prepend description with..', + 'rule_action_add_tag_choice' => '新增標籤…', + 'rule_action_remove_tag_choice' => '移除標籤…', + 'rule_action_remove_all_tags_choice' => '移除所有標籤', + 'rule_action_set_description_choice' => '把描述設置為…', + 'rule_action_append_description_choice' => '描述後加上…', + 'rule_action_prepend_description_choice' => '描述前加上…', // tags - 'store_new_tag' => 'Store new tag', - 'update_tag' => 'Update tag', + 'store_new_tag' => '儲存新的標籤', + 'update_tag' => '更新標籤', 'no_location_set' => 'No location set.', 'meta_data' => 'Meta data', 'location' => 'Location', @@ -259,16 +261,16 @@ return [ 'pref_custom_fiscal_year_label' => 'Enabled', 'pref_custom_fiscal_year_help' => 'In countries that use a financial year other than January 1 to December 31, you can switch this on and specify start / end days of the fiscal year', 'pref_fiscal_year_start_label' => 'Fiscal year start date', - 'pref_two_factor_auth' => '2-step verification', - 'pref_two_factor_auth_help' => 'When you enable 2-step verification (also known as two-factor authentication), you add an extra layer of security to your account. You sign in with something you know (your password) and something you have (a verification code). Verification codes are generated by an application on your phone, such as Authy or Google Authenticator.', - 'pref_enable_two_factor_auth' => 'Enable 2-step verification', - 'pref_two_factor_auth_disabled' => '2-step verification code removed and disabled', - 'pref_two_factor_auth_remove_it' => 'Don\'t forget to remove the account from your authentication app!', - 'pref_two_factor_auth_code' => 'Verify code', - 'pref_two_factor_auth_code_help' => 'Scan the QR code with an application on your phone such as Authy or Google Authenticator and enter the generated code.', - 'pref_two_factor_auth_reset_code' => 'Reset verification code', - 'pref_two_factor_auth_remove_code' => 'Remove verification code', - 'pref_two_factor_auth_remove_will_disable' => '(this will also disable two-factor authentication)', + 'pref_two_factor_auth' => '雙重身份驗證', + 'pref_two_factor_auth_help' => '當您啟用二步驗證 (也稱為雙重身份驗證) 時,你的帳戶安全性將會更上一層樓。你需要以您知道的東西(密碼)和你擁有的東西(驗證碼)來進行登錄。驗證碼是由您的手機上的應用程式生成的,如 Authy 或 Google Authenticator 。', + 'pref_enable_two_factor_auth' => '啟用雙重身份驗證', + 'pref_two_factor_auth_disabled' => '成功刪除和禁用雙重身份驗證', + 'pref_two_factor_auth_remove_it' => '別忘了從你的身份驗證程式(例如 Authy 或 Google Authenticator)中刪除帳戶 !', + 'pref_two_factor_auth_code' => '驗證代碼', + 'pref_two_factor_auth_code_help' => '請以你的手機上的身份驗證應用程式(例如 Authy 或 Google Authenticator)掃描 QR 代碼,然後輸入其所生成的代碼。', + 'pref_two_factor_auth_reset_code' => '重置驗證代碼', + 'pref_two_factor_auth_remove_code' => '刪除驗證代碼', + 'pref_two_factor_auth_remove_will_disable' => '(這也會禁用雙重身份驗證)', 'pref_save_settings' => 'Save settings', 'saved_preferences' => 'Preferences saved!', 'transaction_page_size_title' => 'Page size', @@ -283,7 +285,7 @@ return [ 'pref_optional_tj_interest_date' => 'Interest date', 'pref_optional_tj_book_date' => 'Book date', 'pref_optional_tj_process_date' => 'Processing date', - 'pref_optional_tj_due_date' => 'Due date', + 'pref_optional_tj_due_date' => '到期日', 'pref_optional_tj_payment_date' => 'Payment date', 'pref_optional_tj_invoice_date' => 'Invoice date', 'pref_optional_tj_internal_reference' => 'Internal reference', @@ -341,7 +343,7 @@ return [ 'create_new_withdrawal' => 'Create new withdrawal', 'create_new_deposit' => 'Create new deposit', 'create_new_transfer' => 'Create new transfer', - 'create_new_asset' => 'Create new asset account', + 'create_new_asset' => '建立新的資產帳戶', 'create_new_expense' => 'Create new expense account', 'create_new_revenue' => 'Create new revenue account', 'create_new_piggy_bank' => 'Create new piggy bank', @@ -419,29 +421,29 @@ return [ 'average_bill_amount_overall' => '平均賬單金額 (總計)', // accounts: - 'details_for_asset' => 'Details for asset account ":name"', + 'details_for_asset' => '資產帳戶的詳細資訊 ":name"', 'details_for_expense' => 'Details for expense account ":name"', 'details_for_revenue' => 'Details for revenue account ":name"', 'details_for_cash' => 'Details for cash account ":name"', - 'store_new_asset_account' => 'Store new asset account', + 'store_new_asset_account' => '儲存新的資產帳戶', 'store_new_expense_account' => 'Store new expense account', 'store_new_revenue_account' => 'Store new revenue account', - 'edit_asset_account' => 'Edit asset account ":name"', + 'edit_asset_account' => '編輯資產帳戶 ":name"', 'edit_expense_account' => 'Edit expense account ":name"', 'edit_revenue_account' => 'Edit revenue account ":name"', - 'delete_asset_account' => 'Delete asset account ":name"', + 'delete_asset_account' => '刪除資產帳戶 ":name"', 'delete_expense_account' => 'Delete expense account ":name"', 'delete_revenue_account' => 'Delete revenue account ":name"', - 'asset_deleted' => 'Successfully deleted asset account ":name"', + 'asset_deleted' => '成功刪除資產帳戶 ":name"', 'expense_deleted' => 'Successfully deleted expense account ":name"', 'revenue_deleted' => 'Successfully deleted revenue account ":name"', - 'update_asset_account' => 'Update asset account', + 'update_asset_account' => '更新資產帳戶資訊', 'update_expense_account' => 'Update expense account', 'update_revenue_account' => 'Update revenue account', - 'make_new_asset_account' => 'Create a new asset account', + 'make_new_asset_account' => '建立新的資產帳戶', 'make_new_expense_account' => 'Create a new expense account', 'make_new_revenue_account' => 'Create a new revenue account', - 'asset_accounts' => 'Asset accounts', + 'asset_accounts' => '資產帳戶', 'expense_accounts' => 'Expense accounts', 'revenue_accounts' => 'Revenue accounts', 'cash_accounts' => 'Cash accounts', @@ -472,16 +474,16 @@ return [ 'update_withdrawal' => 'Update withdrawal', 'update_deposit' => 'Update deposit', 'update_transfer' => 'Update transfer', - 'updated_withdrawal' => 'Updated withdrawal ":description"', - 'updated_deposit' => 'Updated deposit ":description"', - 'updated_transfer' => 'Updated transfer ":description"', - 'delete_withdrawal' => 'Delete withdrawal ":description"', - 'delete_deposit' => 'Delete deposit ":description"', - 'delete_transfer' => 'Delete transfer ":description"', - 'deleted_withdrawal' => 'Successfully deleted withdrawal ":description"', - 'deleted_deposit' => 'Successfully deleted deposit ":description"', - 'deleted_transfer' => 'Successfully deleted transfer ":description"', - 'stored_journal' => 'Successfully created new transaction ":description"', + 'updated_withdrawal' => '成功更新提款 ":description"', + 'updated_deposit' => '成功更新存款 ":description"', + 'updated_transfer' => '成功更新轉帳 ":description"', + 'delete_withdrawal' => '刪除提款 ":description"', + 'delete_deposit' => '刪除存款 ":description"', + 'delete_transfer' => '刪除轉帳 ":description"', + 'deleted_withdrawal' => '成功刪除提款 ":description"', + 'deleted_deposit' => '成功刪除存款 ":description"', + 'deleted_transfer' => '成功刪除轉帳 ":description"', + 'stored_journal' => '成功建立交易 ":description"', 'select_transactions' => 'Select transactions', 'stop_selection' => 'Stop selecting transactions', 'edit_selected' => 'Edit selected', @@ -501,7 +503,7 @@ return [ 'yourAccounts' => 'Your accounts', 'budgetsAndSpending' => 'Budgets and spending', 'savings' => 'Savings', - 'markAsSavingsToContinue' => 'Mark your asset accounts as "Savings account" to fill this panel', + 'markAsSavingsToContinue' => '將你的資產帳戶標記為 「儲蓄帳戶」 即可顯示在這裡', 'createPiggyToContinue' => 'Create piggy banks to fill this panel.', 'newWithdrawal' => 'New expense', 'newDeposit' => 'New deposit', @@ -521,13 +523,13 @@ return [ 'dashboard' => 'Dashboard', 'currencies' => 'Currencies', 'accounts' => 'Accounts', - 'Asset account' => 'Asset account', - 'Default account' => 'Asset account', + 'Asset account' => '資產帳戶', + 'Default account' => '資產帳戶', 'Expense account' => 'Expense account', 'Revenue account' => 'Revenue account', 'Initial balance account' => '初始帳戶', 'budgets' => 'Budgets', - 'tags' => 'Tags', + 'tags' => '標籤', 'reports' => 'Reports', 'transactions' => 'Transactions', 'expenses' => 'Expenses', @@ -576,7 +578,7 @@ return [ 'balanceEnd' => '期間之未的結餘', 'reportsOwnAccounts' => 'Reports for your own accounts', 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts', - 'splitByAccount' => 'Split by account', + 'splitByAccount' => '以帳號來分割', 'balancedByTransfersAndTags' => 'Balanced by transfers and tags', 'coveredWithTags' => 'Covered with tags', 'leftUnbalanced' => 'Left unbalanced', @@ -669,8 +671,8 @@ return [ 'events' => 'Events', 'target_amount' => 'Target amount', 'start_date' => 'Start date', - 'target_date' => 'Target date', - 'no_target_date' => 'No target date', + 'target_date' => '儲蓄目標日期', + 'no_target_date' => '沒有儲蓄目標日期', 'todo' => 'to do', 'table' => 'Table', 'piggy_bank_not_exists' => 'Piggy bank no longer exists.', @@ -684,23 +686,23 @@ return [ 'cannot_remove_amount_piggy' => 'Could not remove :amount from ":name".', // tags - 'regular_tag' => 'Just a regular tag.', + 'regular_tag' => '只是一個普通的標籤。', 'balancing_act' => '這標籤最多會有兩項交易:一個支出和一個轉帳,而他們會互相抵消。', - 'advance_payment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.', - 'delete_tag' => 'Delete tag ":tag"', - 'deleted_tag' => 'Deleted tag ":tag"', - 'new_tag' => 'Make new tag', - 'edit_tag' => 'Edit tag ":tag"', - 'updated_tag' => 'Updated tag ":tag"', - 'created_tag' => 'Tag ":tag" has been created!', + 'advance_payment' => '這種標籤容許一個支出和多個存款以抵銷原本的支出。', + 'delete_tag' => '刪除標籤 ":tag"', + 'deleted_tag' => '刪除了標籤 ":tag"', + 'new_tag' => '建立新標籤', + 'edit_tag' => '編輯標籤 ":tag"', + 'updated_tag' => '更新了標籤 ":tag"', + 'created_tag' => '成功創建標籤 ":tag" !', 'no_year' => 'No year set', 'no_month' => 'No month set', - 'tag_title_nothing' => 'Default tags', - 'tag_title_balancingAct' => 'Balancing act tags', - 'tag_title_advancePayment' => 'Advance payment tags', - 'tags_introduction' => 'Usually tags are singular words, designed to quickly band items together using things like expensive, bill or for-party. In Firefly III, tags can have more properties such as a date, description and location. This allows you to join transactions together in a more meaningful way. For example, you could make a tag called Christmas dinner with friends and add information about the restaurant. Such tags are "singular", you would only use them for a single occasion, perhaps with multiple transactions.', - 'tags_group' => 'Tags group transactions together, which makes it possible to store reimbursements (in case you front money for others) and other "balancing acts" where expenses are summed up (the payments on your new TV) or where expenses and deposits are cancelling each other out (buying something with saved money). It\'s all up to you. Using tags the old-fashioned way is of course always possible.', - 'tags_start' => 'Create a tag to get started or enter tags when creating new transactions.', + 'tag_title_nothing' => '預設標籤', + 'tag_title_balancingAct' => '抵銷行為標籤', + 'tag_title_advancePayment' => '預付款標籤', + 'tags_introduction' => '標籤通常是一些方便分類的短語,例如 很貴賬單 或者 派對用品。 在 Firefly III 裡,標籤可以有不同的屬性,例如日期、描述、或位置。這能方便你更有意義地把交易分類。例如,你可以建立一個 與朋友一起吃聖誕大餐的標籤,並加上餐廳的資訊。這類的標籤標籤是 「即棄」 的,你只會在一次事件中使用它,而標籤可能有多個交易。', + 'tags_group' => '標籤可以把交易進行分組,容許你記錄報銷(你為其他人墊支),或者其他「抵銷行為」——例如分期付款(買電視機的時候),或者支出和收入會互相抵銷(以儲蓄買東西)的交易。當然,你也可以建立普通的標籤,隨你喜歡。', + 'tags_start' => '要開始使用,請新增標籤或在建立新交易紀錄時輸入標籤。', // administration @@ -730,11 +732,11 @@ return [ // split a transaction: 'transaction_meta_data' => 'Transaction meta-data', 'transaction_dates' => 'Transaction dates', - 'splits' => 'Splits', - 'split_title_withdrawal' => 'Split your new withdrawal', - 'split_intro_one_withdrawal' => 'Firefly supports the "splitting" of a withdrawal.', + 'splits' => '分割', + 'split_title_withdrawal' => '分割你的新提款', + 'split_intro_one_withdrawal' => 'Firefly 容許 "分割" 一個提款。', 'split_intro_two_withdrawal' => 'It means that the amount of money you\'ve spent is divided between several destination expense accounts, budgets or categories.', - 'split_intro_three_withdrawal' => 'For example: you could split your :total groceries so you pay :split_one from your "daily groceries" budget and :split_two from your "cigarettes" budget.', + 'split_intro_three_withdrawal' => '例如:你可以分割你一共 :total 的日用品,所以你可以由你的「日用品」預算支付 :split_one 和由你的「香煙」預算中支付 :split_two 。', 'split_table_intro_withdrawal' => 'Split your withdrawal in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', 'store_splitted_withdrawal' => 'Store splitted withdrawal', 'update_splitted_withdrawal' => 'Update splitted withdrawal', @@ -757,47 +759,53 @@ return [ 'split_this_withdrawal' => 'Split this withdrawal', 'split_this_deposit' => 'Split this deposit', 'split_this_transfer' => 'Split this transfer', - 'cannot_edit_multiple_source' => 'You cannot edit splitted transaction #:id with description ":description" because it contains multiple source accounts.', - 'cannot_edit_multiple_dest' => 'You cannot edit splitted transaction #:id with description ":description" because it contains multiple destination accounts.', + 'cannot_edit_multiple_source' => '你不能修改描述為 ":description" 的分割交易 #:id 因為他有多個來源帳號。', + 'cannot_edit_multiple_dest' => '你不能修改描述為 ":description" 的分割交易 #:id 因為他有多個目標帳號。', 'no_edit_multiple_left' => 'You have selected no valid transactions to edit.', // import - 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you.', + 'configuration_file_help' => 'If you have previously imported data into Firefly III, you may have a configuration file, which will pre-set configuration values for you. For some banks, other users have kindly provided their configuration file.', 'import_data_index' => 'Index', 'import_file_type_csv' => 'CSV (comma separated values)', 'import_file_type_help' => 'Select the type of file you will upload', - 'import_start' => 'Start the import', - 'configure_import' => 'Further configure your import', + 'import_start' => '開始匯入', + 'configure_import' => '進一步調整匯入設定', 'import_finish_configuration' => 'Finish configuration', 'settings_for_import' => 'Settings', - 'import_status' => 'Import status', - 'import_status_text' => 'The import is currently running, or will start momentarily.', - 'import_complete' => 'Import configuration complete!', - 'import_complete_text' => 'The import is ready to start. All the configuration you needed to do has been done. Please download the configuration file. It will help you with the import should it not go as planned. To actually run the import, you can either execute the following command in your console, or run the web-based import. Depending on your configuration, the console import will give you more feedback.', + 'import_status' => '匯入狀態', + 'import_status_text' => '匯入正在進行中,或即將進行匯入。', + 'import_complete' => '匯入設定完成!', + 'import_complete_text' => '匯入程序已準備妥當。你已完成所有設定。請下載設定檔,當你的匯入出現問題時它將幫上忙。若要執行匯入程序,你可以在您的伺服器上執行以下命令,或運行網頁導入程序。根據您的配置,在伺服器上執行命令或會給你更多的資訊。', 'import_download_config' => 'Download configuration', - 'import_start_import' => 'Start import', - 'import_intro_beta' => 'The import function of Firefly III is in beta. Many users of Firefly III have tried many different files. Although each individual compontent of this import routine works (really), the combination might break. If your file cannot be imported by Firefly, please read this wiki page so I can fix the problem you have run into.', - 'import_data' => 'Import data', - 'import_data_full' => 'Import data into Firefly III', - 'import' => 'Import', - 'import_intro_text' => 'Welcome to the Firefly III data import routine. At the moment, this routine can help you import files into Firefly. To do so, you must download or export transactions from other systems or software, and upload them here. The next steps will let you help Firefly III determin what the content is of your file, and how to handle it. Please select a file, and read all instructions carefully.', + 'import_start_import' => '開始匯入', + 'import_intro_beta' => 'Firefly III 的匯入功能依然在測試階段。很多 Firefly III 的用戶已經成功使用這個功能匯入不同的檔案。儘管這個匯入功能的每個部分都能夠正常運作(我說真的),但是整個功能或者會有點問題。如果你的檔案不能匯入到 Firefly 內,請閱讀這個維基頁面,以方便我修復你所遇到的問題。', + 'import_data' => '匯入資料', + 'import_data_full' => '匯入資料到 Firefly III', + 'import' => '匯入', + 'import_intro_what_it_does' => 'This page allows you to import data into Firefly III. To do so, export data from your bank, or from another financial management system. Upload that file here. Firefly III will convert the data. You need to give it some directions. Please select a file and follow the instructions.', + 'import_intro_import_conf_title' => 'Import "configuration"', + 'import_intro_beta_warning' => 'Warning', + 'import_intro_import_conf_text' => 'As you will discover over the next few pages, this import routine has a lot of settings. These settings are mainly dependent on the bank (or financial management software) your file comes from. There is a good chance somebody else already imported such a file and has shared their configuration file. Please visit the import configuration center to see if there already is a configuration available for your bank or system. If there is, you should download this configuration file and upload it here as well. It will save you a lot of time!', 'import_file_help' => 'Select your file', - 'import_status_settings_complete' => 'The import is ready to start.', - 'import_status_import_complete' => 'The import has completed.', - 'import_status_import_running' => 'The import is currently running. Please be patient.', - 'import_status_header' => 'Import status and progress', - 'import_status_errors' => 'Import errors', - 'import_status_report' => 'Import report', - 'import_finished' => 'Import has finished', - 'import_error_single' => 'An error has occured during the import.', - 'import_error_multi' => 'Some errors occured during the import.', - 'import_error_fatal' => 'There was an error during the import routine. Please check the log files. The error seems to be:', - 'import_error_timeout' => 'The import seems to have timed out. If this error persists, please import your data using the console command.', - 'import_double' => 'Row #:row: This row has been imported before, and is stored in :description.', - 'import_finished_all' => 'The import has finished. Please check out the results below.', - 'import_with_key' => 'Import with key \':key\'', - 'import_finished_report' => 'The import has finished. Please note any errors in the block above this line. All transactions imported during this particular session have been tagged, and you can check them out below. ', - 'import_finished_link' => 'The transactions imported can be found in tag :tag.', + 'import_status_settings_complete' => '匯入已準備妥當,可以開始。', + 'import_status_import_complete' => '匯入已完成。', + 'import_status_import_running' => '匯入正在進行中。請稍候。', + 'import_status_header' => '匯入狀態與進度', + 'import_status_errors' => '匯入錯誤', + 'import_status_report' => '匯入報告', + 'import_finished' => '匯入已完成', + 'import_error_single' => '匯入時發生了一個錯誤。', + 'import_error_multi' => '匯入時發生了一些錯誤。', + 'import_error_fatal' => '匯入時發生了一個錯誤。 請檢查紀錄檔。 錯誤好像是:', + 'import_error_timeout' => '匯入程序似乎已經越時。如果這個錯誤持續,請使用伺服器命令啟動匯入程序。', + 'import_double' => '行 #:row: 這行曾被匯入過,並已儲存在:description。', + 'import_finished_all' => '匯入已完成。請檢查下列的結果。', + 'import_with_key' => '以鍵 \':key\' 作匯入', + + 'import_share_configuration' => 'Please consider downloading your configuration and sharing it at the import configuration center. This will allow other users of Firefly III to import their files more easily.', + + 'import_finished_report' => '匯入已完成。請留意在這行上面的錯誤記錄。這次所匯入的所有交易都已經進行標記,你可以在下面查看。 ', + 'import_finished_link' => '匯入成功的所有交易都可以在標籤 :tag 內找到。', ]; diff --git a/resources/lang/zh-TW/form.php b/resources/lang/zh-TW/form.php index aeb72045a8..f2041f1d56 100644 --- a/resources/lang/zh-TW/form.php +++ b/resources/lang/zh-TW/form.php @@ -3,8 +3,10 @@ * form.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -33,11 +35,11 @@ return [ 'asset_destination_account' => '資產帳戶 (目標)', 'asset_source_account' => '資產帳戶 (來源)', 'journal_description' => '描述', - 'split_journal' => '拆分此交易', - 'split_journal_explanation' => 'Split this transaction in multiple parts', + 'split_journal' => '分割此交易', + 'split_journal_explanation' => '分割這個交易為幾個部分', 'currency' => '貨幣', - 'account_id' => 'Asset account', - 'budget_id' => 'Budget', + 'account_id' => '資產帳戶', + 'budget_id' => '預算', 'openingBalance' => '開戶金額', 'tagMode' => '標記模式', 'tagPosition' => '標籤位置', @@ -46,13 +48,13 @@ return [ 'targetamount' => '目標金額', 'accountRole' => '帳戶角色', 'openingBalanceDate' => '開戶日期', - 'ccType' => 'Credit card payment plan', - 'ccMonthlyPaymentDate' => 'Credit card monthly payment date', - 'piggy_bank_id' => 'Piggy bank', - 'returnHere' => 'Return here', - 'returnHereExplanation' => 'After storing, return here to create another one.', - 'returnHereUpdateExplanation' => 'After updating, return here.', - 'description' => 'Description', + 'ccType' => '信用卡付款計畫', + 'ccMonthlyPaymentDate' => '信用卡每月付款日期', + 'piggy_bank_id' => '存錢筒', + 'returnHere' => '回到這裡', + 'returnHereExplanation' => '儲存後,回到這裡創建另一個記錄。', + 'returnHereUpdateExplanation' => '更新後,回到這裡。', + 'description' => '描述', 'expense_account' => '支出帳戶', 'revenue_account' => '收入帳戶', 'amount' => '金額', @@ -62,16 +64,16 @@ return [ 'process_date' => '處理日期', 'category' => '類別', 'tags' => '標籤', - 'deletePermanently' => 'Delete permanently', - 'cancel' => 'Cancel', - 'targetdate' => 'Target date', - 'tag' => 'Tag', - 'under' => 'Under', + 'deletePermanently' => '永久刪除', + 'cancel' => '取消', + 'targetdate' => '儲蓄目標日期', + 'tag' => '標籤', + 'under' => '低於', 'symbol' => 'Symbol', 'code' => 'Code', 'iban' => 'IBAN', 'accountNumber' => '帳戶號碼', - 'has_headers' => 'Headers', + 'has_headers' => '標頭', 'date_format' => '日期格式', 'specifix' => 'Bank- or file specific fixes', 'attachments[]' => '附檔', @@ -79,12 +81,12 @@ return [ 'store_new_deposit' => '存儲新存款', 'store_new_transfer' => '存儲新轉帳', 'add_new_withdrawal' => '新增提款', - 'add_new_deposit' => 'Add a new deposit', + 'add_new_deposit' => '新增新存款', 'add_new_transfer' => 'Add a new transfer', 'noPiggybank' => '(no piggy bank)', - 'title' => 'Title', - 'notes' => 'Notes', - 'filename' => 'File name', + 'title' => '標題', + 'notes' => '備註', + 'filename' => '檔案名稱', 'mime' => 'Mime type', 'size' => 'Size', 'trigger' => 'Trigger', @@ -116,9 +118,9 @@ return [ 'category_areYouSure' => 'Are you sure you want to delete the category named ":name"?', 'currency_areYouSure' => 'Are you sure you want to delete the currency named ":name"?', 'piggyBank_areYouSure' => 'Are you sure you want to delete the piggy bank named ":name"?', - 'journal_areYouSure' => 'Are you sure you want to delete the transaction described ":description"?', + 'journal_areYouSure' => '你真的要刪除這個描述為 ":description" 的交易嗎?', 'mass_journal_are_you_sure' => 'Are you sure you want to delete these transactions?', - 'tag_areYouSure' => 'Are you sure you want to delete the tag ":tag"?', + 'tag_areYouSure' => '你真的要要刪除標籤 ":tag" 嗎?', 'permDeleteWarning' => 'Deleting stuff from Firely is permanent and cannot be undone.', 'mass_make_selection' => 'You can still prevent items from being deleted by removing the checkbox.', 'delete_all_permanently' => 'Delete selected permanently', @@ -136,9 +138,9 @@ return [ 'single_user_mode' => 'Single user mode', // import - 'import_file' => 'Import file', + 'import_file' => '匯入檔案', 'configuration_file' => 'Configuration file', - 'import_file_type' => 'Import file type', + 'import_file_type' => '匯入檔案類型', 'csv_comma' => 'A comma (,)', 'csv_semicolon' => 'A semicolon (;)', 'csv_tab' => 'A tab (invisible)', @@ -147,7 +149,7 @@ return [ 'csv_config' => 'CSV import configuration', - 'due_date' => 'Due date', + 'due_date' => '到期日', 'payment_date' => 'Payment date', 'invoice_date' => 'Invoice date', 'internal_reference' => 'Internal reference', diff --git a/resources/lang/zh-TW/help.php b/resources/lang/zh-TW/help.php index 5e56825869..8175c162da 100644 --- a/resources/lang/zh-TW/help.php +++ b/resources/lang/zh-TW/help.php @@ -3,83 +3,31 @@ * help.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ // tour! - 'main-content-title' => '歡迎來到 Firefly III', - 'main-content-text' => '來看看這個簡單的教學來學習使用 Firefly III 吧!', - 'sidebar-toggle-title' => '按側欄來建立新的東西', - 'sidebar-toggle-text' => '按一下加號圖案來創建新物件。帳號、交易、任何東西都可以!', - 'account-menu-title' => '所有帳戶', - 'account-menu-text' => '你能在這裡找到你所有的帳戶。', - 'budget-menu-title' => '預算', - 'budget-menu-text' => '本頁可以幫助你管理財產及降低支出。', - 'report-menu-title' => '報表', - 'report-menu-text' => '如果你需要一個財務狀況的簡報,來看看這個吧。', - 'transaction-menu-title' => '交易', - 'transaction-menu-text' => '你可以在這裡找到所有交易記錄。', - 'option-menu-title' => '設定', - 'option-menu-text' => '相當不言而喻吧。', - 'main-content-end-title' => '完', - 'main-content-end-text' => '每一頁在右上方有一個小問號。按一下它可以取得與頁面相關説明。', - 'index' => '首頁', - 'home' => '首頁', - 'accounts-index' => 'accounts.index', - 'accounts-create' => 'accounts.create', - 'accounts-edit' => 'accounts.edit', - 'accounts-delete' => 'accounts.delete', - 'accounts-show' => 'accounts.show', - 'attachments-edit' => 'attachments.edit', - 'attachments-delete' => 'attachments.delete', - 'attachments-show' => 'attachments.show', - 'attachments-preview' => 'attachments.preview', - 'bills-index' => 'bills.index', - 'bills-create' => 'bills.create', - 'bills-edit' => 'bills.edit', - 'bills-delete' => 'bills.delete', - 'bills-show' => 'bills.show', - 'budgets-index' => 'budgets.index', - 'budgets-create' => 'budgets.create', - 'budgets-edit' => 'budgets.edit', - 'budgets-delete' => 'budgets.delete', - 'budgets-show' => 'budgets.show', - 'budgets-noBudget' => 'budgets.noBudget', - 'categories-index' => 'categories.index', - 'categories-create' => 'categories.create', - 'categories-edit' => 'categories.edit', - 'categories-delete' => 'categories.delete', - 'categories-show' => 'categories.show', - 'categories-show-date' => 'categories.show.date', - 'categories-noCategory' => 'categories.noCategory', - 'currency-index' => 'currency.index', - 'currency-create' => 'currency.create', - 'currency-edit' => 'currency.edit', - 'currency-delete' => 'currency.delete', - 'new-user-index' => 'new-user.index', - 'piggy-banks-index' => 'piggy-banks.index', - 'piggy-banks-create' => 'piggy-banks.create', - 'piggy-banks-edit' => 'piggy-banks.edit', - 'piggy-banks-delete' => 'piggy-banks.delete', - 'piggy-banks-show' => 'piggy-banks.show', - 'preferences' => 'preferences', - 'profile' => 'profile', - 'profile-change-password' => 'profile.change-password', - 'profile-delete-account' => 'profile.delete-account', - 'reports-index' => 'reports.index', - 'reports-report' => 'reports.report', - 'search' => '搜尋', - 'tags-index' => 'tags.index', - 'tags-create' => 'tags.create', - 'tags-show' => 'tags.show', - 'tags-edit' => 'tags.edit', - 'tags-delete' => 'tags.delete', - 'transactions-index' => 'transactions.index', - 'transactions-create' => 'transactions.create', - 'transactions-edit' => 'transactions.edit', - 'transactions-delete' => 'transactions.delete', - 'transactions-show' => 'transactions.show', + 'main-content-title' => '歡迎來到 Firefly III', + 'main-content-text' => '來看看這個簡單的教學來學習使用 Firefly III 吧!', + 'sidebar-toggle-title' => '按側欄來建立新的東西', + 'sidebar-toggle-text' => '按一下加號圖案來創建新物件。帳號、交易、任何東西都可以!', + 'account-menu-title' => '所有帳戶', + 'account-menu-text' => '你能在這裡找到你所有的帳戶。', + 'budget-menu-title' => '預算', + 'budget-menu-text' => '本頁可以幫助你管理財產及降低支出。', + 'report-menu-title' => '報表', + 'report-menu-text' => '如果你需要一個財務狀況的簡報,來看看這個吧。', + 'transaction-menu-title' => '交易', + 'transaction-menu-text' => '你可以在這裡找到所有交易記錄。', + 'option-menu-title' => '設定', + 'option-menu-text' => '相當不言而喻吧。', + 'main-content-end-title' => '完', + 'main-content-end-text' => '每一頁在右上方有一個小問號。按一下它可以取得與頁面相關説明。', + 'index' => '首頁', + 'home' => '首頁', ]; diff --git a/resources/lang/zh-TW/list.php b/resources/lang/zh-TW/list.php index 64b65ec301..0249ff0555 100644 --- a/resources/lang/zh-TW/list.php +++ b/resources/lang/zh-TW/list.php @@ -3,8 +3,10 @@ * list.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -27,36 +29,37 @@ return [ 'account' => '帳戶', 'matchingAmount' => '金額', 'lastMatch' => '最後出現', - 'split_number' => '拆分編號 #', + 'split_number' => '分割編號 #', 'destination' => '到', 'source' => '來源', 'expectedMatch' => 'Expected match', 'automatch' => '自動匹配?', 'repeat_freq' => '重複', - 'description' => 'Description', - 'amount' => 'Amount', - 'date' => 'Date', + 'description' => '描述', + 'amount' => '金額', + 'internal_reference' => 'Internal reference', + 'date' => '日期', 'interest_date' => '付息日', 'book_date' => 'Book date', 'process_date' => '處理日期', - 'due_date' => 'Due date', - 'payment_date' => 'Payment date', - 'invoice_date' => 'Invoice date', - 'interal_reference' => 'Internal reference', - 'notes' => 'Notes', + 'due_date' => '到期日', + 'payment_date' => '付款日期', + 'invoice_date' => '發票日期', + 'interal_reference' => '內部參考', + 'notes' => '備註', 'from' => '從', 'piggy_bank' => '存錢筒', 'to' => '至', 'budget' => '預算', 'category' => '類別', 'bill' => '賬單', - 'withdrawal' => 'Withdrawal', - 'deposit' => 'Deposit', - 'transfer' => 'Transfer', - 'type' => 'Type', - 'completed' => 'Completed', + 'withdrawal' => '取款', + 'deposit' => '存款', + 'transfer' => '轉帳', + 'type' => '類型', + 'completed' => '已完成', 'iban' => 'IBAN', - 'paid_current_period' => 'Paid this period', + 'paid_current_period' => '在這期間已付', 'email' => '電子郵件', 'registered_at' => '註冊於', 'is_activated' => '已經啟動', diff --git a/resources/lang/zh-TW/pagination.php b/resources/lang/zh-TW/pagination.php index b1cf416ae8..d87b6631ad 100644 --- a/resources/lang/zh-TW/pagination.php +++ b/resources/lang/zh-TW/pagination.php @@ -3,11 +3,15 @@ * pagination.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ - 'previous' => '« Previous', - 'next' => 'Next »', + + 'previous' => '« 上一頁', + 'next' => '下一頁 »', + ]; diff --git a/resources/lang/zh-TW/passwords.php b/resources/lang/zh-TW/passwords.php index 7044ce975f..4f28fe3fb0 100644 --- a/resources/lang/zh-TW/passwords.php +++ b/resources/lang/zh-TW/passwords.php @@ -3,8 +3,10 @@ * passwords.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ diff --git a/resources/lang/zh-TW/validation.php b/resources/lang/zh-TW/validation.php index bbf1c9b870..e0fbc90855 100644 --- a/resources/lang/zh-TW/validation.php +++ b/resources/lang/zh-TW/validation.php @@ -3,8 +3,10 @@ * validation.php * Copyright (C) 2016 thegrumpydictator@gmail.com * - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. + * This software may be modified and distributed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International License. + * + * See the LICENSE file for details. */ return [ @@ -30,12 +32,12 @@ return [ 'unique_object_for_user' => '這個名稱已被使用。', 'unique_account_for_user' => '這個帳號名稱已被使用。', 'between.numeric' => ':attribute 必須在 :min 和 :max 之間。', - 'between.file' => 'The :attribute must be between :min and :max kilobytes.', + 'between.file' => ':attribute 必須在 :min kB到 :max kB之間。', 'between.string' => ':attribute 包含的字符數量必須在 :min 到 :max 之間。', 'between.array' => ':attribute 的數目必須在 :min 到 :max 之間。', - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'date' => 'The :attribute is not a valid date.', + 'boolean' => ':attribute 必須為 true 或 false。', + 'confirmed' => ':attribute 的屬性不相符', + 'date' => ':attribute 不是有效的日期。', 'date_format' => ':attribute 不符合格式 :format 。', 'different' => ':attribute 和 :other 不能相同。', 'digits' => ':attribute 必須是 :digits 位數字。', @@ -44,27 +46,27 @@ return [ 'filled' => ':attribute 欄位是必填的。', 'exists' => '所選的 :attribute 無效。', 'image' => ':attribute 必須是圖片。', - 'in' => 'The selected :attribute is invalid.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'max.numeric' => 'The :attribute may not be greater than :max.', - 'max.file' => 'The :attribute may not be greater than :max kilobytes.', - 'max.string' => 'The :attribute may not be greater than :max characters.', + 'in' => '所選的 :attribute 無效。', + 'integer' => ':attribute 必須是整數。', + 'ip' => ':attribute 必須是一個有效的 IP 地址。', + 'json' => ':attribute 必須是一個有效的 JSON 字符串。', + 'max.numeric' => ':attribute 不能大於 :max。', + 'max.file' => ':attribute 不能大於 :max kB。', + 'max.string' => ':attribute 不能大於 :max 字元。', 'max.array' => ':attribute 的數量不能超過 :max 個。', 'mimes' => ':attribute 的文件類型必須是 :values 。', 'min.numeric' => ':attribute 至少需要 :min。', 'min.file' => ':attribute 大小至少為 :min KB。', - 'min.string' => 'The :attribute must be at least :min characters.', + 'min.string' => ':attribute 最少需要有 :min 個字符。', 'min.array' => ':attribute 至少需要有 :min 項。', 'not_in' => '所選的 :attribute 無效。', 'numeric' => ':attribute 必須是數字。', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values is present.', + 'regex' => ':attribute 格式無效。', + 'required' => ':attribute 欄位是必填的。', + 'required_if' => ':attribute 欄位在 :other 是 :value 時是必填的。', + 'required_unless' => '除非 :other 是 :value ,否則 :attribute 是必填的。', + 'required_with' => '當 :values​​ 存在時, :attribute 是必填的。', + 'required_with_all' => '當 :values​​ 存在時, :attribute 是必填的。', 'required_without' => '當 :values​​ 不存在時, :attribute 是必填的。', 'required_without_all' => '當沒有任何 :values​​ 存在時, :attribute 為必填項。', 'same' => ':attribute 和 :other 必須匹配。', @@ -77,4 +79,9 @@ return [ 'url' => ':attribute 格式無效。', 'timezone' => ':attribute 必須是有效的區域。', '2fa_code' => ':attribute 格式無效。', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'file' => 'The :attribute must be a file.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'present' => 'The :attribute field must be present.', ]; diff --git a/resources/views/accounts/show.twig b/resources/views/accounts/show.twig index 4f298d6748..61d41da0c5 100644 --- a/resources/views/accounts/show.twig +++ b/resources/views/accounts/show.twig @@ -37,7 +37,7 @@

{{ 'transactions'|_ }}

- {% include 'list.journals' with {sorting:true, accountPerspective: account} %} + {% include 'list.journals-tasker' with {sorting:true} %}
diff --git a/resources/views/accounts/show_with_date.twig b/resources/views/accounts/show_with_date.twig index 8ebe28de97..89ae367972 100644 --- a/resources/views/accounts/show_with_date.twig +++ b/resources/views/accounts/show_with_date.twig @@ -39,7 +39,7 @@

{{ 'transactions'|_ }}

- {% include 'list.journals' with {sorting:true} %} + {% include 'list.journals-tasker' with {sorting:true} %}
diff --git a/resources/views/auth/register.twig b/resources/views/auth/register.twig index e627e6691d..fc3f7bf51b 100644 --- a/resources/views/auth/register.twig +++ b/resources/views/auth/register.twig @@ -26,7 +26,7 @@
- + {% if showDemoWarning %}

You will receive an email from Firefly III. If your email address is incorrect, your account may not work.

diff --git a/resources/views/import/complete.twig b/resources/views/import/complete.twig index 9d4df06c5d..4272cc3648 100644 --- a/resources/views/import/complete.twig +++ b/resources/views/import/complete.twig @@ -27,6 +27,12 @@ class="fa fa-fw fa-gears"> {{ 'import_start_import'|_ }}
+

+   +

+

+ {{ 'import_share_configuration'|_ }} +

diff --git a/resources/views/import/finished.twig b/resources/views/import/finished.twig index 4a6f7e9903..abf47a20c6 100644 --- a/resources/views/import/finished.twig +++ b/resources/views/import/finished.twig @@ -11,9 +11,11 @@

{{ 'import_finished'|_ }}

- This import has beeen done. Link to tag or set of transactions. +

+ {{ 'import_share_configuration'|_ }} +

diff --git a/resources/views/import/index.twig b/resources/views/import/index.twig index c1b02b329a..137d87bf9d 100644 --- a/resources/views/import/index.twig +++ b/resources/views/import/index.twig @@ -11,20 +11,37 @@

{{ 'import'|_ }}

-

- {{ 'import_intro_text'|_ }} -

+
+
+

+ {{ 'import_data_full'|_ }} +

+

+ {{ 'import_intro_what_it_does'|_ }} +

+

+ {{ 'import_intro_import_conf_title'|_ }} +

+

+ {{ 'import_intro_import_conf_text'|_ }} +

+

+ {{ 'import_intro_beta_warning'|_ }} +

+ +

+  {{ 'import_intro_beta'|_ }} +

+
+
-

-  {{ 'import_intro_beta'|_ }} -

-
+
{{ ExpandedForm.file('import_file', {helpText: 'import_file_help'|_}) }} {{ ExpandedForm.file('configuration_file', {helpText: 'configuration_file_help'|_|raw}) }} diff --git a/resources/views/index.twig b/resources/views/index.twig index 64a8e1d873..88bd28b7e1 100644 --- a/resources/views/index.twig +++ b/resources/views/index.twig @@ -79,7 +79,7 @@
- {% include 'list.journals-tiny' with {'transactions': data[0],'account': data[1]} %} + {% include 'list.journals-tiny-tasker' with {'transactions': data[0],'account': data[1]} %}
-
-
- -
-
-

{{ 'savings'|_ }}

- -
-
- {% if savings|length == 0 %} -

{{ 'markAsSavingsToContinue'|_ }}

- {% else %} - {% for account in savings %} -
-
- -
{{ account.startBalance|formatAmount }}
- -
- {% if account.difference < 0 %} - -
-
- {% if account.percentage >= 20 %} - {{ account.difference|formatAmountPlain }} - {% endif %} -
-
- {% if account.percentage < 20 %} - {{ account.difference|formatAmountPlain }} - {% endif %} -
-
- {% else %} - -
-
- {% if account.percentage >= 20 %} - {{ account.difference|formatAmountPlain }} - {% endif %} -
-
- {% if account.percentage < 20 %} - {{ account.difference|formatAmountPlain }} - {% endif %} -
-
- {% endif %} - -
- -
{{ account.endBalance|formatAmount }}
-
- {% endfor %} - {% endif %} -
- -
-
-
- -
-
-

{{ 'piggyBanks'|_ }}

- -
-
- {% if piggyBankAccounts|length == 0 %} -

{{ 'createPiggyToContinue'|_ }}

- {% else %} - {% for account in piggyBankAccounts %} - -
- -
{{ account.startBalance|formatAmount }}
- -
- -
-
- {% if account.percentage >= 20 %} - {{ account.piggyBalance|formatAmountPlain }} {{ 'divided'|_ }} - {% endif %} -
-
- {% if account.percentage < 20 %} - {{ account.difference|formatAmountPlain }} {{ 'toDivide'|_ }} - {% endif %} -
-
-
- -
{{ account.piggyBalance|formatAmount }}
-
- {% endfor %} - {% endif %} -
-
-
-
- {% endblock %} {% block scripts %} diff --git a/resources/views/list/journals-tasker.twig b/resources/views/list/journals-tasker.twig new file mode 100644 index 0000000000..1af28d1a5d --- /dev/null +++ b/resources/views/list/journals-tasker.twig @@ -0,0 +1,140 @@ +{{ journals.render|raw }} + + + + + + + + + + + + + {% if not hideBudgets %} + + {% endif %} + + + {% if not hideCategories %} + + {% endif %} + + + {% if not hideBills %} + + {% endif %} + + + + + {% for transaction in journals %} + + + + + + + + + + + + {% if not hideBudgets %} + + {% endif %} + + + {% if not hideCategories %} + + {% endif %} + + + {% if not hideBills %} + + {% endif %} + + {% endfor %} + +
{{ trans('list.description') }}{{ trans('list.amount') }}
+ + + {% if transaction.transaction_description|length > 0 %} + {{ transaction.transaction_description }} ({{ transaction.description }}) + {% else %} + {{ transaction.description }} + {% endif %} + + {{ splitJournalIndicator(transaction.journal_id) }} + + {% if transaction.transactionJournal.attachments|length > 0 %} + + {% endif %} + + + + {{ formatAmountWithCode(transaction.transaction_amount, transaction.transaction_currency_code) }} + + {{ optionalJournalAmount(transaction.journal_id, transaction.transaction_amount, + transaction.transaction_currency_code, transaction.transaction_type_type) }} + + +
+ +
+
+ {{ journals.render|raw }} +
+
+ diff --git a/resources/views/list/journals-tiny-tasker.twig b/resources/views/list/journals-tiny-tasker.twig new file mode 100644 index 0000000000..a8eae3298d --- /dev/null +++ b/resources/views/list/journals-tiny-tasker.twig @@ -0,0 +1,25 @@ + diff --git a/resources/views/partials/menu-sidebar.twig b/resources/views/partials/menu-sidebar.twig index 983d7e1b3e..f1b45e4a37 100644 --- a/resources/views/partials/menu-sidebar.twig +++ b/resources/views/partials/menu-sidebar.twig @@ -130,7 +130,8 @@ -
  • +
  • {{ 'options'|_ }} @@ -149,9 +150,10 @@
  • {% if Auth.user.hasRole('owner') %} -
  • - {{ 'administration'|_ }} -
  • +
  • + {{ 'administration'|_ }} +
  • {% endif %} diff --git a/resources/views/popup/list/journals-tasker.twig b/resources/views/popup/list/journals-tasker.twig new file mode 100644 index 0000000000..36c36aeccb --- /dev/null +++ b/resources/views/popup/list/journals-tasker.twig @@ -0,0 +1,92 @@ + + + + + + + + {% if not hideSource %} + + {% endif %} + {% if not hideDestination %} + + {% endif %} + + {% if not hideBudget %} + + {% endif %} + + + {% if not hideCategory %} + + {% endif %} + + + + + {% for transaction in journals %} + + + + + + + {% if not hideSource %} + + {% endif %} + {% if not hideDestination %} + + {% endif %} + + + {% if not hideBudget %} + + {% endif %} + + + {% if not hideCategory %} + + {% endif %} + + {% endfor %} + + + + + + + +
     {{ trans('list.description') }}{{ trans('list.amount') }}
    + + {% if transaction.transaction_description|length > 0 %} + {{ transaction.transaction_description }} ({{ transaction.description }}) + {% else %} + {{ transaction.description }} + {% endif %} + + + + {{ formatAmountWithCode(transaction.transaction_amount, transaction.transaction_currency_code) }} + + {{ optionalJournalAmount(transaction.journal_id, transaction.transaction_amount, + transaction.transaction_currency_code, transaction.transaction_type_type) }} +
    {{ 'sum'|_ }}:{{ sum|formatAmount }}
    + +{{ journals.render|raw }} diff --git a/resources/views/popup/report/expense-entry.twig b/resources/views/popup/report/expense-entry.twig index bcc814827b..6af2fd25fd 100644 --- a/resources/views/popup/report/expense-entry.twig +++ b/resources/views/popup/report/expense-entry.twig @@ -8,7 +8,7 @@
    - - -
    diff --git a/resources/views/reports/audit/report.twig b/resources/views/reports/audit/report.twig index bd6c12bb75..8f57ea5fd6 100644 --- a/resources/views/reports/audit/report.twig +++ b/resources/views/reports/audit/report.twig @@ -62,7 +62,7 @@ balance: auditData[account.id].endBalance|formatAmount })|raw }}

    - {% include 'reports/partials/journals-audit.twig' with {'journals': auditData[account.id].journals,'account':account} %} + {% include 'reports/partials/journals-audit-tasker.twig' with {'journals': auditData[account.id].journals,'account':account} %}

    {{ trans('firefly.audit_end_balance', { diff --git a/resources/views/reports/default/month.twig b/resources/views/reports/default/month.twig index 6e34e689b1..69f1642d41 100644 --- a/resources/views/reports/default/month.twig +++ b/resources/views/reports/default/month.twig @@ -20,8 +20,7 @@

    -
    - {% include 'reports/partials/accounts.twig' %} +
    @@ -93,6 +92,9 @@ var hideTheRest = '{{ trans('firefly.hideTheRest',{number:incomeTopLength}) }}'; var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}'; var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}'; + + + var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}'; diff --git a/resources/views/reports/default/multi-year.twig b/resources/views/reports/default/multi-year.twig index 40170b188f..b631c35ff3 100644 --- a/resources/views/reports/default/multi-year.twig +++ b/resources/views/reports/default/multi-year.twig @@ -31,9 +31,7 @@
    -
    - {% include 'reports/partials/accounts.twig' %} - +
    @@ -176,6 +174,9 @@ var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}'; var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}'; + + var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}'; + diff --git a/resources/views/reports/default/year.twig b/resources/views/reports/default/year.twig index caf274a9ff..8bf9e86b1f 100644 --- a/resources/views/reports/default/year.twig +++ b/resources/views/reports/default/year.twig @@ -31,7 +31,8 @@
    - {% include 'reports/partials/accounts.twig' %} +
    +
    {% include 'reports/partials/income-vs-expenses.twig' %}
    @@ -133,6 +134,9 @@ var hideTheRest = '{{ trans('firefly.hideTheRest',{number:incomeTopLength}) }}'; var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}'; var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}'; + + + var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}'; diff --git a/resources/views/reports/partials/journals-audit-tasker.twig b/resources/views/reports/partials/journals-audit-tasker.twig new file mode 100644 index 0000000000..50e9ed6a00 --- /dev/null +++ b/resources/views/reports/partials/journals-audit-tasker.twig @@ -0,0 +1,161 @@ +{{ journals.render|raw }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% for transaction in journals %} + + + + + + + + + + + + + + + + + + + + + + + + + + {% if transaction.bill_id %} + + {% else %} + + {% endif %} + + + + + + + + + + + {% endfor %} + +
      {{ trans('list.description') }}{{ trans('list.balance_before') }}{{ trans('list.amount') }}{{ trans('list.balance_after') }}{{ trans('list.date') }}{{ trans('list.book_date') }}{{ trans('list.process_date') }}{{ trans('list.interest_date') }}{{ trans('list.due_date') }}{{ trans('list.payment_date') }}{{ trans('list.invoice_date') }}{{ trans('list.from') }}{{ trans('list.to') }}{{ trans('list.bill') }}{{ trans('list.internal_reference') }}{{ trans('list.notes') }}{{ trans('list.create_date') }}{{ trans('list.update_date') }}
    +
    + + +
    +
    {{ transaction|typeIconTransaction }} + + {% if transaction.transaction_description|length > 0 %} + {{ transaction.transaction_description }} ({{ transaction.description }}) + {% else %} + {{ transaction.description }} + {% endif %} + + {{ transaction.before|formatAmount }} + + {{ formatAmountWithCode(transaction.transaction_amount, transaction.transaction_currency_code) }} + + {{ optionalJournalAmount(transaction.journal_id, transaction.transaction_amount, + transaction.transaction_currency_code, transaction.transaction_type_type) }} + {{ transaction.after|formatAmount }}{{ transaction.date.formatLocalized(monthAndDayFormat) }} + {% if transaction.transactionJournal.hasMeta('book_date') %} + {{ transaction.transactionJournal.getMeta('book_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + {% if transaction.transactionJournal.hasMeta('process_date') %} + {{ transaction.transactionJournal.getMeta('process_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + {% if transaction.transactionJournal.hasMeta('interest_date') %} + {{ transaction.transactionJournal.getMeta('interest_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + {% if transaction.transactionJournal.hasMeta('due_date') %} + {{ transaction.transactionJournal.getMeta('due_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + {% if transaction.transactionJournal.hasMeta('payment_date') %} + {{ transaction.transactionJournal.getMeta('payment_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + {% if transaction.transactionJournal.hasMeta('invoice_date') %} + {{ transaction.transactionJournal.getMeta('invoice_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + {{ transactionSourceAccount(transaction) }} + + {{ transactionDestinationAccount(transaction) }} + + {{ transactionBudgets(transaction) }} + + {{ transactionCategories(transaction) }} + +   + {{ transaction.bill_name }} +   + + {% if transaction.transactionJournal.hasMeta('internal_reference') %} + {{ transaction.transactionJournal.getMeta('internal_reference') }} + {% endif %} + + + + {% if transaction.transactionJournal.hasMeta('notes') %} + {{ transaction.transactionJournal.getMeta('notes')|nl2br }} + {% endif %} + + + {{ transaction.transactionJournal.created_at.formatLocalized(dateTimeFormat) }} + + {{ transaction.transactionJournal.updated_at.formatLocalized(dateTimeFormat) }} +
    + +{{ journals.render|raw }} diff --git a/resources/views/rules/index.twig b/resources/views/rules/index.twig index 96b6597d01..5c0dee4ef9 100644 --- a/resources/views/rules/index.twig +++ b/resources/views/rules/index.twig @@ -104,10 +104,10 @@ class="btn btn-danger">
    -
    +
    diff --git a/resources/views/transactions/create.twig b/resources/views/transactions/create.twig index 63cf400f2c..afa0b4b78c 100644 --- a/resources/views/transactions/create.twig +++ b/resources/views/transactions/create.twig @@ -93,16 +93,15 @@ not optionalFields.invoice_date or not optionalFields.internal_reference or not optionalFields.notes or - not optionalFields.attachments - %} -

    {{ trans('firefly.hidden_fields_preferences', {link: route('preferences')})|raw }}

    + not optionalFields.attachments %} +

    + {{ trans('firefly.hidden_fields_preferences', {link: route('preferences')})|raw }}

    {% endif %} {% if - optionalFields.interest_date or optionalFields.book_date or optionalFields.process_date - or optionalFields.due_date or optionalFields.payment_date - or optionalFields.invoice_date - %} + optionalFields.interest_date or optionalFields.book_date or optionalFields.process_date + or optionalFields.due_date or optionalFields.payment_date + or optionalFields.invoice_date %}

    {{ 'optional_field_meta_dates'|_ }}

    diff --git a/resources/views/transactions/edit.twig b/resources/views/transactions/edit.twig index c13ff7bb31..03ed04c1ed 100644 --- a/resources/views/transactions/edit.twig +++ b/resources/views/transactions/edit.twig @@ -110,18 +110,17 @@ {% if - optionalFields.interest_date or - optionalFields.book_date or - optionalFields.process_date or - optionalFields.due_date or - optionalFields.payment_date or - optionalFields.invoice_date or - data.interest_date or - data.book_date or - data.process_date or - data.due_date or - data.payment_date - %} + optionalFields.interest_date or + optionalFields.book_date or + optionalFields.process_date or + optionalFields.due_date or + optionalFields.payment_date or + optionalFields.invoice_date or + data.interest_date or + data.book_date or + data.process_date or + data.due_date or + data.payment_date %}

    {{ 'optional_field_meta_dates'|_ }}

    @@ -163,15 +162,12 @@ {% endif %} - {% if - optionalFields.internal_reference or - optionalFields.notes or - data['interal_reference'] or - data['notes'] - - %} + optionalFields.internal_reference or + optionalFields.notes or + data['interal_reference'] or + data['notes'] %}

    {{ 'optional_field_meta_business'|_ }}

    diff --git a/routes/console.php b/routes/console.php index a70b3bb62b..6cfd0b721d 100755 --- a/routes/console.php +++ b/routes/console.php @@ -8,8 +8,6 @@ */ declare(strict_types = 1); -use Illuminate\Foundation\Inspiring; - /* |-------------------------------------------------------------------------- | Console Routes @@ -20,7 +18,3 @@ use Illuminate\Foundation\Inspiring; | simple approach to interacting with each command's IO methods. | */ - -Artisan::command('inspire', function () { - $this->comment(Inspiring::quote()); -}); diff --git a/routes/web.php b/routes/web.php index e6573fa07b..91187a8dc0 100755 --- a/routes/web.php +++ b/routes/web.php @@ -40,7 +40,7 @@ Route::group( Route::group( ['middleware' => 'user-simple-auth'], function () { Route::get('/error', 'HomeController@displayError'); - Route::any('logout', ['uses' => 'Auth\LoginController@logout','as' => 'logout']); + Route::any('logout', ['uses' => 'Auth\LoginController@logout', 'as' => 'logout']); Route::get('/flush', ['uses' => 'HomeController@flush']); } ); @@ -312,6 +312,14 @@ Route::group( Route::get('/reports', ['uses' => 'ReportController@index', 'as' => 'reports.index']); Route::get('/reports/report/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'ReportController@report', 'as' => 'reports.report']); + /** + * Report AJAX data Controller: + */ + Route::get( + '/reports/data/accountReport/{start_date}/{end_date}/{accountList}', + ['uses' => 'Report\AccountController@accountReport', 'as' => 'reports.data.accountReport'] + ); + /** * Rules Controller */ diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php index 2f2d20ff72..451bd48bed 100755 --- a/tests/ExampleTest.php +++ b/tests/ExampleTest.php @@ -4,6 +4,9 @@ use Illuminate\Foundation\Testing\WithoutMiddleware; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; +/** + * Class ExampleTest + */ class ExampleTest extends TestCase { /** diff --git a/tests/TestCase.php b/tests/TestCase.php index 8208edcaf6..2781681df5 100755 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,5 +1,8 @@