diff --git a/lib/Pear/LocalLoop/Controller/Api/External.pm b/lib/Pear/LocalLoop/Controller/Api/External.pm index 4a2ee0e..6f8b5c1 100644 --- a/lib/Pear/LocalLoop/Controller/Api/External.pm +++ b/lib/Pear/LocalLoop/Controller/Api/External.pm @@ -323,7 +323,7 @@ sub post_supplier_history { total_spend => { sum => 'sales.value' }, } ], - group_by => [ 'me.id', 'organisation.name' ], + group_by => [ 'me.id', 'organisation.id' ], order_by => { '-asc' => 'organisation.name' }, } );