diff --git a/parkstay/reports.py b/parkstay/reports.py index 8c0043d9a4..a719f17a97 100644 --- a/parkstay/reports.py +++ b/parkstay/reports.py @@ -184,10 +184,12 @@ def bookings_report(_date): writer = csv.writer(strIO) writer.writerow(fieldnames) + types = dict(Booking.BOOKING_TYPE_CHOICES) + for b in bookings: b_name = u'{} {}'.format(b.details.get('first_name',''),b.details.get('last_name','')) created = timezone.localtime(b.created, pytz.timezone('Australia/Perth')) - writer.writerow([created.strftime('%d/%m/%Y %H:%M:%S'),b.confirmation_number,b_name.encode('utf-8'),b.active_invoice.amount if b.active_invoice else '',b.active_invoice.reference if b.active_invoice else '',b.booking_type]) + writer.writerow([created.strftime('%d/%m/%Y %H:%M:%S'),b.confirmation_number,b_name.encode('utf-8'),b.active_invoice.amount if b.active_invoice else '',b.active_invoice.reference if b.active_invoice else '', types[b.booking_type] if b.booking_type in types else b.booking_type]) #for b in history_bookings: # b_name = '{} {}'.format(b.details.get('first_name',''),b.details.get('last_name',''))