- | {{ ($finalRows->firstItem() ?? 1) + $index }} |
+ $freezeThroughSupplier])
+ >{{ ($finalRows->firstItem() ?? 1) + $index }} |
@foreach ($finalFields as $field)
@php $value = $row[$field['name']] ?? null; @endphp
- $field['type'] === 'number'])>
+ @php $freezeField = $freezeThroughSupplier && in_array($field['name'], $freezeThroughSupplierFields, true); @endphp
+ | $field['type'] === 'number',
+ 'payables-final-freeze-column' => $freezeField,
+ 'payables-final-freeze-edge' => $freezeThroughSupplier && $field['name'] === 'supplier',
+ ])
+ >
@if ($value === null || $value === '')
-
@elseif ($field['type'] === 'number' && is_numeric($value))
@@ -119,7 +155,7 @@
上一页
@endif
第 {{ $finalRows?->currentPage() ?? 1 }} 页 / 共 {{ $finalRows?->lastPage() ?? 1 }} 页
- · 每页 {{ $finalRows?->perPage() ?? (in_array($finalDataset, ['payment-reconciliation', 'return-reconciliation'], true) ? 15 : 50) }} 条
+ · 每页 {{ $finalRows?->perPage() ?? (in_array($finalDataset, ['payment-reconciliation', 'return-reconciliation', 'supplier-payables-report'], true) ? 15 : 50) }} 条
@if ($finalRows?->hasMorePages())
下一页
@endif
@@ -128,6 +164,51 @@
+@if ($freezeThroughSupplier)
+
+@endif
+
@include('business.pages.supplier-payables.maintenance-blade-modal', [
'content' => ['supplierPayableMaintenance' => $finalMaintenance],
'supplierMaintenanceAction' => $finalActions,
diff --git a/tests/Feature/Business/SupplierPayableFinalPagesTest.php b/tests/Feature/Business/SupplierPayableFinalPagesTest.php
index 954453f1..5ed99193 100644
--- a/tests/Feature/Business/SupplierPayableFinalPagesTest.php
+++ b/tests/Feature/Business/SupplierPayableFinalPagesTest.php
@@ -295,6 +295,53 @@ class SupplierPayableFinalPagesTest extends FeatureTestCase
->assertDontSeeText('PM-01');
}
+ public function test_final_supplier_payables_report_paginates_and_freezes_through_supplier(): void
+ {
+ $records = [];
+ for ($index = 1; $index <= 20; $index++) {
+ $records[sprintf('supplier-payable:%02d', $index)] = [
+ 'summary_month' => '2026-09',
+ 'checker' => sprintf('对账人%02d', $index),
+ 'settlement_method' => '月结',
+ 'company' => sprintf('供应商主体%02d', $index),
+ 'supplier' => sprintf('SUP-%02d', $index),
+ 'express_freight' => '0',
+ ];
+ }
+ app(SupplierPayableOverrideStore::class)->saveBatch(
+ 'final:supplier:supplier-payables-report',
+ $records,
+ (int) $this->company->id,
+ (int) $this->user->id,
+ );
+
+ $baseUrl = route('business.pages.show', [
+ 'company_id' => (int) $this->company->id,
+ 'section' => 'supplier-payables-final',
+ 'page' => 'supplier-payables-report',
+ ]);
+ $url = fn (int $page): string => $baseUrl . '?page=' . $page;
+
+ $this->loginAs()->get($url(1))
+ ->assertOk()
+ ->assertSee('payables-final-table--freeze-through-supplier', false)
+ ->assertSee('data-final-column="summary_month"', false)
+ ->assertSee('data-final-column="supplier"', false)
+ ->assertSee('payables-final-freeze-edge', false)
+ ->assertSee('data-caiwu-replay', false)
+ ->assertSeeText('每页 15 条')
+ ->assertSeeText('第 1 页 / 共 2 页')
+ ->assertSeeText('SUP-01')
+ ->assertDontSeeText('SUP-16');
+
+ $this->loginAs()->get($url(2))
+ ->assertOk()
+ ->assertSeeText('第 2 页 / 共 2 页')
+ ->assertSeeText('SUP-16')
+ ->assertSeeText('SUP-20')
+ ->assertDontSeeText('SUP-01');
+ }
+
public function test_final_import_reads_files_larger_than_one_chunk(): void
{
$lines = ['月份,入库单号,采购单号,日期,供应商,货号,商品编码,规格名称,数量,单价,金额,预估单价,预估金额,供应商商品编码,备注,仓库名称,快递名称,快递单号,未发出,对账人'];
|