Fixed so that saving the journal entry from the journal entry editor triggers updating the total of the debit or credit side, which in turn triggers validating the balance if it is on a transfer form. This fixed the problem that deleting a journal entry updates total but not re-validating the balance.

This commit is contained in:
依瑪貓 2023-03-13 22:53:10 +08:00
parent 3a12472d4b
commit 2d771f04be
2 changed files with 2 additions and 2 deletions

View File

@ -144,8 +144,6 @@ class JournalEntryEditor {
this.#entry = this.#side.addJournalEntry();
}
this.#entry.save(this.#account.dataset.code, this.#account.dataset.text, this.#summary.dataset.value, this.#amount.value);
this.#side.updateTotal();
this.#side.currency.validateBalance();
bootstrap.Modal.getInstance(this.#modal).hide();
}
return false;

View File

@ -599,6 +599,7 @@ class DebitCreditSideSubForm {
}
}
this.#total.innerText = formatDecimal(this.getTotal());
this.currency.validateBalance();
}
@ -830,6 +831,7 @@ class JournalEntrySubForm {
this.amount.value = amount;
this.#amountText.innerText = formatDecimal(new Decimal(amount));
this.validate();
this.side.updateTotal();
}
}