summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYingtong Li <runassudo@yingtongli.me>2020-01-26 03:20:26 +1100
committerYingtong Li <runassudo@yingtongli.me>2020-01-26 03:20:26 +1100
commit005d1980ae26d935f2fcddf48ddd3d7533526664 (patch)
tree8dd8c920cfa97de662a5d295591f2e3952384c41
parent6df1fe78a4eb5c076e9af9c31e43b3e0a1a29dea (diff)
Update IWT fee calculation
-rw-r--r--sstreasury/models.py4
-rw-r--r--sstreasury/static/sstreasury/budget.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/sstreasury/models.py b/sstreasury/models.py
index 3292699..e29245c 100644
--- a/sstreasury/models.py
+++ b/sstreasury/models.py
@@ -100,8 +100,8 @@ class BudgetRevision(models.Model):
total = Decimal(0)
for item in self.revenue:
total += Decimal(item['Unit price']) * item['Units']
- if item['IWT']:
- total -= (Decimal(item['Unit price']) - (Decimal(item['Unit price']) - Decimal('0.8')) / Decimal('1.019')) * item['Units']
+ if item['IWT'] and item['Unit price'] > 0:
+ total -= (Decimal(item['Unit price']) - (Decimal(item['Unit price']) - Decimal('0.8133')) / Decimal('1.01884')) * item['Units']
return total
def get_expense_total(self):
diff --git a/sstreasury/static/sstreasury/budget.js b/sstreasury/static/sstreasury/budget.js
index a63324d..01924a0 100644
--- a/sstreasury/static/sstreasury/budget.js
+++ b/sstreasury/static/sstreasury/budget.js
@@ -24,7 +24,7 @@ function recalcRevTotal(args) {
for (var row of args.grid.data) {
total += row['Unit price'] * row['Units'];
if (row['Unit price'] > 0 && row['IWT']) {
- totalIWT += (row['Unit price'] - (row['Unit price'] - 0.8) / 1.019) * row['Units'];
+ totalIWT += (row['Unit price'] - (row['Unit price'] - 0.8133) / 1.01884) * row['Units'];
}
}
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.