diff --git a/app/Events/Model/TransactionGroup/TransactionGroupEventObjects.php b/app/Events/Model/TransactionGroup/TransactionGroupEventObjects.php index 47331fdbe9..2739d94809 100644 --- a/app/Events/Model/TransactionGroup/TransactionGroupEventObjects.php +++ b/app/Events/Model/TransactionGroup/TransactionGroupEventObjects.php @@ -48,13 +48,13 @@ class TransactionGroupEventObjects public function appendFromTransactionGroup(TransactionGroup $transactionGroup): void { - Log::debug(sprintf('Appended transaction group #%d', $transactionGroup->id)); + //Log::debug(sprintf('Appended transaction group #%d', $transactionGroup->id)); $this->transactionGroups->push($transactionGroup); /** @var TransactionJournal $journal */ foreach ($transactionGroup->transactionJournals as $journal) { $journal->refresh(); - Log::debug(sprintf('Appended transaction journal #%d (%s)', $journal->id, $journal->date->format('Y-m-d H:i:s'))); + //Log::debug(sprintf('Appended transaction journal #%d (%s)', $journal->id, $journal->date->format('Y-m-d H:i:s'))); $this->transactionJournals->put($journal->id, $journal); $this->budgets = $this->budgets->merge($journal->budgets); $this->categories = $this->categories->merge($journal->categories); @@ -62,7 +62,7 @@ class TransactionGroupEventObjects /** @var Transaction $transaction */ foreach ($journal->transactions as $transaction) { - Log::debug(sprintf('Appended account #%d', $transaction->account->id)); + // Log::debug(sprintf('Appended account #%d', $transaction->account->id)); $this->accounts->push($transaction->account); } } diff --git a/app/Support/Models/AccountBalanceCalculator.php b/app/Support/Models/AccountBalanceCalculator.php index 9aafad0e99..2bde5063f5 100644 --- a/app/Support/Models/AccountBalanceCalculator.php +++ b/app/Support/Models/AccountBalanceCalculator.php @@ -139,14 +139,14 @@ class AccountBalanceCalculator /** @var Transaction $entry */ foreach ($set as $entry) { - Log::debug(sprintf( - '[%s] Processing transaction #%d on acount #%d with currency #%d and amount %s', - $entry->date, - $entry->id, - $entry->account_id, - $entry->transaction_currency_id, - Steam::bcround($entry->amount, 2) - )); +// Log::debug(sprintf( +// '[%s] Processing transaction #%d on acount #%d with currency #%d and amount %s', +// $entry->date, +// $entry->id, +// $entry->account_id, +// $entry->transaction_currency_id, +// Steam::bcround($entry->amount, 2) +// )); // start with empty array: $entry->account_id = (int) $entry->account_id; $entry->transaction_currency_id = (int) $entry->transaction_currency_id; diff --git a/resources/views/components/lists/subscriptions.blade.php b/resources/views/components/lists/subscriptions.blade.php index 95d56fab10..d2891fbc2e 100644 --- a/resources/views/components/lists/subscriptions.blade.php +++ b/resources/views/components/lists/subscriptions.blade.php @@ -2,211 +2,231 @@
- +
- - - - - - - - - - - - - - @if(count($objectGroup['bills']) > 0) - - @foreach($objectGroup['bills'] as $entry) - - - -
{{ __('list.name') }}{{ trans('list.matchingAmount') }}
- @if(!$entry['active']) - - @endif - {{ $entry['name'] }} - {{-- count attachments --}} - @if(count($entry['attachments']) > 0) - - @endif + + + + + + + + + + + + + + @if(count($objectGroup['bills']) > 0) + + @foreach($objectGroup['bills'] as $entry) + + + + - - + + + - {{-- - paidDates = 0 (bill not paid in period) - pay_dates = 0 (bill not expected to be paid in this period) - bill is active. - --}} - @if(0 === count($entry['paid_dates']) && 0 === count($entry['pay_dates']) && $entry['active']) - - - @endif + {{-- + paidDates = 0 (bill not paid in period) + pay_dates = 0 (bill not expected to be paid in this period) + bill is active. + --}} + @if(0 === count($entry['paid_dates']) && 0 === count($entry['pay_dates']) && $entry['active']) + + + @endif - {{-- - paid_dates = 0 (bill not paid in period) - pay_dates > 0 (bill IS expected to be paid in this period) - bill is active - first pay date is in the past. - --}} - @if(0 === count($entry['paid_dates']) && count($entry['pay_dates']) > 0 && $entry['active']) - @if($entry['next_expected_match_diff'] === __('firefly.not_expected_period')) {{-- terrible code, you should sue me for this. --}} - - @else - - @endif - + @else + + @endif + - @endif + + @endif - {{-- - paid_dates >= 0 (bill is paid X times). - Don't care about pay_dates. - --}} + {{-- + paid_dates >= 0 (bill is paid X times). + Don't care about pay_dates. + --}} - @if(count($entry['paid_dates']) > 0 && $entry['active']) - - - @endif - {{-- bill is not active --}} - @if(!$entry['active']) - - - @endif - - - @endforeach - @foreach(($sums[$objectGroupOrder] ?? []) as $sum) - @if('0' !== $sum['avg']) - - - - - - - @endif - @if('0' !== $sum['total_left_to_pay']) - - - - - - - @endif - @if('0' !== $sum['per_period']) - - - - - - - @endif - @endforeach - - @endif + @if(count($entry['paid_dates']) > 0 && $entry['active']) + + + @endif + {{-- bill is not active --}} + @if(!$entry['active']) + + + @endif + + + @endforeach + @if(array_key_exists($objectGroupOrder, $sums)) + @foreach($sums[$objectGroupOrder] as $sum) + @if('0' !== $sum['avg']) + + + + + + + @endif + @if('0' !== $sum['total_left_to_pay']) + + + + + + + @endif + @if('0' !== $sum['per_period']) + + + + + + + @endif + @endforeach + @endif + + @endif -
{{ __('list.name') }}{{ trans('list.matchingAmount') }}
+ @if(!$entry['active']) + + @endif + {{ $entry['name'] }} + {{-- count attachments --}} + @if(count($entry['attachments']) > 0) + + @endif - - + + ~ {!! format_amount_by_symbol(($entry['amount_max'] + $entry['amount_min'])/2, $entry['currency_symbol'], $entry['currency_decimal_places']) !!} @if('0' !== $entry['pc_amount_max'] && null !== $entry['pc_amount_max']) - (~ {!! format_amount_by_symbol(($entry['pc_amount_max'] + $entry['pc_amount_min'])/2, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!}) + (~ {!! format_amount_by_symbol(($entry['pc_amount_max'] + $entry['pc_amount_min'])/2, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!} + ) @endif -
- {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) ({{ __('firefly.active_exp_bills_only') }}) - - {!! format_amount_by_symbol($sum['avg'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} -
- {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) ({{ __('firefly.left_to_pay_active_bills') }}) - - {!! format_amount_by_symbol($sum['total_left_to_pay'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} -
- {{ __('firefly.per_period_sum_' . $sum['period']) }} ({{ $sum['currency_name'] }}) - ({{ __('firefly.active_bills_only') }}) - - {!! format_amount_by_symbol($sum['per_period'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} -
+ {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) + ({{ __('firefly.active_exp_bills_only') }}) + + {!! format_amount_by_symbol($sum['avg'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} +
+ {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) + ({{ __('firefly.left_to_pay_active_bills') }}) + + {!! format_amount_by_symbol($sum['total_left_to_pay'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} +
+ {{ __('firefly.per_period_sum_' . $sum['period']) }} + ({{ $sum['currency_name'] }}) + ({{ __('firefly.active_bills_only') }}) + + {!! format_amount_by_symbol($sum['per_period'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} +
+
- +
@@ -214,34 +234,35 @@ @if(count($totals) > 0) -
Totals
+
Totals
- - - @foreach($totals as $sum) - @if('0' !== $sum['avg']) - - - - - @endif - @if('0' !== $sum['per_period']) - - - - - @endif - @endforeach - +
- {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) ({{ __('firefly.active_exp_bills_only_total') }}) - - {!! format_amount_by_symbol($sum['avg'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} -
- {{ __('firefly.per_period_sum_' . $sum['period']) }} ({{ $sum['currency_name'] }}) - ({{ __('firefly.active_bills_only_total') }}) - - {!! format_amount_by_symbol($sum['per_period'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} -
+ + @foreach($totals as $sum) + @if('0' !== $sum['avg']) + + + + + @endif + @if('0' !== $sum['per_period']) + + + + + @endif + @endforeach + -
+ {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) + ({{ __('firefly.active_exp_bills_only_total') }}) + + {!! format_amount_by_symbol($sum['avg'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} +
+ {{ __('firefly.per_period_sum_' . $sum['period']) }} ({{ $sum['currency_name'] }}) + ({{ __('firefly.active_bills_only_total') }}) + + {!! format_amount_by_symbol($sum['per_period'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} +
+ @endif