effective_memberships 0.13.5 → 0.13.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/concerns/effective_memberships_applicant.rb +39 -0
  3. data/app/models/concerns/effective_memberships_category.rb +16 -1
  4. data/app/models/concerns/effective_memberships_fee_payment.rb +36 -0
  5. data/app/models/concerns/effective_memberships_registrar.rb +41 -40
  6. data/app/models/effective/fee.rb +6 -0
  7. data/app/views/admin/categories/_fields_applicant_requirements.html.haml +55 -0
  8. data/app/views/admin/categories/_fields_applicant_steps.html.haml +4 -0
  9. data/app/views/admin/categories/_fields_fee_payment_requirements.html.haml +11 -0
  10. data/app/views/admin/categories/_fields_fee_payment_steps.html.haml +4 -0
  11. data/app/views/admin/categories/_form.html.haml +3 -5
  12. data/app/views/admin/categories/_form_wizards.html.haml +16 -0
  13. data/app/views/effective/applicant_endorsements/complete.html.haml +1 -1
  14. data/app/views/effective/applicant_references/_form_declaration.html.haml +3 -2
  15. data/app/views/effective/applicant_references/complete.html.haml +1 -1
  16. data/app/views/effective/applicants/_cpd.html.haml +3 -0
  17. data/app/views/effective/applicants/_cpd_requirements.html.haml +2 -0
  18. data/app/views/effective/applicants/_declarations_fields.html.haml +5 -0
  19. data/app/views/effective/applicants/_references_requirements.html.haml +1 -0
  20. data/app/views/effective/applicants/cpd.html.haml +20 -0
  21. data/app/views/effective/applicants/declarations.html.haml +1 -7
  22. data/app/views/effective/applicants/files.html.haml +3 -1
  23. data/app/views/effective/applicants/references.html.haml +4 -0
  24. data/app/views/effective/applicants/transcripts.html.haml +2 -0
  25. data/app/views/effective/wizard_steps/_cpd_fields.html.haml +3 -0
  26. data/app/views/effective/wizard_steps/_cpd_requirements.html.haml +15 -0
  27. data/app/views/effective/wizard_steps/_cpd_statements.html.haml +15 -0
  28. data/db/migrate/01_create_effective_memberships.rb.erb +6 -5
  29. data/lib/effective_memberships/version.rb +1 -1
  30. metadata +15 -3
  31. data/app/views/admin/categories/_form_fee_payment_steps.html.haml +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02521eeb4da07e9cece1d9cbd784b6ecf5fe7d042ab48f0407455bbe3f9d725c
4
- data.tar.gz: 42255afdbdcebbf4787328d0088e6183453e79cef39a84f6b81123eb19a9be86
3
+ metadata.gz: 77571110c375655e79ac7ef7150003db9d611ea564d7f0f9ebc65ec38be21715
4
+ data.tar.gz: a6aa04f69f1cf002779f768f6b2362b819bbfdb8d874ee23bfad8f4ed1c1f65f
5
5
  SHA512:
6
- metadata.gz: 7ec1e5ca1c59f678388a0d8750a768de77bb7f63bc7803fd9c0627f8370b26e8d764a313013234dbbe1d435f38e4c67ba612840607f2620ce9772d955a705345
7
- data.tar.gz: 066b68def2279607ac729e81ef88e42cc13ed619165ab75c734a68a61d007bf26fae2dfacc59e6427efceba4130fab81009fe0c659f067a736fdbe26a1d2de20
6
+ metadata.gz: 96bad4189f675621a5fc51652b23c021fd09e21bb4737a3b97e7ab0f3fa2a770bdc437dac40fc27179b3c91b19d7ce296cb50d14601fc83d8e7be8184df6a382
7
+ data.tar.gz: b979ee021ff929ebbab1415f5da5e89134fb2202c4f41bafeeb514c83e10312bf9cc97bf8aa0ad3ea73ef185463eaef574c8d5a94564c589ad16586e18aa4f29
@@ -63,6 +63,7 @@ module EffectiveMembershipsApplicant
63
63
  experience: 'Work Experience',
64
64
  references: 'References',
65
65
  files: 'Attach Files',
