module ErpCommerce::Extensions::ActiveRecord::ActsAsPriceable::InstanceMethods
Public Instance Methods
get_current_simple_amount_with_currency()
click to toggle source
# File lib/erp_commerce/extensions/active_record/acts_as_priceable.rb, line 30 def get_current_simple_amount_with_currency amount = nil plan = get_current_simple_plan unless plan.nil? amount = help.number_to_currency(plan.money_amount, :unit => plan.currency.symbol) end amount end
get_current_simple_plan()
click to toggle source
# File lib/erp_commerce/extensions/active_record/acts_as_priceable.rb, line 39 def get_current_simple_plan self.pricing_plans.where('is_simple_amount = ? and (from_date <= ? and thru_date >= ? or (from_date is null and thru_date is null))', true, Date.today, Date.today).first end
get_default_price()
click to toggle source
# File lib/erp_commerce/extensions/active_record/acts_as_priceable.rb, line 26 def get_default_price self.pricing_plans.first.get_price end
help()
click to toggle source
# File lib/erp_commerce/extensions/active_record/acts_as_priceable.rb, line 48 def help Helper.instance end