Sha256: 5496aa6c5c6cfe046c7f16960428e6efd5cd47f7af191b325cf8e1c84482f33b

Contents?: true

Size: 758 Bytes

Versions: 7

Compression:

Stored size: 758 Bytes

Contents

module Dorsale::BillingMachine
  class << self
    def vat_modes
      [:single, :multiple]
    end

    def vat_mode
      @vat_mode ||= :single
    end

    def vat_mode=(new_mode)
      raise "invalid mode #{new_mode}" unless vat_modes.include?(new_mode)
      @vat_mode = new_mode
    end

    def invoice_pdf_model
      "::Dorsale::BillingMachine::Invoice#{vat_mode.to_s.capitalize}VatPdf".constantize
    end

    def quotation_pdf_model
      "::Dorsale::BillingMachine::Quotation#{vat_mode.to_s.capitalize}VatPdf".constantize
    end

    attr_writer :default_currency

    def default_currency
      @default_currency ||= "€"
    end

    attr_writer :default_vat_rate

    def default_vat_rate
      @default_vat_rate ||= 20.0
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dorsale-3.13.0 app/models/dorsale/billing_machine.rb
dorsale-3.12.0 app/models/dorsale/billing_machine.rb
dorsale-3.11.0 app/models/dorsale/billing_machine.rb
dorsale-3.10.3 app/models/dorsale/billing_machine.rb
dorsale-3.10.2 app/models/dorsale/billing_machine.rb
dorsale-3.10.1 app/models/dorsale/billing_machine.rb
dorsale-3.10.0 app/models/dorsale/billing_machine.rb