class PComptaElement < ApplicationRecord
  belongs_to :p_customer
  belongs_to :element, :polymorphic => true
  
  QI_DYNAMICS = %w(amount solde element_date)

  eval(QI_DYNAMICS_CORE)
  
  def ca_amount
    self.element.compta_amount if self.element
  end
  
  def ca_solde
    
  end
  
  def element_date
    self.element.compta_date if self.element
  end
end
