Revised the account selector to find the account codes from the form through the TransactionForm class, but not finding the codes by itself.

This commit is contained in:
2023-03-13 21:04:39 +08:00
parent cdd31b1047
commit 82a6a53dc4
2 changed files with 58 additions and 5 deletions

View File

@ -150,14 +150,10 @@ class AccountSelector {
* @return {string[]} the account codes that are used in the form
*/
#getCodesUsedInForm() {
const accountCodes = Array.from(document.getElementsByClassName("accounting-" + this.#prefix + "-account-code"));
const inUse = [];
const inUse = TransactionForm.getAccountCodesUsed(this.#entryType);
if (this.#entryEditor.getAccountCode() !== null) {
inUse.push(this.#entryEditor.getAccountCode());
}
for (const accountCode of accountCodes) {
inUse.push(accountCode.value);
}
return inUse
}