diff --git a/app/models/form/sales/pages/discount.rb b/app/models/form/sales/pages/discount.rb index 56670075b..2d632985e 100644 --- a/app/models/form/sales/pages/discount.rb +++ b/app/models/form/sales/pages/discount.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::Discount < ::Form::Page def initialize(id, hsh, subsection) super @id = "discount" - @header = "About the price of the property" + @copy_key = "sales.sale_information.discount" @depends_on = [{ "right_to_buy?" => true, }] diff --git a/app/models/form/sales/pages/grant.rb b/app/models/form/sales/pages/grant.rb index 7c7d2a625..2f96701c5 100644 --- a/app/models/form/sales/pages/grant.rb +++ b/app/models/form/sales/pages/grant.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::Grant < ::Form::Page def initialize(id, hsh, subsection) super @id = "grant" - @header = "About the price of the property" + @copy_key = "sales.sale_information.grant" @depends_on = [{ "right_to_buy?" => false, "rent_to_buy_full_ownership?" => false, diff --git a/app/models/form/sales/pages/purchase_price.rb b/app/models/form/sales/pages/purchase_price.rb index 2203375ef..0bb1da53e 100644 --- a/app/models/form/sales/pages/purchase_price.rb +++ b/app/models/form/sales/pages/purchase_price.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::PurchasePrice < ::Form::Page def initialize(id, hsh, subsection) super @id = "purchase_price" - @header = "About the price of the property" + @copy_key = "sales.sale_information.purchase_price.discounted_ownership" @depends_on = [{ "right_to_buy?" => true }, { "right_to_buy?" => false, diff --git a/app/models/form/sales/pages/purchase_price_outright_ownership.rb b/app/models/form/sales/pages/purchase_price_outright_ownership.rb index 897a19c2e..ea42a7001 100644 --- a/app/models/form/sales/pages/purchase_price_outright_ownership.rb +++ b/app/models/form/sales/pages/purchase_price_outright_ownership.rb @@ -4,11 +4,21 @@ class Form::Sales::Pages::PurchasePriceOutrightOwnership < ::Form::Page @depends_on = [ { "outright_sale_or_discounted_with_full_ownership?" => true }, ] - @header = "About the price of the property" @top_guidance_partial = "financial_calculations_outright_sale" @ownershipsch = ownershipsch end + def copy_key + case @ownershipsch + when 1 + "sales.sale_information.purchase_price.shared_ownership" + when 2 + "sales.sale_information.purchase_price.discounted_ownership" + when 3 + "sales.sale_information.purchase_price.outright_sale" + end + end + def questions @questions ||= [ Form::Sales::Questions::PurchasePrice.new(nil, nil, self, ownershipsch: @ownershipsch), diff --git a/app/models/form/sales/questions/discount.rb b/app/models/form/sales/questions/discount.rb index f99203ebe..1d8c5a46b 100644 --- a/app/models/form/sales/questions/discount.rb +++ b/app/models/form/sales/questions/discount.rb @@ -2,17 +2,13 @@ class Form::Sales::Questions::Discount < ::Form::Question def initialize(id, hsh, page) super @id = "discount" - @check_answer_label = "Percentage discount" - @header = "What was the percentage discount?" @type = "numeric" + @copy_key = "sales.sale_information.discount" @min = 0 @max = form.start_year_after_2024? ? 70 : 100 @step = 0.1 @width = 5 @suffix = "%" - @hint_text = "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)

- If discount capped, enter capped %

- If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given." @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @top_guidance_partial = "financial_calculations_discounted_ownership" end diff --git a/app/models/form/sales/questions/grant.rb b/app/models/form/sales/questions/grant.rb index 45b70d61f..17361fe9c 100644 --- a/app/models/form/sales/questions/grant.rb +++ b/app/models/form/sales/questions/grant.rb @@ -2,15 +2,13 @@ class Form::Sales::Questions::Grant < ::Form::Question def initialize(id, hsh, page) super @id = "grant" - @check_answer_label = "Amount of any loan, grant or subsidy" - @header = "What was the amount of any loan, grant, discount or subsidy given?" + @copy_key = "sales.sale_information.grant" @type = "numeric" @min = 0 @max = 999_999 @step = 1 @width = 5 @prefix = "£" - @hint_text = "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @top_guidance_partial = "financial_calculations_discounted_ownership" end diff --git a/app/models/form/sales/questions/purchase_price.rb b/app/models/form/sales/questions/purchase_price.rb index 3a9bd4ee7..06c9bc8c8 100644 --- a/app/models/form/sales/questions/purchase_price.rb +++ b/app/models/form/sales/questions/purchase_price.rb @@ -2,14 +2,11 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question def initialize(id, hsh, page, ownershipsch:) super(id, hsh, page) @id = "value" - @check_answer_label = "Purchase price" - @header = "What is the full purchase price?" @type = "numeric" @min = 0 @step = 0.01 @width = 5 @prefix = "£" - @hint_text = hint_text @ownership_sch = ownershipsch @question_number = QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.fetch(form.start_date.year, QUESTION_NUMBER_FROM_YEAR_AND_OWNERSHIP.max_by { |k, _v| k }.last)[ownershipsch] @top_guidance_partial = top_guidance_partial @@ -20,10 +17,15 @@ class Form::Sales::Questions::PurchasePrice < ::Form::Question 2024 => { 2 => 101, 3 => 111 }, }.freeze - def hint_text - return if @ownership_sch == 3 # outright sale - - "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount" + def copy_key + case @ownership_sch + when 1 + "sales.sale_information.purchase_price.shared_ownership" + when 2 + "sales.sale_information.purchase_price.discounted_ownership" + when 3 + "sales.sale_information.purchase_price.outright_sale" + end end def top_guidance_partial diff --git a/config/locales/forms/2023/sales/sale_information.yml b/config/locales/forms/2023/sales/sale_information.yml index 20caf8f46..5851c924a 100644 --- a/config/locales/forms/2023/sales/sale_information.yml +++ b/config/locales/forms/2023/sales/sale_information.yml @@ -175,4 +175,34 @@ en: mscharge: check_answer_label: "Monthly leasehold charges" hint_text: "" - question_text: "Enter the total monthly charge" \ No newline at end of file + question_text: "Enter the total monthly charge" + + purchase_price: + shared_ownership: + page_header: "About the price of the property" + check_answer_label: "Purchase price" + hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount" + question_text: "What is the full purchase price?" + discounted_ownership: + page_header: "About the price of the property" + check_answer_label: "Purchase price" + hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount" + question_text: "What is the full purchase price?" + outright_sale: + page_header: "About the price of the property" + check_answer_label: "Purchase price" + hint_text: "" + question_text: "What is the full purchase price?" + + discount: + page_header: "About the price of the property" + check_answer_label: "Percentage discount" + hint_text: "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)

If discount capped, enter capped %

If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given." + question_text: "What was the percentage discount?" + + grant: + page_header: "About the price of the property" + check_answer_label: "Amount of any loan, grant or subsidy" + hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy" + question_text: "What was the amount of any loan, grant, discount or subsidy given?" + \ No newline at end of file diff --git a/config/locales/forms/2024/sales/sale_information.yml b/config/locales/forms/2024/sales/sale_information.yml index a69aaa678..5f54fa7fa 100644 --- a/config/locales/forms/2024/sales/sale_information.yml +++ b/config/locales/forms/2024/sales/sale_information.yml @@ -175,4 +175,34 @@ en: mscharge: check_answer_label: "Monthly leasehold charges" hint_text: "" - question_text: "Enter the total monthly charge" \ No newline at end of file + question_text: "Enter the total monthly charge" + + purchase_price: + shared_ownership: + page_header: "About the price of the property" + check_answer_label: "Purchase price" + hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount" + question_text: "What is the full purchase price?" + discounted_ownership: + page_header: "About the price of the property" + check_answer_label: "Purchase price" + hint_text: "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount" + question_text: "What is the full purchase price?" + outright_sale: + page_header: "About the price of the property" + check_answer_label: "Purchase price" + hint_text: "" + question_text: "What is the full purchase price?" + + discount: + page_header: "About the price of the property" + check_answer_label: "Percentage discount" + hint_text: "For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)

If discount capped, enter capped %

If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given." + question_text: "What was the percentage discount?" + + grant: + page_header: "About the price of the property" + check_answer_label: "Amount of any loan, grant or subsidy" + hint_text: "For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy" + question_text: "What was the amount of any loan, grant, discount or subsidy given?" + \ No newline at end of file