effective_memberships 0.7.3 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cdabd18c745a7596a4d7d39fb50436a4f6464e88399c8ca4e4b77d58abaddeb
|
4
|
+
data.tar.gz: 42df553cb0e753d4259f90a3358c4c3118ca847b5a8128d387de9a2b130a49a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2daa5ad4a3d3f8287b611d3482c32ef07a974bc5488c5adc08884e3f1ca58a7e44fb195ca22d31c4a1c57b8830865036238a584260f3633047f0f382caefcfe9
|
7
|
+
data.tar.gz: c904772304719fc3a34b472cb1b4b917909bf94185bc320c60ec691c2ad742bf98a78cb073516011c9669885844072b10ba2ac97ccd4b37987d46342c751e61c
|
@@ -264,7 +264,7 @@ module EffectiveMembershipsOwner
|
|
264
264
|
|
265
265
|
# Only continue if there is a late renewal fee for the same period
|
266
266
|
renewal_fee = fees.find { |fee| fee.fee_type == 'Renewal' && fee.period == period && fee.category_id == category.id && fee.category_type == category.class.name }
|
267
|
-
return
|
267
|
+
return if fee.blank? && (renewal_fee.blank? || renewal_fee.late? == false)
|
268
268
|
|
269
269
|
# Build the late fee
|
270
270
|
fee ||= fees.build()
|
@@ -292,7 +292,7 @@ module EffectiveMembershipsOwner
|
|
292
292
|
# Assign in bad standing
|
293
293
|
if membership.bad_standing_admin?
|
294
294
|
# Nothing to do
|
295
|
-
elsif bad_standing_fees.present?
|
295
|
+
elsif bad_standing_fees.present? && membership.categories.any?(&:create_bad_standing?)
|
296
296
|
membership.bad_standing = true
|
297
297
|
membership.bad_standing_reason = 'Unpaid Fees'
|
298
298
|
else
|
@@ -385,5 +385,4 @@ module EffectiveMembershipsOwner
|
|
385
385
|
end
|
386
386
|
end
|
387
387
|
|
388
|
-
|
389
388
|
end
|
@@ -401,7 +401,7 @@ module EffectiveMembershipsRegistrar
|
|
401
401
|
GC.start
|
402
402
|
|
403
403
|
# Update Membership Status - Assign In Bad Standing
|
404
|
-
memberships.find_each { |membership|
|
404
|
+
memberships.find_each { |membership| create_bad_standing!(membership, period: period) }
|
405
405
|
GC.start
|
406
406
|
|
407
407
|
true
|
@@ -416,7 +416,7 @@ module EffectiveMembershipsRegistrar
|
|
416
416
|
raise("expected build_renewal_fee to return a fee for period #{period}") unless fee.kind_of?(Effective::Fee)
|
417
417
|
next if fee.purchased?
|
418
418
|
|
419
|
-
puts("Created renewal fee for #{membership.owner}") if fee.new_record? &&
|
419
|
+
puts("Created renewal fee for #{membership.owner}") if fee.new_record? && debug?
|
420
420
|
|
421
421
|
fee.save!
|
422
422
|
end
|
@@ -426,10 +426,18 @@ module EffectiveMembershipsRegistrar
|
|
426
426
|
membership.categories.select(&:create_late_fees?).map do |category|
|
427
427
|
fee = membership.owner.build_late_fee(category: category, period: period)
|
428
428
|
next if fee.blank? || fee.purchased?
|
429
|
+
|
430
|
+
puts("Created late fee for #{membership.owner}") if fee.new_record? && debug?
|
431
|
+
|
429
432
|
fee.save!
|
430
433
|
end
|
431
434
|
end
|
432
435
|
|
436
|
+
def create_bad_standing!(membership, period:)
|
437
|
+
return unless membership.categories.any?(&:create_bad_standing?)
|
438
|
+
update_membership_status!(membership, period: period)
|
439
|
+
end
|
440
|
+
|
433
441
|
def update_membership_status!(membership, period: nil)
|
434
442
|
membership.owner.update_membership_status!
|
435
443
|
end
|
@@ -442,6 +450,10 @@ module EffectiveMembershipsRegistrar
|
|
442
450
|
|
443
451
|
protected
|
444
452
|
|
453
|
+
def debug?
|
454
|
+
false
|
455
|
+
end
|
456
|
+
|
445
457
|
def add_member_role(owner)
|
446
458
|
owner.add_role(:member)
|
447
459
|
|
@@ -4,16 +4,16 @@
|
|
4
4
|
- outstanding_owners = current_user.memberships_owners.select { |owner| owner.outstanding_fee_payment_fees.present? }
|
5
5
|
|
6
6
|
- if memberships.present?
|
7
|
-
- if memberships.any? { |membership| membership.
|
7
|
+
- if memberships.any? { |membership| membership.categories.any?(&:create_renewal_fees?) }
|
8
8
|
- date = EffectiveMemberships.Registrar.renewal_fee_date(date: Time.zone.now)
|
9
9
|
%p Annual dues become available for purchase on #{date.strftime('%B %e')} of each year.
|
10
10
|
|
11
|
-
- if memberships.any? { |membership| membership.
|
12
|
-
- date = EffectiveMemberships.Registrar.late_fee_date(
|
11
|
+
- if memberships.any? { |membership| membership.categories.any?(&:create_late_fees?) }
|
12
|
+
- date = EffectiveMemberships.Registrar.late_fee_date(period: Time.zone.now)
|
13
13
|
%p Late fees will be applied on #{date.strftime('%B %e')}.
|
14
14
|
|
15
|
-
- if memberships.any? { |membership| membership.
|
16
|
-
- date = EffectiveMemberships.Registrar.bad_standing_date(
|
15
|
+
- if memberships.any? { |membership| membership.categories.any?(&:create_bad_standing?) }
|
16
|
+
- date = EffectiveMemberships.Registrar.bad_standing_date(period: Time.zone.now)
|
17
17
|
%p Memberships with unpaid fees or dues will be marked in bad standing on #{date.strftime('%B %e')}.
|
18
18
|
|
19
19
|
- if outstanding_owners.present?
|