Skip to content

Commit 773e4dd

Browse files
committed
Introduce round with precision 6 as what the bss is expecting in order for the validations to work see HEA-984
1 parent 7f06d8c commit 773e4dd

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

apps/baseline/models.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,17 +2038,16 @@ def validate_income(self):
20382038
and self.times_per_month is not None
20392039
and self.months_per_year is not None
20402040
):
2041-
if (
2042-
self.income
2043-
!= self.payment_per_time * self.people_per_household * self.times_per_month * self.months_per_year
2041+
if round(self.income, 6) != round(
2042+
self.payment_per_time * self.people_per_household * self.times_per_month * self.months_per_year, 6
20442043
):
20452044
raise ValidationError(
20462045
_(
20472046
"Quantity produced for Other Cash Income must be payment per time * number of people * labor per month * months per year" # NOQA: E501
20482047
)
20492048
)
20502049
elif self.income is not None and self.payment_per_time is not None and self.times_per_year is not None:
2051-
if self.income != self.payment_per_time * self.times_per_year:
2050+
if round(self.income, 6) != round(self.payment_per_time * self.times_per_year, 6):
20522051
raise ValidationError(_("Income for 'Other Cash Income' must be payment per time * times per year"))
20532052

20542053
def calculate_fields(self):

0 commit comments

Comments
 (0)