Commits

Kevin Veroneau committed c4ed59d

Fixed bug when calculating monthly income in the monthly budget view.

Comments (0)

Files changed (1)

         if datetime.date(today.year, today.month, day).weekday() == 4:
             paydays += 1
     weekly_income = Decimal("0.00")
+    biweekly_income = Decimal("0.00")
     for income in Income.objects.filter(active=True):
-        weekly_income += income.amount
+        if income.per_month == 4:
+            weekly_income += income.amount
+        elif income.per_month == 2:
+            biweekly_income += income.amount
     total_income = weekly_income * paydays
+    total_income += biweekly_income * (paydays/2)
     banks = Decimal("0.00")
     for bank in Bank.objects.filter(active=True):
         banks += bank.balance