Reformat if-statement.

This commit is contained in:
James Cole 2020-01-01 19:55:02 +01:00
parent fca5d9d55b
commit c78c667157
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -186,10 +186,19 @@ class ReportController extends Controller
// in our outgoing?
$key = 'spent';
$amount = app('steam')->positive($journal['amount']);
if (TransactionType::DEPOSIT === $journal['transaction_type_type'] || ((TransactionType::TRANSFER === $journal['transaction_type_type']
|| TransactionType::OPENING_BALANCE === $journal['transaction_type_type'])
&& in_array($journal['destination_account_id'], $ids, true)
)) {
if (
TransactionType::DEPOSIT === $journal['transaction_type_type']
|| // deposit = incoming
// transfer or opening balance, and these accounts are the destination.
(
(
TransactionType::TRANSFER === $journal['transaction_type_type']
|| TransactionType::OPENING_BALANCE === $journal['transaction_type_type']
)
&& in_array($journal['destination_account_id'], $ids, true)
)
) {
$key = 'earned';
}
$data[$currencyId][$period][$key] = bcadd($data[$currencyId][$period][$key], $amount);