fix: 统一财务退货表与厂家端表头

This commit is contained in:
苏木 2026-11-02 22:31:36 +08:00
parent 801df996d4
commit b1ae8eb534
2 changed files with 58 additions and 16 deletions

View File

@ -474,37 +474,41 @@
</p>
@endif
<div class="sr-scroll">
<table class="sr-return-table">
<table class="sr-return-table" data-finance-return-table>
<thead>
<tr>
<th scope="col">发货时间</th><th scope="col">条形码</th><th scope="col">商品名称</th>
<th scope="col">厂家扣减数量</th><th scope="col">厂家扣减金额</th><th scope="col">记账归属</th>
<th scope="col">物流记账数量</th><th scope="col">物流记账金额</th><th scope="col">物流公司</th>
<th scope="col">备注</th><th scope="col">快递单号</th><th scope="col">对账人</th><th scope="col">确认状态</th>
<th scope="col">发货时间</th><th scope="col">明细供应商</th><th scope="col">条形码</th>
<th scope="col">商品名称</th><th scope="col">发货量</th><th scope="col">单价</th>
<th scope="col">金额</th><th scope="col">供应商条码</th><th scope="col">备注</th>
<th scope="col">标题</th><th scope="col">wms配货单号</th><th scope="col">仓库名称</th>
<th scope="col">快递单号</th><th scope="col">类型</th><th scope="col">操作</th>
</tr>
</thead>
<tbody>
@forelse ($financeReturnPanel['rows'] as $row)
<tr @class(['is-logistics' => $row['_accounting_target'] === '物流'])>
<td>{{ $row['send_time'] ?? '—' }}</td>
<td>{{ $row['supplier'] ?? '—' }}</td>
<td>{{ $row['barcode'] ?? '—' }}</td>
<td>{{ $row['sku_name'] ?? '—' }}</td>
<td class="is-num">{{ $row['_accounting_target'] === '不记账' ? '—' : number_format($row['_supplier_qty'], 2) }}</td>
<td class="is-num">{{ $row['_accounting_target'] === '不记账' ? '—' : number_format($row['_supplier_amount'], 2) }}</td>
<td class="is-num">{{ $row['qty'] ?? '—' }}</td>
<td class="is-num">{{ $row['unit_price'] ?? '—' }}</td>
<td class="is-num">{{ $row['amount'] ?? '—' }}</td>
<td>{{ $row['supplier_barcode'] ?? '—' }}</td>
<td>
<span class="sr-tag {{ $row['_accounting_target'] === '物流' ? 'is-logistics' : ($row['_accounting_target'] === '不记账' ? 'is-no-bookkeeping' : 'is-match') }}">
{{ $row['_accounting_label'] }}
</span>
{{ $row['remark'] ?? '—' }}
@if ($row['_accounting_target'] !== '厂家')
<span class="sr-tag {{ $row['_accounting_target'] === '物流' ? 'is-logistics' : 'is-no-bookkeeping' }}">{{ $row['_accounting_label'] }}</span>
@endif
@if ($row['_accounting_note'] !== '按厂家退货扣减')
<div class="sr-muted" style="font-size:.7rem">{{ $row['_accounting_note'] }}</div>
@endif
</td>
<td class="is-num">{{ $row['_logistics_qty'] > 0 ? number_format($row['_logistics_qty'], 2) : '—' }}</td>
<td class="is-num">{{ $row['_logistics_amount'] > 0 ? number_format($row['_logistics_amount'], 2) : '—' }}</td>
<td>{{ $row['_logistics_company'] !== '' ? $row['_logistics_company'] : '—' }}</td>
<td>{{ $row['remark'] ?? '—' }}</td>
<td>{{ $row['title'] ?? '—' }}</td>
<td>{{ $row['wms_pick_no'] ?? '—' }}</td>
<td>{{ $row['warehouse'] ?? '—' }}</td>
<td>{{ $row['express_no'] ?? '—' }}</td>
<td>{{ $row['reconciler'] ?? '—' }}</td>
<td><span class="sr-type-tag">退货</span></td>
<td>
@if ($row['status'] === 'confirmed')
<span class="sr-tag is-match">已确认</span>
@ -516,7 +520,7 @@
</td>
</tr>
@empty
<tr><td colspan="13"><div class="sr-empty">当前月份和对账人筛选下没有退货数据。</div></td></tr>
<tr><td colspan="15"><div class="sr-empty">当前月份和对账人筛选下没有退货数据。</div></td></tr>
@endforelse
</tbody>
</table>

View File

@ -241,6 +241,44 @@ class SupplierReconciliationDingTalkTest extends FeatureTestCase
->assertSee('name="month"', false);
}
public function test_finance_return_table_uses_the_supplier_data_headers(): void
{
$this->seedReconciliation();
$html = $this->loginAs()->get($this->pageUrl())->assertOk()->getContent();
$tableStart = strpos($html, 'data-finance-return-table');
$this->assertNotFalse($tableStart, '财务退货表应正常渲染。');
$headStart = strpos($html, '<thead>', $tableStart);
$headEnd = strpos($html, '</thead>', $headStart);
$this->assertNotFalse($headStart);
$this->assertNotFalse($headEnd);
preg_match_all('/<th scope="col">(.*?)<\/th>/s', substr($html, $headStart, $headEnd - $headStart), $matches);
$headers = array_map(
static fn (string $value): string => html_entity_decode(strip_tags(trim($value))),
$matches[1],
);
$this->assertSame([
'发货时间',
'明细供应商',
'条形码',
'商品名称',
'发货量',
'单价',
'金额',
'供应商条码',
'备注',
'标题',
'wms配货单号',
'仓库名称',
'快递单号',
'类型',
'操作',
], $headers);
}
public function test_monthly_return_push_sends_all_statuses_and_only_the_selected_supplier_month(): void
{
$this->saveRobot();