mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06: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:
parent
21e89c3b64
commit
037135e764
@ -46,6 +46,7 @@ class Report implements ReportInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* This methods fails to take in account transfers FROM shared accounts.
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param int $limit
|
||||
|
@ -306,8 +306,23 @@ class ReportQuery implements ReportQueryInterface
|
||||
}
|
||||
)
|
||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->where('transaction_types.type', 'Withdrawal')
|
||||
->where('acm_from.data', '!=', '"sharedExpense"')
|
||||
// not shared, withdrawal
|
||||
->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)
|
||||
->after($start)
|
||||
->where('transaction_journals.user_id', \Auth::user()->id)
|
||||
|
Loading…
Reference in New Issue
Block a user