effective_memberships 0.9.16 → 0.10.0
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: 978c99bc1bc8f0106fac7867dc8a07acea70bd94456d248e20cbb2e57c633b76
|
4
|
+
data.tar.gz: af1183a241f5b564c7b3ca4aa1ded0768dfde262d3b75da1933ddd177e430ede
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caa13055dda3360d3d1426710a39923cc79fcf99cf0af710acead650e3f56089d068e4d30fde0072ba2708cc144515a948a4a265624f0726e6afee4e1457861d
|
7
|
+
data.tar.gz: 5f8241aba4c6d6ca7757346ae74520993d48d4d04af8c5bdf486337ec2e939da8f2d7641fe746319d8c284190c07594b0be1b675240e996beee98815bb124c74
|
@@ -99,6 +99,10 @@ module EffectiveMembershipsOwner
|
|
99
99
|
fees.select { |fee| fee.fee_payment_fee? && !fee.purchased? }
|
100
100
|
end
|
101
101
|
|
102
|
+
def outstanding_renewal_fees
|
103
|
+
fees.select { |fee| fee.fee_type == 'Renewal' && !fee.purchased? }
|
104
|
+
end
|
105
|
+
|
102
106
|
def outstanding_fee_payments
|
103
107
|
fee_payments = EffectiveMemberships.FeePayment.all
|
104
108
|
|
@@ -156,6 +156,7 @@ module EffectiveMembershipsRegistrar
|
|
156
156
|
raise('expected to and from to be different') if from == to
|
157
157
|
|
158
158
|
date ||= Time.zone.now
|
159
|
+
period = period(date: date)
|
159
160
|
|
160
161
|
# Existing Membership
|
161
162
|
membership = owner.membership
|
@@ -171,11 +172,18 @@ module EffectiveMembershipsRegistrar
|
|
171
172
|
membership.build_membership_status(status: status) if status.present?
|
172
173
|
|
173
174
|
unless skip_fees
|
174
|
-
|
175
|
-
raise('already has purchased prorated fee') if fee.purchased?
|
175
|
+
existing = owner.membership_period_fee(category: from, period: period)
|
176
176
|
|
177
|
-
|
178
|
-
|
177
|
+
if existing
|
178
|
+
fee = owner.build_prorated_fee(date: date)
|
179
|
+
raise('already has purchased prorated fee') if fee.purchased?
|
180
|
+
|
181
|
+
fee = owner.build_discount_fee(date: date, from: from)
|
182
|
+
raise('already has purchased discount fee') if fee.purchased?
|
183
|
+
else
|
184
|
+
fee = owner.build_renewal_fee(category: to, period: period)
|
185
|
+
raise('already has purchased renewal fee') if fee.purchased?
|
186
|
+
end
|
179
187
|
end
|
180
188
|
|
181
189
|
save!(owner, date: date)
|
@@ -31,8 +31,11 @@
|
|
31
31
|
%li A #{month} prorated fee
|
32
32
|
|
33
33
|
- if applicant.reclassification?
|
34
|
-
|
35
|
-
|
34
|
+
- if applicant.owner.outstanding_renewal_fees.present?
|
35
|
+
%li A renewal fee in their new category
|
36
|
+
- else
|
37
|
+
%li A #{month} prorated fee to the new category
|
38
|
+
%li A #{month} discount fee from their old category
|
36
39
|
|
37
40
|
- if applicant.reinstatement?
|
38
41
|
%li A #{month} prorated fee to their reinstatement category
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_memberships
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|