mirror of
https://github.com/nikdoof/pacmanager.git
synced 2025-12-13 07:32:15 +00:00
Fix error if a corp has 0% tax rate.
This commit is contained in:
@@ -66,7 +66,10 @@ class MonthTotal(models.Model):
|
||||
if self.corporation.fixed_value is not None:
|
||||
return self.corporation.fixed_value
|
||||
threshold = Decimal(managerconf.get('pac.tax_threshold', '200000000'))
|
||||
calc = (self.tax / self.corporation.tax_rate) * int(managerconf.get('pac.tax_rate', '10'))
|
||||
if self.corporation.tax_rate == 0:
|
||||
calc = 0
|
||||
else:
|
||||
calc = (self.tax / self.corporation.tax_rate) * int(managerconf.get('pac.tax_rate', '10'))
|
||||
if calc > threshold: return round(calc, 2)
|
||||
return threshold
|
||||
|
||||
|
||||
Reference in New Issue
Block a user