Replaced the JavaScript getXXX methods with the "get XXX" getters.
This commit is contained in:
parent
fa1dedf207
commit
57a4177037
@ -1019,7 +1019,7 @@ class RecurringTransactionTab extends TabPlane {
|
|||||||
* @return {string} the description of the recurring item
|
* @return {string} the description of the recurring item
|
||||||
*/
|
*/
|
||||||
#getDescription(itemButton) {
|
#getDescription(itemButton) {
|
||||||
const today = new Date(this.editor.lineItemEditor.form.getDate());
|
const today = new Date(this.editor.lineItemEditor.form.date);
|
||||||
const thisMonth = today.getMonth() + 1;
|
const thisMonth = today.getMonth() + 1;
|
||||||
const lastMonth = (thisMonth + 10) % 12 + 1;
|
const lastMonth = (thisMonth + 10) % 12 + 1;
|
||||||
const lastBimonthlyFrom = ((thisMonth + thisMonth % 2 + 8) % 12 + 1);
|
const lastBimonthlyFrom = ((thisMonth + thisMonth % 2 + 8) % 12 + 1);
|
||||||
|
@ -213,7 +213,7 @@ class JournalEntryForm {
|
|||||||
* @return {string[]} the account codes used in the form
|
* @return {string[]} the account codes used in the form
|
||||||
*/
|
*/
|
||||||
getAccountCodesUsed(debitCredit) {
|
getAccountCodesUsed(debitCredit) {
|
||||||
return this.getLineItems(debitCredit).map((lineItem) => lineItem.getAccountCode())
|
return this.getLineItems(debitCredit).map((lineItem) => lineItem.accountCode)
|
||||||
.filter((code) => code !== null);
|
.filter((code) => code !== null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ class JournalEntryForm {
|
|||||||
*
|
*
|
||||||
* @return {string} the date
|
* @return {string} the date
|
||||||
*/
|
*/
|
||||||
getDate() {
|
get date() {
|
||||||
return this.#date.value;
|
return this.#date.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ class JournalEntryForm {
|
|||||||
updateMinDate() {
|
updateMinDate() {
|
||||||
let lastOriginalLineItemDate = null;
|
let lastOriginalLineItemDate = null;
|
||||||
for (const lineItem of this.getLineItems()) {
|
for (const lineItem of this.getLineItems()) {
|
||||||
const date = lineItem.getOriginalLineItemDate();
|
const date = lineItem.originalLineItemDate;
|
||||||
if (date !== null) {
|
if (date !== null) {
|
||||||
if (lastOriginalLineItemDate === null || lastOriginalLineItemDate < date) {
|
if (lastOriginalLineItemDate === null || lastOriginalLineItemDate < date) {
|
||||||
lastOriginalLineItemDate = date;
|
lastOriginalLineItemDate = date;
|
||||||
@ -444,7 +444,7 @@ class CurrencySubForm {
|
|||||||
*
|
*
|
||||||
* @return {string} the currency code
|
* @return {string} the currency code
|
||||||
*/
|
*/
|
||||||
getCurrencyCode() {
|
get currencyCode() {
|
||||||
return this.#code.value;
|
return this.#code.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,7 +473,7 @@ class CurrencySubForm {
|
|||||||
updateCodeSelectorStatus() {
|
updateCodeSelectorStatus() {
|
||||||
let isEnabled = true;
|
let isEnabled = true;
|
||||||
for (const lineItem of this.getLineItems()) {
|
for (const lineItem of this.getLineItems()) {
|
||||||
if (lineItem.getOriginalLineItemId() !== null) {
|
if (lineItem.originalLineItemId !== null) {
|
||||||
isEnabled = false;
|
isEnabled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -505,7 +505,7 @@ class CurrencySubForm {
|
|||||||
*/
|
*/
|
||||||
validateBalance() {
|
validateBalance() {
|
||||||
if (this.#debit !== null && this.#credit !== null) {
|
if (this.#debit !== null && this.#credit !== null) {
|
||||||
if (!this.#debit.getTotal().equals(this.#credit.getTotal())) {
|
if (!this.#debit.total.equals(this.#credit.total)) {
|
||||||
this.#control.classList.add("is-invalid");
|
this.#control.classList.add("is-invalid");
|
||||||
this.#error.innerText = A_("The totals of the debit and credit amounts do not match.");
|
this.#error.innerText = A_("The totals of the debit and credit amounts do not match.");
|
||||||
return false;
|
return false;
|
||||||
@ -664,10 +664,10 @@ class DebitCreditSubForm {
|
|||||||
*
|
*
|
||||||
* @return {Decimal} the total amount
|
* @return {Decimal} the total amount
|
||||||
*/
|
*/
|
||||||
getTotal() {
|
get total() {
|
||||||
let total = new Decimal("0");
|
let total = new Decimal("0");
|
||||||
for (const lineItem of this.lineItems) {
|
for (const lineItem of this.lineItems) {
|
||||||
const amount = lineItem.getAmount();
|
const amount = lineItem.amount;
|
||||||
if (amount !== null) {
|
if (amount !== null) {
|
||||||
total = total.plus(amount);
|
total = total.plus(amount);
|
||||||
}
|
}
|
||||||
@ -680,7 +680,7 @@ class DebitCreditSubForm {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
updateTotal() {
|
updateTotal() {
|
||||||
this.#total.innerText = formatDecimal(this.getTotal());
|
this.#total.innerText = formatDecimal(this.total);
|
||||||
this.currency.validateBalance();
|
this.currency.validateBalance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -881,7 +881,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {boolean} true if the line item needs offset, or false otherwise
|
* @return {boolean} true if the line item needs offset, or false otherwise
|
||||||
*/
|
*/
|
||||||
isNeedOffset() {
|
get isNeedOffset() {
|
||||||
return "isNeedOffset" in this.element.dataset;
|
return "isNeedOffset" in this.element.dataset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -890,7 +890,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the ID of the original line item
|
* @return {string|null} the ID of the original line item
|
||||||
*/
|
*/
|
||||||
getOriginalLineItemId() {
|
get originalLineItemId() {
|
||||||
return this.#originalLineItemId.value === ""? null: this.#originalLineItemId.value;
|
return this.#originalLineItemId.value === ""? null: this.#originalLineItemId.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -899,7 +899,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the date of the original line item
|
* @return {string|null} the date of the original line item
|
||||||
*/
|
*/
|
||||||
getOriginalLineItemDate() {
|
get originalLineItemDate() {
|
||||||
return this.#originalLineItemId.dataset.date === ""? null: this.#originalLineItemId.dataset.date;
|
return this.#originalLineItemId.dataset.date === ""? null: this.#originalLineItemId.dataset.date;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -908,7 +908,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the text of the original line item
|
* @return {string|null} the text of the original line item
|
||||||
*/
|
*/
|
||||||
getOriginalLineItemText() {
|
get originalLineItemText() {
|
||||||
return this.#originalLineItemId.dataset.text === ""? null: this.#originalLineItemId.dataset.text;
|
return this.#originalLineItemId.dataset.text === ""? null: this.#originalLineItemId.dataset.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -917,7 +917,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the description
|
* @return {string|null} the description
|
||||||
*/
|
*/
|
||||||
getDescription() {
|
get description() {
|
||||||
return this.#description.value === ""? null: this.#description.value;
|
return this.#description.value === ""? null: this.#description.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -926,7 +926,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the account code
|
* @return {string|null} the account code
|
||||||
*/
|
*/
|
||||||
getAccountCode() {
|
get accountCode() {
|
||||||
return this.#accountCode.value === ""? null: this.#accountCode.value;
|
return this.#accountCode.value === ""? null: this.#accountCode.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -935,7 +935,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the account text
|
* @return {string|null} the account text
|
||||||
*/
|
*/
|
||||||
getAccountText() {
|
get accountText() {
|
||||||
return this.#accountCode.dataset.text === ""? null: this.#accountCode.dataset.text;
|
return this.#accountCode.dataset.text === ""? null: this.#accountCode.dataset.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -944,7 +944,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {Decimal|null} the amount
|
* @return {Decimal|null} the amount
|
||||||
*/
|
*/
|
||||||
getAmount() {
|
get amount() {
|
||||||
return this.#amount.value === ""? null: new Decimal(this.#amount.value);
|
return this.#amount.value === ""? null: new Decimal(this.#amount.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -953,7 +953,7 @@ class LineItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {Decimal|null} the minimal amount
|
* @return {Decimal|null} the minimal amount
|
||||||
*/
|
*/
|
||||||
getAmountMin() {
|
get amountMin() {
|
||||||
return this.#amount.dataset.min === ""? null: new Decimal(this.#amount.dataset.min);
|
return this.#amount.dataset.min === ""? null: new Decimal(this.#amount.dataset.min);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,12 +190,6 @@ class JournalEntryLineItemEditor {
|
|||||||
*/
|
*/
|
||||||
description = null;
|
description = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* The amount
|
|
||||||
* @type {string}
|
|
||||||
*/
|
|
||||||
amount = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The description editors
|
* The description editors
|
||||||
* @type {{debit: DescriptionEditor, credit: DescriptionEditor}}
|
* @type {{debit: DescriptionEditor, credit: DescriptionEditor}}
|
||||||
@ -249,7 +243,6 @@ class JournalEntryLineItemEditor {
|
|||||||
if (this.lineItem === null) {
|
if (this.lineItem === null) {
|
||||||
this.lineItem = this.#debitCreditSubForm.addLineItem();
|
this.lineItem = this.#debitCreditSubForm.addLineItem();
|
||||||
}
|
}
|
||||||
this.amount = this.#amountInput.value;
|
|
||||||
this.lineItem.save(this);
|
this.lineItem.save(this);
|
||||||
bootstrap.Modal.getInstance(this.#modal).hide();
|
bootstrap.Modal.getInstance(this.#modal).hide();
|
||||||
}
|
}
|
||||||
@ -257,6 +250,24 @@ class JournalEntryLineItemEditor {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the amount.
|
||||||
|
*
|
||||||
|
* @return {string} the amount
|
||||||
|
*/
|
||||||
|
get amount() {
|
||||||
|
return this.#amountInput.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the currency code.
|
||||||
|
*
|
||||||
|
* @return {string} the currency code
|
||||||
|
*/
|
||||||
|
get currencyCode() {
|
||||||
|
return this.#debitCreditSubForm.currency.currencyCode;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the original line item from the original line item selector.
|
* Saves the original line item from the original line item selector.
|
||||||
*
|
*
|
||||||
@ -308,15 +319,6 @@ class JournalEntryLineItemEditor {
|
|||||||
this.#amountInput.max = "";
|
this.#amountInput.max = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the currency code.
|
|
||||||
*
|
|
||||||
* @return {string} the currency code
|
|
||||||
*/
|
|
||||||
getCurrencyCode() {
|
|
||||||
return this.#debitCreditSubForm.currency.getCurrencyCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the description from the description editor.
|
* Saves the description from the description editor.
|
||||||
*
|
*
|
||||||
@ -520,10 +522,10 @@ class JournalEntryLineItemEditor {
|
|||||||
this.lineItem = lineItem;
|
this.lineItem = lineItem;
|
||||||
this.#debitCreditSubForm = lineItem.debitCreditSubForm;
|
this.#debitCreditSubForm = lineItem.debitCreditSubForm;
|
||||||
this.debitCredit = this.#debitCreditSubForm.debitCredit;
|
this.debitCredit = this.#debitCreditSubForm.debitCredit;
|
||||||
this.isNeedOffset = lineItem.isNeedOffset();
|
this.isNeedOffset = lineItem.isNeedOffset;
|
||||||
this.originalLineItemId = lineItem.getOriginalLineItemId();
|
this.originalLineItemId = lineItem.originalLineItemId;
|
||||||
this.originalLineItemDate = lineItem.getOriginalLineItemDate();
|
this.originalLineItemDate = lineItem.originalLineItemDate;
|
||||||
this.originalLineItemText = lineItem.getOriginalLineItemText();
|
this.originalLineItemText = lineItem.originalLineItemText;
|
||||||
this.#originalLineItemText.innerText = this.originalLineItemText;
|
this.#originalLineItemText.innerText = this.originalLineItemText;
|
||||||
if (this.originalLineItemId === null) {
|
if (this.originalLineItemId === null) {
|
||||||
this.#originalLineItemContainer.classList.add("d-none");
|
this.#originalLineItemContainer.classList.add("d-none");
|
||||||
@ -533,25 +535,25 @@ class JournalEntryLineItemEditor {
|
|||||||
this.#originalLineItemControl.classList.add("accounting-not-empty");
|
this.#originalLineItemControl.classList.add("accounting-not-empty");
|
||||||
}
|
}
|
||||||
this.#setEnableDescriptionAccount(!lineItem.isMatched && this.originalLineItemId === null);
|
this.#setEnableDescriptionAccount(!lineItem.isMatched && this.originalLineItemId === null);
|
||||||
this.description = lineItem.getDescription();
|
this.description = lineItem.description;
|
||||||
if (this.description === null) {
|
if (this.description === null) {
|
||||||
this.#descriptionControl.classList.remove("accounting-not-empty");
|
this.#descriptionControl.classList.remove("accounting-not-empty");
|
||||||
} else {
|
} else {
|
||||||
this.#descriptionControl.classList.add("accounting-not-empty");
|
this.#descriptionControl.classList.add("accounting-not-empty");
|
||||||
}
|
}
|
||||||
this.#descriptionText.innerText = this.description === null? "": this.description;
|
this.#descriptionText.innerText = this.description === null? "": this.description;
|
||||||
if (lineItem.getAccountCode() === null) {
|
if (lineItem.accountCode === null) {
|
||||||
this.#accountControl.classList.remove("accounting-not-empty");
|
this.#accountControl.classList.remove("accounting-not-empty");
|
||||||
} else {
|
} else {
|
||||||
this.#accountControl.classList.add("accounting-not-empty");
|
this.#accountControl.classList.add("accounting-not-empty");
|
||||||
}
|
}
|
||||||
this.accountCode = lineItem.getAccountCode();
|
this.accountCode = lineItem.accountCode;
|
||||||
this.accountText = lineItem.getAccountText();
|
this.accountText = lineItem.accountText;
|
||||||
this.#accountText.innerText = this.accountText;
|
this.#accountText.innerText = this.accountText;
|
||||||
this.#amountInput.value = lineItem.getAmount() === null? "": String(lineItem.getAmount());
|
this.#amountInput.value = lineItem.amount === null? "": String(lineItem.amount);
|
||||||
const maxAmount = this.#getMaxAmount();
|
const maxAmount = this.#getMaxAmount();
|
||||||
this.#amountInput.max = maxAmount === null? "": maxAmount;
|
this.#amountInput.max = maxAmount === null? "": maxAmount;
|
||||||
this.#amountInput.min = lineItem.getAmountMin() === null? "": String(lineItem.getAmountMin());
|
this.#amountInput.min = lineItem.amountMin === null? "": String(lineItem.amountMin);
|
||||||
this.#validate();
|
this.#validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ class RecurringItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the name
|
* @return {string|null} the name
|
||||||
*/
|
*/
|
||||||
getName() {
|
get name() {
|
||||||
return this.#name.value === ""? null: this.#name.value;
|
return this.#name.value === ""? null: this.#name.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ class RecurringItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the account code
|
* @return {string|null} the account code
|
||||||
*/
|
*/
|
||||||
getAccountCode() {
|
get accountCode() {
|
||||||
return this.#accountCode.value === ""? null: this.#accountCode.value;
|
return this.#accountCode.value === ""? null: this.#accountCode.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,7 +485,7 @@ class RecurringItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the account text
|
* @return {string|null} the account text
|
||||||
*/
|
*/
|
||||||
getAccountText() {
|
get accountText() {
|
||||||
return this.#accountCode.dataset.text === ""? null: this.#accountCode.dataset.text;
|
return this.#accountCode.dataset.text === ""? null: this.#accountCode.dataset.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,7 +494,7 @@ class RecurringItemSubForm {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the description template
|
* @return {string|null} the description template
|
||||||
*/
|
*/
|
||||||
getDescriptionTemplate() {
|
get descriptionTemplate() {
|
||||||
return this.#descriptionTemplate.value === ""? null: this.#descriptionTemplate.value;
|
return this.#descriptionTemplate.value === ""? null: this.#descriptionTemplate.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,12 +504,12 @@ class RecurringItemSubForm {
|
|||||||
* @param editor {RecurringItemEditor} the recurring item editor
|
* @param editor {RecurringItemEditor} the recurring item editor
|
||||||
*/
|
*/
|
||||||
save(editor) {
|
save(editor) {
|
||||||
this.#name.value = editor.getName() === null? "": editor.getName();
|
this.#name.value = editor.name === null? "": editor.name;
|
||||||
this.#nameText.innerText = this.#name.value;
|
this.#nameText.innerText = this.#name.value;
|
||||||
this.#accountCode.value = editor.accountCode;
|
this.#accountCode.value = editor.accountCode;
|
||||||
this.#accountCode.dataset.text = editor.accountText;
|
this.#accountCode.dataset.text = editor.accountText;
|
||||||
this.#accountText.innerText = editor.accountText;
|
this.#accountText.innerText = editor.accountText;
|
||||||
this.#descriptionTemplate.value = editor.getDescriptionTemplate() === null? "": editor.getDescriptionTemplate();
|
this.#descriptionTemplate.value = editor.descriptionTemplate === null? "": editor.descriptionTemplate;
|
||||||
this.#descriptionTemplateText.innerText = this.#descriptionTemplate.value;
|
this.#descriptionTemplateText.innerText = this.#descriptionTemplate.value;
|
||||||
this.validate();
|
this.validate();
|
||||||
}
|
}
|
||||||
@ -677,7 +677,7 @@ class RecurringItemEditor {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the name
|
* @return {string|null} the name
|
||||||
*/
|
*/
|
||||||
getName() {
|
get name() {
|
||||||
return this.#name.value === ""? null: this.#name.value;
|
return this.#name.value === ""? null: this.#name.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -686,7 +686,7 @@ class RecurringItemEditor {
|
|||||||
*
|
*
|
||||||
* @return {string|null} the description template
|
* @return {string|null} the description template
|
||||||
*/
|
*/
|
||||||
getDescriptionTemplate() {
|
get descriptionTemplate() {
|
||||||
return this.#descriptionTemplate.value === ""? null: this.#descriptionTemplate.value;
|
return this.#descriptionTemplate.value === ""? null: this.#descriptionTemplate.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -742,16 +742,16 @@ class RecurringItemEditor {
|
|||||||
*/
|
*/
|
||||||
onEdit(item) {
|
onEdit(item) {
|
||||||
this.#item = item;
|
this.#item = item;
|
||||||
this.#name.value = item.getName() === null? "": item.getName();
|
this.#name.value = item.name === null? "": item.name;
|
||||||
this.accountCode = item.getAccountCode();
|
this.accountCode = item.accountCode;
|
||||||
this.accountText = item.getAccountText();
|
this.accountText = item.accountText;
|
||||||
if (this.accountText === null) {
|
if (this.accountText === null) {
|
||||||
this.#accountControl.classList.remove("accounting-not-empty");
|
this.#accountControl.classList.remove("accounting-not-empty");
|
||||||
} else {
|
} else {
|
||||||
this.#accountControl.classList.add("accounting-not-empty");
|
this.#accountControl.classList.add("accounting-not-empty");
|
||||||
}
|
}
|
||||||
this.#accountContainer.innerText = item.getAccountText() == null? "": item.getAccountText();
|
this.#accountContainer.innerText = this.accountText === null? "": this.accountText;
|
||||||
this.#descriptionTemplate.value = item.getDescriptionTemplate() === null? "": item.getDescriptionTemplate();
|
this.#descriptionTemplate.value = item.descriptionTemplate === null? "": item.descriptionTemplate;
|
||||||
this.#validate();
|
this.#validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,8 +113,8 @@ class OriginalLineItemSelector {
|
|||||||
const otherLineItems = form.getLineItems().filter((lineItem) => lineItem !== currentLineItem);
|
const otherLineItems = form.getLineItems().filter((lineItem) => lineItem !== currentLineItem);
|
||||||
let otherOffset = new Decimal(0);
|
let otherOffset = new Decimal(0);
|
||||||
for (const otherLineItem of otherLineItems) {
|
for (const otherLineItem of otherLineItems) {
|
||||||
if (otherLineItem.getOriginalLineItemId() === originalLineItemId) {
|
if (otherLineItem.originalLineItemId === originalLineItemId) {
|
||||||
const amount = otherLineItem.getAmount();
|
const amount = otherLineItem.amount;
|
||||||
if (amount !== null) {
|
if (amount !== null) {
|
||||||
otherOffset = otherOffset.plus(amount);
|
otherOffset = otherOffset.plus(amount);
|
||||||
}
|
}
|
||||||
@ -131,8 +131,8 @@ class OriginalLineItemSelector {
|
|||||||
const otherLineItems = this.lineItemEditor.form.getLineItems().filter((lineItem) => lineItem !== this.lineItemEditor.lineItem);
|
const otherLineItems = this.lineItemEditor.form.getLineItems().filter((lineItem) => lineItem !== this.lineItemEditor.lineItem);
|
||||||
const otherOffsets = {}
|
const otherOffsets = {}
|
||||||
for (const otherLineItem of otherLineItems) {
|
for (const otherLineItem of otherLineItems) {
|
||||||
const otherOriginalLineItemId = otherLineItem.getOriginalLineItemId();
|
const otherOriginalLineItemId = otherLineItem.originalLineItemId;
|
||||||
const amount = otherLineItem.getAmount();
|
const amount = otherLineItem.amount;
|
||||||
if (otherOriginalLineItemId === null || amount === null) {
|
if (otherOriginalLineItemId === null || amount === null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ class OriginalLineItemSelector {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
onOpen() {
|
onOpen() {
|
||||||
this.#currencyCode = this.lineItemEditor.getCurrencyCode();
|
this.#currencyCode = this.lineItemEditor.currencyCode;
|
||||||
this.#debitCredit = this.lineItemEditor.debitCredit;
|
this.#debitCredit = this.lineItemEditor.debitCredit;
|
||||||
for (const option of this.#options) {
|
for (const option of this.#options) {
|
||||||
option.setActive(option.id === this.lineItemEditor.originalLineItemId);
|
option.setActive(option.id === this.lineItemEditor.originalLineItemId);
|
||||||
@ -341,7 +341,7 @@ class OriginalLineItem {
|
|||||||
*/
|
*/
|
||||||
isMatched(debitCredit, currencyCode, query = null) {
|
isMatched(debitCredit, currencyCode, query = null) {
|
||||||
return this.netBalance.greaterThan(0)
|
return this.netBalance.greaterThan(0)
|
||||||
&& this.date <= this.#selector.lineItemEditor.form.getDate()
|
&& this.date <= this.#selector.lineItemEditor.form.date
|
||||||
&& this.#isDebitCreditMatches(debitCredit)
|
&& this.#isDebitCreditMatches(debitCredit)
|
||||||
&& this.#currencyCode === currencyCode
|
&& this.#currencyCode === currencyCode
|
||||||
&& this.#isQueryMatches(query);
|
&& this.#isQueryMatches(query);
|
||||||
|
Loading…
Reference in New Issue
Block a user