Sha256: c3965f0796699eb6616591612efc0cd65082a3f39681d48b0188fb8bfb086279

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

module FacturaePrint
  module Renderers
    module HTMLRendererHelpers
      
      def to_currency(amount)
        @invoice_currency_symbol ||= currency_symbol(@invoice.invoices.first.invoice_issue_data.invoice_currency_code)
        "#{amount} #{@invoice_currency_symbol}"
      end
      
      def currency_symbol(currency_code)
        case currency_code
        when "EUR": "€"
        when "USD": "$"
        else
          currency_code
        end
      end
      
      def individual_full_name(individual)
        [individual.name, individual.first_surname, individual.second_surname].compact.join(' ')
      end
      
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facturae_print-0.0.2 lib/facturae_print/renderers/html_renderer_helpers.rb