Class: MnoEnterprise::Invoice

Inherits:
BaseResource show all
Defined in:
app/models/mno_enterprise/invoice.rb

Instance Method Summary collapse

Methods inherited from BaseResource

#==, base_class, #cache_key, #clear_association_cache, #clear_attribute_changes!, exists?, find_by, first, last, #max_updated_column_timestamp, #read_attribute, #reload, #save, #save!, #update, #write_attribute

Methods included from HerExtension::Validations::RemoteUniquenessValidation

included

Instance Method Details

#paid?Boolean

Return true if the invoice has been paid false otherwise

Returns:

  • (Boolean)


49
50
51
# File 'app/models/mno_enterprise/invoice.rb', line 49

def paid?
  !self.paid_at.blank?
end

#period_labelObject

Return a label describing the time period this invoice covers



42
43
44
45
# File 'app/models/mno_enterprise/invoice.rb', line 42

def period_label
  return '' unless self.started_at && self.ended_at
  "#{self.started_at.strftime("%b %d,%Y")} to #{self.ended_at.strftime("%b %d,%Y")}"
end