TaxCalculator

public enum TaxCalculator

Utility to generate tax relevant data from a Ledger

It relies heavily on meta data in the ledger.

  • Generates all tax slips based on the meta data in the ledger for a specifc tax year

    Declaration

    Swift

    public static func generateTaxSlips(from ledger: Ledger, for year: Int) throws -> [TaxSlip]

    Parameters

    ledger

    Ledger

    year

    tax year to get the slips for

    Return Value

    Array of TaxSlips

  • Gets all taxable sales from the ledger for a specific year

    Declaration

    Swift

    public static func getTaxableSales(from ledger: Ledger, for year: Int) throws -> [Sale]

    Parameters

    ledger

    ledger to get the transactions from

    year

    tax year

    Return Value

    Array of all sales