Sha256: 58b2932137ce0ceaaa68f006a9016d122501c92e1476b5c37f5f960b1ca226d9

Contents?: true

Size: 582 Bytes

Versions: 27

Compression:

Stored size: 582 Bytes

Contents

module Dorsale::BillingMachine
  DEFAULT_VAT_RATE = 20.00

  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

  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
dorsale-2.5.0 app/models/dorsale/billing_machine.rb
dorsale-2.4.3 app/models/dorsale/billing_machine.rb
dorsale-2.4.2 app/models/dorsale/billing_machine.rb
dorsale-2.4.1 app/models/dorsale/billing_machine.rb
dorsale-2.4.0 app/models/dorsale/billing_machine.rb
dorsale-2.3.5 app/models/dorsale/billing_machine.rb
dorsale-2.3.4 app/models/dorsale/billing_machine.rb
dorsale-2.3.3 app/models/dorsale/billing_machine.rb
dorsale-2.3.2 app/models/dorsale/billing_machine.rb
dorsale-2.3.1 app/models/dorsale/billing_machine.rb
dorsale-2.3.0 app/models/dorsale/billing_machine.rb
dorsale-2.2.16 app/models/dorsale/billing_machine.rb
dorsale-2.2.15 app/models/dorsale/billing_machine.rb
dorsale-2.2.14 app/models/dorsale/billing_machine.rb
dorsale-2.2.13 app/models/dorsale/billing_machine.rb
dorsale-2.2.12 app/models/dorsale/billing_machine.rb
dorsale-2.2.11 app/models/dorsale/billing_machine.rb
dorsale-2.2.10 app/models/dorsale/billing_machine.rb
dorsale-2.2.9 app/models/dorsale/billing_machine.rb
dorsale-2.2.8 app/models/dorsale/billing_machine.rb