66
+ cpd: 'Continuing Professional Development',
66
67
  stamp: 'Professional Stamp',
67
68
  declarations: 'Declarations',
68
69
  summary: 'Review',
@@ -78,6 +79,8 @@ module EffectiveMembershipsApplicant
78
79
  has_many_attached :applicant_files
79
80
  has_many_attached :transcripts
80
81
 
82
+ has_many_purgable if respond_to?(:has_many_purgable)
83
+
81
84
  # Transcripts Step
82
85
  attr_accessor :declare_will_send_transcripts
83
86
 
@@ -88,6 +91,9 @@ module EffectiveMembershipsApplicant
88
91
  # Reinstatements Step
89
92
  attr_accessor :declare_reinstatement
90
93
 
94
+ # CPD Step
95
+ attr_accessor :declare_cpd
96
+
91
97
  # Admin Approve Step
92
98
  attr_accessor :approved_membership_number
93
99
  attr_accessor :approved_membership_date
@@ -344,6 +350,17 @@ module EffectiveMembershipsApplicant
344
350
  end
345
351
  end
346
352
 
353
+ # CPD step
354
+ with_options(if: -> { current_step == :cpd }) do
355
+ validates :declare_cpd, acceptance: true
356
+
357
+ validate do
358
+ if (cpd_cycles = cpd_uncompleted_cpd_cycles).present?
359
+ self.errors.add(:base, "Please complete #{cpd_cycles.map(&:to_s).to_sentence} to continue")
360
+ end
361
+ end
362
+ end
363
+
347
364
  # Transcripts step
348
365
  with_options(if: -> { current_step == :transcripts }) do
349
366
  validates :declare_will_send_transcripts, acceptance: true
@@ -710,6 +727,28 @@ module EffectiveMembershipsApplicant
710
727
  required_steps.include?(:transcripts)
711
728
  end
712
729
 
730
+ # CPD Step
731
+ def cpd_requirement
732
+ (category&.applicant_cpd_step_requirement.presence || EffectiveMemberships.Category.cpd_step_requirements.first)
733
+ end
734
+
735
+ def cpd_required_cpd_cycles
736
+ date = submitted_at || Time.zone.now
737
+
738
+ [
739
+ (EffectiveCpd.previous_cpd_cycle(date: date) if cpd_requirement.to_s.include?('previous')),
740
+ (EffectiveCpd.current_cpd_cycle(date: date) if cpd_requirement.to_s.include?('current'))
741
+ ].compact
742
+ end
743
+
744
+ def cpd_completed_cpd_cycles
745
+ cpd_required_cpd_cycles.select { |cpd_cycle| user&.cpd_statement(cpd_cycle: cpd_cycle)&.completed? }
746
+ end
747
+
748
+ def cpd_uncompleted_cpd_cycles
749
+ cpd_required_cpd_cycles.reject { |cpd_cycle| user&.cpd_statement(cpd_cycle: cpd_cycle)&.completed? }
750
+ end
751
+
713
752
  # Files Step
714
753
  def min_applicant_files
715
754
  category&.min_applicant_files.to_i
@@ -23,6 +23,19 @@ module EffectiveMembershipsCategory
23
23
  def categories
24
24
  []
25
25
  end
26
+
27
+ # These are the values for the Applicant and FeePayment cpd_step_requirements fields
28
+ # The first entry should always mean None Required.
29
+ # Please use current and previous as lowercase
30
+ def cpd_step_requirements
31
+ [
32
+ 'None',
33
+ 'Must submit current',
34
+ 'Must submit previous',
35
+ 'Must submit current and previous'
36
+ ]
37
+ end
38
+
26
39
  end
27
40
 
28
41
  included do
@@ -55,6 +68,7 @@ module EffectiveMembershipsCategory
55
68
  applicant_reinstatement_fee :integer
56
69
  applicant_wizard_steps :text
57
70
 
71
+ applicant_cpd_step_requirement :string
58
72
  min_applicant_educations :integer
59
73
  min_applicant_endorsements :integer
60
74
  min_applicant_equivalences :integer
@@ -82,7 +96,8 @@ module EffectiveMembershipsCategory
82
96
  prorated_dec :integer
83
97
 
