44 lines
2.3 KiB
PHP
44 lines
2.3 KiB
PHP
@php
|
|
// Determine which fields to show based on active tab
|
|
$isInputTab = isset($activeTab) && $activeTab['slug'] === 'input';
|
|
$pageTitle = $isInputTab ? '进项报表' : '销项报表';
|
|
if ($isInputTab) {
|
|
$displayFields = ['id', 'company_name', 'input_goods_amount', 'input_goods_tax', 'input_service_amount', 'input_service_tax', 'input_total_amount', 'input_total_tax'];
|
|
$displayHeaders = ['序号', '公司名称', '商品金额', '商品税额', '服务费金额', '服务费税额', '金额合计', '税额合计'];
|
|
} else {
|
|
$displayFields = ['id', 'company_name', 'output_goods_amount', 'output_goods_tax', 'output_service_amount', 'output_service_tax', 'output_total_amount', 'output_total_tax'];
|
|
$displayHeaders = ['序号', '公司名称', '商品金额', '商品税额', '服务费金额', '服务费税额', '金额合计', '税额合计'];
|
|
}
|
|
@endphp
|
|
<div class="business-page-header">
|
|
<span class="business-page-title">{{ $pageTitle ?? '发票数据报表' }}</span>
|
|
</div>
|
|
<div class="business-table-container">
|
|
<table class="business-table">
|
|
<thead>
|
|
<tr>
|
|
@foreach($displayHeaders as $h)
|
|
<th>{{ $h }}</th>
|
|
@endforeach
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($items as $item)
|
|
<tr>
|
|
@foreach($displayFields as $f)
|
|
@if($f === 'id')
|
|
<td>{{ $loop->iteration }}</td>
|
|
@elseif(in_array($f, ['input_goods_amount', 'input_goods_tax', 'input_service_amount', 'input_service_tax', 'input_total_amount', 'input_total_tax', 'output_goods_amount', 'output_goods_tax', 'output_service_amount', 'output_service_tax', 'output_total_amount', 'output_total_tax']))
|
|
<td>{{ number_format($item->$f, 2) }}</td>
|
|
@else
|
|
<td>{{ $item->$f }}</td>
|
|
@endif
|
|
@endforeach
|
|
</tr>
|
|
@endforeach
|
|
@if($items->isEmpty())
|
|
<tr><td colspan="{{ count($displayHeaders) }}" style="text-align:center; color:#9ca3af; padding:2rem;">暂无数据</td></tr>
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div> |