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)


83
84
85
# File 'app/models/effective/fee.rb', line 83

def applicant_submit_fee?
  fee_type == 'Applicant'
end

#bad_standing?Boolean

Returns:

  • (Boolean)


75
76
77
78
79
80
# File 'app/models/effective/fee.rb', line 75

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)


96
97
98
# File 'app/models/effective/fee.rb', line 96

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

#default_titleObject



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

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

#fee_payment_fee?Boolean

Returns:

  • (Boolean)


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

def fee_payment_fee?
  fee_type != 'Applicant'
end

#late?Boolean

Returns:

  • (Boolean)


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

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)


92
93
94
# File 'app/models/effective/fee.rb', line 92

def membership_period_fee?
  fee_type == 'Prorated' || fee_type == 'Renewal'
end

#to_sObject



64
65
66
# File 'app/models/effective/fee.rb', line 64

def to_s
  title.presence || default_title()
end