mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-17 20:08:52 +00:00
Code cleanup.
This commit is contained in:
@@ -66,8 +66,6 @@ class AccountDestroyService
|
||||
|
||||
// delete account meta:
|
||||
$account->accountMeta()->delete();
|
||||
|
||||
|
||||
// delete account.
|
||||
try {
|
||||
$account->delete();
|
||||
|
||||
@@ -66,8 +66,6 @@ trait AccountServiceTrait
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return $iban;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,6 @@ trait BillServiceTrait
|
||||
$ruleAction->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $note
|
||||
|
||||
@@ -41,8 +41,6 @@ use FireflyIII\Models\RecurrenceTransactionMeta;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Validation\AccountValidator;
|
||||
use Log;
|
||||
|
||||
|
||||
/**
|
||||
* Trait RecurringTransactionTrait
|
||||
*
|
||||
@@ -136,8 +134,6 @@ trait RecurringTransactionTrait
|
||||
$validator = app(AccountValidator::class);
|
||||
$validator->setUser($recurrence->user);
|
||||
$validator->setTransactionType($recurrence->transactionType->type);
|
||||
|
||||
|
||||
if (!$validator->validateSource($source->id, null, null)) {
|
||||
throw new FireflyException(sprintf('Source invalid: %s', $validator->sourceError)); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
@@ -76,8 +76,6 @@ class BillUpdateService
|
||||
'amount_max' => $bill->amount_max,
|
||||
'transaction_currency_name' => $bill->transactionCurrency->name,
|
||||
];
|
||||
|
||||
|
||||
// update note:
|
||||
if (array_key_exists('notes', $data)) {
|
||||
$this->updateNote($bill, (string)$data['notes']);
|
||||
|
||||
@@ -39,8 +39,6 @@ use Log;
|
||||
class CategoryUpdateService
|
||||
{
|
||||
private $user;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
@@ -138,8 +136,6 @@ class CategoryUpdateService
|
||||
->where('rt_meta.value', $oldName)
|
||||
->update(['rt_meta.value' => $newName]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Category $category
|
||||
* @param array $data
|
||||
|
||||
@@ -51,8 +51,6 @@ class GroupCloneService
|
||||
foreach ($group->transactionJournals as $journal) {
|
||||
$this->cloneJournal($journal, $newGroup, (int)$group->id);
|
||||
}
|
||||
|
||||
|
||||
return $newGroup;
|
||||
}
|
||||
|
||||
@@ -147,6 +145,4 @@ class GroupCloneService
|
||||
$newMeta->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -145,8 +145,6 @@ class JournalUpdateService
|
||||
$this->updateField('description');
|
||||
$this->updateField('date');
|
||||
$this->updateField('order');
|
||||
|
||||
|
||||
$this->transactionJournal->save();
|
||||
$this->transactionJournal->refresh();
|
||||
|
||||
@@ -294,8 +292,6 @@ class JournalUpdateService
|
||||
$validator->setTransactionType($expectedType);
|
||||
$validator->setUser($this->transactionJournal->user);
|
||||
$validator->source = $this->getValidSourceAccount();
|
||||
|
||||
|
||||
$result = $validator->validateDestination($destId, $destName, null);
|
||||
Log::debug(sprintf('hasValidDestinationAccount(%d, "%s") will return %s', $destId, $destName, var_export($result, true)));
|
||||
|
||||
@@ -393,8 +389,6 @@ class JournalUpdateService
|
||||
// refresh transactions.
|
||||
$this->sourceTransaction->refresh();
|
||||
$this->destinationTransaction->refresh();
|
||||
|
||||
|
||||
Log::debug(sprintf('Will set source to #%d ("%s")', $source->id, $source->name));
|
||||
Log::debug(sprintf('Will set dest to #%d ("%s")', $destination->id, $destination->name));
|
||||
}
|
||||
@@ -505,8 +499,6 @@ class JournalUpdateService
|
||||
// do some parsing.
|
||||
Log::debug(sprintf('Create date value from string "%s".', $value));
|
||||
}
|
||||
|
||||
|
||||
$this->transactionJournal->$fieldName = $value;
|
||||
Log::debug(sprintf('Updated %s', $fieldName));
|
||||
}
|
||||
@@ -692,13 +684,9 @@ class JournalUpdateService
|
||||
$origSourceTransaction = $this->getSourceTransaction();
|
||||
$origSourceTransaction->amount = app('steam')->negative($amount);
|
||||
$origSourceTransaction->save();
|
||||
|
||||
|
||||
$destTransaction = $this->getDestinationTransaction();
|
||||
$destTransaction->amount = app('steam')->positive($amount);
|
||||
$destTransaction->save();
|
||||
|
||||
|
||||
// refresh transactions.
|
||||
$this->sourceTransaction->refresh();
|
||||
$this->destinationTransaction->refresh();
|
||||
@@ -738,8 +726,6 @@ class JournalUpdateService
|
||||
$source->foreign_currency_id = $foreignCurrency->id;
|
||||
$source->foreign_amount = app('steam')->negative($foreignAmount);
|
||||
$source->save();
|
||||
|
||||
|
||||
$dest->foreign_currency_id = $foreignCurrency->id;
|
||||
$dest->foreign_amount = app('steam')->positive($foreignAmount);
|
||||
$dest->save();
|
||||
|
||||
@@ -103,8 +103,6 @@ class RecurrenceUpdateService
|
||||
$this->updateRepetitions($recurrence, $data['repetitions'] ?? []);
|
||||
}
|
||||
// update all transactions:
|
||||
|
||||
|
||||
// update all transactions (and associated meta-data)
|
||||
if (array_key_exists('transactions', $data)) {
|
||||
$this->updateTransactions($recurrence, $data['transactions'] ?? []);
|
||||
@@ -240,8 +238,6 @@ class RecurrenceUpdateService
|
||||
return;
|
||||
}
|
||||
$currencyFactory = app(TransactionCurrencyFactory::class);
|
||||
|
||||
|
||||
// loop all and try to match them:
|
||||
if ($originalCount === count($transactions)) {
|
||||
Log::debug('Loop and find');
|
||||
|
||||
Reference in New Issue
Block a user