effective_memberships 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e562d7ef78e3298066d1051a02aee3f0e81515a5221f5210f0782403d4634a6
|
4
|
+
data.tar.gz: 7951880cdf0b2fd8f0a4dfbff341b58ef61853cab50d36da54ed31ee5f16f457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a46a6e3b2117e117aef3dd3ee1d28e4f6cb9790ce22144193549c54cd6c96253f2268287e6f228083e7d526b14d6b1091cb196091caf1f7da7eec9df5f5ac65
|
7
|
+
data.tar.gz: 5cf7629541e967ce4ffd3c06a1e0953cc0d36fa2528e4fb85a4418ce1c5ff77e71f13ea172e77d1fea3d9f2f73623dc5b285079099e51be2df385ad0f572587b
|
@@ -395,6 +395,16 @@ module EffectiveMembershipsApplicant
|
|
395
395
|
can_revisit_completed_steps(step)
|
396
396
|
end
|
397
397
|
|
398
|
+
# Find fee
|
399
|
+
def fee(fee_type:)
|
400
|
+
fees.find { |fee| fee.fee_type == fee_type }
|
401
|
+
end
|
402
|
+
|
403
|
+
# Find or build
|
404
|
+
def build_fee(fee_type:)
|
405
|
+
fee(fee_type: fee_type) || fees.build(parent: self, owner: owner, fee_type: fee_type)
|
406
|
+
end
|
407
|
+
|
398
408
|
def applicant_fee_type
|
399
409
|
return 'Reinstatement' if reinstatement?
|
400
410
|
'Applicant'
|
@@ -411,18 +421,22 @@ module EffectiveMembershipsApplicant
|
|
411
421
|
|
412
422
|
# All Fees and Orders
|
413
423
|
def submit_fees
|
424
|
+
default_applicant_submit_fees
|
425
|
+
end
|
426
|
+
|
427
|
+
def default_applicant_submit_fees
|
414
428
|
# Find or build submit fee
|
415
|
-
fee = fees.first ||
|
429
|
+
fee = fees.first || build_fee(fee_type: applicant_fee_type)
|
416
430
|
|
417
431
|
raise('expected a present applicant fee price') if applicant_fee_price.blank?
|
418
432
|
|
419
433
|
unless fee.purchased?
|
420
434
|
fee.assign_attributes(
|
421
|
-
fee_type: applicant_fee_type
|
422
|
-
category: applicant_fee_category
|
423
|
-
price: applicant_fee_price
|
424
|
-
tax_exempt: applicant_fee_category
|
425
|
-
qb_item_name: applicant_fee_category
|
435
|
+
fee_type: applicant_fee_type,
|
436
|
+
category: applicant_fee_category,
|
437
|
+
price: applicant_fee_price,
|
438
|
+
tax_exempt: applicant_fee_category.applicant_fee_tax_exempt,
|
439
|
+
qb_item_name: applicant_fee_category.applicant_fee_qb_item_name
|
426
440
|
)
|
427
441
|
end
|
428
442
|
|