Sha256: 4ddc7f04e45decfb63a40f8019d059792f6910a5bc12f550f2808be2973eafc9

Contents?: true

Size: 444 Bytes

Versions: 16

Compression:

Stored size: 444 Bytes

Contents

# An sales campaign
#
# Carries an affiliate fee
#
class SalesCampaign < Campaign
  money_columns :sales_fee

  belongs_to :sales_person, :class_name => 'Contact'
  validates :sales_person, :presence => { :if => lambda {|x| x.type == 'SalesCampaign' } }

  ##
  # The sum cost of this campaign
  #
  def cost
    sales_fee
  end

  def set_cost(options = {})
    dated_costs.clear
    dated_costs.create(options.merge(:cost => cost))
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
e9_crm-0.1.34 app/models/sales_campaign.rb
e9_crm-0.1.33 app/models/sales_campaign.rb
e9_crm-0.1.32 app/models/sales_campaign.rb
e9_crm-0.1.31 app/models/sales_campaign.rb
e9_crm-0.1.30 app/models/sales_campaign.rb
e9_crm-0.1.29 app/models/sales_campaign.rb
e9_crm-0.1.28 app/models/sales_campaign.rb
e9_crm-0.1.27 app/models/sales_campaign.rb
e9_crm-0.1.26 app/models/sales_campaign.rb
e9_crm-0.1.25 app/models/sales_campaign.rb
e9_crm-0.1.24 app/models/sales_campaign.rb
e9_crm-0.1.23 app/models/sales_campaign.rb
e9_crm-0.1.22 app/models/sales_campaign.rb
e9_crm-0.1.21 app/models/sales_campaign.rb
e9_crm-0.1.20 app/models/sales_campaign.rb
e9_crm-0.1.19 app/models/sales_campaign.rb