mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix various issues with new features, nullpointers and missing checks.
This commit is contained in:
@@ -550,9 +550,9 @@ class BillRepository implements BillRepositoryInterface
|
||||
foreach ($set as $transactionJournal) {
|
||||
$setAmount = bcadd($setAmount, Amount::getAmountFromJournalObject($transactionJournal));
|
||||
}
|
||||
Log::debug(sprintf('Bill #%d ("%s") with %d transaction(s) and sum %s %s', $bill->id, $bill->name, $set->count(), $currency->code, $setAmount));
|
||||
//Log::debug(sprintf('Bill #%d ("%s") with %d transaction(s) and sum %s %s', $bill->id, $bill->name, $set->count(), $currency->code, $setAmount));
|
||||
$return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], $setAmount);
|
||||
Log::debug(sprintf('Total sum is now %s', $return[$currency->id]['sum']));
|
||||
//Log::debug(sprintf('Total sum is now %s', $return[$currency->id]['sum']));
|
||||
}
|
||||
|
||||
return $return;
|
||||
@@ -586,7 +586,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
|
||||
$minField = $convertToNative && $bill->transactionCurrency->id !== $default->id ? 'native_amount_min' : 'amount_min';
|
||||
$maxField = $convertToNative && $bill->transactionCurrency->id !== $default->id ? 'native_amount_max' : 'amount_max';
|
||||
Log::debug(sprintf('min field is %s, max field is %s', $minField, $maxField));
|
||||
// Log::debug(sprintf('min field is %s, max field is %s', $minField, $maxField));
|
||||
|
||||
if ($total > 0) {
|
||||
$currency = $convertToNative && $bill->transactionCurrency->id !== $default->id ? $default : $bill->transactionCurrency;
|
||||
|
@@ -133,8 +133,8 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
|
||||
Log::debug(sprintf('Now in %s(%s, %s)', __METHOD__, $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s')));
|
||||
$return = [];
|
||||
$availableBudgets = $this->user->availableBudgets()
|
||||
->where('start_date', $start->format('Y-m-d H:i:s'))
|
||||
->where('end_date', $end->format('Y-m-d H:i:s'))->get()
|
||||
->where('start_date', $start->format('Y-m-d'))
|
||||
->where('end_date', $end->format('Y-m-d'))->get()
|
||||
;
|
||||
|
||||
Log::debug(sprintf('Found %d available budgets', $availableBudgets->count()));
|
||||
|
@@ -287,7 +287,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
$amount = '' === $amount ? '0' : $amount;
|
||||
$sum = bcadd($sum, $amount);
|
||||
}
|
||||
Log::debug(sprintf('Current amount in piggy bank #%d ("%s") is %s', $piggyBank->id, $piggyBank->name, $sum));
|
||||
// Log::debug(sprintf('Current amount in piggy bank #%d ("%s") is %s', $piggyBank->id, $piggyBank->name, $sum));
|
||||
|
||||
return $sum;
|
||||
}
|
||||
|
Reference in New Issue
Block a user