Class: Caboose::StoreConfig

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/caboose/store_config.rb

Constant Summary collapse

WEIGHT_UNIT_METRIC =
'g'
WEIGHT_UNIT_IMPERIAL =
'oz'
LENGTH_UNIT_METRIC =
'cm'
LENGTH_UNIT_IMPERIAL =
'in'
PAYMENT_PROCESSOR_AUTHNET =
'authnet'
PAYMENT_PROCESSOR_STRIPE =
'stripe'

Instance Method Summary collapse

Instance Method Details

#next_invoice_numberObject


62
63
64
65
66
# File 'app/models/caboose/store_config.rb', line 62

def next_invoice_number
  x = Invoice.where("invoice_number is not null").reorder("invoice_number desc").limit(1).first
  return x.invoice_number + 1 if x
  return self.starting_invoice_number      
end