UNPKG

@accounter/server

Version:
13 lines (11 loc) 381 B
import type { RawVatReportRecord } from '../../reports/helpers/vat-report.helper'; export function getVatDataFromVatReportRecords(records: Array<RawVatReportRecord>) { return records.reduce( (acc, { roundedVATToAdd, localVatAfterDeduction }) => { acc[0] += localVatAfterDeduction ?? 0; acc[1] += roundedVATToAdd ?? 0; return acc; }, [0, 0], ); }