CaiWuXiTong/resources/views/business/pages/company-management/tax-forecast-data-logic.blade.php

184 lines
8.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@php
use Modules\EcommerceFinance\Services\TaxForecastLogic;
$parameterRows = [
['label' => '小规模增值税征收率', 'value' => ($taxSettings['vat_small_rate'] ?? '1') . '%', 'hint' => '超过免税额度时按不含税销售额计算'],
['label' => '小规模季度免税额度', 'value' => number_format((float) ($taxSettings['vat_free_threshold'] ?? 0)) . ' 元/季', 'hint' => '季度不含税销售额不超过该额度时增值税为 0'],
['label' => '一般纳税人进销项抵扣', 'value' => ($taxSettings['vat_general_enabled'] ?? '1') === '1' ? '开启' : '关闭', 'hint' => '关闭后一般纳税人按销项税额全额提示'],
['label' => '城建税税率', 'value' => ($taxSettings['surtax_city_rate'] ?? '7') . '%', 'hint' => '市区 7%、县城/镇 5%、其他 1%'],
['label' => '教育费附加', 'value' => ($taxSettings['surtax_education_rate'] ?? '3') . '%', 'hint' => '以预计增值税为计税依据'],
['label' => '地方教育附加', 'value' => ($taxSettings['surtax_local_education_rate'] ?? '2') . '%', 'hint' => '以预计增值税为计税依据'],
['label' => '六税两费减半', 'value' => ($taxSettings['surtax_halved'] ?? '1') === '1' ? '开启' : '关闭', 'hint' => '附加税费减半征收'],
['label' => '印花税税率(购销合同)', 'value' => ($taxSettings['stamp_duty_rate'] ?? '0.03') . '%', 'hint' => '按购销合同金额计算'],
['label' => '印花税减半', 'value' => ($taxSettings['stamp_duty_halved'] ?? '1') === '1' ? '开启' : '关闭', 'hint' => '小规模、小微减半征收'],
['label' => '小型微利企业所得税实际税负', 'value' => ($taxSettings['cit_effective_rate'] ?? '5') . '%', 'hint' => '应纳税所得额 × 25% × 20%'],
['label' => '年应纳税所得额上限', 'value' => number_format((float) ($taxSettings['cit_threshold'] ?? 0)) . ' 元', 'hint' => '超过上限部分提示分段计算'],
['label' => '个体工商户减半上限', 'value' => number_format((float) ($taxSettings['individual_halved_threshold'] ?? 0)) . ' 元', 'hint' => '经营所得个人所得税减半'],
['label' => '核定应税所得率默认值', 'value' => ($taxSettings['assessed_income_rate'] ?? '10') . '%', 'hint' => '核定征收主体未单独维护时按此默认值'],
['label' => '收入预测口径', 'value' => TaxForecastLogic::INCOME_FORECAST_SOURCES[$taxSettings['income_forecast_source'] ?? ''] ?? '上月实际收入(bills.income)', 'hint' => '预测月份未出账时取值方式'],
];
@endphp
<style>
.data-logic-page { margin-top: 1.5rem; }
.data-logic-note {
padding: 1rem 1.25rem;
border: 1px solid var(--vip-border, #d8d2c7);
border-radius: 0.75rem;
background: var(--vip-surface, #ffffff);
color: var(--vip-content-ink, #171717);
font-size: 0.875rem;
line-height: 1.5rem;
}
.data-logic-card {
margin-top: 1.25rem;
overflow: hidden;
border: 1px solid var(--vip-border, #d8d2c7);
border-radius: 0.75rem;
background: var(--vip-surface, #ffffff);
}
.data-logic-card h3 {
margin: 0;
padding: 0.9rem 1.1rem;
border-bottom: 1px solid var(--vip-border, #e5e0d6);
font-size: 0.9375rem;
font-weight: 600;
}
.data-logic-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.data-logic-table th {
padding: 0.65rem 0.9rem;
border-bottom: 1px solid var(--vip-border, #e5e0d6);
background: #faf8f4;
color: #6b6455;
font-weight: 600;
text-align: left;
white-space: nowrap;
}
.data-logic-table td {
padding: 0.7rem 0.9rem;
border-bottom: 1px solid #f0ece4;
color: #33302a;
vertical-align: top;
line-height: 1.4rem;
}
.data-logic-table tr:last-child td { border-bottom: 0; }
.data-logic-code { font-weight: 600; color: #8a6d1f; white-space: nowrap; }
.data-logic-category { white-space: nowrap; }
.data-logic-tag {
display: inline-block;
padding: 0.1rem 0.45rem;
border-radius: 0.4rem;
background: #f4efe3;
color: #7a6428;
font-size: 0.75rem;
white-space: nowrap;
}
.data-logic-tag.is-pending { background: #fdeeee; color: #9c2f2f; }
.data-logic-value { font-weight: 600; color: #2a2927; white-space: nowrap; }
.data-logic-health { margin-top: 0.35rem; color: #7c7565; font-size: 0.75rem; line-height: 1.15rem; }
.data-logic-edit-button {
padding: 0.45rem 1.1rem;
border-radius: 0.45rem;
background: #2a2927;
color: #f2e7c5 !important;
font-size: 0.8125rem;
text-decoration: none;
white-space: nowrap;
}
</style>
<div class="data-logic-page">
<div class="data-logic-note" style="display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem;">
<span>规则参数由负责人维护,保存后下次预测按新参数计算。</span>
<a class="data-logic-edit-button" href="{{ route('business.tax-forecast-logic.edit') }}">编辑配置</a>
</div>
<div class="data-logic-note">
本页是税金预测表当前实际使用的计算口径,与 <code>docs/税金预测表需求说明.md</code> 保持一致;
工商类型、征收方式(查账/核定)接入前,涉及所得税的列在预测表中留空,不做推测。
<a href="{{ route('business.pages.show', ['section' => 'company-management', 'page' => 'tax-forecast']) }}" style="color: #8a6d1f;">返回税金预测表</a>
</div>
<div class="data-logic-card">
<h3>当前运行参数</h3>
<table class="data-logic-table">
<thead>
<tr>
<th>参数</th>
<th>当前值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
@foreach ($parameterRows as $row)
<tr>
<td>{{ $row['label'] }}</td>
<td class="data-logic-value">{{ $row['value'] }}</td>
<td>{{ $row['hint'] }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="data-logic-card">
<h3>数据来源</h3>
<table class="data-logic-table">
<thead>
<tr>
<th>来源</th>
<th>对象</th>
<th>状态</th>
<th>说明</th>
</tr>
</thead>
<tbody>
@foreach ($taxHealth as $source)
<tr>
<td>{{ $source['name'] }}</td>
<td><code>{{ $source['object'] }}</code></td>
<td>
<span class="data-logic-tag {{ $source['status'] === '已同步' ? '' : 'is-pending' }}">{{ $source['status'] }}</span>
</td>
<td>
{{ $source['detail'] !== '' ? $source['detail'] : '—' }}
<div class="data-logic-health">收入口径:主体维度经营报表同源(bills.income);成本口径:公司成本安排页。</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="data-logic-card">
<h3>规则清单</h3>
<table class="data-logic-table">
<thead>
<tr>
<th>规则编号</th>
<th>规则类别</th>
<th>规则对象</th>
<th>规则逻辑</th>
<th>数据来源</th>
<th>优先级说明</th>
<th>状态</th>
</tr>
</thead>
<tbody>
@foreach ($taxRules as $category => $categoryRules)
@foreach ($categoryRules as $rule)
<tr>
<td class="data-logic-code">{{ $rule['code'] }}</td>
<td class="data-logic-category">{{ $category }}</td>
<td>{{ $rule['object'] }}</td>
<td>{{ $rule['logic'] }}</td>
<td>{{ $rule['source'] }}</td>
<td>{{ $rule['priority'] }}</td>
<td><span class="data-logic-tag">已生效</span></td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div>
</div>