Sha256: 8be62b2c9cef6a2c9f12ba181bc573217535ae1219e1559ca55e332b0144fd4b

Contents?: true

Size: 1.79 KB

Versions: 209

Compression:

Stored size: 1.79 KB

Contents

module Caboose
  class StoreConfig < ActiveRecord::Base
    self.table_name = 'store_configs'    
    
    belongs_to :site    
    attr_accessible :id,
      :site_id,            
      :pp_name,
      :pp_testing,
      :authnet_api_login_id,        # pp_username
      :authnet_api_transaction_key, # pp_password      
      :authnet_relay_url,           # pp_relay_url
      :stripe_secret_key,
      :stripe_publishable_key,
      :ups_username,
      :ups_password,
      :ups_key,
      :ups_origin_account,
      :usps_username,
      :usps_secret_key,
      :usps_publishable_key,
      :fedex_username,
      :fedex_password,
      :fedex_key,
      :fedex_account,
      :ups_min,
      :ups_max,
      :usps_min,
      :usps_max,
      :fedex_min,                
      :fedex_max,
      :taxcloud_api_id,
      :taxcloud_api_key,
      :origin_country, 
      :origin_state, 
      :origin_city, 
      :origin_zip,           
      :fulfillment_email,
      :shipping_email,
      :handling_percentage,
      :auto_calculate_packages,
      :auto_calculate_shipping,
      :auto_calculate_tax,      
      :custom_packages_function,   
      :custom_shipping_function,   
      :custom_tax_function,                  
      :length_unit,
      :download_instructions,
      :weight_unit,
      :allow_instore_pickup,
      :custom_invoice_pdf
      
    WEIGHT_UNIT_METRIC   = 'g'
    WEIGHT_UNIT_IMPERIAL = 'oz'
    LENGTH_UNIT_METRIC   = 'cm'
    LENGTH_UNIT_IMPERIAL = 'in'
    
    PAYMENT_PROCESSOR_AUTHNET = 'authnet'
    PAYMENT_PROCESSOR_STRIPE  = 'stripe'
      
    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
        
  end
end

Version data entries

209 entries across 209 versions & 1 rubygems

Version Path
caboose-cms-0.9.221 app/models/caboose/store_config.rb
caboose-cms-0.9.220 app/models/caboose/store_config.rb
caboose-cms-0.9.219 app/models/caboose/store_config.rb
caboose-cms-0.9.218 app/models/caboose/store_config.rb
caboose-cms-0.9.217 app/models/caboose/store_config.rb
caboose-cms-0.9.216 app/models/caboose/store_config.rb
caboose-cms-0.9.215 app/models/caboose/store_config.rb
caboose-cms-0.9.214 app/models/caboose/store_config.rb
caboose-cms-0.9.213 app/models/caboose/store_config.rb
caboose-cms-0.9.212 app/models/caboose/store_config.rb
caboose-cms-0.9.211 app/models/caboose/store_config.rb
caboose-cms-0.9.210 app/models/caboose/store_config.rb
caboose-cms-0.9.209 app/models/caboose/store_config.rb
caboose-cms-0.9.208 app/models/caboose/store_config.rb
caboose-cms-0.9.207 app/models/caboose/store_config.rb
caboose-cms-0.9.206 app/models/caboose/store_config.rb
caboose-cms-0.9.205 app/models/caboose/store_config.rb
caboose-cms-0.9.204 app/models/caboose/store_config.rb
caboose-cms-0.9.203 app/models/caboose/store_config.rb
caboose-cms-0.9.202 app/models/caboose/store_config.rb