3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-12-25 08:23:46 +00:00

Fix rechargement

This commit is contained in:
Yoann Pétri 2018-12-18 11:38:20 +01:00
parent 1e462fd81b
commit cd6dbc82e7
2 changed files with 7 additions and 5 deletions

View file

@ -231,6 +231,7 @@ def cancel_consumption(request, pk):
""" """
consumption = get_object_or_404(ConsumptionHistory, pk=pk) consumption = get_object_or_404(ConsumptionHistory, pk=pk)
user = consumption.customer user = consumption.customer
if consumption.paymentMethod.affect_balance:
user.profile.debit -= consumption.amount user.profile.debit -= consumption.amount
user.save() user.save()
consumptionT = Consumption.objects.get(customer=user, product=consumption.product) consumptionT = Consumption.objects.get(customer=user, product=consumption.product)
@ -252,6 +253,7 @@ def cancel_menu(request, pk):
""" """
menu_history = get_object_or_404(MenuHistory, pk=pk) menu_history = get_object_or_404(MenuHistory, pk=pk)
user = menu_history.customer user = menu_history.customer
if menu_history.paymentMethod.affect_balance:
user.profile.debit -= menu_history.amount user.profile.debit -= menu_history.amount
user.save() user.save()
for product in manu_history.menu.articles: for product in manu_history.menu.articles:

View file

@ -39,5 +39,5 @@
<li><a href="https://www.facebook.com/coopesmetz/" class="icon fa-facebook alt"><span class="label">Facebook</span></a></li> <li><a href="https://www.facebook.com/coopesmetz/" class="icon fa-facebook alt"><span class="label">Facebook</span></a></li>
</ul> </ul>
</section> </section>
<p class="copyright">coope.rez v3.0.1 (release stable) &copy; 2018 Yoann Pietri.</p> <p class="copyright">coope.rez v3.0.2 (release stable) &copy; 2018 Yoann Pietri.</p>