James Cole 2022-09-11 07:08:02 +02:00
parent d9e8f8106a
commit 9c2f771bae
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
4 changed files with 18 additions and 15 deletions

View File

@ -438,7 +438,7 @@ class AccountController extends Controller
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty($account->id); $cache->addProperty($account->id);
if ($cache->has()) { if ($cache->has()) {
//return response()->json($cache->get()); return response()->json($cache->get());
} }
$currencies = $this->accountRepository->getUsedCurrencies($account); $currencies = $this->accountRepository->getUsedCurrencies($account);

View File

@ -99,7 +99,7 @@ class BudgetController extends Controller
$cache->addProperty($budget->id); $cache->addProperty($budget->id);
if ($cache->has()) { if ($cache->has()) {
//return response()->json($cache->get()); return response()->json($cache->get());
} }
$step = $this->calculateStep($start, $end); // depending on diff, do something with range of chart. $step = $this->calculateStep($start, $end); // depending on diff, do something with range of chart.
$collection = new Collection([$budget]); $collection = new Collection([$budget]);

View File

@ -181,28 +181,31 @@ class ReportController extends Controller
$period = $journal['date']->format($format); $period = $journal['date']->format($format);
$currencyId = (int) $journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$data[$currencyId] = $data[$currencyId] ?? [ $data[$currencyId] = $data[$currencyId] ?? [
'currency_id' => $currencyId, 'currency_id' => $currencyId,
'currency_symbol' => $journal['currency_symbol'], 'currency_symbol' => $journal['currency_symbol'],
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
'currency_name' => $journal['currency_name'], 'currency_name' => $journal['currency_name'],
'currency_decimal_places' => (int) $journal['currency_decimal_places'], 'currency_decimal_places' => (int) $journal['currency_decimal_places'],
]; ];
$data[$currencyId][$period] = $data[$currencyId][$period] ?? [ $data[$currencyId][$period] = $data[$currencyId][$period] ?? [
'period' => $period, 'period' => $period,
'spent' => '0', 'spent' => '0',
'earned' => '0', 'earned' => '0',
]; ];
// in our outgoing? // in our outgoing?
$key = 'spent'; $key = 'spent';
$amount = app('steam')->positive($journal['amount']); $amount = app('steam')->positive($journal['amount']);
// deposit = incoming
// transfer or reconcile or opening balance, and these accounts are the destination.
if ( if (
TransactionType::DEPOSIT === $journal['transaction_type_type'] 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::TRANSFER === $journal['transaction_type_type']
|| TransactionType::RECONCILIATION === $journal['transaction_type_type']
|| TransactionType::OPENING_BALANCE === $journal['transaction_type_type'] || TransactionType::OPENING_BALANCE === $journal['transaction_type_type']
) )
&& in_array($journal['destination_account_id'], $ids, true) && in_array($journal['destination_account_id'], $ids, true)

View File

@ -73,7 +73,7 @@ class BoxController extends Controller
$cache->addProperty($today); $cache->addProperty($today);
$cache->addProperty('box-available'); $cache->addProperty('box-available');
if ($cache->has()) { if ($cache->has()) {
//return response()->json($cache->get()); return response()->json($cache->get());
} }
$leftPerDayAmount = '0'; $leftPerDayAmount = '0';
$leftToSpendAmount = '0'; $leftToSpendAmount = '0';