Browse Source

CLDC-4300: Stricten validation on initialpurchase

pull/3307/head
samyou-softwire 3 weeks ago
parent
commit
d80c149eef
  1. 2
      app/models/validations/sales/sale_information_validations.rb
  2. 4
      config/locales/validations/sales/sale_information.en.yml

2
app/models/validations/sales/sale_information_validations.rb

@ -42,7 +42,7 @@ module Validations::Sales::SaleInformationValidations
record.errors.add :initialpurchase, I18n.t("validations.sales.sale_information.initialpurchase.must_be_after_1980")
end
if record.saledate.present? && record.initialpurchase > record.saledate
if record.saledate.present? && record.initialpurchase >= record.saledate
record.errors.add :initialpurchase, I18n.t("validations.sales.sale_information.initialpurchase.must_be_before_saledate")
record.errors.add :saledate, :skip_bu_error, message: I18n.t("validations.sales.sale_information.saledate.must_be_after_initial_purchase_date")
end

4
config/locales/validations/sales/sale_information.en.yml

@ -25,11 +25,11 @@ en:
initialpurchase:
must_be_after_1980: "The initial purchase date must be after January 1, 1980."
must_be_before_last_transaction: "The initial purchase date must be before the last staircasing transaction date."
must_be_before_saledate: "The initial purchase date must be before the date of this sale."
must_be_before_saledate: "The initial staircasing transaction date must be before the sale date of this staircasing transaction."
lasttransaction:
must_be_after_1980: "The last staircasing transaction date must be after January 1, 1980."
must_be_after_initial_purchase: "The last staircasing transaction date must be after the initial purchase date."
must_be_before_saledate: "The last staircasing transaction date must be before the date of this sale."
must_be_before_saledate: "The initial staircasing transaction date must be before the sale date of this staircasing transaction."
fromprop:
previous_property_type_bedsit: "A bedsit cannot have more than 1 bedroom."
frombeds:

Loading…
Cancel
Save