mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 13:10:35 +00:00
Various code cleanup.
This commit is contained in:
@@ -151,7 +151,7 @@ trait RecurringTransactionTrait
|
||||
[
|
||||
'recurrence_id' => $recurrence->id,
|
||||
'transaction_currency_id' => $currency->id,
|
||||
'foreign_currency_id' => null === $foreignCurrency ? null : $foreignCurrency->id,
|
||||
'foreign_currency_id' => $foreignCurrency?->id,
|
||||
'source_id' => $source->id,
|
||||
'destination_id' => $destination->id,
|
||||
'amount' => $array['amount'],
|
||||
|
||||
@@ -31,6 +31,7 @@ use FireflyIII\Models\Location;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Services\Internal\Support\AccountServiceTrait;
|
||||
use FireflyIII\User;
|
||||
use JsonException;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
@@ -78,7 +79,7 @@ class AccountUpdateService
|
||||
*
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function update(Account $account, array $data): Account
|
||||
{
|
||||
@@ -215,7 +216,7 @@ class AccountUpdateService
|
||||
$newOrder = $data['order'];
|
||||
Log::debug(sprintf('Order is set to be updated from %s to %s', $oldOrder, $newOrder));
|
||||
$list = $this->getTypeIds([AccountType::MORTGAGE, AccountType::LOAN, AccountType::DEBT]);
|
||||
if (in_array($type, [AccountType::ASSET], true)) {
|
||||
if ($type === AccountType::ASSET) {
|
||||
$list = $this->getTypeIds([AccountType::ASSET]);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\Internal\Update;
|
||||
|
||||
use FireflyIII\Exceptions\DuplicateTransactionException;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\TransactionJournalFactory;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
@@ -168,7 +169,7 @@ class GroupUpdateService
|
||||
* @param array $data
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws \FireflyIII\Exceptions\DuplicateTransactionException
|
||||
* @throws DuplicateTransactionException
|
||||
*/
|
||||
private function createTransactionJournal(TransactionGroup $transactionGroup, array $data): void
|
||||
{
|
||||
|
||||
@@ -475,7 +475,7 @@ class JournalUpdateService
|
||||
$billId = (int)($this->data['bill_id'] ?? 0);
|
||||
$billName = (string)($this->data['bill_name'] ?? '');
|
||||
$bill = $this->billRepository->findBill($billId, $billName);
|
||||
$this->transactionJournal->bill_id = null === $bill ? null : $bill->id;
|
||||
$this->transactionJournal->bill_id = $bill?->id;
|
||||
Log::debug('Updated bill ID');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user