Class: Effective::Fee
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::Fee
- Defined in:
- app/models/effective/fee.rb
Instance Method Summary collapse
-
#applicant_submit_fee? ⇒ Boolean
Used by applicant.applicant_submit_fees.
- #bad_standing? ⇒ Boolean
- #custom_fee? ⇒ Boolean
- #default_title ⇒ Object
- #fee_payment_fee? ⇒ Boolean
- #late? ⇒ Boolean
-
#membership_period_fee? ⇒ Boolean
Will advance a membership.fees_paid_through_year value when purchased.
- #to_s ⇒ Object
Instance Method Details
#applicant_submit_fee? ⇒ Boolean
Used by applicant.applicant_submit_fees
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
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
104 105 106 |
# File 'app/models/effective/fee.rb', line 104 def custom_fee? EffectiveMemberships.custom_fee_types.include?(fee_type) end |
#default_title ⇒ Object
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
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
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
100 101 102 |
# File 'app/models/effective/fee.rb', line 100 def membership_period_fee? ['Prorated', 'Renewal'].include?(fee_type) end |
#to_s ⇒ Object
68 69 70 |
# File 'app/models/effective/fee.rb', line 68 def to_s title.presence || default_title() end |