report fields
This commit is contained in:
@@ -9,6 +9,8 @@ use App\Utilities\Recurring;
|
||||
|
||||
class ExpenseSummary extends Report
|
||||
{
|
||||
public $default_name = 'reports.summary.expense';
|
||||
|
||||
public $icon = 'fa fa-shopping-cart';
|
||||
|
||||
public $chart = [
|
||||
@@ -26,21 +28,11 @@ class ExpenseSummary extends Report
|
||||
],
|
||||
];
|
||||
|
||||
public function getDefaultName()
|
||||
{
|
||||
return trans('reports.summary.expense');
|
||||
}
|
||||
|
||||
public function getCategory()
|
||||
{
|
||||
return trans('reports.income_expense');
|
||||
}
|
||||
|
||||
public function getTotals()
|
||||
{
|
||||
$payments = $this->applyFilters(Transaction::type('expense')->isNotTransfer(), ['date_field' => 'paid_at'])->get();
|
||||
|
||||
switch ($this->report->basis) {
|
||||
switch ($this->model->settings->basis) {
|
||||
case 'cash':
|
||||
// Payments
|
||||
$this->setTotals($payments, 'paid_at');
|
||||
|
||||
@@ -10,24 +10,16 @@ use App\Utilities\Recurring;
|
||||
|
||||
class IncomeExpenseSummary extends Report
|
||||
{
|
||||
public $default_name = 'reports.summary.income_expense';
|
||||
|
||||
public $icon = 'fa fa-chart-pie';
|
||||
|
||||
public function getDefaultName()
|
||||
{
|
||||
return trans('reports.summary.income_expense');
|
||||
}
|
||||
|
||||
public function getCategory()
|
||||
{
|
||||
return trans('reports.income_expense');
|
||||
}
|
||||
|
||||
public function getTotals()
|
||||
{
|
||||
$income_transactions = $this->applyFilters(Transaction::type('income')->isNotTransfer(), ['date_field' => 'paid_at'])->get();
|
||||
$expense_transactions = $this->applyFilters(Transaction::type('expense')->isNotTransfer(), ['date_field' => 'paid_at'])->get();
|
||||
|
||||
switch ($this->report->basis) {
|
||||
switch ($this->model->settings->basis) {
|
||||
case 'cash':
|
||||
// Income Transactions
|
||||
$this->setTotals($income_transactions, 'paid_at', true);
|
||||
|
||||
@@ -9,6 +9,8 @@ use App\Utilities\Recurring;
|
||||
|
||||
class IncomeSummary extends Report
|
||||
{
|
||||
public $default_name = 'reports.summary.income';
|
||||
|
||||
public $icon = 'fa fa-money-bill';
|
||||
|
||||
public $chart = [
|
||||
@@ -26,21 +28,11 @@ class IncomeSummary extends Report
|
||||
],
|
||||
];
|
||||
|
||||
public function getDefaultName()
|
||||
{
|
||||
return trans('reports.summary.income');
|
||||
}
|
||||
|
||||
public function getCategory()
|
||||
{
|
||||
return trans('reports.income_expense');
|
||||
}
|
||||
|
||||
public function getTotals()
|
||||
{
|
||||
$transactions = $this->applyFilters(Transaction::type('income')->isNotTransfer(), ['date_field' => 'paid_at'])->get();
|
||||
|
||||
switch ($this->report->basis) {
|
||||
switch ($this->model->settings->basis) {
|
||||
case 'cash':
|
||||
// Transactions
|
||||
$this->setTotals($transactions, 'paid_at');
|
||||
|
||||
@@ -11,20 +11,14 @@ use App\Utilities\Recurring;
|
||||
|
||||
class ProfitLoss extends Report
|
||||
{
|
||||
public $default_name = 'reports.profit_loss';
|
||||
|
||||
public $category = 'general.accounting';
|
||||
|
||||
public $icon = 'fa fa-heart';
|
||||
|
||||
public $chart = false;
|
||||
|
||||
public function getDefaultName()
|
||||
{
|
||||
return trans('reports.profit_loss');
|
||||
}
|
||||
|
||||
public function getCategory()
|
||||
{
|
||||
return trans('general.accounting');
|
||||
}
|
||||
|
||||
public function setViews()
|
||||
{
|
||||
parent::setViews();
|
||||
@@ -73,7 +67,7 @@ class ProfitLoss extends Report
|
||||
$income_transactions = $this->applyFilters(Transaction::type('income')->isNotTransfer(), ['date_field' => 'paid_at'])->get();
|
||||
$expense_transactions = $this->applyFilters(Transaction::type('expense')->isNotTransfer(), ['date_field' => 'paid_at'])->get();
|
||||
|
||||
switch ($this->report->basis) {
|
||||
switch ($this->model->settings->basis) {
|
||||
case 'cash':
|
||||
// Income Transactions
|
||||
$this->setTotals($income_transactions, 'paid_at', true, $this->tables['income']);
|
||||
|
||||
@@ -15,20 +15,14 @@ class TaxSummary extends Report
|
||||
{
|
||||
use Currencies;
|
||||
|
||||
public $default_name = 'reports.summary.tax';
|
||||
|
||||
public $category = 'general.accounting';
|
||||
|
||||
public $icon = 'fa fa-percent';
|
||||
|
||||
public $chart = false;
|
||||
|
||||
public function getDefaultName()
|
||||
{
|
||||
return trans('reports.summary.tax');
|
||||
}
|
||||
|
||||
public function getCategory()
|
||||
{
|
||||
return trans('general.accounting');
|
||||
}
|
||||
|
||||
public function setViews()
|
||||
{
|
||||
parent::setViews();
|
||||
@@ -54,7 +48,7 @@ class TaxSummary extends Report
|
||||
|
||||
public function getTotals()
|
||||
{
|
||||
switch ($this->report->basis) {
|
||||
switch ($this->model->settings->basis) {
|
||||
case 'cash':
|
||||
// Invoice Payments
|
||||
$invoices = $this->applyFilters(Transaction::type('income')->isDocument()->with(['invoice', 'invoice.totals'])->isNotTransfer(), ['date_field' => 'paid_at'])->get();
|
||||
|
||||
Reference in New Issue
Block a user