Replaced the function-based JavaScript with the object-oriented TransactionForm, CurrencySubForm, DebitCreditSideSubForm, JournalEntrySubForm, and JournalEntryForm classes for the transaction form.

This commit is contained in:
2023-03-13 17:17:01 +08:00
parent 2b84f64554
commit be0ae5eba4
9 changed files with 1035 additions and 637 deletions

View File

@ -105,7 +105,7 @@ class AccountSelector {
AccountSelector.#formAccount.innerText = "";
AccountSelector.#formAccount.dataset.code = "";
AccountSelector.#formAccount.dataset.text = "";
validateJournalEntryAccount();
JournalEntryForm.validateAccount();
};
for (const option of this.#options) {
option.onclick = () => {
@ -113,7 +113,7 @@ class AccountSelector {
AccountSelector.#formAccount.innerText = option.dataset.content;
AccountSelector.#formAccount.dataset.code = option.dataset.code;
AccountSelector.#formAccount.dataset.text = option.dataset.content;
validateJournalEntryAccount();
JournalEntryForm.validateAccount();
};
}
this.#query.addEventListener("input", () => {

View File

@ -249,6 +249,7 @@ class SummaryEditor {
this.#formAccount.dataset.code = this.#selectedAccount.dataset.code;
this.#formAccount.dataset.text = this.#selectedAccount.dataset.text;
this.#formAccount.innerText = this.#selectedAccount.dataset.text;
JournalEntryForm.validateAccount();
}
this.#formSummary.dataset.value = this.summary.value;
this.#formSummary.innerText = this.summary.value;

File diff suppressed because it is too large Load Diff