Make it possible to convert prices automatically
Some checks failed
Django CI/CD / test (push) Failing after 1m19s
Django CI/CD / build-and-push (push) Has been skipped

This commit is contained in:
2024-11-10 15:34:08 +01:00
parent f61cde180f
commit 527cf4ba52
8 changed files with 449 additions and 202 deletions

View File

@ -300,9 +300,9 @@ def stats(request: HttpRequest, year: int = 0) -> HttpResponse:
).distinct()
this_year_purchases = Purchase.objects.filter(date_purchased__year=year)
this_year_purchases_with_currency = this_year_purchases.select_related(
"edition"
).filter(price_currency__exact=selected_currency)
this_year_purchases_with_currency = this_year_purchases.select_related("edition")
# fixme: add conversion table for currencies
# ).filter(price_currency__exact=selected_currency)
this_year_purchases_without_refunded = this_year_purchases_with_currency.filter(
date_refunded=None
)