diff --git a/modules/EcommerceFinance/Services/AccountMappingStore.php b/modules/EcommerceFinance/Services/AccountMappingStore.php index 9e8e505f..816439dd 100644 --- a/modules/EcommerceFinance/Services/AccountMappingStore.php +++ b/modules/EcommerceFinance/Services/AccountMappingStore.php @@ -56,7 +56,7 @@ class AccountMappingStore ]; /** 票据口径可取值 */ - public const INVOICES = ['0.06', '不开票', '-']; + public const INVOICES = ['0.06', '0.09', '不开票', '-']; /** * 存储目录。 diff --git a/tests/Feature/Business/AccountMappingPageTest.php b/tests/Feature/Business/AccountMappingPageTest.php index 8608a44b..d944e52a 100644 --- a/tests/Feature/Business/AccountMappingPageTest.php +++ b/tests/Feature/Business/AccountMappingPageTest.php @@ -246,4 +246,31 @@ class AccountMappingPageTest extends FeatureTestCase $this->assertSame('不开票', $rule['invoice']); $this->assertSame('支出基准', $rule['basis']); } + + /** 9% 票据口径(京东短信服务费)并入常用取值,页面下拉可选且不再报提示。 */ + public function test_nine_percent_invoice_is_a_known_option(): void + { + $this->grantAdminPermission(); + + $this->assertContains('0.09', AccountMappingStore::INVOICES); + + $invoices = $this->loginAs()->getJson($this->rulesUrl())->assertOk()->json('options.invoices'); + $this->assertContains('0.09', $invoices); + + $issues = app(AccountMappingValidator::class)->validate([[ + 'id' => 9001, + 'platform' => '京东', + 'item' => '短信服务费', + 'memo' => '销售费用手续费', + 'invoice' => '0.09', + 'category' => '平台服务费', + 'dAcct' => '销售费用', + 'dSub' => '', + 'cAcct' => '其他货币资金', + 'cSub' => '', + 'basis' => '支出基准', + ]])['issues'][9001] ?? []; + + $this->assertNotContains('invoice_unknown', array_column($issues, 'code')); + } }