def _check_total(self, check, total, computed_total): if total != computed_total: check.mark_fail(level=check.LEVEL_ERROR, message="The computed amount isn't correct, it " "should be {}, please edit and save the " "{} to fix it.".format(currency_formatter(total), self._meta.verbose_name)) else: check.mark_pass() return check
def _check_total(self, check, total, computed_total): if total.quantize(TWO_PLACES) != computed_total.quantize(TWO_PLACES): check.mark_fail(level=check.LEVEL_ERROR, message="The computed amount isn't correct, it " "should be {}, please edit and save the " "{} to fix it.".format( currency_formatter(total), self._meta.verbose_name)) else: check.mark_pass() return check
def __str__(self): if self.detail: return self.detail return "Payment of {}".format(currency_formatter(self.amount))