mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Adding charts to reports
This commit is contained in:
parent
5066a95da0
commit
238618a1c3
@ -7,6 +7,7 @@ use Auth;
|
||||
use DateInterval;
|
||||
use DatePeriod;
|
||||
use stdClass;
|
||||
use App\Models\Client;
|
||||
|
||||
class AbstractReport
|
||||
{
|
||||
@ -154,7 +155,9 @@ class AbstractReport
|
||||
if ($subgroup == 'user') {
|
||||
return $entity->user->getDisplayName();
|
||||
} elseif ($subgroup == 'client') {
|
||||
if ($entity->client) {
|
||||
if ($entity instanceof Client) {
|
||||
return $entity->getDisplayName();
|
||||
} elseif ($entity->client) {
|
||||
return $entity->client->getDisplayName();
|
||||
} else {
|
||||
return trans('texts.unset');
|
||||
|
@ -24,6 +24,7 @@ class AgingReport extends AbstractReport
|
||||
public function run()
|
||||
{
|
||||
$account = Auth::user()->account;
|
||||
$subgroup = $this->options['subgroup'];
|
||||
|
||||
$clients = Client::scope()
|
||||
->orderBy('name')
|
||||
@ -56,6 +57,14 @@ class AgingReport extends AbstractReport
|
||||
//$this->addToTotals($client->currency_id, 'paid', $payment ? $payment->getCompletedAmount() : 0);
|
||||
//$this->addToTotals($client->currency_id, 'amount', $invoice->amount);
|
||||
//$this->addToTotals($client->currency_id, 'balance', $invoice->balance);
|
||||
|
||||
if ($subgroup == 'age') {
|
||||
$dimension = trans('texts.' .$invoice->present()->ageGroup);
|
||||
} else {
|
||||
$dimension = $this->getDimension($client);
|
||||
}
|
||||
|
||||
$this->addChartData($dimension, $invoice->invoice_date, $invoice->balance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user