Skip to content

Commit

Permalink
ps: fix the refunds report
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrayndwiga committed Nov 1, 2017
1 parent 031d747 commit 3c48b2e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions parkstay/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ def booking_refunds(start,end):
name = ''
if track:
name = track.user.get_full_name() if track.user.get_full_name() else track.user.email
writer.writerow([booking.confirmation_number,booking.customer.get_full_name(),'Manual',v,line.oracle_code,e.created.strftime('%d/%m/%Y'),name])
if booking:
b_name = '{} {}'.format(booking.details.get('first_name',''),booking.details.get('last_name',''))
writer.writerow([booking.confirmation_number,b_name,'Manual',v,line.oracle_code,e.created.strftime('%d/%m/%Y'),name,invoice.reference])
else:
writer.writerow(['','','Manual',v,line.oracle_code,e.created.strftime('%d/%m/%Y'),name,invoice.reference])
for b in bpoint:
booking, invoice = None, None
try:
invoice = Invoice.objects.get(reference=b.crn1)
if invoice.system == '0019':
Expand All @@ -97,7 +102,11 @@ def booking_refunds(start,end):
name = ''
if track:
name = track.user.get_full_name() if track.user.get_full_name() else track.user.email
writer.writerow([booking.confirmation_number,booking.customer.get_full_name(),'Card',v,line.oracle_code,b.created.strftime('%d/%m/%Y'),name])
if booking:
b_name = '{} {}'.format(booking.details.get('first_name',''),booking.details.get('last_name',''))
writer.writerow([booking.confirmation_number,b_name,'Card',v,line.oracle_code,b.created.strftime('%d/%m/%Y'),name,invoice.reference])
else:
writer.writerow(['','','Card',v,line.oracle_code,b.created.strftime('%d/%m/%Y'),name,invoice.reference])
except Invoice.DoesNotExist:
pass

Expand Down

0 comments on commit 3c48b2e

Please sign in to comment.