Fix month offset (missing first month in history)
This commit is contained in:
parent
4bb682fc88
commit
c3ba376793
1 changed files with 2 additions and 2 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue