akaunting 3.0 (the last dance)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<div class="overflow-x-visible mb-8">
|
||||
<table class="w-full rp-border-collapse">
|
||||
@include($class->views['detail.table.header'])
|
||||
@include($class->views['detail.table.body'])
|
||||
@include($class->views['detail.table.footer'])
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<tbody>
|
||||
@if (!empty($class->row_values[$table_key]))
|
||||
@foreach($class->row_tree_nodes[$table_key] as $id => $node)
|
||||
@include($class->views['detail.table.row'], ['tree_level' => 0])
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="{{ count($class->dates) + 2 }}">
|
||||
<div class="text-muted pl-0">{{ trans('general.no_records') }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
@@ -0,0 +1,11 @@
|
||||
@php $grand_total = array_sum($class->footer_totals[$table_key]); @endphp
|
||||
|
||||
<tfoot>
|
||||
<tr class="px-3">
|
||||
<th class="{{ $class->column_name_width }} text-uppercase text-left">{{ trans_choice('general.totals', 1) }}</th>
|
||||
@foreach($class->footer_totals[$table_key] as $total)
|
||||
<th class="{{ $class->column_value_width }} text-right px-0">{{ $class->has_money ? money($total, default_currency(), true) : $total }}</th>
|
||||
@endforeach
|
||||
<th class="{{ $class->column_name_width }} text-right pl-0 pr-4">{{ $class->has_money ? money($grand_total, default_currency(), true) : $grand_total }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@@ -0,0 +1,13 @@
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
@if (($table_key == 'default') && !empty($class->groups))
|
||||
<th class="{{ $class->column_name_width }}">{{ $class->groups[$class->model->settings->group] }}</th>
|
||||
@else
|
||||
<th class="{{ $class->column_name_width }}">{{ $table_name }}</th>
|
||||
@endif
|
||||
@foreach($class->dates as $date)
|
||||
<th class="{{ $class->column_value_width }} text-right px-0">{{ $date }}</th>
|
||||
@endforeach
|
||||
<th class="{{ $class->column_name_width }} text-right pl-0 pr-4">{{ trans_choice('general.totals', 1) }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -0,0 +1,87 @@
|
||||
<!-- if it HAS NOT subcategories -->
|
||||
@if (is_null($node))
|
||||
@php
|
||||
$rows = $class->row_values[$table_key][$id];
|
||||
@endphp
|
||||
|
||||
@if ($row_total = array_sum($rows))
|
||||
@if (isset($parent_id))
|
||||
<tr class="collapse-sub" data-collapse="child-{{ $parent_id }}">
|
||||
<td class="{{ $class->column_name_width }} py-top text-left text-black-400" style="padding-left: {{ $tree_level * 20 }}px;" title="{{ $class->row_names[$table_key][$id] }}">{{ $class->row_names[$table_key][$id] }}</td>
|
||||
@else
|
||||
<tr>
|
||||
<td class="{{ $class->column_name_width }} py-top text-left text-black-400" title="{{ $class->row_names[$table_key][$id] }}">{{ $class->row_names[$table_key][$id] }}</td>
|
||||
@endif
|
||||
|
||||
@foreach($rows as $row)
|
||||
<td class="{{ $class->column_value_width }} py-top ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row, default_currency(), true) : $row }}</td>
|
||||
@endforeach
|
||||
<td class="{{ $class->column_name_width }} py-top ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total, default_currency(), true) : $row }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<!-- if it HAS subcategories -->
|
||||
@if (is_array($node))
|
||||
<!-- parent part -->
|
||||
@php
|
||||
$parent_row_values = $class->row_values[$table_key][$id];
|
||||
|
||||
array_walk_recursive($node, function ($value, $key) use ($class, $table_key, $id, &$parent_row_values) {
|
||||
if ($key == $id) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($class->row_values[$table_key][$key] as $date => $amount) {
|
||||
$parent_row_values[$date] += $amount;
|
||||
}
|
||||
});
|
||||
@endphp
|
||||
|
||||
@if ($row_total = array_sum($parent_row_values))
|
||||
@if (isset($parent_id))
|
||||
<tr class="collapse-sub" data-collapse="child-{{ $parent_id }}">
|
||||
<td class="{{ $class->column_name_width }} py-top text-left text-black-400" style="padding-left: {{ $tree_level * 20 }}px;" title="{{ $class->row_names[$table_key][$id] }}">
|
||||
@else
|
||||
<tr>
|
||||
<td class="{{ $class->column_name_width }} py-top text-left text-black-400" title="{{ $class->row_names[$table_key][$id] }}">
|
||||
@endif
|
||||
|
||||
{{ $class->row_names[$table_key][$id] }}
|
||||
@if (array_sum($parent_row_values) != array_sum($class->row_values[$table_key][$id]))
|
||||
<button type="button" class="align-text-top" node="child-{{ $id }}" onClick="toggleSub('child-{{ $id }}', event)">
|
||||
<span class="material-icons transform transition-all rotate-90 text-lg leading-none">navigate_next</span>
|
||||
</button>
|
||||
@endif
|
||||
</td>
|
||||
@foreach($parent_row_values as $row)
|
||||
<td class="{{ $class->column_value_width }} py-top ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row, default_currency(), true) : $row }}</td>
|
||||
@endforeach
|
||||
<td class="{{ $class->column_name_width }} py-top ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total, default_currency(), true) : $row }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<!-- no categories part -->
|
||||
@php $rows = $class->row_values[$table_key][$id]; @endphp
|
||||
@if (($row_total = array_sum($rows)) && array_sum($parent_row_values) != array_sum($rows))
|
||||
<tr class="collapse-sub" data-collapse="child-{{ $id }}">
|
||||
<td class="{{ $class->column_name_width }} py-top text-left text-black-400" style="padding-left: {{ ($tree_level + 1) * 20 }}px;" title="{{ $class->row_names[$table_key][$id] }}">{{ $class->row_names[$table_key][$id] }}</td>
|
||||
@foreach($rows as $row)
|
||||
<td class="{{ $class->column_value_width }} py-top ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row, default_currency(), true) : $row }}</td>
|
||||
@endforeach
|
||||
<td class="{{ $class->column_name_width }} py-top ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total, default_currency(), true) : $row }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<!-- subcategories part -->
|
||||
@php
|
||||
$parent_id = $id;
|
||||
$tree_level++;
|
||||
@endphp
|
||||
|
||||
@foreach($node as $id => $node)
|
||||
@if ($parent_id != $id)
|
||||
@include($class->views['detail.table.row'], ['parent_id' => $parent_id, 'tree_level' => $tree_level])
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
Reference in New Issue
Block a user