1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00

Fix history with multiple companies

This commit is contained in:
Hillel Coren 2016-12-29 12:49:29 +02:00
parent 7b04deab67
commit e08a001126

View File

@ -36,15 +36,14 @@ class HistoryUtils
ACTIVITY_TYPE_VIEW_QUOTE,
];
$activities = Activity::scope()
->with(['client.contacts', 'invoice', 'task', 'expense'])
$activities = Activity::with(['client.contacts', 'invoice', 'task', 'expense'])
->whereIn('user_id', $userIds)
->whereIn('activity_type_id', $activityTypes)
->orderBy('id', 'asc')
->orderBy('id', 'desc')
->limit(100)
->get();
foreach ($activities as $activity)
foreach ($activities->reverse() as $activity)
{
if ($activity->activity_type_id == ACTIVITY_TYPE_CREATE_CLIENT) {
$entity = $activity->client;