Added the amount attribute to the JavaScript JournalEntryEditor class to pass the amount to the JournalEntrySubForm without exposing the amount input element.

This commit is contained in:
依瑪貓 2023-03-18 14:44:29 +08:00 committed by 依瑪貓
parent 94a527caf2
commit 1a54592d4c

View File

@ -189,6 +189,12 @@ class JournalEntryEditor {
*/ */
summary = null; summary = null;
/**
* The amount
* @type {string}
*/
amount = "";
/** /**
* Constructs a new journal entry editor. * Constructs a new journal entry editor.
* *
@ -223,7 +229,8 @@ class JournalEntryEditor {
if (this.entry === null) { if (this.entry === null) {
this.entry = this.#side.addJournalEntry(); this.entry = this.#side.addJournalEntry();
} }
this.entry.save(this.isNeedOffset, this.originalEntryId, this.originalEntryDate, this.originalEntryText, this.accountCode, this.accountText, this.summary, this.#amount.value); this.amount = this.#amount.value;
this.entry.save(this.isNeedOffset, this.originalEntryId, this.originalEntryDate, this.originalEntryText, this.accountCode, this.accountText, this.summary, this.amount);
bootstrap.Modal.getInstance(this.#modal).hide(); bootstrap.Modal.getInstance(this.#modal).hide();
} }
return false; return false;