diff --git a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm index e0f1eb0..c4aceeb 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm @@ -84,6 +84,7 @@ sub delete { my $id = $c->param('id'); if ( my $category = $c->result_set->find($id) ) { + $category->transaction_category->delete; $category->delete; $c->flash( success => 'Category Deleted' ); } else { diff --git a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm index 428fdf9..d1e5c0a 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm @@ -54,6 +54,7 @@ sub delete { my $id = $c->param('id'); if ( my $transaction = $c->result_set->find($id) ) { + $transaction->category->delete; $transaction->delete; $c->flash( success => 'Successfully deleted transaction' ); $c->redirect_to( '/admin/transactions' ); diff --git a/templates/admin/transactions/read.html.ep b/templates/admin/transactions/read.html.ep index 0b180ae..98b45e4 100644 --- a/templates/admin/transactions/read.html.ep +++ b/templates/admin/transactions/read.html.ep @@ -36,7 +36,7 @@
- +