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_bad_standing_on ⇒ Object
- #default_late_on ⇒ Object
- #default_period ⇒ Object
- #default_qb_item_name ⇒ Object
- #default_tax_exempt ⇒ Object
- #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
93 94 95 |
# File 'app/models/effective/fee.rb', line 93 def applicant_submit_fee? fee_type == 'Applicant' end |
#bad_standing? ⇒ 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
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_on ⇒ Object
118 119 120 |
# File 'app/models/effective/fee.rb', line 118 def default_bad_standing_on nil end |
#default_late_on ⇒ Object
114 115 116 |
# File 'app/models/effective/fee.rb', line 114 def default_late_on nil end |
#default_period ⇒ Object
110 111 112 |
# File 'app/models/effective/fee.rb', line 110 def default_period EffectiveMemberships.Registrar.current_period end |
#default_qb_item_name ⇒ Object
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_exempt ⇒ Object
135 136 137 |
# File 'app/models/effective/fee.rb', line 135 def default_tax_exempt category.present? ? category.tax_exempt : false end |
#default_title ⇒ Object
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
97 98 99 |
# File 'app/models/effective/fee.rb', line 97 def fee_payment_fee? fee_type != 'Applicant' end |
#late? ⇒ 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
102 103 104 |
# File 'app/models/effective/fee.rb', line 102 def membership_period_fee? fee_type == 'Prorated' || fee_type == 'Renewal' end |
#to_s ⇒ Object
74 75 76 |
# File 'app/models/effective/fee.rb', line 74 def to_s title.presence || default_title() end |