From f645121fb1c7d6876d6ca0ca2e8d0360ce089525 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Sat, 25 Mar 2017 10:39:53 -0300 Subject: [PATCH] Add error when editing LIQ --- kfet/static/kfet/js/kfet.js | 6 ++++++ kfet/views.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kfet/static/kfet/js/kfet.js b/kfet/static/kfet/js/kfet.js index f0e7a316..8236b3e9 100644 --- a/kfet/static/kfet/js/kfet.js +++ b/kfet/static/kfet/js/kfet.js @@ -86,6 +86,12 @@ function getErrorsHtml(data) { content += '
  • Montant invalide
  • '; content += ''; } + if ('account' in data['errors']) { + content += 'Général'; + content += ''; + } return content; } diff --git a/kfet/views.py b/kfet/views.py index 23d3c703..e87dde9b 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -1017,7 +1017,8 @@ def kpsul_perform_operations(request): to_articles_stocks[operation.article] -= operation.article_nb else: if operationgroup.on_acc.is_cash: - data['errors']['account'] = 'Charge et retrait impossible sur LIQ' + data['errors']['account'] = 'LIQ' + return JsonResponse(data, status=400) if operation.type != Operation.EDIT: to_checkout_balance += operation.amount operationgroup.amount += operation.amount