Replaced the accountCode and accountText getters with the account getter in the JavaScript LineItemSubForm class.

This commit is contained in:
2023-04-01 00:14:47 +08:00
parent 94391b02a6
commit a1d6844e52
2 changed files with 8 additions and 26 deletions

View File

@ -517,12 +517,12 @@ class JournalEntryLineItemEditor {
this.#descriptionControl.classList.add("accounting-not-empty");
}
this.#descriptionText.innerText = this.description === null? "": this.description;
if (lineItem.accountCode === null) {
this.account = lineItem.account;
if (this.account === null) {
this.#accountControl.classList.remove("accounting-not-empty");
} else {
this.#accountControl.classList.add("accounting-not-empty");
}
this.account = new JournalEntryAccount(lineItem.accountCode, lineItem.accountText, lineItem.isNeedOffset);
this.#accountText.innerText = this.account.text;
this.#amountInput.value = lineItem.amount === null? "": String(lineItem.amount);
const maxAmount = this.#getMaxAmount();