Merge branch 'Hotfix-categoryandstatsfix'

This commit is contained in:
Finn 2018-01-18 14:26:04 +00:00
commit 5e0adc1350
2 changed files with 2 additions and 2 deletions

View file

@ -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');

View file

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