3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-26 06:32:27 +00:00

Merge branch 'fix-3.3.3' into 'master'

Fix 3.3.3

See merge request coope/coopev3!13
This commit is contained in:
Nanoy 2019-01-26 17:04:28 +01:00
commit 9f03e66a0b
3 changed files with 15 additions and 11 deletions

View file

@ -1,3 +1,5 @@
## v3.3.3
* fix commande (moyen de paiment n'affectant pas le solde)
## v3.3.2 ## v3.3.2
* fix de la vérification du solde dans la commande * fix de la vérification du solde dans la commande
* fix de l'affichage de la liste des fûts * fix de l'affichage de la liste des fûts

View file

@ -205,6 +205,7 @@ def order(request):
consumption.save() consumption.save()
ch = ConsumptionHistory(customer=user, quantity=quantity, paymentMethod=paymentMethod, product=product, amount=Decimal(quantity*product.amount), coopeman=request.user) ch = ConsumptionHistory(customer=user, quantity=quantity, paymentMethod=paymentMethod, product=product, amount=Decimal(quantity*product.amount), coopeman=request.user)
ch.save() ch.save()
if(paymentMethod.affect_balance):
if(user.profile.balance >= Decimal(product.amount*quantity)): if(user.profile.balance >= Decimal(product.amount*quantity)):
user.profile.debit += Decimal(product.amount*quantity) user.profile.debit += Decimal(product.amount*quantity)
else: else:
@ -215,8 +216,9 @@ def order(request):
quantity = int(m["quantity"]) quantity = int(m["quantity"])
mh = MenuHistory(customer=user, quantity=quantity, paymentMethod=paymentMethod, menu=menu, amount=int(quantity*menu.amount), coopeman=request.user) mh = MenuHistory(customer=user, quantity=quantity, paymentMethod=paymentMethod, menu=menu, amount=int(quantity*menu.amount), coopeman=request.user)
mh.save() mh.save()
if(user.profile.balance >= Decimal(menu.amount*quantity)): if(paymentMethod.affect_balance):
user.profile.debit += Decimal(menu.amount*quantity) if(user.profile.balance >= Decimal(product.amount*quantity)):
user.profile.debit += Decimal(product.amount*quantity)
else: else:
error_message = "Solde insuffisant" error_message = "Solde insuffisant"
raise Exception(error_message) raise Exception(error_message)

View file

@ -39,6 +39,6 @@
<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.3.2 (release stable) &copy; 2018 Yoann Pietri.</p> <p class="copyright">coope.rez v3.3.3 (release stable) &copy; 2018 Yoann Pietri.</p>