From f76baf41c3d77ede447d4558ee912abd699caad4 Mon Sep 17 00:00:00 2001 From: Kevin Alberts Date: Fri, 11 Oct 2024 13:45:51 +0200 Subject: [PATCH] Show drinks with writeoffs in transaction list --- alexia/apps/billing/views.py | 5 +++-- locale/nl/LC_MESSAGES/django.mo | Bin 28573 -> 28615 bytes locale/nl/LC_MESSAGES/django.po | 15 +++++++++------ templates/billing/order_list.html | 4 +++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/alexia/apps/billing/views.py b/alexia/apps/billing/views.py index 70e02cd..7053bef 100644 --- a/alexia/apps/billing/views.py +++ b/alexia/apps/billing/views.py @@ -2,7 +2,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.core.exceptions import PermissionDenied from django.core import serializers -from django.db.models import Count, Sum +from django.db.models import Count, Sum, Q from django.db.models.functions import ExtractYear, TruncMonth from django.http import Http404, JsonResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render @@ -102,10 +102,11 @@ def get_queryset(self): return Event.objects.filter(organizer=self.request.organization) \ .annotate( order_count=Count('orders'), + writeoff_order_count=Count('writeoff_orders'), revenue=Sum('orders__amount'), visitors=Count('orders__authorization', distinct=True), ) \ - .filter(order_count__gt=0, ) \ + .filter(Q(order_count__gt=0) | Q(writeoff_order_count__gt=0)) \ .order_by('-starts_at') \ .select_related('pricegroup') diff --git a/locale/nl/LC_MESSAGES/django.mo b/locale/nl/LC_MESSAGES/django.mo index ed4cd6c71895d9976335e4a38903ff1941fb7a6b..1acb39d7917ada35c67c06eb4a6759f759785d69 100644 GIT binary patch delta 8394 zcmXZg3!INt{=o6am|@I}F~;4vj9g+2F)k~_kp2siiPM7=R>2isG zWG6ot@lW}rD5{6;v#do?|J*Xl+(2;v^)~nwHoyjrqKJQ^Tli0B9EFZwi#2dBreFzH z#=l`jJcAYRJeH55M0AltDh-!{KVl{76>f;zvv3ggI@ld2WA$=Tv=yDGxN#I^;30H@ z577BeU^;$^$@mQ#&?T&jS22(Eql_j|)P;th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v?Q2kFBx8*yJ~%(b$syTC9if1y7;R{d+9$e;$pdiHY&{sGMD~;zDNSup}@EuIS(`ZFXu{?fR=`5^!_yH>djCUc;)~JBEx}@Z3A6DZ*b(Ej zNlBv^a~YTuT#H5YcViA-#D>^#afL5R# zaya9t8x2q8pm4)j^mI-@S2zz{;UYBf@^JlmbPu-;O3SDR@ut_n6K2QuK^$MB^L^*Z+YgbOBvh z>a^r=W}yA*)7XDYU55b=M{c;#9L=~5X5h8KUcte^QD}lw(EIPkD)<1pfJf29oN;JTl;GfY$^grnL;0XFN;XL}~OPiVedqFew zzOLwshoW!Eq;P!!M(Nor-sxLw#hC00TP9_1X}Be~>*lnS!fRIiy>~ur?(^SGwk)04 HIsN|uSaPVz diff --git a/locale/nl/LC_MESSAGES/django.po b/locale/nl/LC_MESSAGES/django.po index 2ac973d..1c5946c 100644 --- a/locale/nl/LC_MESSAGES/django.po +++ b/locale/nl/LC_MESSAGES/django.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: alexia\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 13:14+0200\n" -"PO-Revision-Date: 2024-10-11 13:14+0018\n" +"POT-Creation-Date: 2024-10-11 13:42+0200\n" +"PO-Revision-Date: 2024-10-11 13:42+0018\n" "Last-Translator: b'Kevin Alberts '\n" "Language-Team: WWW-commissie \n" "Language: nl\n" @@ -776,7 +776,6 @@ msgid "availability" msgstr "beschikbaarheid" #: alexia/apps/scheduling/models.py:249 -#| msgid "comments" msgid "comment" msgstr "commentaar" @@ -1058,11 +1057,16 @@ msgstr "Statistieken" msgid "The amount of unique debtors this event" msgstr "Het aantal unieke debiteuren deze activiteit" -#: templates/billing/order_list.html:51 templates/billing/order_month.html:18 templates/billing/pricegroup_confirm_delete.html:3 templates/billing/pricegroup_detail.html:3 templates/billing/pricegroup_detail.html:8 templates/billing/productgroup_detail.html:29 templates/billing/productgroup_detail.html:71 templates/billing/sellingprice_list.html:14 +#: templates/billing/order_list.html:51 +#| msgid "Write off" +msgid "Write-offs" +msgstr "Afschrijvingen" + +#: templates/billing/order_list.html:52 templates/billing/order_month.html:18 templates/billing/pricegroup_confirm_delete.html:3 templates/billing/pricegroup_detail.html:3 templates/billing/pricegroup_detail.html:8 templates/billing/productgroup_detail.html:29 templates/billing/productgroup_detail.html:71 templates/billing/sellingprice_list.html:14 msgid "Price group" msgstr "Prijsgroep" -#: templates/billing/order_list.html:66 +#: templates/billing/order_list.html:68 #, python-format msgid "%(organization)s hasn't used Alexia Billing yet!" msgstr "%(organization)s heeft Alexia Financieel nog niet in gebruik!" @@ -2024,7 +2028,6 @@ msgid "Unknown" msgstr "Onbekend" #: templates/scheduling/event_detail.html:148 -#| msgid "bartender" msgid "Comment by bartender" msgstr "Commentaar van tapper" diff --git a/templates/billing/order_list.html b/templates/billing/order_list.html index 6e4e8ca..fc8826f 100644 --- a/templates/billing/order_list.html +++ b/templates/billing/order_list.html @@ -48,6 +48,7 @@

{% trans 'Visitors' %} {% trans 'Transactions' %} {% trans 'Revenue' %} + {% if request.organization.writeoff_enabled %}{% trans 'Write-offs' %}{% endif %} {% trans 'Price group' %} @@ -58,7 +59,8 @@

{{ event.name }} {{ event.visitors }} {{ event.order_count }} - € {{ event.revenue|floatformat:2 }} + € {{ event.revenue|floatformat:2|default:"—" }} + {% if request.organization.writeoff_enabled %}{{ event.writeoff_order_count }}{% endif %} {{ event.pricegroup }} {% empty %}