From: Magnus Hagander Date: Wed, 24 Oct 2018 14:09:38 +0000 (+0100) Subject: Make it possible to refund VAT-less invoices X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=b616aa12151d5c1915ed6517e07d074d5f9c2c78;p=pgeu-website.git Make it possible to refund VAT-less invoices --- diff --git a/postgresqleu/invoices/forms.py b/postgresqleu/invoices/forms.py index 8917ec0..256d230 100644 --- a/postgresqleu/invoices/forms.py +++ b/postgresqleu/invoices/forms.py @@ -126,11 +126,11 @@ class RefundForm(forms.Form): raise ValidationError(errstr) def clean_vatamount(self): - errstr = "VAT Amount must be a decimal between 1 and {0}".format(self.invoice.total_vat) + errstr = "VAT Amount must be a decimal between 0 and {0}".format(self.invoice.total_vat) try: amount = Decimal(self.cleaned_data['vatamount']) - if amount < 1 or amount > self.invoice.total_vat: + if amount < 0 or amount > self.invoice.total_vat: raise ValidationError(errstr) if amount.as_tuple().exponent > 0 or amount.as_tuple().exponent < -2: raise ValidationError("Maximum two decimal digits supported")