diff --git a/app/models/validations/sales/sale_information_validations.rb b/app/models/validations/sales/sale_information_validations.rb index 24fdff3ea..e448b6aca 100644 --- a/app/models/validations/sales/sale_information_validations.rb +++ b/app/models/validations/sales/sale_information_validations.rb @@ -2,8 +2,9 @@ module Validations::Sales::SaleInformationValidations def validate_practical_completion_date_before_saledate(record) return if record.saledate.blank? || record.hodate.blank? - unless record.saledate > record.hodate - record.errors.add :hodate, I18n.t("validations.sale_information.hodate.must_be_before_exdate") + if record.hodate > record.saledate + record.errors.add :hodate, I18n.t("validations.sale_information.hodate.must_be_before_saledate") + record.errors.add :saledate, I18n.t("validations.sale_information.saledate.must_be_after_hodate") end end diff --git a/config/locales/en.yml b/config/locales/en.yml index c084071ce..712af8b2b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -422,13 +422,14 @@ en: social_homebuy: "Social HomeBuy buyers should not have lived here before" rent_to_buy: "Rent to Buy buyers should not have lived here before" hodate: - must_be_before_exdate: "Practical completion or handover date must be before exchange date" + must_be_before_saledate: "Practical completion or handover date must be before exchange date" exdate: - must_be_before_saledate: "Contract exchange date must be less than 1 year before completion date" + must_be_before_saledate: "Contract exchange date must be before completion date" must_be_less_than_1_year_from_saledate: "Contract exchange date must be less than 1 year before completion date" saledate: - must_be_after_exdate: "Completion date must be less than 1 year after contract exchange date" + must_be_after_exdate: "Completion date must be after contract exchange date" must_be_less_than_1_year_from_exdate: "Completion date must be less than 1 year after contract exchange date" + must_be_after_hodate: "Completion date must be after practical completion or handover date" previous_property_beds: property_type_bedsit: "Bedsit bedroom maximum 1" discounted_ownership_value: "Mortgage, deposit, and grant total must equal £%{value_with_discount}"