84
98
  # Fee Payments
85
- fee_payment_wizard_steps :text
99
+ fee_payment_wizard_steps :text
100
+ fee_payment_cpd_step_requirement :string
86
101
 
87
102
  # Renewals
88
103
  create_renewal_fees :boolean
@@ -45,6 +45,9 @@ module EffectiveMembershipsFeePayment
45
45
 
46
46
  log_changes(except: :wizard_steps) if respond_to?(:log_changes)
47
47
 
48
+ # CPD Step
49
+ attr_accessor :declare_cpd
50
+
48
51
  # Declarations Step
49
52
  attr_accessor :declare_code_of_ethics
50
53
  attr_accessor :declare_truth
@@ -120,6 +123,17 @@ module EffectiveMembershipsFeePayment
120
123
  self.errors.add(:base, 'please complete your existing fee payment first') if existing.present?
121
124
  end
122
125
 
126
+ # CPD step
127
+ with_options(if: -> { current_step == :cpd }) do
128
+ validates :declare_cpd, acceptance: true
129
+
130
+ validate do
131
+ if (cpd_cycles = cpd_uncompleted_cpd_cycles).present?
132
+ self.errors.add(:base, "Please complete #{cpd_cycles.map(&:to_s).to_sentence} to continue")
133
+ end
134
+ end
135
+ end
136
+
123
137
  # Declarations Step
124
138
  with_options(if: -> { current_step == :declarations }) do
125
139
  validates :declare_code_of_ethics, acceptance: true
@@ -225,4 +239,26 @@ module EffectiveMembershipsFeePayment
225
239
  save!
226
240
  end
227
241
 
242
+ # CPD Step
243
+ def cpd_requirement
244
+ (category&.fee_payment_cpd_step_requirement.presence || EffectiveMemberships.Category.cpd_step_requirements.first)
245
+ end
246
+
247
+ def cpd_required_cpd_cycles
248
+ date = submitted_at || Time.zone.now
249
+
250
+ [
251
+ (EffectiveCpd.previous_cpd_cycle(date: date) if cpd_requirement.to_s.include?('previous')),
252
+ (EffectiveCpd.current_cpd_cycle(date: date) if cpd_requirement.to_s.include?('current'))
253
+ ].compact
254
+ end
255
+
256
+ def cpd_completed_cpd_cycles
257
+ cpd_required_cpd_cycles.select { |cpd_cycle| user&.cpd_statement(cpd_cycle: cpd_cycle)&.completed? }
258
+ end
259
+
260
+ def cpd_uncompleted_cpd_cycles
261
+ cpd_required_cpd_cycles.reject { |cpd_cycle| user&.cpd_statement(cpd_cycle: cpd_cycle)&.completed? }
262
+ end
263
+
228
264
  end
@@ -63,6 +63,47 @@ module EffectiveMembershipsRegistrar
63
63
  period(date: date).end_of_year
64
64
  end
65
65
 
66
+ def current_period
67
+ period(date: Time.zone.now)
68
+ end
69
+
70
+ def last_period
71
+ advance_period(period: current_period, number: -1)
72
+ end
73
+
74
+ # Returns a date of Jan 1, Year
75
+ def period(date:)
76
+ cutoff = renewal_fee_date(date: date) # period_end_on
77
+ period = (date < cutoff) ? advance_period(period: date, number: 0) : advance_period(period: date, number: 1)
78
+ period.to_date
79
+ end
80
+
81
+ # This is only used for a form collection on admin memberships
82
+ def periods(from:, to: nil)
83
+ to ||= Time.zone.now
84
+
85
+ raise('expected to date') unless to.respond_to?(:strftime)
86
+ raise('expected from date') unless from.respond_to?(:strftime)
87
+
88
+ from = period(date: from)
89
+ to = period(date: to)
90
+
91
+ retval = []
92
+
93
+ loop do
94
+ retval << from
95
+ from = advance_period(period: from, number: 1)
96
+ break if from > to
97
+ end
98
+
99
+ retval
100
+ end
101
+
102
+ def periods_collection(from: nil, to: nil)
103
+ from ||= Time.zone.now - 10.years
104
+ periods(from: from, to: to).reverse.map { |period| [period_end_on(date: period), period] }
105
+ end
106
+
66
107
  # Category is required, statuses are optional
