Sha256: 23373780adbf03953bab21c5d87c78ec75899f11d4110ee815acb9529a58f39a

Contents?: true

Size: 1.26 KB

Versions: 22

Compression:

Stored size: 1.26 KB

Contents

# FIXME it's possible I got currency for some fields wrong.
class Gillbus
  class Commission

    extend Fields
    include UpdateAttrs

    # Collecting type
    field :type

    # Symbolic collecting code
    field :code

    # Collecting description
    field :description

    # Value of collecting in sale currency
    field :value, :money

    # Value of collecting VAT in sale currency
    field :vat, :money

    # Collecting currency
    field :currency

    # Exchange rate of collecting to sale currency
    field :rate

    # Value of collecting in currency in which it is brought
    field :value_in_currency, :money

    # Value of collecting VAT in currency in which it is brought
    field :vat_in_currency, :money

    # The return amount from collecting in sale currency (w/o VAT)
    field :return_value, :money

    # The return amount from collecting VAT in sale currency
    field :return_vat, :money

    # The return amount from collecting in currency in which it is brought  (w/o VAT)
    field :return_value_in_currency, :money

    # The return amount from collecting VAT in currency in which it is brought.
    field :return_vat_in_currency, :money

    parser do
      def money(val)
        Monetize.parse(val, doc['CURRENCY'])
      end
    end

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
gillbus-0.12.0 lib/gillbus/structs/commission.rb
gillbus-0.11.0 lib/gillbus/structs/commission.rb