diff --git a/kfet/views.py b/kfet/views.py index 00e4f9fe..e81640ba 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -452,6 +452,9 @@ def kpsul_perform_operations(request): # Filling cof status for statistics operationgroup.is_cof = operationgroup.on_acc.is_cof + # Updating account's balance + operationgroup.on_acc.balance += operationgroup.amount + # Apply all saves in a transaction to ensure database integrity try: with transaction.atomic(): @@ -459,6 +462,9 @@ def kpsul_perform_operations(request): operationgroup.save() data['operationgroup'] = operationgroup.pk + # Saving account with new balance + operationgroup.on_acc.save() + # Filling operationgroup id for each operations and saving for operation in operations: operation.group = operationgroup