67
108
  def assign!(owner, categories:, statuses: nil, date: nil, number: nil)
68
109
  categories = Array(categories)
@@ -423,46 +464,6 @@ module EffectiveMembershipsRegistrar
423
464
  number.to_s
424
465
  end
425
466
 
426
- def current_period
427
- period(date: Time.zone.now)
428
- end
429
-
430
- def last_period
431
- advance_period(period: current_period, number: -1)
432
- end
433
-
434
- # Returns a date of Jan 1, Year
435
- def period(date:)
436
- cutoff = renewal_fee_date(date: date) # period_end_on
437
- period = (date < cutoff) ? advance_period(period: date, number: 0) : advance_period(period: date, number: 1)
438
- period.to_date
439
- end
440
-
441
- # This is only used for a form collection on admin memberships
442
- def periods(from:, to: nil)
443
- to ||= Time.zone.now
444
-
445
- raise('expected to date') unless to.respond_to?(:strftime)
446
- raise('expected from date') unless from.respond_to?(:strftime)
447
-
448
- from = period(date: from)
449
- to = period(date: to)
450
-
451
- retval = []
452
-
453
- loop do
454
- retval << from
455
- from = advance_period(period: from, number: 1)
456
- break if from > to
457
- end
458
-
459
- retval
460
- end
461
-
462
- def periods_collection(from: nil, to: nil)
463
- from ||= Time.zone.now - 10.years
464
- periods(from: from, to: to).reverse.map { |period| [period_end_on(date: period), period] }
465
- end
466
467
 
467
468
  # Called by applicant.approve!
468
469
  def delete_fees!(resource)
@@ -53,9 +53,15 @@ module Effective
53
53
 
54
54
  before_validation do
55
55
  self.period ||= EffectiveMemberships.Registrar.current_period
56
+ self.checkout_type ||= CHECKOUT_TYPES.first
57
+
56
58
  self.title = default_title() if self.title.blank?
57
59
  end
58
60
 
61
+ before_validation(if: -> { qb_item_name.blank? && category.present? }) do
62
+ assign_attributes(qb_item_name: category.qb_item_name, tax_exempt: category.tax_exempt?)
63
+ end
64
+
59
65
  before_validation(if: -> { fee_type == 'Renewal' && category.present? && period.present? }) do
60
66
  self.late_on ||= EffectiveMemberships.Registrar.late_fee_date(period: period) if category.create_late_fees?
61
67
  self.not_in_good_standing_on ||= EffectiveMemberships.Registrar.not_in_good_standing_date(period: period) if category.create_not_in_good_standing?
