Renamed "voucher line item" to "journal entry line item".

This commit is contained in:
2023-03-20 20:52:35 +08:00
parent e26af6f3fc
commit 8f909965a9
34 changed files with 336 additions and 303 deletions

View File

@ -166,14 +166,14 @@
.accounting-list-group-hover .list-group-item:hover {
background-color: #ececec;
}
.accounting-voucher-line-item {
.accounting-journal-entry-line-item {
border: none;
}
.accounting-voucher-line-item-header {
.accounting-journal-entry-line-item-header {
font-weight: bolder;
border-bottom: thick double slategray;
}
.list-group-item.accounting-voucher-line-item-total {
.list-group-item.accounting-journal-entry-line-item-total {
font-weight: bolder;
border-top: thick double slategray;
}

View File

@ -30,7 +30,7 @@ class AccountSelector {
/**
* The line item editor
* @type {VoucherLineItemEditor}
* @type {JournalEntryLineItemEditor}
*/
#lineItemEditor;
@ -85,7 +85,7 @@ class AccountSelector {
/**
* Constructs an account selector.
*
* @param lineItemEditor {VoucherLineItemEditor} the line item editor
* @param lineItemEditor {JournalEntryLineItemEditor} the line item editor
* @param debitCredit {string} either "debit" or "credit"
*/
constructor(lineItemEditor, debitCredit) {
@ -210,7 +210,7 @@ class AccountSelector {
/**
* Returns the account selector instances.
*
* @param lineItemEditor {VoucherLineItemEditor} the line item editor
* @param lineItemEditor {JournalEntryLineItemEditor} the line item editor
* @return {{debit: AccountSelector, credit: AccountSelector}}
*/
static getInstances(lineItemEditor) {

View File

@ -30,7 +30,7 @@ class DescriptionEditor {
/**
* The line item editor
* @type {VoucherLineItemEditor}
* @type {JournalEntryLineItemEditor}
*/
#lineItemEditor;
@ -109,7 +109,7 @@ class DescriptionEditor {
/**
* Constructs a description editor.
*
* @param lineItemEditor {VoucherLineItemEditor} the line item editor
* @param lineItemEditor {JournalEntryLineItemEditor} the line item editor
* @param debitCredit {string} either "debit" or "credit"
*/
constructor(lineItemEditor, debitCredit) {
@ -246,7 +246,7 @@ class DescriptionEditor {
/**
* Returns the description editor instances.
*
* @param lineItemEditor {VoucherLineItemEditor} the line item editor
* @param lineItemEditor {JournalEntryLineItemEditor} the line item editor
* @return {{debit: DescriptionEditor, credit: DescriptionEditor}}
*/
static getInstances(lineItemEditor) {

View File

@ -1,5 +1,5 @@
/* The Mia! Accounting Flask Project
* voucher-line-item-editor.js: The JavaScript for the voucher line item editor
* journal-entry-line-item-editor.js: The JavaScript for the journal entry line item editor
*/
/* Copyright (c) 2023 imacat.
@ -23,10 +23,10 @@
"use strict";
/**
* The voucher line item editor.
* The journal entry line item editor.
*
*/
class VoucherLineItemEditor {
class JournalEntryLineItemEditor {
/**
* The voucher form
@ -35,7 +35,7 @@ class VoucherLineItemEditor {
form;
/**
* The voucher line item editor
* The journal entry line item editor
* @type {HTMLFormElement}
*/
#element;
@ -137,7 +137,7 @@ class VoucherLineItemEditor {
#amountError;
/**
* The voucher line item to edit
* The journal entry line item to edit
* @type {LineItemSubForm|null}
*/
lineItem;
@ -149,7 +149,7 @@ class VoucherLineItemEditor {
#debitCreditSubForm;
/**
* Whether the voucher line item needs offset
* Whether the journal entry line item needs offset
* @type {boolean}
*/
isNeedOffset = false;
@ -215,7 +215,7 @@ class VoucherLineItemEditor {
originalLineItemSelector;
/**
* Constructs a new voucher line item editor.
* Constructs a new journal entry line item editor.
*
* @param form {VoucherForm} the voucher form
*/
@ -476,7 +476,7 @@ class VoucherLineItemEditor {
}
/**
* The callback when adding a new voucher line item.
* The callback when adding a new journal entry line item.
*
* @param debitCredit {DebitCreditSubForm} the debit or credit sub-form
*/
@ -512,9 +512,9 @@ class VoucherLineItemEditor {
}
/**
* The callback when editing a voucher line item.
* The callback when editing a journal entry line item.
*
* @param lineItem {LineItemSubForm} the voucher line item sub-form
* @param lineItem {LineItemSubForm} the journal entry line item sub-form
*/
onEdit(lineItem) {
this.lineItem = lineItem;

View File

@ -30,7 +30,7 @@ class OriginalLineItemSelector {
/**
* The line item editor
* @type {VoucherLineItemEditor}
* @type {JournalEntryLineItemEditor}
*/
lineItemEditor;
@ -84,7 +84,7 @@ class OriginalLineItemSelector {
/**
* Constructs an original line item selector.
*
* @param lineItemEditor {VoucherLineItemEditor} the line item editor
* @param lineItemEditor {JournalEntryLineItemEditor} the line item editor
*/
constructor(lineItemEditor) {
this.lineItemEditor = lineItemEditor;

View File

@ -100,7 +100,7 @@ class VoucherForm {
/**
* The line item editor
* @type {VoucherLineItemEditor}
* @type {JournalEntryLineItemEditor}
*/
lineItemEditor;
@ -121,7 +121,7 @@ class VoucherForm {
this.#addCurrencyButton = document.getElementById("accounting-add-currency");
this.#note = document.getElementById("accounting-note");
this.#noteError = document.getElementById("accounting-note-error");
this.lineItemEditor = new VoucherLineItemEditor(this);
this.lineItemEditor = new JournalEntryLineItemEditor(this);
this.#addCurrencyButton.onclick = () => {
const newIndex = 1 + (this.#currencies.length === 0? 0: Math.max(...this.#currencies.map((currency) => currency.index)));
@ -993,7 +993,7 @@ class LineItemSubForm {
/**
* Stores the data into the line item sub-form.
*
* @param editor {VoucherLineItemEditor} the line item editor
* @param editor {JournalEntryLineItemEditor} the line item editor
*/
save(editor) {
if (editor.isNeedOffset) {