reports view alignment updated

This commit is contained in:
batuhanbas 2020-01-28 15:51:36 +03:00
parent e6577b00f1
commit 7136f597d8
11 changed files with 52 additions and 15 deletions

View File

@ -16,6 +16,11 @@ class ProfitLoss extends Report
public $icon = 'fa fa-heart';
public $indents = [
'table_header' => '0px',
'table_rows' => '48px',
];
public function setViews()
{
parent::setViews();

View File

@ -21,10 +21,16 @@ class TaxSummary extends Report
public $icon = 'fa fa-percent';
public $indents = [
'table_header' => '0px',
'table_rows' => '48px',
];
public function setViews()
{
parent::setViews();
$this->views['content.header'] = 'reports.tax_summary.content.header';
$this->views['content.footer'] = 'reports.tax_summary.content.footer';
$this->views['table.header'] = 'reports.tax_summary.table.header';
$this->views['table.footer'] = 'reports.tax_summary.table.footer';
}
@ -62,6 +68,17 @@ class TaxSummary extends Report
break;
}
// TODO: move to views
foreach ($this->footer_totals as $table => $dates) {
foreach ($dates as $date => $total) {
if (!isset($this->net_profit[$date])) {
$this->net_profit[$date] = 0;
}
$this->net_profit[$date] += $total;
}
}
}
public function setTotals($items, $date_field, $check_type = false, $table = 'default')

View File

@ -2,12 +2,12 @@
@section('new_button')
<span>
<a href="{{ url($class->getUrl('print')) }}" target="_blank" class="btn btn-white header-button-top btn-sm">
<a href="{{ url($class->getUrl('print')) }}" target="_blank" class="btn btn-white btn-sm header-button-top">
<span class="fa fa-print"></span> &nbsp;{{ trans('general.print') }}
</a>
</span>
<span>
<a href="{{ url($class->getUrl('export')) }}" class="btn btn-white header-button-top btn-sm">
<a href="{{ url($class->getUrl('export')) }}" class="btn btn-white btn-sm header-button-top">
<span class="fa fa-upload"></span> &nbsp;{{ trans('general.export') }}
</a>
</span>

View File

@ -1,5 +1,5 @@
<div class="table-responsive overflow-auto mt-4">
<table class="table align-items-center rp-border-collapse">
<div class="table-responsive overflow-auto">
<table class="table table-hover align-items-center rp-border-collapse">
@include($class->views['table.header'])
<tbody>
@if (!empty($class->row_values[$table]))

View File

@ -1,6 +1,6 @@
<tfoot>
<tr class="rp-border-top-1">
<th class="report-column text-left">{{ trans_choice('general.totals', 1) }}</th>
<th class="report-column text-left text-uppercase">{{ trans_choice('general.totals', 1) }}</th>
@php $grand_total = 0; @endphp
@foreach($class->footer_totals[$table] as $total)
@php $grand_total += $total; @endphp

View File

@ -1,8 +1,8 @@
<div class="table-responsive overflow-auto mt-5">
<table class="table align-items-center rp-border-collapse">
<div class="table-responsive overflow-auto my-4">
<table class="table table-hover align-items-center rp-border-collapse">
<tfoot class="border-top-style">
<tr class="rp-border-top-1">
<th class="report-column">{{ trans('reports.net_profit') }}</th>
<th class="report-column text-uppercase">{{ trans('reports.net_profit') }}</th>
@foreach($class->net_profit as $profit)
<th class="report-column text-right px-0">@money($profit, setting('default.currency'), true)</th>
@endforeach

View File

@ -1,12 +1,12 @@
<div class="table-responsive overflow-auto">
<table class="table align-items-center rp-border-collapse">
<div class="table-responsive overflow-auto mt-4">
<table class="table table-hover align-items-center rp-border-collapse">
<thead class="border-top-style">
<tr class="rp-border-bottom-1">
<th class="report-column text-right"></th>
@foreach($class->dates as $date)
<th class="report-column text-right px-0">{{ $date }}</th>
@endforeach
<th class="report-column text-right">
<th class="report-column text-right text-uppercase">
{{ trans_choice('general.totals', 1) }}
</th>
</tr>

View File

@ -1,6 +1,6 @@
<tfoot>
<tr class="rp-border-top-1">
<th class="report-column text-left">{{ trans_choice('general.totals', 1) }}</th>
<th class="report-column text-left text-uppercase">{{ trans_choice('general.totals', 1) }}</th>
@php $grand_total = 0; @endphp
@foreach($class->footer_totals[$table] as $date => $total)
@php $grand_total += $total; @endphp

View File

@ -0,0 +1,15 @@
<div class="table-responsive overflow-auto my-4">
<table class="table table-hover align-items-center rp-border-collapse">
<tfoot class="border-top-style">
<tr class="rp-border-top-1">
<th class="report-column text-uppercase">{{ trans('reports.net_profit') }}</th>
@foreach($class->net_profit as $profit)
<th class="report-column text-right px-0">@money($profit, setting('default.currency'), true)</th>
@endforeach
<th class="report-column text-right">
@money(array_sum($class->net_profit), setting('default.currency'), true)
</th>
</tr>
</tfoot>
</table>
</div>

View File

@ -1,5 +1,5 @@
<div class="table-responsive overflow-auto">
<table class="table align-items-center rp-border-collapse">
<div class="table-responsive overflow-auto mt-4">
<table class="table table-hover align-items-center rp-border-collapse">
<thead class="border-top-style">
<tr>
<th class="report-column text-right rp-border-bottom-1"></th>

View File

@ -1,4 +1,4 @@
<thead class="border-top-style">
<thead class="border-top-style mt-4">
<tr>
<th class="rp-float-left" colspan="{{ count($class->dates) + 2 }}">
<h4>{{ $table }}</h4>