mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix(server): add formatted values to responses transformers
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { IBill } from '@/interfaces';
|
||||
import { Transformer } from '@/lib/Transformer/Transformer';
|
||||
import { ItemEntryTransformer } from '@/services/Sales/Invoices/ItemEntryTransformer';
|
||||
import { SaleInvoiceTaxEntryTransformer } from '@/services/Sales/Invoices/SaleInvoiceTaxEntryTransformer';
|
||||
import { formatNumber } from 'utils';
|
||||
|
||||
@@ -23,6 +24,7 @@ export class PurchaseInvoiceTransformer extends Transformer {
|
||||
'totalFormatted',
|
||||
'totalLocalFormatted',
|
||||
'taxes',
|
||||
'entries',
|
||||
];
|
||||
};
|
||||
|
||||
@@ -178,4 +180,15 @@ export class PurchaseInvoiceTransformer extends Transformer {
|
||||
currencyCode: bill.currencyCode,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the entries of the bill.
|
||||
* @param {Bill} credit
|
||||
* @returns {}
|
||||
*/
|
||||
protected entries = (bill) => {
|
||||
return this.item(bill.entries, new ItemEntryTransformer(), {
|
||||
currencyCode: bill.currencyCode,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user