Browse Source

Add docblock on ReportsRepository class

pull/12/head
Nafies Luthfi 8 years ago
parent
commit
bd82cc3abd
  1. 35
      app/Entities/Reports/ReportsRepository.php

35
app/Entities/Reports/ReportsRepository.php

@ -14,13 +14,30 @@ use App\Entities\Projects\Project;
*/
class ReportsRepository extends BaseRepository
{
/**
* Payment model.
*
* @var \App\Entities\Payments\Payment
*/
protected $model;
/**
* Create ReportsRepository class instance.
*
* @param \App\Entities\Payments\Payment $model
*/
public function __construct(Payment $model)
{
parent::__construct($model);
}
/**
* Get payment daily report.
*
* @param string $date
* @param string $q
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getDailyReports($date, $q)
{
return Payment::orderBy('date', 'desc')
@ -29,6 +46,13 @@ class ReportsRepository extends BaseRepository
->get();
}
/**
* Get payment montly report by year and month.
*
* @param string $year
* @param string $month
* @return \Illuminate\Support\Collection
*/
public function getMonthlyReports($year, $month)
{
$rawQuery = 'date, count(`id`) as count';
@ -52,6 +76,12 @@ class ReportsRepository extends BaseRepository
return collect($reports);
}
/**
* Get payment yearly report.
*
* @param string $year
* @return \Illuminate\Support\Collection
*/
public function getYearlyReports($year)
{
$rawQuery = 'MONTH(date) as month';
@ -76,6 +106,11 @@ class ReportsRepository extends BaseRepository
return collect($reports);
}
/**
* Get current credit/receiveble earnings report.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getCurrentCredits()
{
// On Progress, Done, On Hold

Loading…
Cancel
Save