diff --git a/app/Utilities/SidebarMenu.php b/app/Utilities/SidebarMenu.php index 4945be32..bb19c2f1 100644 --- a/app/Utilities/SidebarMenu.php +++ b/app/Utilities/SidebarMenu.php @@ -22,6 +22,7 @@ class SidebarMenu ['title' => '经营报表', 'items' => [ ['financial-operations', 'ledger', '财务台账', 'menu_book'], ['financial-operations', 'shop-flows', '店铺收支明细', 'receipt_long'], + ['financial-operations', 'independent-company-reconciliation', '独立公司对账', 'fact_check'], ['company-management', 'subject-operating-report', '主体维度经营报表', 'domain'], ['company-management', 'company-cost-arrangement', '公司成本安排', 'account_balance_wallet'], ['company-management', 'tax-forecast', '税金预测表', 'calculate'], diff --git a/app/Utilities/SidebarPermissions.php b/app/Utilities/SidebarPermissions.php index b3806f53..5509ffdc 100644 --- a/app/Utilities/SidebarPermissions.php +++ b/app/Utilities/SidebarPermissions.php @@ -407,9 +407,10 @@ class SidebarPermissions $normalizedKey = self::LEGACY_PAGE_KEYS[$key] ?? $key; $normalized[] = $normalizedKey; - // 店铺收支明细与财务台账同组授权,旧台账页面权限自动获得新页面入口。 + // 店铺收支明细、独立公司对账与财务台账同组授权,旧台账页面权限自动获得新页面入口。 if ($normalizedKey === 'financial-operations/ledger') { $normalized[] = 'financial-operations/shop-flows'; + $normalized[] = 'financial-operations/independent-company-reconciliation'; } // 「过账数据」紧随店铺应收账款展示;旧权限配置没有新菜单键时, diff --git a/config/business_navigation.php b/config/business_navigation.php index 357bbdf1..d4a6c3bf 100644 --- a/config/business_navigation.php +++ b/config/business_navigation.php @@ -1000,6 +1000,7 @@ $navigation = [ ['slug' => 'bookkeeping-details', 'title' => '记账明细'], ['slug' => 'non-operating-expenses', 'title' => '营业外支出'], ['slug' => 'financial-analysis', 'title' => '财务经营分析表'], + ['slug' => 'independent-company-reconciliation', 'title' => '独立公司对账'], ['slug' => 'ledger', 'title' => '财务台账', 'show_in_section_menu' => false], ['slug' => 'shop-flows', 'title' => '店铺收支明细'], ], diff --git a/tests/Feature/Business/FinanceLedgerNavigationTest.php b/tests/Feature/Business/FinanceLedgerNavigationTest.php index ffd0ce99..0250d0f6 100644 --- a/tests/Feature/Business/FinanceLedgerNavigationTest.php +++ b/tests/Feature/Business/FinanceLedgerNavigationTest.php @@ -45,6 +45,25 @@ class FinanceLedgerNavigationTest extends FeatureTestCase 'title' => '店铺收支明细', 'icon' => 'receipt_long', ], $reports['items'][1]); + $this->assertSame([ + 'section' => 'financial-operations', + 'page' => 'independent-company-reconciliation', + 'title' => '独立公司对账', + 'icon' => 'fact_check', + ], $reports['items'][2]); + } + + public function test_independent_company_reconciliation_page_opens_from_operating_reports(): void + { + $this->loginAs() + ->get(route('business.pages.show', [ + 'section' => 'financial-operations', + 'page' => 'independent-company-reconciliation', + ])) + ->assertOk() + ->assertSeeText('财务经营报表') + ->assertSeeText('独立公司对账') + ->assertSeeText('该页面暂未配置数据表,敬请期待。'); } public function test_ledger_page_and_legacy_link_open_under_financial_operations(): void @@ -113,13 +132,20 @@ class FinanceLedgerNavigationTest extends FeatureTestCase ]); $this->assertSame( - ['financial-operations/ledger', 'financial-operations/shop-flows'], + [ + 'financial-operations/ledger', + 'financial-operations/shop-flows', + 'financial-operations/independent-company-reconciliation', + ], SidebarPermissions::allowedKeys($regular) ); $navigation = SidebarPermissions::navigationFor($regular); $this->assertSame(['financial-operations'], array_column($navigation, 'slug')); - $this->assertSame(['ledger', 'shop-flows'], array_column($navigation[0]['pages'], 'slug')); + $this->assertSame( + ['independent-company-reconciliation', 'ledger', 'shop-flows'], + array_column($navigation[0]['pages'], 'slug') + ); } $this->loginAs($regular)