class PProductStock < ActiveRecord::Base
  belongs_to :p_product
  belongs_to :p_color
  belongs_to :p_size
  
  has_many :p_sheet_line_lines, :dependent => :delete_all
  
  def delta_stock
    (self.stock_ok - self.stock_th_ok)
  end
  
end
