Fix #7845 among other things

This commit is contained in:
James Cole
2023-08-12 17:43:24 +02:00
parent 4c90f66578
commit 1b9d8dd3c3
38 changed files with 120 additions and 123 deletions

View File

@@ -143,9 +143,8 @@ class JournalUpdateService
Log::debug(sprintf('Now in %s', __METHOD__));
Log::debug(sprintf('Now in JournalUpdateService for journal #%d.', $this->transactionJournal->id));
if ($this->removeReconciliation()) {
$this->data['reconciled'] = false;
}
$this->data['reconciled'] = array_key_exists('reconciled', $this->data) ? $this->data['reconciled'] : false;
// can we update account data using the new type?
if ($this->hasValidAccounts()) {
@@ -182,21 +181,6 @@ class JournalUpdateService
$this->transactionJournal->refresh();
}
/**
* @return bool
*/
private function removeReconciliation(): bool
{
if (count($this->data) > 1) {
return true;
}
if (1 === count($this->data) && true === array_key_exists('transaction_journal_id', $this->data)) {
return true;
}
return false;
}
/**
* @return bool
*/
@@ -514,9 +498,9 @@ class JournalUpdateService
{
$type = $this->transactionJournal->transactionType->type;
if ((
array_key_exists('bill_id', $this->data)
array_key_exists('bill_id', $this->data)
|| array_key_exists('bill_name', $this->data)
)
)
&& TransactionType::WITHDRAWAL === $type
) {
$billId = (int)($this->data['bill_id'] ?? 0);