diff --git a/src/accounting/static/js/journal-entry-editor.js b/src/accounting/static/js/journal-entry-editor.js index 1f9eb09..18899bd 100644 --- a/src/accounting/static/js/journal-entry-editor.js +++ b/src/accounting/static/js/journal-entry-editor.js @@ -239,7 +239,7 @@ class JournalEntryEditor { this.#summaryEditors = SummaryEditor.getInstances(this); this.#accountSelectors = AccountSelector.getInstances(this); this.originalEntrySelector = new OriginalEntrySelector(this); - this.#originalEntryControl.onclick = () => this.originalEntrySelector.onOpen(this.originalEntryId) + this.#originalEntryControl.onclick = () => this.originalEntrySelector.onOpen() this.#originalEntryDelete.onclick = () => this.clearOriginalEntry(); this.#summaryControl.onclick = () => this.#summaryEditors[this.entryType].onOpen(); this.#accountControl.onclick = () => this.#accountSelectors[this.entryType].onOpen(); diff --git a/src/accounting/static/js/original-entry-selector.js b/src/accounting/static/js/original-entry-selector.js index b006128..79d091b 100644 --- a/src/accounting/static/js/original-entry-selector.js +++ b/src/accounting/static/js/original-entry-selector.js @@ -176,13 +176,12 @@ class OriginalEntrySelector { /** * The callback when the original entry selector is shown. * - * @param originalEntryId {string|null} the ID of the original entry */ - onOpen(originalEntryId = null) { + onOpen() { this.#currencyCode = this.entryEditor.getCurrencyCode(); this.#entryType = this.entryEditor.entryType; for (const option of this.#options) { - option.setActive(option.id === originalEntryId); + option.setActive(option.id === this.entryEditor.originalEntryId); } this.#query.value = ""; this.#updateNetBalances();