Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refund Reporting and Boating Icon fixes #396

Merged
merged 2 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions mooring/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1733,19 +1733,21 @@ def list(self, request, *args, **kwargs):
recordsTotal = cursor.fetchone()[0]
cursor.execute(sqlCount, sqlParams)
recordsFiltered = cursor.fetchone()[0]

cursor.execute(sql, sqlParams)
columns = [col[0] for col in cursor.description]
data = [
dict(zip(columns, row))
for row in cursor.fetchall()
]


bookings_qs = Booking.objects.filter(id__in=[b['id'] for b in data]).prefetch_related('mooringarea', 'campsites', 'campsites__campsite', 'customer', 'regos', 'history', 'invoices', 'canceled_by')
booking_map = {b.id: b for b in bookings_qs}
clean_data = []
for bk in data:
cg = None
booking = booking_map[bk['id']]
booking = booking_map[bk['id']]
cg = booking.mooringarea
bk['editable'] = booking.editable
bk['status'] = booking.status
Expand Down Expand Up @@ -1904,7 +1906,7 @@ def create(self, request, format=None):
print(traceback.print_exc())
raise
except ValidationError as e:
print e
print (e)
raise serializers.ValidationError(repr(e.error_dict))
except Exception as e:
utils.delete_session_booking(request.session)
Expand Down
4 changes: 2 additions & 2 deletions mooring/frontend/exploreparks/src/parkfinder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,9 @@
[v-cloak] {
display: none;
}

@font-face {
font-family: "DPaWSymbols";
src: url("assets/boating.woff") format("woff");
src: url('/static/exploreparks/fonts/boating.woff') format("woff");
}

.symb {
Expand Down Expand Up @@ -524,6 +523,7 @@ export default {
sitesInPersonIcon: require('./assets/pin_offline.svg'),
sitesAltIcon: require('./assets/pin_alt.svg'),
locationIcon: require('./assets/location.svg'),
boatingFont: require('./assets/fonts/boating.woff'),
paginate: ['filterResults'],
selectedFeature: null,
current_map_scale: 1950001,
Expand Down
2 changes: 1 addition & 1 deletion mooring/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ def __check_refund_status(self):
invoices = Invoice.objects.filter(reference__in=references)
for i in invoices:
if i.voided:
amount += i.payment_amount
amount += i.total_payment_amount
refund_amount += i.refund_amount

if amount == 0:
Expand Down
2 changes: 1 addition & 1 deletion mooring/static/exploreparks/js/map.js

Large diffs are not rendered by default.