@@ -0,0 +1,55 @@
1
+ %p The following numbers set the minimum number of required items an applicant must provide to complete each step. Leave blank for none.
2
+
3
+ - applicant = EffectiveMemberships.Applicant.new
4
+
5
+ %table.table.table-sm
6
+ %tbody
7
+ - if applicant.wizard_step_keys.include?(:education)
8
+ %tr
9
+ %td= applicant.wizard_step_title(:education)
10
+ %td= f.number_field :min_applicant_educations, label: false
11
+ %td minimum number of education degrees
12
+
13
+ - if applicant.wizard_step_keys.include?(:course_amounts)
14
+ %tr
15
+ %td= applicant.wizard_step_title(:course_amounts)
16
+ %td= f.number_field :min_applicant_courses, label: false
17
+ %td minimum number of courses
18
+
19
+ - if applicant.wizard_step_keys.include?(:experience)
20
+ %tr
21
+ %td= applicant.wizard_step_title(:experience)
22
+ %td= f.number_field :min_applicant_experiences_months, label: false
23
+ %td minimimum months of work experience
24
+
25
+ - if applicant.wizard_step_keys.include?(:endorsements)
26
+ %tr
27
+ %td= applicant.wizard_step_title(:endorsements)
28
+ %td= f.number_field :min_applicant_endorsements, label: false
29
+ %td minimimum number of endorsements
30
+
31
+ - if applicant.wizard_step_keys.include?(:equivalences)
32
+ %tr
33
+ %td= applicant.wizard_step_title(:equivalences)
34
+ %td= f.number_field :min_applicant_equivalences, label: false
35
+ %td minimimum number of equivalent memberships
36
+
37
+ - if applicant.wizard_step_keys.include?(:references)
38
+ %tr
39
+ %td= applicant.wizard_step_title(:references)
40
+ %td= f.number_field :min_applicant_references, label: false
41
+ %td minimimum number of references
42
+
43
+ - if applicant.wizard_step_keys.include?(:files)
44
+ %tr
45
+ %td= applicant.wizard_step_title(:files)
46
+ %td= f.number_field :min_applicant_files, label: false
47
+ %td minimimum number of attached files
48
+
49
+ - if applicant.wizard_step_keys.include?(:cpd)
50
+ %tr
51
+ %td= applicant.wizard_step_title(:cpd)
52
+ %td= f.select :applicant_cpd_step_requirement, f.object.class.cpd_step_requirements, label: false
53
+ %td
54
+ minimum required
55
+ = ets(EffectiveCpd.CpdStatement)
@@ -0,0 +1,4 @@
1
+ %p The following wizard steps will be displayed when applying for this #{et(Effective::Category)}
2
+
3
+ - f.object.applicant_wizard_steps += EffectiveMemberships.Applicant.required_wizard_steps
4
+ = f.checks :applicant_wizard_steps, f.object.applicant_wizard_steps_collection(), label: false
@@ -0,0 +1,11 @@
1
+ - fee_payment = EffectiveMemberships.FeePayment.new
2
+
3
+ %table.table.table-sm
4
+ %tbody
5
+ - if fee_payment.wizard_step_keys.include?(:cpd)
6
+ %tr
7
+ %td= fee_payment.wizard_step_title(:cpd)
8
+ %td= f.select :fee_payment_cpd_step_requirement, f.object.class.cpd_step_requirements, label: false
9
+ %td
10
+ minimum required
11
+ = ets(EffectiveCpd.CpdStatement)
@@ -0,0 +1,4 @@
1
+ %p The following wizard steps will be displayed when applying for this #{et(Effective::FeePayment)}
2
+
3
+ - f.object.fee_payment_wizard_steps += EffectiveMemberships.FeePayment.required_wizard_steps
4
+ = f.checks :fee_payment_wizard_steps, f.object.fee_payment_wizard_steps_collection(), label: false
@@ -6,17 +6,15 @@
6
6
  = render 'admin/categories/form_fees', category: category
7
7
 
8
8
  - if category.persisted?
9
+ = tab 'Wizards' do
10
+ = render 'admin/categories/form_wizards', category: category
11
+
9
12
  = tab 'Content - Applicants' do
10
13
  = render 'admin/categories/form_applicant_content', category: category
11
14
 
12
15
  = tab 'Content - Renewals' do
13
16
  = render 'admin/categories/form_fee_payment_content', category: category
14
17
 
15
- = tab 'Wizards' do
16
- .row
17
- .col= render 'admin/categories/form_applicant_steps', category: category
18
- .col= render 'admin/categories/form_fee_payment_steps', category: category
19
-
20
18
  - if category.respond_to?(:log_changes_datatable)
21
19
  = tab 'Logs' do
22
20
  = render_inline_datatable(category.log_changes_datatable)
@@ -0,0 +1,16 @@
1
+ = effective_form_with(model: [:admin, category], engine: true) do |f|
2
+ .row
3
+ .col
4
+ = card(et(EffectiveMemberships.Applicant) + ' Wizard Steps') do
5
+ = render 'admin/categories/fields_applicant_steps', f: f
6
+
7
+ = card(et(EffectiveMemberships.Applicant) + ' Requirements') do
8
+ = render 'admin/categories/fields_applicant_requirements', f: f
9
+ .col
10
+ = card(et(EffectiveMemberships.FeePayment) + ' Wizard Steps') do
11
+ = render 'admin/categories/fields_fee_payment_steps', f: f
12
+
13
+ = card(et(EffectiveMemberships.FeePayment) + ' Requirements') do
14
+ = render 'admin/categories/fields_fee_payment_requirements', f: f
15
+
16
+ = f.submit
@@ -1,2 +1,2 @@
1
1
  = card do
