mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-02 12:15:55 +00:00
First attempt at new month report.
This commit is contained in:
@@ -30,6 +30,9 @@ class ReportController extends BaseController
|
||||
$this->_journals = $journals;
|
||||
$this->_repository = $repository;
|
||||
|
||||
View::share('title', 'Reports');
|
||||
View::share('mainTitleIcon', 'fa-line-chart');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,6 +49,33 @@ class ReportController extends BaseController
|
||||
return View::make('reports.index', compact('years', 'months', 'title', 'mainTitleIcon'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $month
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function month($year = '2014', $month = '1')
|
||||
{
|
||||
try {
|
||||
new Carbon($year . '-' . $month . '-01');
|
||||
} catch (Exception $e) {
|
||||
View::make('error')->with('message', 'Invalid date');
|
||||
}
|
||||
$date = new Carbon($year . '-' . $month . '-01');
|
||||
$subTitle = 'Report for ' . $date->format('F Y');
|
||||
$subTitleIcon = 'fa-calendar';
|
||||
$income = $this->_repository->getIncomeForMonth($date,false);
|
||||
|
||||
// var_dump($income->toArray());
|
||||
// exit;
|
||||
|
||||
|
||||
|
||||
|
||||
return View::make('reports.month', compact('date', 'subTitle', 'subTitleIcon','income'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $year
|
||||
* @param $month
|
||||
@@ -83,7 +113,7 @@ class ReportController extends BaseController
|
||||
return null;
|
||||
}
|
||||
);
|
||||
$deposits = $journals->filter(
|
||||
$deposits = $journals->filter(
|
||||
function (TransactionJournal $journal) {
|
||||
$relations = $journal->transactiongroups()->where('relation', 'balance')->count();
|
||||
$budgets = $journal->budgets()->count();
|
||||
|
||||
Reference in New Issue
Block a user