Add filter for transfer type.

This commit is contained in:
James Cole
2025-09-25 19:17:10 +02:00
parent 62c5440605
commit 74f7c07a76

View File

@@ -208,12 +208,12 @@ trait PeriodOverview
foreach ($transactions as $index => $item) {
$date = Carbon::parse($item['date']);
if ($date >= $start && $date <= $end) {
if ('away' === $direction && -1 === bccomp((string)$item['amount'], '0')) {
if ('Transfer' === $item['type'] && 'away' === $direction && -1 === bccomp((string)$item['amount'], '0')) {
$result[] = $item;
continue;
}
if ('in' === $direction && 1 === bccomp((string)$item['amount'], '0')) {
if ('Transfer' === $item['type'] && 'in' === $direction && 1 === bccomp((string)$item['amount'], '0')) {
$result[] = $item;
continue;