Skip to content

Commit

Permalink
parkstay.reports: change booking type to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Percival committed Jan 8, 2018
1 parent 4d3e164 commit 4707184
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parkstay/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',''))
Expand Down

0 comments on commit 4707184

Please sign in to comment.