v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View 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);
}
}

View 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);
}
}

View 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);
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Listeners\Common;
use App\Abstracts\Reports\Listener;
class ProfitLossReport extends Listener
{
protected $class = 'App\Reports\ProfitLoss';
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Listeners\Common;
use App\Abstracts\Reports\Listener;
class TaxSummaryReport extends Listener
{
protected $class = 'App\Reports\TaxSummary';
}