From 99887926db4e521f58bec611b86fc2661387a4b7 Mon Sep 17 00:00:00 2001 From: Finn Date: Thu, 18 Jan 2018 12:06:07 +0000 Subject: [PATCH 1/2] Added version to changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87e0954..e2dbd3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ # Next Release +# v0.10.3 + * Added Category and Transaction Category tables to DB * Added API for categories in Transactions * **Admin Feature** Added ability to add and delete categories From 759d9615b92aa66d4fa3763861662bdc2fecdd4f Mon Sep 17 00:00:00 2001 From: Finn Date: Thu, 18 Jan 2018 14:24:47 +0000 Subject: [PATCH 2/2] fixed to admin interface categories & stats --- lib/Pear/LocalLoop/Controller/Admin/Categories.pm | 2 +- lib/Pear/LocalLoop/Controller/Api/Stats.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm index c4aceeb..b37900d 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Categories.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Categories.pm @@ -19,7 +19,7 @@ sub create { my $c = shift; my $validation = $c->validation; - $validation->required('category', 'trim')->like(qr/^[\w]*$/)->not_in_resultset('name', $c->result_set); + $validation->required('category', 'trim')->not_in_resultset('name', $c->result_set); my $category_name = $validation->param('category'); diff --git a/lib/Pear/LocalLoop/Controller/Api/Stats.pm b/lib/Pear/LocalLoop/Controller/Api/Stats.pm index 8545406..cd348c3 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Stats.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Stats.pm @@ -93,7 +93,7 @@ sub post_customer { my @all_weeks = $week_transaction_rs->all; my $first = $all_weeks[0]->get_column('count') || 0; - my $second = $all_weeks[1]->get_column('count') || 0; + my $second = defined $all_weeks[1] ? $all_weeks[1]->get_column('count') || 0 : 0; my $max = max( map { $_->get_column('count') } @all_weeks ); my $sum = sum( map { $_->get_column('count') } @all_weeks ); my $count = $week_transaction_rs->count;