mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various bugfixes and code clean up.
This commit is contained in:
@@ -28,6 +28,7 @@ use FireflyIII\Factory\BudgetFactory;
|
||||
use FireflyIII\Factory\CategoryFactory;
|
||||
use FireflyIII\Factory\PiggyBankFactory;
|
||||
use FireflyIII\Factory\TransactionCurrencyFactory;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceMeta;
|
||||
@@ -44,6 +45,15 @@ use Log;
|
||||
*/
|
||||
trait RecurringTransactionTrait
|
||||
{
|
||||
/**
|
||||
* @param null|string $expectedType
|
||||
* @param int|null $accountId
|
||||
* @param null|string $accountName
|
||||
*
|
||||
* @return Account|null
|
||||
*/
|
||||
abstract public function findAccount(?string $expectedType, ?int $accountId, ?string $accountName): ?Account;
|
||||
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $repetitions
|
||||
|
@@ -124,7 +124,6 @@ trait TransactionServiceTrait
|
||||
|
||||
// alternatively, return by name. Validator should catch invalid names.
|
||||
return $repository->findByName($accountName, [AccountType::ASSET]);
|
||||
break;
|
||||
case AccountType::EXPENSE:
|
||||
if ($accountId > 0) {
|
||||
// must be able to find it based on ID. Validator should catch invalid ID's.
|
||||
@@ -140,7 +139,6 @@ trait TransactionServiceTrait
|
||||
|
||||
// return cash account:
|
||||
return $repository->getCashAccount();
|
||||
break;
|
||||
case AccountType::REVENUE:
|
||||
if ($accountId > 0) {
|
||||
// must be able to find it based on ID. Validator should catch invalid ID's.
|
||||
|
Reference in New Issue
Block a user