Browse Source

earnings and frequency on same page

pull/273/head
MadeTech Dushan 3 years ago
parent
commit
3062bb2896
  1. 16
      app/models/case_log.rb
  2. 69
      config/forms/2021_2022.json

16
app/models/case_log.rb

@ -243,22 +243,6 @@ private
self.month = startdate.month
self.year = startdate.year
end
case net_income_known
when "Weekly"
self.incfreq = "Weekly"
self.incref = nil
when "Monthly"
self.incfreq = "Monthly"
self.incref = nil
when "Annually"
self.incfreq = "Yearly"
self.incref = nil
when "Tenant prefers not to say"
self.incref = 1
self.incfreq = nil
when "Don’t know"
self.incfreq = nil
end
self.hhmemb = other_hhmemb + 1 if other_hhmemb.present?
self.renttype = RENT_TYPE_MAPPING[rent_type]
self.lettype = "#{renttype} #{needstype} #{owning_organisation[:provider_type]}" if renttype.present? && needstype.present? && owning_organisation[:provider_type].present?

69
config/forms/2021_2022.json

@ -2311,76 +2311,33 @@
}
}
},
"weekly_net_income": {
"depends_on": [{ "net_income_known": "Weekly" }],
"net_income": {
"depends_on": [{ "net_income_known": "Yes" }],
"header": "",
"description": "",
"questions": {
"earnings": {
"check_answer_label": "Total household income",
"header": "How much income does the household have in total every week?",
"header": "How much income does the household have in total",
"guidance_partial": "what_counts_as_income",
"hint_text": "",
"type": "numeric",
"min": 0,
"step": "1",
"width": 5,
"prefix": "£",
"suffix": " every week"
}
},
"soft_validations": {
"override_net_income_validation": {
"check_answer_label": "Net income confirmed?",
"type": "validation_override",
"answer_options": {
"override_net_income_validation": "Yes"
}
}
}
},
"monthly_net_income": {
"depends_on": [{ "net_income_known": "Monthly" }],
"header": "",
"description": "",
"questions": {
"earnings": {
"check_answer_label": "Total household income",
"header": "How much income does the household have in total every month?",
"prefix": "£"
},
"incfreq": {
"check_answer_label": "How often does the household receive this amount?",
"header": "How often does the household receive this amount?",
"hint_text": "",
"type": "numeric",
"min": 0,
"step": "1",
"width": 5,
"prefix": "£",
"suffix": " every month"
}
},
"soft_validations": {
"override_net_income_validation": {
"check_answer_label": "Net income confirmed?",
"type": "validation_override",
"type": "radio",
"answer_options": {
"override_net_income_validation": "Yes"
"0": "Weekly",
"1": "Monthly",
"2": "Yearly"
}
}
}
},
"yearly_net_income": {
"depends_on": [{ "net_income_known": "Annually" }],
"header": "",
"description": "",
"questions": {
"earnings": {
"check_answer_label": "Total household income",
"header": "How much income does the household have in total every year?",
"hint_text": "",
"type": "numeric",
"min": 0,
"step": "1",
"width": 5,
"prefix": "£",
"suffix": " every year"
}
},
"soft_validations": {
"override_net_income_validation": {

Loading…
Cancel
Save