Moved the JournalEntryAccount class from journal-entry-line-item-editor.js to journal-entry-form.js.

This commit is contained in:
依瑪貓 2023-04-01 22:42:34 +08:00
parent 211821b4d7
commit cb6de08152
2 changed files with 47 additions and 46 deletions

View File

@ -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. * The line item sub-form.
* *

View File

@ -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);
}
}