2
- %p Thank you. The confidential endorsement has been completed.
2
+ %p.text-center Thank you. The confidential endorsement has been completed.
@@ -23,8 +23,9 @@
23
23
  label: "Do you have any reservations about the applicant?", inline: true, required: true
24
24
 
25
25
  = f.show_if :reservations, true do
26
- = f.text_area :reservations_reason,
27
- label: 'Please provide a brief but candid explanation of your reservations'
26
+ .mt-2
27
+ = f.text_area :reservations_reason,
28
+ label: 'Please provide a brief but candid explanation of your reservations'
28
29
 
29
30
  .mt-4
30
31
 
@@ -1,2 +1,2 @@
1
1
  = card do
2
- %p Thank you. The confidential reference has been completed.
2
+ %p.text-center Thank you. The confidential reference has been completed.
@@ -0,0 +1,3 @@
1
+ = wizard_card(applicant) do
2
+ = render('effective/wizard_steps/cpd_statements', resource: applicant)
3
+ = render('effective/wizard_steps/cpd_requirements', resource: applicant)
@@ -0,0 +1,2 @@
1
+ - # Intentionally blank
2
+ %p TODO
@@ -0,0 +1,5 @@
1
+ = f.check_box :declare_code_of_ethics,
2
+ label: 'Yes, I hereby certify that I have read and will adhere to the Code of Ethics'
3
+
4
+ = f.check_box :declare_truth,
5
+ label: 'Yes, I hereby certify that the statements and information contained herein are correct'
@@ -0,0 +1 @@
1
+ %p Please provide the names individuals who can speak to your character and reputation.
@@ -0,0 +1,20 @@
1
+ = render 'layout' do
2
+ = render 'effective/applicants/content', resource: resource
3
+
4
+ = card(et('effective_cpd.name')) do
5
+ = render('cpd_requirements', applicant: resource)
6
+
7
+ = card('All ' + cpd_statements_label) do
8
+ = render('effective/wizard_steps/cpd_statements', resource: resource)
9
+
10
+ = card('Requirements') do
11
+ = render('effective/wizard_steps/cpd_requirements', resource: resource)
12
+
13
+ = card do
14
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
15
+ = f.hidden_field :id
16
+
17
+ - f.object.declare_cpd = true if f.object.has_completed_step?(:cpd)
18
+ = render('effective/wizard_steps/cpd_fields', f: f)
19
+
20
+ = f.save 'Save and Continue'
@@ -9,12 +9,6 @@
9
9
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
10
10
  = f.hidden_field :id
11
11
 
12
- = f.check_box :declare_code_of_ethics,
13
- label: 'Yes, I hereby certify that I have read and will adhere to the Code of Ethics'
14
-
15
- = f.check_box :declare_truth,
16
- label: 'Yes, I hereby certify that the statements and information contained herein are correct'
17
-
18
- = render_if_exists("effective/applicants/declarations_fields", f: f)
12
+ = render("effective/applicants/declarations_fields", f: f)
19
13
 
20
14
  = f.save 'Save and Continue'
@@ -4,11 +4,13 @@
4
4
  = card do
5
5
  - if resource.min_applicant_files > 0
6
6
  %p You must include #{resource.min_applicant_files} or more files.
7
+ - else
8
+ %p Please add zero or more files.
7
9
 
8
10
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
9
11
  = f.hidden_field :id
10
12
 
11
- = f.file_field :applicant_files, attachment_style: :table
13
+ = f.file_field :applicant_files, attachment_style: :table, label: 'Files'
12
14
 
13
15
  = render_if_exists("effective/applicants/files_fields", f: f)
14
16
 
@@ -2,8 +2,12 @@
2
2
  = render 'effective/applicants/content', resource: resource
3
3
 
4
4
  = card do
5
+ .mb-2= render('references_requirements', applicant: resource)
6
+
5
7
  - if resource.min_applicant_references > 0
6
8
  %p You must include #{resource.min_applicant_references} or more references.
9
+ - else
10
+ %p Please include zero or more references.
7
11
 
8
12
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
9
13
  = f.hidden_field :id
