Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseCurrencyPayment ¶
type BaseCurrencyPayment struct { // Payment holds original payment details. Payment Payment `yaml:"payment"` // Rate holds payment currency to base currency exchange rate on payment date. Rate float64 `yaml:"rate"` // Amount holds payment currency, converted to company base currency. Amount float64 `yaml:"amount"` }
BaseCurrencyPayment holds payment details, converted to company base currency.
func CalcBaseCurrencyPayment ¶
func CalcBaseCurrencyPayment(rates CurrencyRates, baseCurrency string, p Payment) (*BaseCurrencyPayment, error)
CalcBaseCurrencyPayment calculates payment amount in specified base currency.
type Calc ¶
type Calc struct {
// contains filtered or unexported fields
}
Calc is a tax calculator.
func NewCalc ¶
func NewCalc(rates CurrencyRates) *Calc
NewCalc constructs new quarterly tax calculator.
type Company ¶
type Company struct { // BaseCurrency holds company base (tax) currency, ISO 4217 (e.g., UAH). BaseCurrency string `yaml:"base_currency"` // TaxRate holds company tax rate (e.g., %5 - 0.05). TaxRate float64 `yaml:"tax_rate"` }
Company holds company details.
type CurrencyRates ¶
CurrencyRates defines currency rates lookup.
type Payment ¶
type Payment struct { // Date holds payment date. Date time.Time `yaml:"date"` // Currency holds payment currency, ISO 4217 (e.g., UAH). Currency string `yaml:"currency"` // Amount holds payment amount (in payment's currency). Amount float64 `yaml:"amount"` }
Payment holds bank payment data.
type Quarter ¶
type Quarter struct { // Year holds quarter's year. Year int `yaml:"year"` // Quarter holds quarter's number (1-based). Quarter int `yaml:"quarter"` }
Quarter holds financial year quarter.
type Tax ¶
type Tax struct { // Quarters holds financial year quarter. Quarter Quarter `yaml:"quarter"` // Payments holds quarterly company bank payments. Payments []BaseCurrencyPayment `yaml:"payments"` // Income holds quarterly company income. Income float64 `yaml:"income"` // Tax holds quarterly tax amount. Tax float64 `yaml:"tax"` }
Tax holds tax details.
Click to show internal directories.
Click to hide internal directories.