1
1

add monthly result after irregular expenses

This commit is contained in:
2020-03-01 20:33:32 +01:00
parent eda341a66a
commit 0f37a54469
3 changed files with 5 additions and 0 deletions

View File

@@ -225,5 +225,7 @@ class Statistics:
self.avg_weekly_irregular_expenses = self.avg_daily_irregular_expenses * days_per_week self.avg_weekly_irregular_expenses = self.avg_daily_irregular_expenses * days_per_week
self.avg_monthly_irregular_expenses = self.avg_daily_irregular_expenses * days_per_month self.avg_monthly_irregular_expenses = self.avg_daily_irregular_expenses * days_per_month
self.avg_monthly_result_complete = self.avg_monthly_result + self.avg_monthly_irregular_expenses
def get_daily_stats_in_range(self): def get_daily_stats_in_range(self):
return [s for s in self.daily_stats if self.display_start <= s.date <= self.display_end] return [s for s in self.daily_stats if self.display_start <= s.date <= self.display_end]

View File

@@ -79,6 +79,8 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>monthly result after irregular expenses: {{ avg_monthly_result_complete|euro }}</p>
</div> </div>
<div class="main-container"> <div class="main-container">

View File

@@ -21,5 +21,6 @@ def index(request):
"avg_daily_irregular_expenses": statistics.avg_daily_irregular_expenses, "avg_daily_irregular_expenses": statistics.avg_daily_irregular_expenses,
"avg_weekly_irregular_expenses": statistics.avg_weekly_irregular_expenses, "avg_weekly_irregular_expenses": statistics.avg_weekly_irregular_expenses,
"avg_monthly_irregular_expenses": statistics.avg_monthly_irregular_expenses, "avg_monthly_irregular_expenses": statistics.avg_monthly_irregular_expenses,
"avg_monthly_result_complete": statistics.avg_monthly_result_complete,
} }
return render(request, "financeplanner/index.html", context) return render(request, "financeplanner/index.html", context)