23 lines
310 B
Ruby
23 lines
310 B
Ruby
class Abonnement < ActiveRecord::Base
|
|
belongs_to :reseaux
|
|
has_many :payments, :as => :element
|
|
|
|
def after_paid
|
|
self.paid = true
|
|
self.save
|
|
end
|
|
|
|
def total_price_ht
|
|
self.price
|
|
end
|
|
|
|
def total_price_ttc
|
|
total_price_ht + total_price_ht * tva
|
|
end
|
|
|
|
def tva
|
|
0.2
|
|
end
|
|
|
|
end
|