mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 23:50:09 +00:00
A complete gamble on my side to fix a bug where transfers FROM shared accounts were not counted as income.
This commit is contained in:
@@ -46,6 +46,7 @@ class Report implements ReportInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* This methods fails to take in account transfers FROM shared accounts.
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
* @param int $limit
|
* @param int $limit
|
||||||
|
|||||||
@@ -306,8 +306,23 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||||
->where('transaction_types.type', 'Withdrawal')
|
// not shared, withdrawal
|
||||||
->where('acm_from.data', '!=', '"sharedExpense"')
|
->where(
|
||||||
|
function ($q) {
|
||||||
|
$q->where(
|
||||||
|
function ($q) {
|
||||||
|
$q->where('transaction_types.type', 'Withdrawal');
|
||||||
|
$q->where('acm_from.data', '!=', '"sharedExpense"');
|
||||||
|
}
|
||||||
|
)->orWhere(
|
||||||
|
function ($q) {
|
||||||
|
$q->where('transaction_types.type', 'Transfer');
|
||||||
|
$q->where('acm_from.data', '=', '"sharedExpense"');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
// shared, transfer?
|
||||||
->before($end)
|
->before($end)
|
||||||
->after($start)
|
->after($start)
|
||||||
->where('transaction_journals.user_id', \Auth::user()->id)
|
->where('transaction_journals.user_id', \Auth::user()->id)
|
||||||
|
|||||||
Reference in New Issue
Block a user