Class: Effective::Fee

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/fee.rb

Instance Method Summary collapse

Instance Method Details

#applicant_submit_fee?Boolean

Used by applicant.applicant_submit_fees

Returns:

  • (Boolean)


87
88
89
90
91
# File 'app/models/effective/fee.rb', line 87

def applicant_submit_fee?
  return true if parent.kind_of?(EffectiveMemberships.Applicant)

  ['Applicant', 'Reinstatement'].include?(fee_type)
end

#bad_standing?Boolean

Returns:

  • (Boolean)


79
80
81
82
83
84
# File 'app/models/effective/fee.rb', line 79

def bad_standing?
  return false if bad_standing_on.blank?
  return false if purchased?

  bad_standing_on <= Time.zone.now.to_date
end

#custom_fee?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'app/models/effective/fee.rb', line 104

def custom_fee?
  EffectiveMemberships.custom_fee_types.include?(fee_type)
end

#default_titleObject



108
109
110
# File 'app/models/effective/fee.rb', line 108

def default_title
  [period&.strftime('%Y'), category, fee_type, 'Fee'].compact.join(' ')
end

#fee_payment_fee?Boolean

Returns:

  • (Boolean)


93
94
95
96
97
# File 'app/models/effective/fee.rb', line 93

def fee_payment_fee?
  return false if parent.kind_of?(EffectiveMemberships.Applicant)

  ['Applicant', 'Reinstatement'].exclude?(fee_type)
end

#late?Boolean

Returns:

  • (Boolean)


72
73
74
75
76
77
# File 'app/models/effective/fee.rb', line 72

def late?
  return false if late_on.blank?
  return false if purchased?

  late_on <= Time.zone.now.to_date
end

#membership_period_fee?Boolean

Will advance a membership.fees_paid_through_year value when purchased

Returns:

  • (Boolean)


100
101
102
# File 'app/models/effective/fee.rb', line 100

def membership_period_fee?
  ['Prorated', 'Renewal'].include?(fee_type)
end

#to_sObject



68
69
70
# File 'app/models/effective/fee.rb', line 68

def to_s
  title.presence || default_title()
end