From cb6de081525017de895a5c9411c99846fe713c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 1 Apr 2023 22:42:34 +0800 Subject: [PATCH] Moved the JournalEntryAccount class from journal-entry-line-item-editor.js to journal-entry-form.js. --- .../static/js/journal-entry-form.js | 47 +++++++++++++++++++ .../js/journal-entry-line-item-editor.js | 46 ------------------ 2 files changed, 47 insertions(+), 46 deletions(-) diff --git a/src/accounting/static/js/journal-entry-form.js b/src/accounting/static/js/journal-entry-form.js index f3544fd..b9cf1cb 100644 --- a/src/accounting/static/js/journal-entry-form.js +++ b/src/accounting/static/js/journal-entry-form.js @@ -784,6 +784,53 @@ class DebitCreditSubForm { } } +/** + * A journal entry account. + * + */ +class JournalEntryAccount { + + /** + * The account code + * @type {string} + */ + code; + + /** + * The account text + * @type {string} + */ + text; + + /** + * Whether the line items in the account needs offset + * @type {boolean} + */ + isNeedOffset; + + /** + * Constructs a journal entry account. + * + * @param code {string} the account code + * @param text {string} the account text + * @param isNeedOffset {boolean} true if the line items in the account needs offset, or false otherwise + */ + constructor(code, text, isNeedOffset) { + this.code = code; + this.text = text; + this.isNeedOffset = isNeedOffset; + } + + /** + * Returns a copy of the account. + * + * @return {JournalEntryAccount} the copy of the account + */ + copy() { + return new JournalEntryAccount(this.code, this.text, this.isNeedOffset); + } +} + /** * The line item sub-form. * diff --git a/src/accounting/static/js/journal-entry-line-item-editor.js b/src/accounting/static/js/journal-entry-line-item-editor.js index 441520d..3015054 100644 --- a/src/accounting/static/js/journal-entry-line-item-editor.js +++ b/src/accounting/static/js/journal-entry-line-item-editor.js @@ -583,49 +583,3 @@ class JournalEntryLineItemEditor { } } -/** - * A journal entry account. - * - */ -class JournalEntryAccount { - - /** - * The account code - * @type {string} - */ - code; - - /** - * The account text - * @type {string} - */ - text; - - /** - * Whether the line items in the account needs offset - * @type {boolean} - */ - isNeedOffset; - - /** - * Constructs a journal entry account. - * - * @param code {string} the account code - * @param text {string} the account text - * @param isNeedOffset {boolean} true if the line items in the account needs offset, or false otherwise - */ - constructor(code, text, isNeedOffset) { - this.code = code; - this.text = text; - this.isNeedOffset = isNeedOffset; - } - - /** - * Returns a copy of the account. - * - * @return {JournalEntryAccount} the copy of the account - */ - copy() { - return new JournalEntryAccount(this.code, this.text, this.isNeedOffset); - } -}