mirror of
https://github.com/nanoy42/coope
synced 2024-12-25 08:23:46 +00:00
Merge branch 'hotfix-3.0.2' into dev
This commit is contained in:
commit
aa897d833c
2 changed files with 7 additions and 4 deletions
|
@ -231,8 +231,9 @@ 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
|
||||||
user.profile.debit -= consumption.amount
|
if consumption.paymentMethod.affect_balance:
|
||||||
user.save()
|
user.profile.debit -= consumption.amount
|
||||||
|
user.save()
|
||||||
consumptionT = Consumption.objects.get(customer=user, product=consumption.product)
|
consumptionT = Consumption.objects.get(customer=user, product=consumption.product)
|
||||||
consumptionT.quantity -= consumption.quantity
|
consumptionT.quantity -= consumption.quantity
|
||||||
consumptionT.save()
|
consumptionT.save()
|
||||||
|
@ -252,8 +253,9 @@ 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
|
||||||
user.profile.debit -= menu_history.amount
|
if menu_history.paymentMethod.affect_balance:
|
||||||
user.save()
|
user.profile.debit -= menu_history.amount
|
||||||
|
user.save()
|
||||||
for product in manu_history.menu.articles:
|
for product in manu_history.menu.articles:
|
||||||
consumptionT = Consumption.objects.get(customer=user, product=product)
|
consumptionT = Consumption.objects.get(customer=user, product=product)
|
||||||
consumptionT -= menu_history.quantity
|
consumptionT -= menu_history.quantity
|
||||||
|
|
|
@ -41,3 +41,4 @@
|
||||||
</section>
|
</section>
|
||||||
<p class="copyright">coope.rez v3.1.0 (version dev) © 2018 Yoann Pietri.</p>
|
<p class="copyright">coope.rez v3.1.0 (version dev) © 2018 Yoann Pietri.</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue