From f1f56d0326714c205daf1d8fd9240226513995bd Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Thu, 24 Oct 2024 00:46:50 -0300 Subject: [PATCH] feat: clean up yearly overview by removing 0 values --- app/apps/yearly_overview/views.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/apps/yearly_overview/views.py b/app/apps/yearly_overview/views.py index 8d3d7e2..8fade8d 100644 --- a/app/apps/yearly_overview/views.py +++ b/app/apps/yearly_overview/views.py @@ -139,15 +139,16 @@ def yearly_overview(request, year: int): "balance_paid", "balance_total", ]: - result[month][field].append( - { - "code": currency_code, - "prefix": prefix, - "suffix": suffix, - "decimal_places": decimal_places, - "amount": entry[field], - } - ) + if entry[field] != 0: + result[month][field].append( + { + "code": currency_code, + "prefix": prefix, + "suffix": suffix, + "decimal_places": decimal_places, + "amount": entry[field], + } + ) # Fill in missing months with empty lists for month in all_months: