mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix(server): getting matched transaction transformer
This commit is contained in:
@@ -169,8 +169,8 @@ export class Transformer {
|
||||
* @param number
|
||||
* @returns
|
||||
*/
|
||||
protected formatNumber(number) {
|
||||
return formatNumber(number, { money: false });
|
||||
protected formatNumber(number, props?) {
|
||||
return formatNumber(number, { money: false, ...props });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ export class GetMatchedTransactionBillsTransformer extends Transformer {
|
||||
'amountFormatted',
|
||||
'transactionNo',
|
||||
'date',
|
||||
'dateFromatted',
|
||||
'dateFormatted',
|
||||
'transactionId',
|
||||
'transactionNo',
|
||||
'transactionType',
|
||||
@@ -52,8 +52,9 @@ export class GetMatchedTransactionBillsTransformer extends Transformer {
|
||||
* @returns {string}
|
||||
*/
|
||||
protected amountFormatted(bill) {
|
||||
return this.formatNumber(bill.totalAmount, {
|
||||
return this.formatNumber(bill.amount, {
|
||||
currencyCode: bill.currencyCode,
|
||||
money: true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -63,7 +64,7 @@ export class GetMatchedTransactionBillsTransformer extends Transformer {
|
||||
* @returns {string}
|
||||
*/
|
||||
protected date(bill) {
|
||||
return bill.date;
|
||||
return bill.billDate;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,8 +72,8 @@ export class GetMatchedTransactionBillsTransformer extends Transformer {
|
||||
* @param {Object} bill - The bill object.
|
||||
* @returns {string}
|
||||
*/
|
||||
protected dateFromatted(bill) {
|
||||
return this.formatDate(bill.date);
|
||||
protected dateFormatted(bill) {
|
||||
return this.formatDate(bill.billDate);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,4 +84,20 @@ export class GetMatchedTransactionBillsTransformer extends Transformer {
|
||||
protected transactionId(bill) {
|
||||
return bill.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the manual journal transaction type.
|
||||
* @returns {string}
|
||||
*/
|
||||
protected transactionType() {
|
||||
return 'Bill';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the manual journal formatted transaction type.
|
||||
* @returns {string}
|
||||
*/
|
||||
protected transsactionTypeFormatted() {
|
||||
return 'Bill';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export class GetMatchedTransactionExpensesTransformer extends Transformer {
|
||||
'amountFormatted',
|
||||
'transactionNo',
|
||||
'date',
|
||||
'dateFromatted',
|
||||
'dateFormatted',
|
||||
'transactionId',
|
||||
'transactionNo',
|
||||
'transactionType',
|
||||
@@ -54,6 +54,7 @@ export class GetMatchedTransactionExpensesTransformer extends Transformer {
|
||||
protected amountFormatted(expense) {
|
||||
return this.formatNumber(expense.totalAmount, {
|
||||
currencyCode: expense.currencyCode,
|
||||
money: true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ export class GetMatchedTransactionExpensesTransformer extends Transformer {
|
||||
* @param expense
|
||||
* @returns {string}
|
||||
*/
|
||||
protected dateFromatted(expense) {
|
||||
protected dateFormatted(expense) {
|
||||
return this.formatDate(expense.paymentDate);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export class GetMatchedTransactionInvoicesTransformer extends Transformer {
|
||||
'amountFormatted',
|
||||
'transactionNo',
|
||||
'date',
|
||||
'dateFromatted',
|
||||
'dateFormatted',
|
||||
'transactionId',
|
||||
'transactionNo',
|
||||
'transactionType',
|
||||
@@ -52,6 +52,7 @@ export class GetMatchedTransactionInvoicesTransformer extends Transformer {
|
||||
protected formatAmount(invoice) {
|
||||
return this.formatNumber(invoice.dueAmount, {
|
||||
currencyCode: invoice.currencyCode,
|
||||
money: true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,7 +61,7 @@ export class GetMatchedTransactionInvoicesTransformer extends Transformer {
|
||||
* @param invoice
|
||||
* @returns {Date}
|
||||
*/
|
||||
protected getDate(invoice) {
|
||||
protected date(invoice) {
|
||||
return invoice.invoiceDate;
|
||||
}
|
||||
|
||||
@@ -69,7 +70,7 @@ export class GetMatchedTransactionInvoicesTransformer extends Transformer {
|
||||
* @param invoice
|
||||
* @returns {string}
|
||||
*/
|
||||
protected formatDate(invoice) {
|
||||
protected dateFormatted(invoice) {
|
||||
return this.formatDate(invoice.invoiceDate);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export class GetMatchedTransactionManualJournalsTransformer extends Transformer
|
||||
'amountFormatted',
|
||||
'transactionNo',
|
||||
'date',
|
||||
'dateFromatted',
|
||||
'dateFormatted',
|
||||
'transactionId',
|
||||
'transactionNo',
|
||||
'transactionType',
|
||||
@@ -54,6 +54,7 @@ export class GetMatchedTransactionManualJournalsTransformer extends Transformer
|
||||
protected amountFormatted(manualJournal) {
|
||||
return this.formatNumber(manualJournal.amount, {
|
||||
currencyCode: manualJournal.currencyCode,
|
||||
money: true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ export class GetMatchedTransactionManualJournalsTransformer extends Transformer
|
||||
* @param manualJournal
|
||||
* @returns {string}
|
||||
*/
|
||||
protected dateFromatted(manualJournal) {
|
||||
protected dateFormatted(manualJournal) {
|
||||
return this.formatDate(manualJournal.date);
|
||||
}
|
||||
|
||||
@@ -107,3 +108,4 @@ export class GetMatchedTransactionManualJournalsTransformer extends Transformer
|
||||
return 'Manual Journal';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user