You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
902 B
34 lines
902 B
class Form::Sales::Questions::HasServiceCharge < ::Form::Question |
|
def initialize(id, hsh, subsection, staircasing:) |
|
super(id, hsh, subsection) |
|
@id = "has_mscharge" |
|
@type = "radio" |
|
@answer_options = ANSWER_OPTIONS |
|
@conditional_for = { |
|
"mscharge" => [1], |
|
} |
|
@hidden_in_check_answers = { |
|
"depends_on" => [ |
|
{ |
|
"has_mscharge" => 1, |
|
}, |
|
], |
|
} |
|
@copy_key = "sales.sale_information.servicecharges.has_servicecharge" |
|
@staircasing = staircasing |
|
@question_number = question_number_from_year[form.start_date.year] || question_number_from_year[question_number_from_year.keys.max] |
|
end |
|
|
|
ANSWER_OPTIONS = { |
|
"1" => { "value" => "Yes" }, |
|
"0" => { "value" => "No" }, |
|
}.freeze |
|
|
|
def question_number_from_year |
|
if @staircasing |
|
{ 2026 => 0 }.freeze |
|
else |
|
{ 2025 => 88, 2026 => 0 }.freeze |
|
end |
|
end |
|
end
|
|
|