|
|
|
@ -2,7 +2,7 @@ module Validations::FinancialValidations
|
|
|
|
|
# Validations methods need to be called 'validate_<page_name>' to run on model save |
|
|
|
|
# or 'validate_' to run on submit as well |
|
|
|
|
def validate_outstanding_rent_amount(record) |
|
|
|
|
if record.hbrentshortfall == 1 && record.tshortfall.present? |
|
|
|
|
if !record.has_hbrentshortfall? && record.tshortfall.present? |
|
|
|
|
record.errors.add :tshortfall, I18n.t("validations.financial.tshortfall.outstanding_amount_not_required") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|