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)


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

def applicant_submit_fee?
  fee_type == 'Applicant'
end

#bad_standing?Boolean

Returns:

  • (Boolean)


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

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)


106
107
108
# File 'app/models/effective/fee.rb', line 106

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

#default_bad_standing_onObject



118
119
120
# File 'app/models/effective/fee.rb', line 118

def default_bad_standing_on
  nil
end

#default_late_onObject



114
115
116
# File 'app/models/effective/fee.rb', line 114

def default_late_on
  nil
end

#default_periodObject



110
111
112
# File 'app/models/effective/fee.rb', line 110

def default_period
  EffectiveMemberships.Registrar.current_period
end

#default_qb_item_nameObject



131
132
133
# File 'app/models/effective/fee.rb', line 131

def default_qb_item_name
  category&.qb_item_name.presence || "#{fee_type}"
end

#default_tax_exemptObject



135
136
137
# File 'app/models/effective/fee.rb', line 135

def default_tax_exempt
  category.present? ? category.tax_exempt : false
end

#default_titleObject



122
123
124
125
126
127
128
129
# File 'app/models/effective/fee.rb', line 122

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

#fee_payment_fee?Boolean

Returns:

  • (Boolean)


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

def fee_payment_fee?
  fee_type != 'Applicant'
end

#late?Boolean

Returns:

  • (Boolean)


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

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)


102
103
104
# File 'app/models/effective/fee.rb', line 102

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

#to_sObject



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

def to_s
  title.presence || default_title()
end