Add error when editing LIQ

This commit is contained in:
Ludovic Stephan 2017-03-25 10:39:53 -03:00
parent 14e0d8090f
commit f645121fb1
2 changed files with 8 additions and 1 deletions

View file

@ -86,6 +86,12 @@ function getErrorsHtml(data) {
content += '<li>Montant invalide</li>';
content += '</ul>';
}
if ('account' in data['errors']) {
content += 'Général';
content += '<ul>';
content += '<li>Opération invalide sur le compte '+data['errors']['account']+'</li>';
content += '</ul>';
}
return content;
}

View file

@ -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