renamed report events and listeners
This commit is contained in:
parent
5a5521e5ad
commit
d5366e74cf
@ -16,11 +16,11 @@ abstract class Report
|
||||
protected $classes = [];
|
||||
|
||||
protected $events = [
|
||||
'App\Events\Common\ReportFilterShowing',
|
||||
'App\Events\Common\ReportFilterApplying',
|
||||
'App\Events\Common\ReportGroupShowing',
|
||||
'App\Events\Common\ReportGroupApplying',
|
||||
'App\Events\Common\ReportRowsShowing',
|
||||
'App\Events\Report\FilterShowing',
|
||||
'App\Events\Report\FilterApplying',
|
||||
'App\Events\Report\GroupShowing',
|
||||
'App\Events\Report\GroupApplying',
|
||||
'App\Events\Report\RowsShowing',
|
||||
];
|
||||
|
||||
public function skipThisClass($event)
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Abstracts;
|
||||
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
use App\Events\Common\ReportRowsShowing;
|
||||
use App\Events\Report\FilterApplying;
|
||||
use App\Events\Report\FilterShowing;
|
||||
use App\Events\Report\GroupApplying;
|
||||
use App\Events\Report\GroupShowing;
|
||||
use App\Events\Report\RowsShowing;
|
||||
use App\Exports\Common\Reports as Export;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Common\Report as Model;
|
||||
@ -286,19 +286,19 @@ abstract class Report
|
||||
|
||||
public function setFilters()
|
||||
{
|
||||
event(new ReportFilterShowing($this));
|
||||
event(new FilterShowing($this));
|
||||
}
|
||||
|
||||
public function setGroups()
|
||||
{
|
||||
$this->groups = [];
|
||||
|
||||
event(new ReportGroupShowing($this));
|
||||
event(new GroupShowing($this));
|
||||
}
|
||||
|
||||
public function setRows()
|
||||
{
|
||||
event(new ReportRowsShowing($this));
|
||||
event(new RowsShowing($this));
|
||||
}
|
||||
|
||||
public function setTotals($items, $date_field, $check_type = false, $table = 'default')
|
||||
@ -337,14 +337,14 @@ abstract class Report
|
||||
|
||||
public function applyFilters($model, $args = [])
|
||||
{
|
||||
event(new ReportFilterApplying($this, $model, $args));
|
||||
event(new FilterApplying($this, $model, $args));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public function applyGroups($model, $args = [])
|
||||
{
|
||||
event(new ReportGroupApplying($this, $model, $args));
|
||||
event(new GroupApplying($this, $model, $args));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\Common;
|
||||
namespace App\Events\Report;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ReportGroupApplying
|
||||
class FilterApplying
|
||||
{
|
||||
use SerializesModels;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\Common;
|
||||
namespace App\Events\Report;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ReportRowsShowing
|
||||
class FilterShowing
|
||||
{
|
||||
use SerializesModels;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\Common;
|
||||
namespace App\Events\Report;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ReportFilterApplying
|
||||
class GroupApplying
|
||||
{
|
||||
use SerializesModels;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\Common;
|
||||
namespace App\Events\Report;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ReportGroupShowing
|
||||
class GroupShowing
|
||||
{
|
||||
use SerializesModels;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\Common;
|
||||
namespace App\Events\Report;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ReportFilterShowing
|
||||
class RowsShowing
|
||||
{
|
||||
use SerializesModels;
|
||||
|
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
use App\Events\Common\ReportRowsShowing;
|
||||
use App\Events\Report\FilterShowing;
|
||||
use App\Events\Report\GroupApplying;
|
||||
use App\Events\Report\GroupShowing;
|
||||
use App\Events\Report\RowsShowing;
|
||||
|
||||
class AddAccountsToReports extends Listener
|
||||
class AddAccounts extends Listener
|
||||
{
|
||||
protected $classes = [
|
||||
'App\Reports\IncomeSummary',
|
||||
@ -22,7 +22,7 @@ class AddAccountsToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
public function handleFilterShowing(FilterShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -37,7 +37,7 @@ class AddAccountsToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
public function handleGroupShowing(GroupShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -52,7 +52,7 @@ class AddAccountsToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupApplying(ReportGroupApplying $event)
|
||||
public function handleGroupApplying(GroupApplying $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -67,7 +67,7 @@ class AddAccountsToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportRowsShowing(ReportRowsShowing $event)
|
||||
public function handleRowsShowing(RowsShowing $event)
|
||||
{
|
||||
if ($this->skipRowsShowing($event, 'account')) {
|
||||
return;
|
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
use App\Events\Common\ReportRowsShowing;
|
||||
use App\Events\Report\FilterShowing;
|
||||
use App\Events\Report\GroupApplying;
|
||||
use App\Events\Report\GroupShowing;
|
||||
use App\Events\Report\RowsShowing;
|
||||
|
||||
class AddCustomersToReports extends Listener
|
||||
class AddCustomers extends Listener
|
||||
{
|
||||
protected $classes = [
|
||||
'App\Reports\IncomeSummary',
|
||||
@ -21,7 +21,7 @@ class AddCustomersToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
public function handleFilterShowing(FilterShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -36,7 +36,7 @@ class AddCustomersToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
public function handleGroupShowing(GroupShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -51,7 +51,7 @@ class AddCustomersToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupApplying(ReportGroupApplying $event)
|
||||
public function handleGroupApplying(GroupApplying $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -66,7 +66,7 @@ class AddCustomersToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportRowsShowing(ReportRowsShowing $event)
|
||||
public function handleRowsShowing(RowsShowing $event)
|
||||
{
|
||||
if ($this->skipRowsShowing($event, 'customer')) {
|
||||
return;
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Report\FilterApplying;
|
||||
use App\Events\Report\FilterShowing;
|
||||
|
||||
class AddDateToReports extends Listener
|
||||
class AddDate extends Listener
|
||||
{
|
||||
protected $classes = [
|
||||
'App\Reports\IncomeSummary',
|
||||
@ -22,7 +22,7 @@ class AddDateToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
public function handleFilterShowing(FilterShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -37,7 +37,7 @@ class AddDateToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterApplying(ReportFilterApplying $event)
|
||||
public function handleFilterApplying(FilterApplying $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
use App\Events\Common\ReportRowsShowing;
|
||||
use App\Events\Report\FilterShowing;
|
||||
use App\Events\Report\GroupShowing;
|
||||
use App\Events\Report\RowsShowing;
|
||||
|
||||
class AddExpenseCategoriesToReports extends Listener
|
||||
class AddExpenseCategories extends Listener
|
||||
{
|
||||
protected $classes = [
|
||||
'App\Reports\ExpenseSummary',
|
||||
@ -19,7 +19,7 @@ class AddExpenseCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
public function handleFilterShowing(FilterShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -34,7 +34,7 @@ class AddExpenseCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
public function handleGroupShowing(GroupShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -49,7 +49,7 @@ class AddExpenseCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportRowsShowing(ReportRowsShowing $event)
|
||||
public function handleRowsShowing(RowsShowing $event)
|
||||
{
|
||||
if ($this->skipRowsShowing($event, 'category')) {
|
||||
return;
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
use App\Events\Common\ReportRowsShowing;
|
||||
use App\Events\Report\FilterShowing;
|
||||
use App\Events\Report\GroupShowing;
|
||||
use App\Events\Report\RowsShowing;
|
||||
|
||||
class AddIncomeCategoriesToReports extends Listener
|
||||
class AddIncomeCategories extends Listener
|
||||
{
|
||||
protected $classes = [
|
||||
'App\Reports\IncomeSummary',
|
||||
@ -19,7 +19,7 @@ class AddIncomeCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
public function handleFilterShowing(FilterShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -34,7 +34,7 @@ class AddIncomeCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
public function handleGroupShowing(GroupShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -49,7 +49,7 @@ class AddIncomeCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportRowsShowing(ReportRowsShowing $event)
|
||||
public function handleRowsShowing(RowsShowing $event)
|
||||
{
|
||||
if ($this->skipRowsShowing($event, 'category')) {
|
||||
return;
|
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
use App\Events\Common\ReportRowsShowing;
|
||||
use App\Events\Report\FilterShowing;
|
||||
use App\Events\Report\GroupShowing;
|
||||
use App\Events\Report\RowsShowing;
|
||||
use App\Models\Setting\Category;
|
||||
|
||||
class AddIncomeExpenseCategoriesToReports extends Listener
|
||||
class AddIncomeExpenseCategories extends Listener
|
||||
{
|
||||
/**
|
||||
* Handle filter showing event.
|
||||
@ -16,7 +16,7 @@ class AddIncomeExpenseCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
public function handleFilterShowing(FilterShowing $event)
|
||||
{
|
||||
$classes = [
|
||||
'App\Reports\IncomeExpenseSummary',
|
||||
@ -35,7 +35,7 @@ class AddIncomeExpenseCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
public function handleGroupShowing(GroupShowing $event)
|
||||
{
|
||||
$classes = [
|
||||
'App\Reports\IncomeExpenseSummary',
|
||||
@ -55,7 +55,7 @@ class AddIncomeExpenseCategoriesToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportRowsShowing(ReportRowsShowing $event)
|
||||
public function handleRowsShowing(RowsShowing $event)
|
||||
{
|
||||
if (
|
||||
empty($event->class)
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportRowsShowing;
|
||||
use App\Events\Report\RowsShowing;
|
||||
|
||||
class AddRowsToTaxReport extends Listener
|
||||
class AddRowsToTax extends Listener
|
||||
{
|
||||
protected $classes = [
|
||||
'App\Reports\TaxSummary',
|
||||
@ -17,7 +17,7 @@ class AddRowsToTaxReport extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportRowsShowing(ReportRowsShowing $event)
|
||||
public function handleRowsShowing(RowsShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Report\FilterApplying;
|
||||
use App\Events\Report\FilterShowing;
|
||||
|
||||
class AddSearchToReports extends Listener
|
||||
class AddSearch extends Listener
|
||||
{
|
||||
protected $classes = [
|
||||
'App\Reports\IncomeSummary',
|
||||
@ -22,7 +22,7 @@ class AddSearchToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
public function handleFilterShowing(FilterShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -37,7 +37,7 @@ class AddSearchToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterApplying(ReportFilterApplying $event)
|
||||
public function handleFilterApplying(FilterApplying $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
namespace App\Listeners\Report;
|
||||
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
use App\Events\Common\ReportRowsShowing;
|
||||
use App\Events\Report\FilterShowing;
|
||||
use App\Events\Report\GroupApplying;
|
||||
use App\Events\Report\GroupShowing;
|
||||
use App\Events\Report\RowsShowing;
|
||||
|
||||
class AddVendorsToReports extends Listener
|
||||
class AddVendors extends Listener
|
||||
{
|
||||
protected $classes = [
|
||||
'App\Reports\ExpenseSummary',
|
||||
@ -21,7 +21,7 @@ class AddVendorsToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
public function handleFilterShowing(FilterShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -36,7 +36,7 @@ class AddVendorsToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
public function handleGroupShowing(GroupShowing $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -51,7 +51,7 @@ class AddVendorsToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupApplying(ReportGroupApplying $event)
|
||||
public function handleGroupApplying(GroupApplying $event)
|
||||
{
|
||||
if ($this->skipThisClass($event)) {
|
||||
return;
|
||||
@ -66,7 +66,7 @@ class AddVendorsToReports extends Listener
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportRowsShowing(ReportRowsShowing $event)
|
||||
public function handleRowsShowing(RowsShowing $event)
|
||||
{
|
||||
if ($this->skipRowsShowing($event, 'vendor')) {
|
||||
return;
|
@ -62,14 +62,14 @@ class Event extends Provider
|
||||
* @var array
|
||||
*/
|
||||
protected $subscribe = [
|
||||
'App\Listeners\Common\AddDateToReports',
|
||||
'App\Listeners\Common\AddAccountsToReports',
|
||||
'App\Listeners\Common\AddCustomersToReports',
|
||||
'App\Listeners\Common\AddVendorsToReports',
|
||||
'App\Listeners\Common\AddExpenseCategoriesToReports',
|
||||
'App\Listeners\Common\AddIncomeCategoriesToReports',
|
||||
'App\Listeners\Common\AddIncomeExpenseCategoriesToReports',
|
||||
'App\Listeners\Common\AddSearchToReports',
|
||||
'App\Listeners\Common\AddRowsToTaxReport',
|
||||
'App\Listeners\Report\AddDate',
|
||||
'App\Listeners\Report\AddAccounts',
|
||||
'App\Listeners\Report\AddCustomers',
|
||||
'App\Listeners\Report\AddVendors',
|
||||
'App\Listeners\Report\AddExpenseCategories',
|
||||
'App\Listeners\Report\AddIncomeCategories',
|
||||
'App\Listeners\Report\AddIncomeExpenseCategories',
|
||||
'App\Listeners\Report\AddSearch',
|
||||
'App\Listeners\Report\AddRowsToTax',
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user