Revised the parameters of the saveDescriptionWithAccount method of the JavaScript JournalEntryLineItemEditor class to accept an DescriptionEditorAccount instance instead of the individual account values.
This commit is contained in:
parent
5bb10bf6ba
commit
2f9d2e36cb
@ -264,7 +264,7 @@ class DescriptionEditor {
|
||||
#submit() {
|
||||
bootstrap.Modal.getOrCreateInstance(this.#modal).hide();
|
||||
if (this.#selectedAccount !== null) {
|
||||
this.lineItemEditor.saveDescriptionWithAccount(this.description.value, this.#selectedAccount.code, this.#selectedAccount.text, this.#selectedAccount.isNeedOffset);
|
||||
this.lineItemEditor.saveDescriptionWithAccount(this.description.value, this.#selectedAccount);
|
||||
} else {
|
||||
this.lineItemEditor.saveDescription(this.description.value);
|
||||
}
|
||||
|
@ -334,14 +334,12 @@ class JournalEntryLineItemEditor {
|
||||
* Saves the description with the suggested account from the description editor.
|
||||
*
|
||||
* @param description {string} the description
|
||||
* @param accountCode {string} the account code
|
||||
* @param accountText {string} the account text
|
||||
* @param isAccountNeedOffset {boolean} true if the line items in the account need offset, or false otherwise
|
||||
* @param account {DescriptionEditorAccount} the suggested account
|
||||
*/
|
||||
saveDescriptionWithAccount(description, accountCode, accountText, isAccountNeedOffset) {
|
||||
saveDescriptionWithAccount(description, account) {
|
||||
this.#accountControl.classList.add("accounting-not-empty");
|
||||
this.account = new JournalEntryAccount(accountCode, accountText, isAccountNeedOffset);
|
||||
this.#accountText.innerText = accountText;
|
||||
this.account = account.copy();
|
||||
this.#accountText.innerText = account.text;
|
||||
this.#validateAccount();
|
||||
this.saveDescription(description)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user