Commit dfd465c7 authored by Sli's avatar Sli

Fix bug where customer can't buy an item when they have the just amount

parent 0d918d80
Pipeline #829 canceled with stage
......@@ -276,7 +276,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView):
total_qty_mod_6 = self.get_total_quantity_for_pid(request, pid) % 6
bq = int((total_qty_mod_6 + q) / 6) # Integer division
q -= bq
if self.customer.amount < (total + q*float(price)): # Check for enough money
if self.customer.amount < (total + round(q*float(price),2)): # Check for enough money
request.session['not_enough'] = True
return False
if product.limit_age >= 18 and not self.customer.user.date_of_birth:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment