Skip to content

Commit

Permalink
Try handling a negative total
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeiP committed Nov 9, 2024
1 parent 3cf2261 commit a419609
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions expenses/apps/expenseapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ def rf_reference_no(self):
def barcode(self):
import math
amount = self.amount()
if amount < 0:
return False
euros = int(math.floor(amount))
cents = int((amount - euros) * 100)
reference = self.rf_reference_no()
Expand Down

0 comments on commit a419609

Please sign in to comment.