mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Added activity report
This commit is contained in:
parent
34776b2eb2
commit
d8f55445c3
@ -67,6 +67,7 @@ class ReportController extends BaseController
|
||||
}
|
||||
|
||||
$reportTypes = [
|
||||
'activity',
|
||||
'aging',
|
||||
'client',
|
||||
'expense',
|
||||
|
40
app/Ninja/Reports/ActivityReport.php
Normal file
40
app/Ninja/Reports/ActivityReport.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Ninja\Reports;
|
||||
|
||||
use App\Models\Activity;
|
||||
use Auth;
|
||||
|
||||
class ActivityReport extends AbstractReport
|
||||
{
|
||||
public $columns = [
|
||||
'date',
|
||||
'client',
|
||||
'user',
|
||||
'activity',
|
||||
];
|
||||
|
||||
public function run()
|
||||
{
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$startDate = $this->startDate->format('Y-m-d');
|
||||
$endDate = $this->endDate->format('Y-m-d');
|
||||
|
||||
$activities = Activity::scope()
|
||||
->with('client.contacts', 'user', 'invoice', 'payment', 'credit', 'task', 'expense', 'account')
|
||||
->whereRaw("DATE(created_at) >= \"{$startDate}\" and DATE(created_at) <= \"$endDate\"");
|
||||
|
||||
foreach ($activities->get() as $activity) {
|
||||
$client = $activity->client;
|
||||
$this->data[] = [
|
||||
$activity->present()->createdAt,
|
||||
$client ? ($this->isExport ? $client->getDisplayName() : $client->present()->link) : '',
|
||||
$activity->present()->user,
|
||||
$activity->getMessage(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
34
resources/views/emails/user_message_html.blade.php
Normal file
34
resources/views/emails/user_message_html.blade.php
Normal file
@ -0,0 +1,34 @@
|
||||
@extends('emails.master_user')
|
||||
|
||||
@section('body')
|
||||
<div>
|
||||
{{ trans('texts.email_salutation', ['name' => $userName]) }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{!! $primaryMessage !!}
|
||||
</div>
|
||||
@if (! empty($secondaryMessage))
|
||||
|
||||
<div>
|
||||
{!! $secondaryMessage !!}
|
||||
</div>
|
||||
@endif
|
||||
@if (! empty($invoiceLink))
|
||||
|
||||
<div>
|
||||
<center>
|
||||
@include('partials.email_button', [
|
||||
'link' => $invoiceLink,
|
||||
'field' => "view_invoice",
|
||||
'color' => '#0b4d78',
|
||||
])
|
||||
</center>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
{{ trans('texts.email_signature') }} <br/>
|
||||
{{ trans('texts.email_from') }}
|
||||
</div>
|
||||
@stop
|
15
resources/views/emails/user_message_text.blade.php
Normal file
15
resources/views/emails/user_message_text.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
{!! trans('texts.email_salutation', ['name' => $userName]) !!}
|
||||
|
||||
{!! strip_tags($primaryMessage) !!}
|
||||
|
||||
@if (! empty($secondaryMessage))
|
||||
{!! strip_tags($secondaryMessage) !!}
|
||||
|
||||
@endif
|
||||
|
||||
@if (! empty($invoiceLink))
|
||||
{!! $invoiceLink !!}
|
||||
@endif
|
||||
|
||||
{!! trans('texts.email_signature') !!}
|
||||
{!! trans('texts.email_from') !!}
|
Loading…
Reference in New Issue
Block a user