Sha256: 737bbb0851d9e057c044b308d7f93a01d00fd74de15cc4a07b91ab44d11393e5

Contents?: true

Size: 830 Bytes

Versions: 3

Compression:

Stored size: 830 Bytes

Contents

module Spree
  class PrintInvoiceConfiguration < Preferences::Configuration

    preference :print_invoice_next_number, :integer, :default => nil
    preference :print_invoice_logo_path, :string, :default => Spree::Config[:admin_interface_logo]
    preference :print_invoice_logo_scale, :integer, :default => 50
    preference :print_invoice_font_face, :string, :default => 'Helvetica'
    preference :print_buttons, :string, :default => 'invoice'
    preference :prawn_options, :hash, :default => {}

    def use_sequential_number?
      print_invoice_next_number.present? && print_invoice_next_number > 0
    end

    def increase_invoice_number
      current_invoice_number = print_invoice_next_number
      set_preference(:print_invoice_next_number, current_invoice_number + 1)
      current_invoice_number
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_print_invoice-1.0.2 app/models/spree/print_invoice_configuration.rb
solidus_print_invoice-1.0.1 app/models/spree/print_invoice_configuration.rb
solidus_print_invoice-1.0.0 app/models/spree/print_invoice_configuration.rb