@@ -7,6 +7,8 @@
7
7
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
8
8
  = f.hidden_field :id
9
9
 
10
+ - f.object.declare_will_send_transcripts = true if f.object.has_completed_step?(:transcripts)
11
+
10
12
  = f.check_box :declare_will_send_transcripts,
11
13
  label: "Yes, I will request my transcripts be sent directly from the insitiution to the registrar.", required: true
12
14
 
@@ -0,0 +1,3 @@
1
+ - # This is a shared partial for the CPD Step on Applicants and FeePayments
2
+
3
+ = f.check_box :declare_cpd, label: "Yes, my #{et('effective_cpd.name')} (#{et('effective_cpd.acronym')}) requirements are complete"
@@ -0,0 +1,15 @@
1
+ - # This is a shared partial for the CPD Step on Applicants and FeePayments
2
+
3
+ - if resource.cpd_required_cpd_cycles.blank?
4
+ %p You are not required to submit a #{cpd_statement_label} at this time.
5
+
6
+ - elsif resource.cpd_uncompleted_cpd_cycles.blank?
7
+ %p Thank you! All required #{cpd_statements_label} have been completed.
8
+
9
+ - elsif resource.cpd_uncompleted_cpd_cycles.present?
10
+ %p You must submit a #{cpd_statement_label} for the following #{cpd_cycles_label} before you may continue:
11
+
12
+ - resource.cpd_uncompleted_cpd_cycles.each do |cpd_cycle|
13
+ %p= link_to("#{cpd_cycle}", effective_cpd.cpd_cycle_cpd_statement_build_path(cpd_cycle, :new, :start), target: '_blank')
14
+
15
+ %p Please complete any required #{cpd_statements_label} then return here.
@@ -0,0 +1,15 @@
1
+ - # This is a shared partial for the CPD Step on Applicants and FeePayments
2
+
3
+ - available = EffectiveCpdAvailableCyclesDatatable.new(self, user: resource.user) unless resource.try(:was_submitted?)
4
+ - completed = EffectiveCpdCompletedStatementsDatatable.new(self, user: resource.user)
5
+
6
+ - if available.present?
7
+ %p The following #{cpd_cycles_label} are available:
8
+ = render_datatable(available, simple: true)
9
+
10
+ - if available.present? && completed.present?
11
+ .my-2
12
+
13
+ - if completed.present?
14
+ %p The following #{cpd_statements_label} have been completed:
15
+ = render_datatable(completed, simple: true)
@@ -16,12 +16,11 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
16
16
  t.boolean :can_apply_restricted, default: false
17
17
  t.text :can_apply_restricted_ids
18
18
 
19
- t.text :applicant_wizard_steps
20
19
  t.integer :applicant_fee
21
20
  t.integer :applicant_reinstatement_fee
21
+ t.text :applicant_wizard_steps
22
22
 
23
- t.text :applicant_review_wizard_steps
24
-
23
+ t.string :applicant_cpd_step_requirement
25
24
  t.integer :min_applicant_educations
26
25
  t.integer :min_applicant_experiences_months
27
26
  t.integer :min_applicant_references
@@ -31,8 +30,7 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
31
30
  t.integer :min_applicant_files
32
31
 
33
32
  t.integer :min_applicant_reviews
34
-
35
- t.text :fee_payment_wizard_steps
33
+ t.text :applicant_review_wizard_steps
36
34
 
37
35
  t.integer :prorated_jan
38
36
  t.integer :prorated_feb
@@ -48,6 +46,9 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
48
46
  t.integer :prorated_dec
49
47
 
50
48
  # Renewals
49
+ t.text :fee_payment_wizard_steps
50
+ t.string :fee_payment_cpd_step_requirement
51
+
51
52
  t.boolean :create_renewal_fees, default: false
52
53
  t.integer :renewal_fee
53
54
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.13.5'
2
+ VERSION = '0.13.6'
3
3
  end
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.13.5
4
+ version: 0.13.6
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-04-11 00:00:00.000000000 Z
11
+ date: 2023-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -369,13 +369,17 @@ files:
369
369
  - app/views/admin/categories/_fees_late.html.haml
