fix(财务经营分析): 排除京东网银钱包 (#1491)

This commit is contained in:
chenxi 2026-11-26 22:42:16 +08:00
parent 7de0d3370f
commit 50f5c7bc64
3 changed files with 15 additions and 1 deletions

View File

@ -3725,6 +3725,9 @@ class Pages extends Controller
$promotionExpenseAvailable ? ($promotionExpenseBucketsByMonth[$reportMonth] ?? []) : null,
$installationExpenseAvailable ? ($installationExpenseBucketsByMonth[$reportMonth] ?? []) : null,
) as $values) {
if (in_array((string) $values['platform'], self::RECEIPT_MATCH_EXCLUDED_PLATFORMS, true)) {
continue;
}
if ($filters['platform'] !== '' && $values['platform'] !== $filters['platform']) {
continue;
}

View File

@ -87,6 +87,7 @@
推广费用-有票取聚水潭「平台费用(新)→ 推广费(店铺)」按店铺月度支出汇总。
安装费取安装明细中客服审核为“已审核”、按客服审核时间归属月份,并汇总结算明细金额;
同一店铺出现多个平台行时,安装费归入申报收入最高的一行,避免重复计入。
京东网银钱包不纳入本表。
快递运费、售后费用-小额打款、管理费用和人工费用尚未建立统一的店铺月汇总,显示为“—”;
上述费用口径齐备后自动计算净利润。
</div>

View File

@ -317,6 +317,12 @@ class NavigationTest extends FeatureTestCase
'store_name' => '测试店铺',
'product_cost' => 300,
]);
DB::connection('business_mirror')->table('store_receipt_product_cost_rows')->insert([
'report_month' => '2026-11-01',
'platform' => '京东网银钱包',
'store_name' => '钱包成本店铺',
'product_cost' => 999,
]);
$this->app->instance(BillingDetailsPageData::class, new class {
public function expenseBucketsForMonth(string $reportMonth): array
{
@ -359,7 +365,9 @@ class NavigationTest extends FeatureTestCase
->assertSeeText('30.00')
->assertSeeText('50.00')
->assertSeeText('推广费用-有票合计')
->assertSeeText('安装费合计');
->assertSeeText('安装费合计')
->assertDontSee('<td>京东网银钱包</td>', false)
->assertDontSeeText('钱包成本店铺');
$csv = $this->loginAs()
->get(route('business.financial-operations.financial-analysis.export'))
@ -368,6 +376,8 @@ class NavigationTest extends FeatureTestCase
'2026-11,,,,淘系支付宝,测试店铺,1000.00,-40.00,-80.00,880.00,300.00,,50.00,10.00,20.00,30.00',
$csv,
);
$this->assertStringNotContainsString('京东网银钱包', $csv);
$this->assertStringNotContainsString('钱包成本店铺', $csv);
$csvRows = array_map(
static fn (string $line): array => str_getcsv($line, ',', '"', '\\'),
preg_split('/\r\n|\n|\r/', trim($csv)) ?: [],