15 lines
381 B
TypeScript
Raw Normal View History

2016-06-13 00:41:33 +02:00
import { Injectable } from '@angular/core';
import { TaxRateService } from './tax-rate.service';
@Injectable()
export class SalesTaxService {
constructor(private rateService: TaxRateService) { }
getVAT(value: string | number) {
let amount = (typeof value === 'string') ?
parseFloat(value) : value;
return (amount || 0) * this.rateService.getRate('VAT');
}
}