mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-07 13:25:21 +02:00
fix(insights:category-explorer): use currency name instead of code
This commit is contained in:
@@ -58,7 +58,7 @@ def get_category_sums_by_currency(queryset, category):
|
|||||||
"""
|
"""
|
||||||
sums = (
|
sums = (
|
||||||
queryset.filter(category=category)
|
queryset.filter(category=category)
|
||||||
.values("account__currency__code")
|
.values("account__currency__name")
|
||||||
.annotate(
|
.annotate(
|
||||||
income=Coalesce(
|
income=Coalesce(
|
||||||
Sum(
|
Sum(
|
||||||
@@ -83,11 +83,11 @@ def get_category_sums_by_currency(queryset, category):
|
|||||||
output_field=DecimalField(max_digits=42, decimal_places=30),
|
output_field=DecimalField(max_digits=42, decimal_places=30),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.order_by("account__currency__code")
|
.order_by("account__currency__name")
|
||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"labels": [item["account__currency__code"] for item in sums],
|
"labels": [item["account__currency__name"] for item in sums],
|
||||||
"datasets": [
|
"datasets": [
|
||||||
{
|
{
|
||||||
"label": _("Income"),
|
"label": _("Income"),
|
||||||
|
|||||||
Reference in New Issue
Block a user