18 lines
297 B
Ruby
18 lines
297 B
Ruby
class LineStockUsage < ApplicationRecord
|
|
belongs_to :line_stock
|
|
|
|
acts_as_caching :fields => %w( price_u_ht price_ht )
|
|
|
|
after_destroy do
|
|
self.line_stock.save
|
|
end
|
|
|
|
def ca_price_u_ht
|
|
self.line_stock.price_u_ht
|
|
end
|
|
|
|
def ca_price_ht
|
|
self.price_u_ht * self.qte
|
|
end
|
|
end
|