tickets: Show number of payed tickets instead of reservations.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 3 Nov 2010 13:04:10 +0000 (14:04 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 3 Nov 2010 13:04:10 +0000 (14:04 +0100)
The table header already said "payed tickets", but the number reflected
the number of payed reservations, which isn't quite as useful.

tickets/templates/tickets/bookings.html
tickets/views.py

index 0c0348d93e52ac87d786716bde40cc5375b21319..787067b4feddae3e3dfcab642d1084c1601b004b 100644 (file)
@@ -8,7 +8,7 @@
     </thead>
     <tbody>
 {% for show, info in shows %}
-<tr><td>{{ show }}</td><td>{{ info.bookings|length }}</td><td>{{ info.tickets }}</td><td>{{ info.payed|length }}</td></tr>
+<tr><td>{{ show }}</td><td>{{ info.bookings|length }}</td><td>{{ info.tickets }}</td><td>{{ info.payed }}</td></tr>
 {% endfor %}
     </tbody>
 </table>
index 5b7ab75e541abfad5009e2b170e57c0f7400e4bd..1764301de977e2ba7824748cb7a1ddc3cee9aa0f 100644 (file)
@@ -137,7 +137,7 @@ def bookings(request):
         shows.append((show_desc, {
             'bookings' : bookings,
             'tickets'  : sum([b.tickets for b in bookings]),
-            'payed'    : Booking.objects.filter(show=show, payment__isnull=False),
+            'payed'    : sum([b.tickets for b in bookings if b.payment is not None]),
         }))
 
     c = { 'shows' : shows }