370
370
  - app/views/admin/categories/_fees_nigs.html.haml
371
371
  - app/views/admin/categories/_fees_renewal.html.haml
372
+ - app/views/admin/categories/_fields_applicant_requirements.html.haml
373
+ - app/views/admin/categories/_fields_applicant_steps.html.haml
374
+ - app/views/admin/categories/_fields_fee_payment_requirements.html.haml
375
+ - app/views/admin/categories/_fields_fee_payment_steps.html.haml
372
376
  - app/views/admin/categories/_form.html.haml
373
377
  - app/views/admin/categories/_form_applicant_content.html.haml
374
378
  - app/views/admin/categories/_form_applicant_steps.html.haml
375
379
  - app/views/admin/categories/_form_category.html.haml
376
380
  - app/views/admin/categories/_form_fee_payment_content.html.haml
377
- - app/views/admin/categories/_form_fee_payment_steps.html.haml
378
381
  - app/views/admin/categories/_form_fees.html.haml
382
+ - app/views/admin/categories/_form_wizards.html.haml
379
383
  - app/views/admin/documents/_form.html.haml
380
384
  - app/views/admin/fee_payments/_fee_payment.html.haml
381
385
  - app/views/admin/fees/_fee.html.haml
@@ -431,8 +435,11 @@ files:
431
435
  - app/views/effective/applicants/_applicant.html.haml
432
436
  - app/views/effective/applicants/_content.html.haml
433
437
  - app/views/effective/applicants/_course_amounts.html.haml
438
+ - app/views/effective/applicants/_cpd.html.haml
439
+ - app/views/effective/applicants/_cpd_requirements.html.haml
434
440
  - app/views/effective/applicants/_dashboard.html.haml
435
441
  - app/views/effective/applicants/_declarations.html.haml
442
+ - app/views/effective/applicants/_declarations_fields.html.haml
436
443
  - app/views/effective/applicants/_demographics.html.haml
437
444
  - app/views/effective/applicants/_education.html.haml
438
445
  - app/views/effective/applicants/_endorsements.html.haml
@@ -445,6 +452,7 @@ files:
445
452
  - app/views/effective/applicants/_organization.html.haml
446
453
  - app/views/effective/applicants/_owner.html.haml
447
454
  - app/views/effective/applicants/_references.html.haml
455
+ - app/views/effective/applicants/_references_requirements.html.haml
448
456
  - app/views/effective/applicants/_reinstatement.html.haml
449
457
  - app/views/effective/applicants/_select.html.haml
450
458
  - app/views/effective/applicants/_select_organization.html.haml
@@ -455,6 +463,7 @@ files:
455
463
  - app/views/effective/applicants/billing.html.haml
456
464
  - app/views/effective/applicants/checkout.html.haml
457
465
  - app/views/effective/applicants/course_amounts.html.haml
466
+ - app/views/effective/applicants/cpd.html.haml
458
467
  - app/views/effective/applicants/declarations.html.haml
459
468
  - app/views/effective/applicants/demographics.html.haml
460
469
  - app/views/effective/applicants/education.html.haml
@@ -517,6 +526,9 @@ files:
517
526
  - app/views/effective/organizations/_form_organization.html.haml
518
527
  - app/views/effective/representatives/_form.html.haml
519
528
  - app/views/effective/representatives/_user_fields.html.haml
529
+ - app/views/effective/wizard_steps/_cpd_fields.html.haml
530
+ - app/views/effective/wizard_steps/_cpd_requirements.html.haml
531
+ - app/views/effective/wizard_steps/_cpd_statements.html.haml
520
532
  - app/views/organizations/_demographics.html.haml
521
533
  - app/views/organizations/_fields_demographics.html.haml
522
534
  - app/views/users/_demographics.html.haml
@@ -1,6 +0,0 @@
1
- = effective_form_with(model: [:admin, category], engine: true) do |f|
2
- %h3 Renewal Wizard Steps
3
- - f.object.fee_payment_wizard_steps += EffectiveMemberships.FeePayment.required_wizard_steps
4
- = f.checks :fee_payment_wizard_steps, f.object.fee_payment_wizard_steps_collection(), label: false
5
-
6
- = f.submit