mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 10:39:28 +00:00
Fix #4235
This commit is contained in:
@@ -27,6 +27,7 @@ use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -206,10 +207,17 @@ class PopupReport implements PopupReportInterface
|
||||
$repository = app(JournalRepositoryInterface::class);
|
||||
$repository->setUser($account->user);
|
||||
|
||||
$accountRepository = app(AccountRepositoryInterface::class);
|
||||
$accountRepository->setUser($account->user);
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
|
||||
$collector->setAccounts(new Collection([$account]))
|
||||
// set report accounts + the request accounts:
|
||||
$set = $attributes['accounts'] ?? new Collection;
|
||||
$set->push($account);
|
||||
|
||||
$collector->setBothAccounts($set)
|
||||
->setRange($attributes['startDate'], $attributes['endDate'])
|
||||
->withAccountInformation()
|
||||
->withBudgetInformation()
|
||||
|
@@ -57,7 +57,7 @@ if (!function_exists('limitStringLength')) {
|
||||
$length = \strlen($string);
|
||||
$result = $string;
|
||||
if ($length > $maxChars) {
|
||||
$result = substr_replace($string, ' ... ', $maxChars / 2, $length - $maxChars);
|
||||
$result = substr_replace($string, ' ... ', (int)($maxChars / 2), $length - $maxChars);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
Reference in New Issue
Block a user