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 $icon = 'fa fa-heart';
public $indents = [
'table_header' => '0px',
'table_rows' => '48px',
];
public function setViews() public function setViews()
{ {
parent::setViews(); parent::setViews();

View File

@ -21,10 +21,16 @@ class TaxSummary extends Report
public $icon = 'fa fa-percent'; public $icon = 'fa fa-percent';
public $indents = [
'table_header' => '0px',
'table_rows' => '48px',
];
public function setViews() public function setViews()
{ {
parent::setViews(); parent::setViews();
$this->views['content.header'] = 'reports.tax_summary.content.header'; $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.header'] = 'reports.tax_summary.table.header';
$this->views['table.footer'] = 'reports.tax_summary.table.footer'; $this->views['table.footer'] = 'reports.tax_summary.table.footer';
} }
@ -62,6 +68,17 @@ class TaxSummary extends Report
break; 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') public function setTotals($items, $date_field, $check_type = false, $table = 'default')

View File

@ -2,12 +2,12 @@
@section('new_button') @section('new_button')
<span> <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') }} <span class="fa fa-print"></span> &nbsp;{{ trans('general.print') }}
</a> </a>
</span> </span>
<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') }} <span class="fa fa-upload"></span> &nbsp;{{ trans('general.export') }}
</a> </a>
</span> </span>

View File

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

View File

@ -1,6 +1,6 @@
<tfoot> <tfoot>
<tr class="rp-border-top-1"> <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 @php $grand_total = 0; @endphp
@foreach($class->footer_totals[$table] as $total) @foreach($class->footer_totals[$table] as $total)
@php $grand_total += $total; @endphp @php $grand_total += $total; @endphp

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<tfoot> <tfoot>
<tr class="rp-border-top-1"> <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 @php $grand_total = 0; @endphp
@foreach($class->footer_totals[$table] as $date => $total) @foreach($class->footer_totals[$table] as $date => $total)
@php $grand_total += $total; @endphp @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"> <div class="table-responsive overflow-auto mt-4">
<table class="table align-items-center rp-border-collapse"> <table class="table table-hover align-items-center rp-border-collapse">
<thead class="border-top-style"> <thead class="border-top-style">
<tr> <tr>
<th class="report-column text-right rp-border-bottom-1"></th> <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> <tr>
<th class="rp-float-left" colspan="{{ count($class->dates) + 2 }}"> <th class="rp-float-left" colspan="{{ count($class->dates) + 2 }}">
<h4>{{ $table }}</h4> <h4>{{ $table }}</h4>