First part of a large code cleanup commit.

This commit is contained in:
James Cole
2019-02-12 21:49:28 +01:00
parent b273af341c
commit e0d87aa11e
70 changed files with 336 additions and 354 deletions

View File

@@ -102,10 +102,12 @@ class ConvertToDeposit implements ActionInterface
if (TransactionType::WITHDRAWAL === $type) {
Log::debug('Going to transform a withdrawal to a deposit.');
return $this->convertWithdrawal($journal);
}
if (TransactionType::TRANSFER === $type) {
Log::debug('Going to transform a transfer to a deposit.');
return $this->convertTransfer($journal);
}
@@ -133,7 +135,7 @@ class ConvertToDeposit implements ActionInterface
// get the action value, or use the original source name in case the action value is empty:
// this becomes a new or existing revenue account.
/** @var Account $source */
$source = $sourceTransactions->first()->account;
$source = $sourceTransactions->first()->account;
$revenueName = '' === $this->action->action_value ? $source->name : $this->action->action_value;
$revenue = $factory->findOrCreate($revenueName, AccountType::REVENUE);