mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-30 04:33:54 -06:00
Refer to correct location for bill transformer.
This commit is contained in:
parent
d3c8d06114
commit
811d8e330f
@ -25,7 +25,7 @@ namespace FireflyIII\Api\V1\Controllers;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Transformers\Bill\BillTransformer;
|
||||
use FireflyIII\Transformers\BillTransformer;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use League\Fractal\Manager;
|
||||
|
@ -30,9 +30,12 @@ use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Transformers\Bill\BillTransformer;
|
||||
use FireflyIII\Transformers\BillTransformer;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use League\Fractal\Manager;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\DataArraySerializer;
|
||||
use Preferences;
|
||||
use URL;
|
||||
use View;
|
||||
@ -230,8 +233,13 @@ class BillController extends Controller
|
||||
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
|
||||
$yearAverage = $repository->getYearAverage($bill, $start);
|
||||
$overallAverage = $repository->getOverallAverage($bill);
|
||||
$transformer = new BillTransformer($start, $end);
|
||||
$object = $transformer->transform($bill);
|
||||
$manager = new Manager();
|
||||
$manager->setSerializer(new DataArraySerializer());
|
||||
$manager->parseIncludes(['attachments']);
|
||||
|
||||
// Make a resource out of the data and
|
||||
$resource = new Item($bill, new BillTransformer($start, $end), 'bill');
|
||||
$object = $manager->createData($resource)->toArray();
|
||||
|
||||
// use collector:
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
@ -242,7 +250,7 @@ class BillController extends Controller
|
||||
$transactions->setPath(route('bills.show', [$bill->id]));
|
||||
|
||||
|
||||
return view('bills.show', compact('transactions', 'yearAverage', 'overallAverage', 'year', 'object','bill', 'subTitle'));
|
||||
return view('bills.show', compact('transactions', 'yearAverage', 'overallAverage', 'year', 'object', 'bill', 'subTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user