mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 08:11:20 +00:00
More code for #159 [skip ci]
This commit is contained in:
@@ -48,6 +48,9 @@ class ReportController extends Controller
|
||||
case 'expense-entry':
|
||||
$html = $this->expenseEntry($attributes);
|
||||
break;
|
||||
case 'income-entry':
|
||||
$html = $this->incomeEntry($attributes);
|
||||
break;
|
||||
}
|
||||
|
||||
return Response::json(['html' => $html]);
|
||||
@@ -83,6 +86,25 @@ class ReportController extends Controller
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the incomes that went to the given asset account.
|
||||
*
|
||||
* @param $attributes
|
||||
*
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function incomeEntry($attributes)
|
||||
{
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$account = $repository->find(intval($attributes['accountId']));
|
||||
$journals = $repository->getIncomeByDestination($account, $attributes['accounts'], $attributes['startDate'], $attributes['endDate']);
|
||||
$view = view('popup.report.income-entry', compact('journals'))->render();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the expenses that went to the given expense account.
|
||||
*
|
||||
|
Reference in New Issue
Block a user