v2 first commit
This commit is contained in:
65
app/Listeners/Common/ExpenseSummaryReport.php
Normal file
65
app/Listeners/Common/ExpenseSummaryReport.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
|
||||
class ExpenseSummaryReport extends Listener
|
||||
{
|
||||
protected $class = 'App\Reports\ExpenseSummary';
|
||||
|
||||
/**
|
||||
* Handle filter showing event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->class->filters['years'] = $this->getYears();
|
||||
$event->class->filters['accounts'] = $this->getAccounts();
|
||||
$event->class->filters['categories'] = $this->getExpenseCategories();
|
||||
$event->class->filters['vendors'] = $this->getVendors();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle group showing event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->class->groups['category'] = trans_choice('general.categories', 1);
|
||||
$event->class->groups['account'] = trans_choice('general.accounts', 1);
|
||||
$event->class->groups['vendor'] = trans_choice('general.vendors', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle group applyinh event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupApplying(ReportGroupApplying $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->applyVendorGroup($event);
|
||||
$this->applyAccountGroup($event);
|
||||
}
|
||||
}
|
||||
68
app/Listeners/Common/IncomeExpenseSummaryReport.php
Normal file
68
app/Listeners/Common/IncomeExpenseSummaryReport.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
|
||||
class IncomeExpenseSummaryReport extends Listener
|
||||
{
|
||||
protected $class = 'App\Reports\IncomeExpenseSummary';
|
||||
|
||||
/**
|
||||
* Handle filter showing event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->class->filters['years'] = $this->getYears();
|
||||
$event->class->filters['accounts'] = $this->getAccounts();
|
||||
$event->class->filters['categories'] = $this->getIncomeExpenseCategories();
|
||||
$event->class->filters['customers'] = $this->getCustomers();
|
||||
$event->class->filters['vendors'] = $this->getVendors();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle group showing event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->class->groups['category'] = trans_choice('general.categories', 1);
|
||||
$event->class->groups['account'] = trans_choice('general.accounts', 1);
|
||||
$event->class->groups['customer'] = trans_choice('general.customers', 1);
|
||||
$event->class->groups['vendor'] = trans_choice('general.vendors', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle group applying event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupApplying(ReportGroupApplying $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->applyCustomerGroup($event);
|
||||
$this->applyVendorGroup($event);
|
||||
$this->applyAccountGroup($event);
|
||||
}
|
||||
}
|
||||
84
app/Listeners/Common/IncomeSummaryReport.php
Normal file
84
app/Listeners/Common/IncomeSummaryReport.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
use App\Events\Common\ReportGroupShowing;
|
||||
|
||||
class IncomeSummaryReport extends Listener
|
||||
{
|
||||
protected $class = 'App\Reports\IncomeSummary';
|
||||
|
||||
/**
|
||||
* Handle filter showing event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterShowing(ReportFilterShowing $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->class->filters['years'] = $this->getYears();
|
||||
$event->class->filters['accounts'] = $this->getAccounts();
|
||||
$event->class->filters['categories'] = $this->getIncomeCategories();
|
||||
$event->class->filters['customers'] = $this->getCustomers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle filter applying event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportFilterApplying(ReportFilterApplying $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Apply date
|
||||
$this->applyDateFilter($event);
|
||||
|
||||
// Apply search
|
||||
$this->applySearchStringFilter($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle group showing event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupShowing(ReportGroupShowing $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->class->groups['category'] = trans_choice('general.categories', 1);
|
||||
$event->class->groups['account'] = trans_choice('general.accounts', 1);
|
||||
$event->class->groups['customer'] = trans_choice('general.customers', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle group applying event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handleReportGroupApplying(ReportGroupApplying $event)
|
||||
{
|
||||
if (!$this->checkClass($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->applyCustomerGroup($event);
|
||||
$this->applyAccountGroup($event);
|
||||
}
|
||||
}
|
||||
10
app/Listeners/Common/ProfitLossReport.php
Normal file
10
app/Listeners/Common/ProfitLossReport.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
|
||||
class ProfitLossReport extends Listener
|
||||
{
|
||||
protected $class = 'App\Reports\ProfitLoss';
|
||||
}
|
||||
10
app/Listeners/Common/TaxSummaryReport.php
Normal file
10
app/Listeners/Common/TaxSummaryReport.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
|
||||
class TaxSummaryReport extends Listener
|
||||
{
|
||||
protected $class = 'App\Reports\TaxSummary';
|
||||
}
|
||||
Reference in New Issue
Block a user