mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-08-23 13:45:14 +00:00
Compare commits
64 Commits
5.1.0-alph
...
5.1.0
Author | SHA1 | Date | |
---|---|---|---|
|
379916ee08 | ||
|
60dbd51259 | ||
|
0927b0c8ae | ||
|
40cc510057 | ||
|
d580bf8f43 | ||
|
4434ea40ee | ||
|
2ba6ffccbc | ||
|
ec335ae88c | ||
|
542c64154c | ||
|
e4fa437f78 | ||
|
61f3f995ad | ||
|
8182cf1efa | ||
|
10d578503c | ||
|
75ee331f36 | ||
|
a32c484fd5 | ||
|
62d74e05f2 | ||
|
23ec5cbaa7 | ||
|
21fcb6f853 | ||
|
9b0a890531 | ||
|
af503597e6 | ||
|
e0c99fa80c | ||
|
a486d65893 | ||
|
08a6e22556 | ||
|
2d5c4c8101 | ||
|
4b7460c1cf | ||
|
8c8a2a1596 | ||
|
ee7731b1a1 | ||
|
36e4462957 | ||
|
e71a4a5595 | ||
|
287aa76d8d | ||
|
a9738fc2a9 | ||
|
bc485363ca | ||
|
f53e9d91c0 | ||
|
99fd90ee49 | ||
|
fb77210f2c | ||
|
6c163ebef3 | ||
|
1d8f34275a | ||
|
1fcc2f6b39 | ||
|
2eaa31163c | ||
|
3de4441bcd | ||
|
cbc43b9dc1 | ||
|
d018c57b17 | ||
|
a5d0658241 | ||
|
ce29beaf55 | ||
|
b11bcc1fbe | ||
|
ab0e77a2e8 | ||
|
80f0637c77 | ||
|
a280319a0b | ||
|
eb3a55d6e0 | ||
|
64a6661ea4 | ||
|
7f46cf805c | ||
|
d0d5dea5ce | ||
|
018ca29184 | ||
|
4b4f78b9eb | ||
|
f084e742c9 | ||
|
ab4de3fdd6 | ||
|
9f7d5b8e88 | ||
|
4958f6e4a6 | ||
|
b3e3a17add | ||
|
0b25fdd043 | ||
|
cfc48ccc26 | ||
|
3810085ea6 | ||
|
0088886915 | ||
|
c427404e5d |
@@ -24,6 +24,7 @@ DEFAULT_LANGUAGE=en_US
|
||||
|
||||
# Change this value to your preferred time zone.
|
||||
# Example: Europe/Amsterdam
|
||||
# For a list of supported time zones, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
TZ=Europe/Amsterdam
|
||||
|
||||
# This variable must match your installation's external address but keep in mind that
|
||||
|
2
.github/code_of_conduct.md
vendored
2
.github/code_of_conduct.md
vendored
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at thegrumpydictator@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at james@firefly-iii.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
|
2
.github/contributing.md
vendored
2
.github/contributing.md
vendored
@@ -4,7 +4,7 @@
|
||||
|
||||
## Feature requests
|
||||
|
||||
I am always interested in expanding Firefly III's many features. Just open a ticket or [drop me a line](mailto:thegrumpydictator@gmail.com).
|
||||
I am always interested in expanding Firefly III's many features. Just open a ticket or [drop me a line](mailto:james@firefly-iii.org).
|
||||
|
||||
## Pull requests
|
||||
|
||||
|
2
.github/security.md
vendored
2
.github/security.md
vendored
@@ -6,7 +6,7 @@ Only the latest version of Firefly III is supported. If you're not running the l
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you find something that compromises the security of Firefly III, you should [send me a message](mailto:thegrumpydictator@gmail.com) as soon as possible. These issues will be fixed immediately. You can also open an issue, but if you feel the issue is sensitive, please drop me a message instead.
|
||||
If you find something that compromises the security of Firefly III, you should [send me a message](mailto:james@firefly-iii.org) as soon as possible. These issues will be fixed immediately. You can also open an issue, but if you feel the issue is sensitive, please drop me a message instead.
|
||||
|
||||
You can use my [GPG key](https://keybase.io/jc5) for extra security. My [GitHub commits](https://github.com/firefly-iii/firefly-iii/commits/master) are almost always signed with this key.
|
||||
|
||||
|
@@ -32,6 +32,7 @@ use Illuminate\Http\Response;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class AccountController
|
||||
@@ -62,6 +63,7 @@ class AccountController extends Controller
|
||||
*/
|
||||
public function search(Request $request)
|
||||
{
|
||||
Log::debug('Now in account search()');
|
||||
$manager = $this->getManager();
|
||||
$query = $request->get('query');
|
||||
$field = $request->get('field');
|
||||
@@ -70,6 +72,8 @@ class AccountController extends Controller
|
||||
return response(null, 422);
|
||||
}
|
||||
$types = $this->mapAccountTypes($type);
|
||||
Log::debug(sprintf('Going to search for "%s" in types', $query), $types);
|
||||
|
||||
/** @var AccountSearch $search */
|
||||
$search = app(AccountSearch::class);
|
||||
$search->setUser(auth()->user());
|
||||
@@ -79,6 +83,8 @@ class AccountController extends Controller
|
||||
|
||||
$accounts = $search->search();
|
||||
|
||||
Log::debug(sprintf('Found %d accounts', $accounts->count()));
|
||||
|
||||
/** @var AccountTransformer $transformer */
|
||||
$transformer = app(AccountTransformer::class);
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
@@ -274,6 +274,7 @@ class TransactionController extends Controller
|
||||
*/
|
||||
public function store(TransactionStoreRequest $request): JsonResponse
|
||||
{
|
||||
Log::debug('Now in API TransactionController::store()');
|
||||
$data = $request->getAll();
|
||||
$data['user'] = auth()->user()->id;
|
||||
|
||||
@@ -283,6 +284,7 @@ class TransactionController extends Controller
|
||||
try {
|
||||
$transactionGroup = $this->groupRepository->store($data);
|
||||
} catch (DuplicateTransactionException $e) {
|
||||
Log::warning('Caught a duplicate. Return error message.');
|
||||
// return bad validation message.
|
||||
// TODO use Laravel's internal validation thing to do this.
|
||||
$response = [
|
||||
@@ -294,7 +296,7 @@ class TransactionController extends Controller
|
||||
|
||||
return response()->json($response, 422);
|
||||
}
|
||||
|
||||
app('preferences')->mark();
|
||||
event(new StoredTransactionGroup($transactionGroup));
|
||||
|
||||
$manager = $this->getManager();
|
||||
@@ -338,6 +340,7 @@ class TransactionController extends Controller
|
||||
$transactionGroup = $this->groupRepository->update($transactionGroup, $data);
|
||||
$manager = $this->getManager();
|
||||
|
||||
app('preferences')->mark();
|
||||
event(new UpdatedTransactionGroup($transactionGroup));
|
||||
|
||||
/** @var User $admin */
|
||||
|
@@ -30,7 +30,7 @@ use FireflyIII\Rules\IsDateOrTime;
|
||||
use FireflyIII\Support\NullArrayObject;
|
||||
use FireflyIII\Validation\TransactionValidation;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class TransactionStoreRequest
|
||||
@@ -46,6 +46,7 @@ class TransactionStoreRequest extends Request
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
Log::debug('Authorize TransactionStoreRequest');
|
||||
// Only allow authenticated users
|
||||
return auth()->check();
|
||||
}
|
||||
@@ -57,6 +58,7 @@ class TransactionStoreRequest extends Request
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
Log::debug('get all data in TransactionStoreRequest');
|
||||
$data = [
|
||||
'group_title' => $this->string('group_title'),
|
||||
'error_if_duplicate_hash' => $this->boolean('error_if_duplicate_hash'),
|
||||
@@ -73,6 +75,7 @@ class TransactionStoreRequest extends Request
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
Log::debug('Collect rules of TransactionStoreRequest');
|
||||
$rules = [
|
||||
// basic fields for group:
|
||||
'group_title' => 'between:1,1000|nullable',
|
||||
@@ -260,11 +263,11 @@ class TransactionStoreRequest extends Request
|
||||
'tags' => $this->arrayFromValue($object['tags']),
|
||||
|
||||
// all custom fields:
|
||||
'internal_reference' => $this->stringFromValue($object['internal_reference']),
|
||||
'external_id' => $this->stringFromValue($object['external_id']),
|
||||
'internal_reference' => $this->stringFromValue((string)$object['internal_reference']),
|
||||
'external_id' => $this->stringFromValue((string)$object['external_id']),
|
||||
'original_source' => sprintf('ff3-v%s|api-v%s', config('firefly.version'), config('firefly.api_version')),
|
||||
'recurrence_id' => $this->integerFromValue($object['recurrence_id']),
|
||||
'bunq_payment_id' => $this->stringFromValue($object['bunq_payment_id']),
|
||||
'bunq_payment_id' => $this->stringFromValue((string)$object['bunq_payment_id']),
|
||||
|
||||
'sepa_cc' => $this->stringFromValue($object['sepa_cc']),
|
||||
'sepa_ct_op' => $this->stringFromValue($object['sepa_ct_op']),
|
||||
|
@@ -65,6 +65,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
|
||||
return parent::render($request, $exception);
|
||||
case 'accounts.show':
|
||||
case 'accounts.show.all':
|
||||
return $this->handleAccount($request, $exception);
|
||||
case 'transactions.show':
|
||||
return $this->handleGroup($request, $exception);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* AccountFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* AccountMetaFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AttachmentFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* BillFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* BudgetFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* CategoryFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* PiggyBankEventFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* PiggyBankFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RecurrenceFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TagFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionCurrencyFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* TransactionFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionGroupFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
@@ -26,6 +26,7 @@ namespace FireflyIII\Factory;
|
||||
use FireflyIII\Exceptions\DuplicateTransactionException;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\User;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class TransactionGroupFactory
|
||||
@@ -60,7 +61,12 @@ class TransactionGroupFactory
|
||||
$this->journalFactory->setUser($this->user);
|
||||
$this->journalFactory->setErrorOnHash($data['error_if_duplicate_hash'] ?? false);
|
||||
|
||||
$collection = $this->journalFactory->create($data);
|
||||
try {
|
||||
$collection = $this->journalFactory->create($data);
|
||||
} catch(DuplicateTransactionException $e) {
|
||||
Log::warning('GroupFactory::create() caught journalFactory::create() with a duplicate!');
|
||||
throw new DuplicateTransactionException($e->getMessage());
|
||||
}
|
||||
$title = $data['group_title'] ?? null;
|
||||
$title = '' === $title ? null : $title;
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* TransactionJournalFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
@@ -129,11 +129,11 @@ class TransactionJournalFactory
|
||||
public function create(array $data): Collection
|
||||
{
|
||||
// convert to special object.
|
||||
$data = new NullArrayObject($data);
|
||||
$dataObject = new NullArrayObject($data);
|
||||
|
||||
Log::debug('Start of TransactionJournalFactory::create()');
|
||||
$collection = new Collection;
|
||||
$transactions = $data['transactions'] ?? [];
|
||||
$transactions = $dataObject['transactions'] ?? [];
|
||||
if (0 === count($transactions)) {
|
||||
Log::error('There are no transactions in the array, the TransactionJournalFactory cannot continue.');
|
||||
|
||||
@@ -145,7 +145,12 @@ class TransactionJournalFactory
|
||||
Log::debug(sprintf('Now creating journal %d/%d', $index + 1, count($transactions)));
|
||||
|
||||
Log::debug('Going to call createJournal', $row);
|
||||
$journal = $this->createJournal(new NullArrayObject($row));
|
||||
try {
|
||||
$journal = $this->createJournal(new NullArrayObject($row));
|
||||
} catch (DuplicateTransactionException|Exception $e) {
|
||||
Log::warning('TransactionJournalFactory::create() caught a duplicate journal in createJournal()');
|
||||
throw new DuplicateTransactionException($e->getMessage());
|
||||
}
|
||||
if (null !== $journal) {
|
||||
$collection->push($journal);
|
||||
}
|
||||
@@ -395,17 +400,20 @@ class TransactionJournalFactory
|
||||
*/
|
||||
private function errorIfDuplicate(string $hash): void
|
||||
{
|
||||
Log::debug(sprintf('In errorIfDuplicate(%s)', $hash));
|
||||
if (false === $this->errorOnHash) {
|
||||
return;
|
||||
}
|
||||
$result = null;
|
||||
if ($this->errorOnHash) {
|
||||
Log::debug('Will verify duplicate!');
|
||||
/** @var TransactionJournalMeta $result */
|
||||
$result = TransactionJournalMeta::where('data', json_encode($hash, JSON_THROW_ON_ERROR))
|
||||
->with(['transactionJournal', 'transactionJournal.transactionGroup'])
|
||||
->first();
|
||||
}
|
||||
if (null !== $result) {
|
||||
Log::warning('Found a duplicate!');
|
||||
throw new DuplicateTransactionException(sprintf('Duplicate of transaction #%d.', $result->transactionJournal->transaction_group_id));
|
||||
}
|
||||
}
|
||||
@@ -526,6 +534,9 @@ class TransactionJournalFactory
|
||||
public function setErrorOnHash(bool $errorOnHash): void
|
||||
{
|
||||
$this->errorOnHash = $errorOnHash;
|
||||
if (true === $errorOnHash) {
|
||||
Log::info('Will trigger duplication alert for this journal.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionJournalMetaFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* TransactionTypeFactory.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -60,6 +60,8 @@ class GroupCollector implements GroupCollectorInterface
|
||||
private $hasCatInformation;
|
||||
/** @var bool Will be true of the query has the tag info tables joined. */
|
||||
private $hasJoinedTagTables;
|
||||
/** @var bool Will be true for attachments */
|
||||
private $hasJoinedAttTables;
|
||||
/** @var int The maximum number of results. */
|
||||
private $limit;
|
||||
/** @var int The page to return. */
|
||||
@@ -86,7 +88,8 @@ class GroupCollector implements GroupCollectorInterface
|
||||
$this->hasBudgetInformation = false;
|
||||
$this->hasBillInformation = false;
|
||||
$this->hasJoinedTagTables = false;
|
||||
$this->integerFields = [
|
||||
$this->hasJoinedAttTables = false;
|
||||
$this->integerFields = [
|
||||
'transaction_group_id',
|
||||
'user_id',
|
||||
'transaction_journal_id',
|
||||
@@ -101,10 +104,10 @@ class GroupCollector implements GroupCollectorInterface
|
||||
'destination_transaction_id',
|
||||
'destination_account_id',
|
||||
'category_id',
|
||||
'budget_id'
|
||||
'budget_id',
|
||||
];
|
||||
$this->total = 0;
|
||||
$this->fields = [
|
||||
$this->total = 0;
|
||||
$this->fields = [
|
||||
# group
|
||||
'transaction_groups.id as transaction_group_id',
|
||||
'transaction_groups.user_id as user_id',
|
||||
@@ -281,11 +284,10 @@ class GroupCollector implements GroupCollectorInterface
|
||||
*/
|
||||
public function getGroups(): Collection
|
||||
{
|
||||
$start = microtime(true);
|
||||
//$start = microtime(true);
|
||||
/** @var Collection $result */
|
||||
$result = $this->query->get($this->fields);
|
||||
$end = round(microtime(true) - $start, 5);
|
||||
|
||||
//$end = round(microtime(true) - $start, 5);
|
||||
// log info about query time.
|
||||
//Log::info(sprintf('Query took Firefly III %s seconds', $end));
|
||||
//Log::info($this->query->toSql(), $this->query->getBindings());
|
||||
@@ -950,6 +952,24 @@ class GroupCollector implements GroupCollectorInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Join table to get attachment information.
|
||||
*/
|
||||
private function joinAttachmentTables(): void
|
||||
{
|
||||
if (false === $this->hasJoinedAttTables) {
|
||||
// join some extra tables:
|
||||
$this->hasJoinedAttTables = true;
|
||||
$this->query->leftJoin('attachments', 'attachments.attachable_id', '=', 'transaction_journals.id')
|
||||
->where(
|
||||
static function (EloquentBuilder $q1) {
|
||||
$q1->where('attachments.attachable_type', TransactionJournal::class);
|
||||
$q1->orWhereNull('attachments.attachable_type');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $existingJournal
|
||||
* @param TransactionJournal $newJournal
|
||||
@@ -980,6 +1000,26 @@ class GroupCollector implements GroupCollectorInterface
|
||||
return $existingJournal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $existingJournal
|
||||
* @param TransactionJournal $newJournal
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function mergeAttachments(array $existingJournal, TransactionJournal $newJournal): array
|
||||
{
|
||||
$newArray = $newJournal->toArray();
|
||||
if (isset($newArray['attachment_id'])) {
|
||||
$attachmentId = (int)$newJournal['tag_id'];
|
||||
$existingJournal['attachments'][$attachmentId] = [
|
||||
'id' => $attachmentId,
|
||||
];
|
||||
}
|
||||
|
||||
return $existingJournal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*
|
||||
@@ -994,7 +1034,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
|
||||
if (!isset($groups[$groupId])) {
|
||||
// make new array
|
||||
$parsedGroup = $this->parseAugmentedGroup($augumentedJournal);
|
||||
$parsedGroup = $this->parseAugmentedJournal($augumentedJournal);
|
||||
$groupArray = [
|
||||
'id' => (int)$augumentedJournal->transaction_group_id,
|
||||
'user_id' => (int)$augumentedJournal->user_id,
|
||||
@@ -1014,11 +1054,14 @@ class GroupCollector implements GroupCollectorInterface
|
||||
$groups[$groupId]['count']++;
|
||||
|
||||
if (isset($groups[$groupId]['transactions'][$journalId])) {
|
||||
// append data to existing group + journal (for multiple tags or multiple attachments)
|
||||
$groups[$groupId]['transactions'][$journalId] = $this->mergeTags($groups[$groupId]['transactions'][$journalId], $augumentedJournal);
|
||||
$groups[$groupId]['transactions'][$journalId] = $this->mergeAttachments($groups[$groupId]['transactions'][$journalId], $augumentedJournal);
|
||||
}
|
||||
|
||||
if (!isset($groups[$groupId]['transactions'][$journalId])) {
|
||||
$groups[$groupId]['transactions'][$journalId] = $this->parseAugmentedGroup($augumentedJournal);
|
||||
// create second, third, fourth split:
|
||||
$groups[$groupId]['transactions'][$journalId] = $this->parseAugmentedJournal($augumentedJournal);
|
||||
}
|
||||
|
||||
|
||||
@@ -1034,10 +1077,11 @@ class GroupCollector implements GroupCollectorInterface
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function parseAugmentedGroup(TransactionJournal $augumentedJournal): array
|
||||
private function parseAugmentedJournal(TransactionJournal $augumentedJournal): array
|
||||
{
|
||||
$result = $augumentedJournal->toArray();
|
||||
$result['tags'] = [];
|
||||
$result = $augumentedJournal->toArray();
|
||||
$result['tags'] = [];
|
||||
$result['attachments'] = [];
|
||||
try {
|
||||
$result['date'] = new Carbon($result['date']);
|
||||
$result['created_at'] = new Carbon($result['created_at']);
|
||||
@@ -1067,6 +1111,14 @@ class GroupCollector implements GroupCollectorInterface
|
||||
];
|
||||
}
|
||||
|
||||
// also merge attachments:
|
||||
if (isset($augumentedJournal['attachment_id'])) {
|
||||
$attachmentId = (int)$augumentedJournal['attachment_id'];
|
||||
$result['attachments'][$attachmentId] = [
|
||||
'id' => $attachmentId,
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1230,4 +1282,15 @@ class GroupCollector implements GroupCollectorInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function withAttachmentInformation(): GroupCollectorInterface
|
||||
{
|
||||
$this->fields[] = 'attachments.id as attachment_id';
|
||||
$this->joinAttachmentTables();
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@@ -57,6 +57,13 @@ interface GroupCollectorInterface
|
||||
*/
|
||||
public function amountLess(string $amount): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Add basic info on attachments of transactions.
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function withAttachmentInformation(): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* Get transactions where the amount is more than.
|
||||
*
|
||||
|
@@ -114,7 +114,7 @@ class CategoryController extends Controller
|
||||
$cache->addProperty($end);
|
||||
$cache->addProperty('chart.category.frontpage');
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||
// return response()->json($cache->get()); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
// currency repos:
|
||||
@@ -163,22 +163,24 @@ class CategoryController extends Controller
|
||||
|
||||
// no category per currency:
|
||||
$noCategory = $noCatRepository->sumExpenses($start, $end);
|
||||
if (0 !== bccomp($noCategory[0]['sum'] ?? '0', '0')) {
|
||||
|
||||
foreach ($noCategory as $currency) {
|
||||
$currencyId = $currency['currency_id'];
|
||||
$currencies[$currencyId] = $currencies[$currencyId] ?? [
|
||||
'currency_id' => $currency['currency_id'],
|
||||
'currency_name' => $currency['currency_name'],
|
||||
'currency_symbol' => $currency['currency_symbol'],
|
||||
'currency_code' => $currency['currency_code'],
|
||||
'currency_decimal_places' => $currency['currency_decimal_places'],
|
||||
foreach ($noCategory as $currency) {
|
||||
$currencyId = $currency['currency_id'];
|
||||
$currencies[$currencyId] = $currencies[$currencyId] ?? [
|
||||
'currency_id' => $currency['currency_id'],
|
||||
'currency_name' => $currency['currency_name'],
|
||||
'currency_symbol' => $currency['currency_symbol'],
|
||||
'currency_code' => $currency['currency_code'],
|
||||
'currency_decimal_places' => $currency['currency_decimal_places'],
|
||||
];
|
||||
$tempData[] = [
|
||||
'name' => trans('firefly.no_category'),
|
||||
'sum' => $currency['sum'],
|
||||
'sum_float' => round($currency['sum'], $currency['currency_decimal_places'] ?? 2),
|
||||
'currency_id' => $currency['currency_id'],
|
||||
];
|
||||
$tempData[] = [
|
||||
'name' => trans('firefly.no_category'),
|
||||
'sum' => $currency['sum'],
|
||||
'sum_float' => round($currency['sum'], $currency['currency_decimal_places']),
|
||||
'currency_id' => $currency['currency_id'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// sort temp array by amount.
|
||||
@@ -203,6 +205,7 @@ class CategoryController extends Controller
|
||||
$name = $entry['name'];
|
||||
$chartData[$currencyId]['entries'][$name] = bcmul($entry['sum'], '-1');
|
||||
}
|
||||
|
||||
$data = $this->generator->multiSet($chartData);
|
||||
$cache->store($data);
|
||||
|
||||
|
@@ -118,6 +118,7 @@ class DebugController extends Controller
|
||||
$search = ['~', '#'];
|
||||
$replace = ['\~', '# '];
|
||||
|
||||
$installationId = app('fireflyconfig')->get('installation_id', '')->data;
|
||||
$phpVersion = str_replace($search, $replace, PHP_VERSION);
|
||||
$phpOs = str_replace($search, $replace, PHP_OS);
|
||||
$interface = PHP_SAPI;
|
||||
@@ -126,8 +127,6 @@ class DebugController extends Controller
|
||||
$drivers = implode(', ', DB::availableDrivers());
|
||||
$currentDriver = DB::getDriverName();
|
||||
$userAgent = $request->header('user-agent');
|
||||
$isSandstorm = var_export(config('firefly.is_sandstorm'), true);
|
||||
$toSandbox = var_export(config('firefly.bunq_use_sandbox'), true);
|
||||
$trustedProxies = config('firefly.trusted_proxies');
|
||||
$displayErrors = ini_get('display_errors');
|
||||
$errorReporting = $this->errorReporting((int)ini_get('error_reporting'));
|
||||
@@ -174,9 +173,10 @@ class DebugController extends Controller
|
||||
|
||||
return view(
|
||||
'debug', compact(
|
||||
'phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'logChannel', 'appLogLevel', 'now', 'drivers', 'currentDriver', 'loginProvider',
|
||||
'userAgent', 'displayErrors', 'errorReporting', 'phpOs', 'interface', 'logContent', 'cacheDriver', 'isSandstorm', 'trustedProxies', 'toSandbox'
|
||||
)
|
||||
'phpVersion', 'extensions', 'localeAttempts', 'appEnv', 'appDebug', 'logChannel', 'appLogLevel', 'now', 'drivers', 'currentDriver',
|
||||
'loginProvider',
|
||||
'userAgent', 'displayErrors', 'installationId', 'errorReporting', 'phpOs', 'interface', 'logContent', 'cacheDriver', 'trustedProxies'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -185,7 +185,7 @@ class BoxController extends Controller
|
||||
foreach ($set as $journal) {
|
||||
$currencyId = (int)$journal['currency_id'];
|
||||
$expenses[$currencyId] = $expenses[$currencyId] ?? '0';
|
||||
$expenses[$currencyId] = bcadd($expenses[$currencyId], $journal['amount']);
|
||||
$expenses[$currencyId] = bcadd($expenses[$currencyId], $journal['amount'] ?? '0');
|
||||
$sums[$currencyId] = $sums[$currencyId] ?? '0';
|
||||
$sums[$currencyId] = bcadd($sums[$currencyId], $journal['amount']);
|
||||
}
|
||||
|
@@ -70,6 +70,12 @@ class CreateController extends Controller
|
||||
$service = app(GroupCloneService::class);
|
||||
$newGroup = $service->cloneGroup($group);
|
||||
|
||||
app('preferences')->mark();
|
||||
|
||||
$title = $newGroup->title ?? $newGroup->transactionJournals->first()->description;
|
||||
|
||||
session()->flash('success', trans('firefly.stored_journal', ['description' => $title]));
|
||||
|
||||
return redirect(route('transactions.show', [$newGroup->id]));
|
||||
}
|
||||
|
||||
|
@@ -107,7 +107,8 @@ class IndexController extends Controller
|
||||
->setPage($page)
|
||||
->withBudgetInformation()
|
||||
->withCategoryInformation()
|
||||
->withAccountInformation();
|
||||
->withAccountInformation()
|
||||
->withAttachmentInformation();
|
||||
$groups = $collector->getPaginatedGroups();
|
||||
$groups->setPath($path);
|
||||
|
||||
@@ -147,7 +148,8 @@ class IndexController extends Controller
|
||||
->setPage($page)
|
||||
->withAccountInformation()
|
||||
->withBudgetInformation()
|
||||
->withCategoryInformation();
|
||||
->withCategoryInformation()
|
||||
->withAttachmentInformation();
|
||||
$groups = $collector->getPaginatedGroups();
|
||||
$groups->setPath($path);
|
||||
|
||||
|
@@ -88,7 +88,7 @@ class ShowController extends Controller
|
||||
throw new FireflyException('This transaction is broken :(.');
|
||||
}
|
||||
|
||||
$type = $first->transactionType->type;
|
||||
$type = (string)trans(sprintf('firefly.%s',$first->transactionType->type));
|
||||
$title = 1 === $splits ? $first->description : $transactionGroup->title;
|
||||
$subTitle = sprintf('%s: "%s"', $type, $title);
|
||||
|
||||
|
@@ -347,6 +347,7 @@ class Request extends FormRequest
|
||||
$longitudeKey = null === $prefix ? 'longitude' : sprintf('%s_longitude', $prefix);
|
||||
$latitudeKey = null === $prefix ? 'latitude' : sprintf('%s_latitude', $prefix);
|
||||
$zoomLevelKey = null === $prefix ? 'zoom_level' : sprintf('%s_zoom_level', $prefix);
|
||||
$hasLocationKey = null === $prefix ? 'has_location' : sprintf('%s_has_location', $prefix);
|
||||
|
||||
// for a POST (store, all fields must be present and accounted for:
|
||||
if (
|
||||
@@ -354,7 +355,8 @@ class Request extends FormRequest
|
||||
&& ($this->has($longitudeKey) && $this->has($latitudeKey) && $this->has($zoomLevelKey))
|
||||
) {
|
||||
Log::debug('Method is POST and all fields present.');
|
||||
$data['store_location'] = true;
|
||||
|
||||
$data['store_location'] = $this->boolean($hasLocationKey);
|
||||
$data['longitude'] = '' === $this->string($longitudeKey) ? null : $this->string($longitudeKey);
|
||||
$data['latitude'] = '' === $this->string($latitudeKey) ? null : $this->string($latitudeKey);
|
||||
$data['zoom_level'] = '' === $this->string($zoomLevelKey) ? null : $this->integer($zoomLevelKey);
|
||||
|
@@ -70,18 +70,22 @@ class IngDescription implements SpecificInterface
|
||||
public function run(array $row): array
|
||||
{
|
||||
$this->row = array_values($row);
|
||||
array_push($this->row); // New column for "Valutadatum"
|
||||
if (count($this->row) >= 8) { // check if the array is correct
|
||||
switch ($this->row[4]) { // Get value for the mutation type
|
||||
case 'GT': // InternetBankieren
|
||||
case 'OV': // Overschrijving
|
||||
case 'VZ': // Verzamelbetaling
|
||||
case 'IC': // Incasso
|
||||
$this->removeIBANIngDescription();
|
||||
$this->removeNameIngDescription();
|
||||
// if "tegenrekening" empty, copy the description. Primitive, but it works.
|
||||
$this->copyDescriptionToOpposite();
|
||||
case 'DV': // Divers
|
||||
$this->removeIBANIngDescription(); // Remove "IBAN:", because it is already at "Tegenrekening"
|
||||
$this->removeNameIngDescription(); // Remove "Naam:", because it is already at "Naam/ Omschrijving"
|
||||
$this->removeIngDescription(); // Remove "Omschrijving", but not the value from description
|
||||
$this->moveValutadatumDescription(); // Move "Valutadatum" from description to new column
|
||||
$this->MoveSavingsAccount(); // Move savings account number and name
|
||||
break;
|
||||
case 'BA': // Betaalautomaat
|
||||
$this->moveValutadatumDescription(); // Move "Valutadatum" from description to new column
|
||||
$this->addNameIngDescription();
|
||||
break;
|
||||
}
|
||||
@@ -99,33 +103,60 @@ class IngDescription implements SpecificInterface
|
||||
$this->row[8] = $this->row[1] . ' ' . $this->row[8];
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove "Omschrijving" (and NOT its value) from the description.
|
||||
*/
|
||||
protected function removeIngDescription(): void
|
||||
{
|
||||
$this->row[8] = preg_replace('/Omschrijving: /', '', $this->row[8]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove IBAN number out of the description
|
||||
* Default description of Description is: Naam: <OPPOS NAME> Omschrijving: <DESCRIPTION> IBAN: <OPPOS IBAN NR>.
|
||||
*/
|
||||
protected function removeIBANIngDescription(): void
|
||||
{
|
||||
// Try replace the iban number with nothing. The IBAN nr is found in the third row
|
||||
// Try replace the iban number with nothing. The IBAN nr is found in the third column
|
||||
$this->row[8] = preg_replace('/\sIBAN:\s' . $this->row[3] . '/', '', $this->row[8]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove name from the description (Remove everything before the description incl the word 'Omschrijving' ).
|
||||
* Remove "Naam" (and its value) from the description.
|
||||
*/
|
||||
protected function removeNameIngDescription(): void
|
||||
{
|
||||
// Try remove everything before the 'Omschrijving'
|
||||
$this->row[8] = preg_replace('/.+Omschrijving: /', '', $this->row[8]);
|
||||
$this->row[8] = preg_replace('/Naam:.*?([a-zA-Z\/]+:)/', '$1', $this->row[8]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy description to name of opposite account.
|
||||
* Move "Valutadatum" from the description to new column.
|
||||
*/
|
||||
private function copyDescriptionToOpposite(): void
|
||||
protected function moveValutadatumDescription(): void
|
||||
{
|
||||
$search = ['Naar Oranje Spaarrekening ', 'Afschrijvingen'];
|
||||
$matches = array();
|
||||
preg_match('/Valutadatum: ([0-9-]+)/', $this->row[8], $matches);
|
||||
$this->row[9] = date("Ymd", strtotime($matches[1]));
|
||||
$this->row[8] = preg_replace('/Valutadatum: [0-9-]+/', '', $this->row[8]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Move savings account number to column 1 and name to column 3.
|
||||
*/
|
||||
private function MoveSavingsAccount(): void
|
||||
{
|
||||
$matches = array();
|
||||
if ('' === (string)$this->row[3]) {
|
||||
$this->row[3] = trim(str_ireplace($search, '', $this->row[8]));
|
||||
if (preg_match('/(Naar|Van) (.*rekening) ([0-9]+)/', $this->row[8], $matches)) {
|
||||
$matches[3] = sprintf("%010d", $matches[3]);
|
||||
$this->row[1] = $matches[2]; // Savings account name
|
||||
$this->row[3] = $matches[3]; // Savings account number
|
||||
$this->row[8] = preg_replace('/(Naar|Van) (.*rekening) ([0-9]+)/', '', $this->row[8]); // Remove the savings account content from description
|
||||
} elseif (preg_match('/(Naar|Van) (.*rekening) ([0-9]+)/', $this->row[1], $matches)) {
|
||||
$matches[3] = sprintf("%010d", $matches[3]);
|
||||
$this->row[1] = $matches[2]; // Savings account name
|
||||
$this->row[3] = $matches[3]; // Savings account number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Account.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AccountMeta.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AccountType.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Attachment.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AvailableBudget.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Bill.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Budget.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* BudgetLimit.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Category.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Configuration.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* CurrencyExchangeRate.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* ImportJob.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* LinkType.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Location.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Note.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* PiggyBank.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* PiggyBankEvent.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* PiggyBankRepetition.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Preference.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Recurrence.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RecurrenceMeta.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RecurrenceRepetition.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RecurrenceTransaction.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RecurrenceTransactionMeta.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Role.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Rule.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RuleAction.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RuleGroup.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RuleTrigger.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Tag.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Transaction.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionCurrency.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionGroup.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionJournal.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionJournalLink.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionJournalMeta.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionType.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AccountServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AdminServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AppServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AttachmentServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AuthServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* BillServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* BroadcastServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* BudgetServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* CategoryServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* CurrencyServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* EventServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* FireflyServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* FireflySessionProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* ImportServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* JournalServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* PiggyBankServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RecurringServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RouteServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RuleGroupServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* RuleServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* SearchServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* SessionServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* TagServiceProvider.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AccountRepository.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
@@ -473,7 +473,9 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
if (AccountType::ASSET !== $account->accountType->type) {
|
||||
throw new FireflyException(sprintf('%s is not an asset account.', $account->name));
|
||||
}
|
||||
$name = $account->name . ' reconciliation';
|
||||
|
||||
$name = trans('firefly.reconciliation_account_name', ['name' => $account->name]);
|
||||
|
||||
/** @var AccountType $type */
|
||||
$type = AccountType::where('type', AccountType::RECONCILIATION)->first();
|
||||
$accounts = $this->user->accounts()->where('account_type_id', $type->id)->get();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AccountRepositoryInterface.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AccountTasker.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* AccountTaskerInterface.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* OperationsRepository.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* OperationsRepositoryInterface.php
|
||||
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user