mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-11-04 05:15:39 +00:00 
			
		
		
		
	Fix #10678
This commit is contained in:
		@@ -23,6 +23,7 @@ declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace FireflyIII\Http\Controllers\Report;
 | 
			
		||||
 | 
			
		||||
use FireflyIII\Support\Facades\Navigation;
 | 
			
		||||
use Throwable;
 | 
			
		||||
use Carbon\Carbon;
 | 
			
		||||
use FireflyIII\Exceptions\FireflyException;
 | 
			
		||||
@@ -290,11 +291,12 @@ class BudgetController extends Controller
 | 
			
		||||
        $cache->addProperty('budget-period-report');
 | 
			
		||||
        $cache->addProperty($accounts->pluck('id')->toArray());
 | 
			
		||||
        if ($cache->has()) {
 | 
			
		||||
            return $cache->get();
 | 
			
		||||
            // return $cache->get();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $periods   = app('navigation')->listOfPeriods($start, $end);
 | 
			
		||||
        $keyFormat = app('navigation')->preferredCarbonFormat($start, $end);
 | 
			
		||||
        $periods   = Navigation::listOfPeriods($start, $end);
 | 
			
		||||
        $keyFormat = Navigation::preferredCarbonFormat($start, $end);
 | 
			
		||||
 | 
			
		||||
        // list expenses for budgets in account(s)
 | 
			
		||||
        $expenses  = $this->opsRepository->listExpenses($start, $end, $accounts);
 | 
			
		||||
 | 
			
		||||
@@ -303,6 +305,17 @@ class BudgetController extends Controller
 | 
			
		||||
            foreach ($currency['budgets'] as $budget) {
 | 
			
		||||
                $count = 0;
 | 
			
		||||
                foreach ($budget['transaction_journals'] as $journal) {
 | 
			
		||||
                    // #10678
 | 
			
		||||
                    // skip transactions between two asset / liability accounts.
 | 
			
		||||
                    if(
 | 
			
		||||
                        in_array($journal['source_account_type'], config('firefly.valid_currency_account_types')) &&
 | 
			
		||||
                        in_array($journal['destination_account_type'], config('firefly.valid_currency_account_types'))
 | 
			
		||||
                    ) {
 | 
			
		||||
                        continue;
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    ++$count;
 | 
			
		||||
                    $key                               = sprintf('%d-%d', $budget['id'], $currency['currency_id']);
 | 
			
		||||
                    $dateKey                           = $journal['date']->format($keyFormat);
 | 
			
		||||
 
 | 
			
		||||
@@ -202,8 +202,11 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
 | 
			
		||||
                'amount'                   => $amount,
 | 
			
		||||
                'destination_account_id'   => $journal['destination_account_id'],
 | 
			
		||||
                'destination_account_name' => $journal['destination_account_name'],
 | 
			
		||||
                'destination_account_type' => $journal['destination_account_type'],
 | 
			
		||||
                'currency_id'              => $journalCurrencyId,
 | 
			
		||||
                'source_account_id'        => $journal['source_account_id'],
 | 
			
		||||
                'source_account_name'      => $journal['source_account_name'],
 | 
			
		||||
                'source_account_type'      => $journal['source_account_type'],
 | 
			
		||||
                'category_name'            => $journal['category_name'],
 | 
			
		||||
                'description'              => $journal['description'],
 | 
			
		||||
                'transaction_group_id'     => $journal['transaction_group_id'],
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user