Revised the JavaScript journal entry line item editor to only override the description with the description of the original line item when there is no existing description.

This commit is contained in:
依瑪貓 2023-04-20 00:28:28 +08:00
parent 50cea90d1b
commit 988757d30e

View File

@ -277,10 +277,14 @@ class JournalEntryLineItemEditor {
this.originalLineItemText = originalLineItem.text;
this.#originalLineItemText.innerText = originalLineItem.text;
this.#setEnableDescriptionAccount(false);
if (originalLineItem.description === "") {
this.#descriptionControl.classList.remove("accounting-not-empty");
} else {
this.#descriptionControl.classList.add("accounting-not-empty");
if (this.description === null) {
if (originalLineItem.description === "") {
this.#descriptionControl.classList.remove("accounting-not-empty");
} else {
this.#descriptionControl.classList.add("accounting-not-empty");
}
this.description = originalLineItem.description === ""? null: originalLineItem.description;
this.#descriptionText.innerText = originalLineItem.description;
}
this.#setEnableAccount(false);
this.#accountControl.classList.add("accounting-not-empty");