diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php
index a4a8d0064..9b16044a3 100644
--- a/app/Abstracts/Report.php
+++ b/app/Abstracts/Report.php
@@ -67,8 +67,8 @@ abstract class Report
'datasets' => [],
];
- public $column_width = 'report-column';
- public $head_column_width = 'head_report_column';
+ public $column_name_width = 'report-column-name';
+ public $column_value_width = 'report-column-value';
public function __construct(Model $model = null, $load_data = true)
{
@@ -79,8 +79,6 @@ abstract class Report
}
$this->model = $model;
- $this->setHeadColumnWidth();
- $this->setDataColumnWidth();
if (!$load_data) {
return;
@@ -100,6 +98,7 @@ abstract class Report
$this->setFilters();
$this->setRows();
$this->setData();
+ $this->setColumnWidth();
$this->loaded = true;
}
@@ -203,33 +202,13 @@ abstract class Report
return \Excel::download(new Export($this->views['content'], $this), \Str::filename($this->model->name) . '.xlsx');
}
- public function setHeadColumnWidth()
+ public function setColumnWidth()
{
if (empty($this->model->settings->period)) {
return;
}
- $head_width = 'head_report_column';
-
- switch ($this->model->settings->period) {
- case 'quarterly':
- $head_width = 'col-sm-2';
- break;
- case 'yearly':
- $head_width = 'col-sm-4';
- break;
- }
-
- $this->head_column_width = $head_width;
- }
-
- public function setDataColumnWidth()
- {
- if (empty($this->model->settings->period)) {
- return;
- }
-
- $width = 'report-column';
+ $width = '';
switch ($this->model->settings->period) {
case 'quarterly':
@@ -240,7 +219,11 @@ abstract class Report
break;
}
- $this->column_width = $width;
+ if (empty($width)) {
+ return;
+ }
+
+ $this->column_name_width = $this->column_value_width = $width;
}
public function setYear()
diff --git a/public/css/custom.css b/public/css/custom.css
index 98f8ec13e..62dbd3de2 100644
--- a/public/css/custom.css
+++ b/public/css/custom.css
@@ -634,15 +634,7 @@ table .align-items-center td span.badge
/*--------Report Column--------*/
-.report-column
-{
- -webkit-box-flex: 0;
- -ms-flex: 0 0 6.66%;
- flex: 0 0 6.66%;
- max-width: 6.66%;
-}
-
-.head_report_column
+.report-column-name
{
-webkit-box-flex: 0;
-ms-flex: 0 0 10%;
@@ -650,6 +642,14 @@ table .align-items-center td span.badge
width: 10%;
max-width: 10%;
}
+
+.report-column-value
+{
+ -webkit-box-flex: 0;
+ -ms-flex: 0 0 6.66%;
+ flex: 0 0 6.66%;
+ max-width: 6.66%;
+}
/*--------Report Column Finish--------*/
diff --git a/resources/views/partials/reports/table/footer.blade.php b/resources/views/partials/reports/table/footer.blade.php
index aae77f330..7464aa6b6 100644
--- a/resources/views/partials/reports/table/footer.blade.php
+++ b/resources/views/partials/reports/table/footer.blade.php
@@ -1,11 +1,11 @@
- | {{ trans_choice('general.totals', 1) }} |
+ {{ trans_choice('general.totals', 1) }} |
@php $grand_total = 0; @endphp
@foreach($class->footer_totals[$table] as $total)
@php $grand_total += $total; @endphp
- @money($total, setting('default.currency'), true) |
+ @money($total, setting('default.currency'), true) |
@endforeach
- @money($grand_total, setting('default.currency'), true) |
+ @money($grand_total, setting('default.currency'), true) |
diff --git a/resources/views/partials/reports/table/header.blade.php b/resources/views/partials/reports/table/header.blade.php
index e4dfb3bc1..c4d0edd32 100644
--- a/resources/views/partials/reports/table/header.blade.php
+++ b/resources/views/partials/reports/table/header.blade.php
@@ -1,13 +1,13 @@
@if (($table == 'default') && !empty($class->groups))
- | {{ $class->groups[$class->model->settings->group] }} |
+ {{ $class->groups[$class->model->settings->group] }} |
@else
- {{ $table }} |
+ {{ $table }} |
@endif
@foreach($class->dates as $date)
- {{ $date }} |
+ {{ $date }} |
@endforeach
- {{ trans_choice('general.totals', 1) }} |
+ {{ trans_choice('general.totals', 1) }} |
diff --git a/resources/views/partials/reports/table/rows.blade.php b/resources/views/partials/reports/table/rows.blade.php
index 5b62bebc8..9ae064ea4 100644
--- a/resources/views/partials/reports/table/rows.blade.php
+++ b/resources/views/partials/reports/table/rows.blade.php
@@ -1,9 +1,9 @@
@php $row_total = 0; @endphp
- | {{ $class->row_names[$table][$id] }} |
+ {{ $class->row_names[$table][$id] }} |
@foreach($rows as $row)
@php $row_total += $row; @endphp
- @money($row, setting('default.currency'), true) |
+ @money($row, setting('default.currency'), true) |
@endforeach
- @money($row_total, setting('default.currency'), true) |
+ @money($row_total, setting('default.currency'), true) |
diff --git a/resources/views/reports/profit_loss/content/footer.blade.php b/resources/views/reports/profit_loss/content/footer.blade.php
index f7091fb6b..0344cba21 100644
--- a/resources/views/reports/profit_loss/content/footer.blade.php
+++ b/resources/views/reports/profit_loss/content/footer.blade.php
@@ -1,12 +1,12 @@
-
+
- | {{ trans('reports.net_profit') }} |
+ {{ trans('reports.net_profit') }} |
@foreach($class->net_profit as $profit)
- @money($profit, setting('default.currency'), true) |
+ @money($profit, setting('default.currency'), true) |
@endforeach
-
+ |
@money(array_sum($class->net_profit), setting('default.currency'), true)
|
diff --git a/resources/views/reports/profit_loss/content/header.blade.php b/resources/views/reports/profit_loss/content/header.blade.php
index d67f42022..77bb48802 100644
--- a/resources/views/reports/profit_loss/content/header.blade.php
+++ b/resources/views/reports/profit_loss/content/header.blade.php
@@ -2,11 +2,11 @@
- |
+ |
@foreach($class->dates as $date)
- {{ $date }} |
+ {{ $date }} |
@endforeach
-
+ |
{{ trans_choice('general.totals', 1) }}
|
diff --git a/resources/views/reports/profit_loss/table/footer.blade.php b/resources/views/reports/profit_loss/table/footer.blade.php
index 92cc749f3..469f393a5 100644
--- a/resources/views/reports/profit_loss/table/footer.blade.php
+++ b/resources/views/reports/profit_loss/table/footer.blade.php
@@ -1,11 +1,11 @@
-
- | {{ trans_choice('general.totals', 1) }} |
+
+ | {{ trans_choice('general.totals', 1) }} |
@php $grand_total = 0; @endphp
@foreach($class->footer_totals[$table] as $date => $total)
@php $grand_total += $total; @endphp
- @money($total, setting('default.currency'), true) |
+ @money($total, setting('default.currency'), true) |
@endforeach
- @money($grand_total, setting('default.currency'), true) |
+ @money($grand_total, setting('default.currency'), true) |