Fix month offset (missing first month in history)

This commit is contained in:
Edgar P. Burkhart 2023-12-29 09:53:59 +01:00
parent 4bb682fc88
commit c3ba376793
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ def history(transaction_set):
"d": [
_history.filter(month=datetime.date(y, m + 1, 1)).first()
for m in range(
_first_month.month if _first_month.year == y else 0,
_first_month.month - 1 if _first_month.year == y else 0,
_last_month.month if _last_month.year == y else 12,
)
],
@ -45,7 +45,7 @@ def history(transaction_set):
return {
"years": _data,
"offset": [range(_first_month.month), range(12 - _last_month.month)],
"offset": [range(_first_month.month - 1), range(12 - _last_month.month)],
"max": max(
_history.aggregate(
max=Max("sum_p", default=0),