mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-11-03 20:55:05 +00:00 
			
		
		
		
	Reorder bill chart [skip ci]
This commit is contained in:
		@@ -6,6 +6,7 @@ use App;
 | 
			
		||||
use Carbon\Carbon;
 | 
			
		||||
use FireflyIII\Http\Controllers\Controller;
 | 
			
		||||
use FireflyIII\Models\Bill;
 | 
			
		||||
use FireflyIII\Models\TransactionJournal;
 | 
			
		||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
 | 
			
		||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
 | 
			
		||||
use FireflyIII\Support\CacheProperties;
 | 
			
		||||
@@ -57,7 +58,7 @@ class BillController extends Controller
 | 
			
		||||
        $cache->addProperty('bills');
 | 
			
		||||
        $cache->addProperty('frontpage');
 | 
			
		||||
        if ($cache->has()) {
 | 
			
		||||
             return Response::json($cache->get()); // @codeCoverageIgnore
 | 
			
		||||
            return Response::json($cache->get()); // @codeCoverageIgnore
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $bills  = $repository->getActiveBills();
 | 
			
		||||
@@ -129,6 +130,13 @@ class BillController extends Controller
 | 
			
		||||
        // get first transaction or today for start:
 | 
			
		||||
        $results = $repository->getJournals($bill);
 | 
			
		||||
 | 
			
		||||
        // resort:
 | 
			
		||||
        $results = $results->sortBy(
 | 
			
		||||
            function (TransactionJournal $journal) {
 | 
			
		||||
                return $journal->date->format('U');
 | 
			
		||||
            }
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $data = $this->generator->single($bill, $results);
 | 
			
		||||
        $cache->store($data);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -289,6 +289,7 @@ class TestDataSeeder extends Seeder
 | 
			
		||||
                'user_id'                 => $this->user->id,
 | 
			
		||||
                'transaction_type_id'     => 1,
 | 
			
		||||
                'transaction_currency_id' => 1,
 | 
			
		||||
                'bill_id'                 => 1,
 | 
			
		||||
                'description'             => $description,
 | 
			
		||||
                'completed'               => 1,
 | 
			
		||||
                'date'                    => $date,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user