diff --git a/app/models/form/sales/pages/living_before_purchase.rb b/app/models/form/sales/pages/living_before_purchase.rb index bdd02e2b7..b8797537b 100644 --- a/app/models/form/sales/pages/living_before_purchase.rb +++ b/app/models/form/sales/pages/living_before_purchase.rb @@ -24,9 +24,9 @@ class Form::Sales::Pages::LivingBeforePurchase < ::Form::Page end def page_routed_to?(log) - if form.start_year_2025_or_later? - log.resale == 2 - elsif @joint_purchase + return false if form.start_year_2025_or_later? && log.resale != 2 + + if @joint_purchase log.joint_purchase? else log.not_joint_purchase? || log.jointpur.nil? diff --git a/app/views/form/guidance/_financial_calculations_shared_ownership.html.erb b/app/views/form/guidance/_financial_calculations_shared_ownership.html.erb index 0741e6afa..b05ba8b15 100644 --- a/app/views/form/guidance/_financial_calculations_shared_ownership.html.erb +++ b/app/views/form/guidance/_financial_calculations_shared_ownership.html.erb @@ -20,8 +20,8 @@ <% end %> must equal the purchase price <%= question_link("value", log, current_user) %> - <% stairbought_page = log.form.get_question("stairbought", log).page %> - <% if stairbought_page.routed_to?(log, current_user) %> + <% stairbought_page = log.form.get_question("stairbought", log)&.page %> + <% if stairbought_page&.routed_to?(log, current_user) %> multiplied by the percentage bought <%= question_link("stairbought", log, current_user) %> <% else %> multiplied by the percentage equity stake <%= question_link("equity", log, current_user) %>