feat: 经营报表新增独立公司对账入口 (#1079)

This commit is contained in:
DoDo 2026-11-11 14:54:56 +08:00
parent c5a525695b
commit 0fbbae4b97
4 changed files with 32 additions and 3 deletions

View File

@ -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'],

View File

@ -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';
}
// 「过账数据」紧随店铺应收账款展示;旧权限配置没有新菜单键时,

View File

@ -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' => '店铺收支明细'],
],

View File

@ -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)