Update IWT fee calculation

This commit is contained in:
Yingtong Li 2020-01-26 03:20:26 +11:00
parent 6df1fe78a4
commit 005d1980ae
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 3 additions and 3 deletions

View File

@ -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):

View File

@ -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'];
}
}