mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
20 lines
508 B
TypeScript
20 lines
508 B
TypeScript
import { Transformer } from '@/lib/Transformer/Transformer';
|
|
|
|
export class CurrencyTransformer extends Transformer {
|
|
/**
|
|
* Include these attributes to sale invoice object.
|
|
* @returns {Array}
|
|
*/
|
|
public includeAttributes = (): string[] => {
|
|
return ['isBaseCurrency'];
|
|
};
|
|
|
|
/**
|
|
* Detarmines whether the currency is base currency.
|
|
* @returns {boolean}
|
|
*/
|
|
public isBaseCurrency(currency): boolean {
|
|
return this.context.organization.baseCurrency === currency.currencyCode;
|
|
}
|
|
}
|