Stop null values on org graphs

This commit is contained in:
Tom Bloor 2017-09-04 17:39:48 +01:00
parent 4d21de7bae
commit 4ba6a443fc

View file

@ -102,7 +102,7 @@ sub _sales_last_duration {
my $transactions = $entity->sales
->search_between( $start, $next_end )
->get_column('value')
->sum;
->sum || 0;
push @{ $data->{ labels } }, $start->day_name;
push @{ $data->{ data } }, $transactions;
$start->add( days => 1 );
@ -134,7 +134,7 @@ sub _purchases_last_duration {
my $transactions = $entity->purchases
->search_between( $start, $next_end )
->get_column('value')
->sum;
->sum || 0;
push @{ $data->{ labels } }, $start->day_name;
push @{ $data->{ data } }, $transactions;
$start->add( days => 1 );