diff --git a/drcr/journal/views.py b/drcr/journal/views.py index 5364997..7891697 100644 --- a/drcr/journal/views.py +++ b/drcr/journal/views.py @@ -174,6 +174,12 @@ def balance_assertions_edit(): if request.method == 'GET': return render_template('journal/balance_assertions_edit.html', assertion=assertion) + if request.form.get('action', None) == 'delete': + # Delete balance assertion + db.session.delete(assertion) + db.session.commit() + return redirect(request.form.get('referrer', '') or url_for('balance_assertions')) + quantity = round(float(request.form['amount']) * (10**AMOUNT_DPS)) if request.form['sign'] == 'cr': quantity = -quantity diff --git a/drcr/templates/journal/balance_assertions_edit.html b/drcr/templates/journal/balance_assertions_edit.html index f82535d..5b153de 100644 --- a/drcr/templates/journal/balance_assertions_edit.html +++ b/drcr/templates/journal/balance_assertions_edit.html @@ -54,7 +54,10 @@ -