From 14e79df571003dde424189f6f9907446b21049a6 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 00:29:04 +0800 Subject: [PATCH] Revised the line item sub-form to store the information whether it needs offsetting as a class instead of a dataset attribute, and store it in the account code input instead of the whole element, for simplicity and readability. --- src/accounting/static/js/journal-entry-form.js | 2 +- .../accounting/journal-entry/include/form-line-item.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/accounting/static/js/journal-entry-form.js b/src/accounting/static/js/journal-entry-form.js index de50130..1792c4a 100644 --- a/src/accounting/static/js/journal-entry-form.js +++ b/src/accounting/static/js/journal-entry-form.js @@ -982,7 +982,7 @@ class LineItemSubForm { * @return {JournalEntryAccount|null} the account */ get account() { - return this.#accountCode.value === null? null: new JournalEntryAccount(this.#accountCode.value, this.#accountCode.dataset.text, "isNeedOffset" in this.#element.dataset); + return this.#accountCode.value === null? null: new JournalEntryAccount(this.#accountCode.value, this.#accountCode.dataset.text, this.#accountCode.classList.contains("accounting-is-need-offset")); } /** diff --git a/src/accounting/templates/accounting/journal-entry/include/form-line-item.html b/src/accounting/templates/accounting/journal-entry/include/form-line-item.html index f4e5be8..22372f6 100644 --- a/src/accounting/templates/accounting/journal-entry/include/form-line-item.html +++ b/src/accounting/templates/accounting/journal-entry/include/form-line-item.html @@ -20,13 +20,13 @@ Author: imacat@mail.imacat.idv.tw (imacat) First written: 2023/2/25 #} {#