BexioApiClient.Accounting.Currency (bexio_api_client v2.0.0)

Copy Markdown

Bexio Currency Module.

Summary

Types

t()

Bexio Currency

Functions

Create a new currency (for create_currency/2). The id and the embedded default exchange rate fields are ignored when creating.

Rounds an amount to the given currency round factor

Types

t()

@type t() :: %BexioApiClient.Accounting.Currency{
  exchange_rate: float() | nil,
  exchange_rate_date: Date.t() | nil,
  exchange_rate_id: integer() | nil,
  exchange_rate_to_ratio: float() | nil,
  id: integer(),
  name: String.t(),
  ratio: float() | nil,
  round_factor: float(),
  source: String.t() | nil,
  source_reason: String.t() | nil
}

Bexio Currency

Fields:

  • :id - automatic id given by bexio
  • :name - Currency Name
  • :round_factor - How to round the given currency
  • :exchange_rate - default exchange rate of the currency, nil for the base currency
  • :exchange_rate_date - date of the default exchange rate
  • :exchange_rate_id - id of the default exchange rate
  • :exchange_rate_to_ratio - ratio part of the default exchange rate
  • :ratio - other ratio part of the default exchange rate
  • :source - source of the default exchange rate
  • :source_reason - reason for the source of the default exchange rate

Functions

new(attrs \\ %{})

@spec new(map()) :: t()

Create a new currency (for create_currency/2). The id and the embedded default exchange rate fields are ignored when creating.

round(t, currency)

Rounds an amount to the given currency round factor