From b384a05f60c48c2bf94e14bc4d0fbe7261a70eca Mon Sep 17 00:00:00 2001 From: chenxi Date: Sat, 24 Oct 2026 10:37:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=88=90=E6=9C=AC=EF=BC=9A?= =?UTF-8?q?=E6=8E=92=E9=99=A4YUNFEI=E5=92=8CBCJ=E5=8D=A0=E4=BD=8D=E7=BC=96?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/SyncStoreReceiptProductCost.php | 2 ++ .../product-costs.blade.php | 4 ++-- .../Unit/StoreReceiptProductCostLineTest.php | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/SyncStoreReceiptProductCost.php b/app/Console/Commands/SyncStoreReceiptProductCost.php index 6a4fac23..93aeba76 100644 --- a/app/Console/Commands/SyncStoreReceiptProductCost.php +++ b/app/Console/Commands/SyncStoreReceiptProductCost.php @@ -44,6 +44,8 @@ class SyncStoreReceiptProductCost extends Command 'AZF', 'DF-PJZY0001', 'JIAXIANGJIANCAIJIAJUZIZHUANG964A', + 'YUNFEI', + 'BCJ', ]; /** 组合装条码前缀;条码结构为「前缀-组件条码-数量-组件条码-数量」。 */ diff --git a/resources/views/business/pages/financial-operations/product-costs.blade.php b/resources/views/business/pages/financial-operations/product-costs.blade.php index 2d6809c9..a40e9bc0 100644 --- a/resources/views/business/pages/financial-operations/product-costs.blade.php +++ b/resources/views/business/pages/financial-operations/product-costs.blade.php @@ -117,8 +117,8 @@ 拆单只取最末级订单行(没有任何下级的叶子行),主单和中间汇总层不参与、避免重复计数; 同一单分多仓发货的按末级实际仓库分行;虚拟条码(X0000x)不计入; ZH-、MKH- 开头的组合装按「组件条码 + 数量」拆分,无法解析的组合装保留原编码; - 套餐/服务及指定配件、组合装占位编码 TCXJ、FUWU、AZF、DF-PJZY0001、 - JIAXIANGJIANCAIJIAJUZIZHUANG964A 全局不取数(组合装里拆出的这些编码同样剔除)。 + 套餐/服务、运费及指定配件、组合装占位编码 TCXJ、FUWU、AZF、DF-PJZY0001、 + JIAXIANGJIANCAIJIAJUZIZHUANG964A、YUNFEI、BCJ 全局不取数(组合装里拆出的这些编码同样剔除)。 发货仓库默认排除「常州简尚家居有限公司」「简尚-苏州福利品仓」「简尚-自动发货仓」, 其中常州简尚家居有限公司的「DF-」商品行例外保留;先执行商品编码全局排除,再执行仓库过滤。 订单状态为 Cancelled(已取消)的明细行不参与商品成本。 diff --git a/tests/Unit/StoreReceiptProductCostLineTest.php b/tests/Unit/StoreReceiptProductCostLineTest.php index d69774fe..c0f34459 100644 --- a/tests/Unit/StoreReceiptProductCostLineTest.php +++ b/tests/Unit/StoreReceiptProductCostLineTest.php @@ -73,6 +73,26 @@ class StoreReceiptProductCostLineTest extends TestCase $this->assertSame('unique', $result['lines'][0]['platform_mapping_status']); } + public function test_yunfei_and_bcj_are_excluded_globally_and_from_bundle_components(): void + { + $command = new SyncStoreReceiptProductCost(); + $constant = (new \ReflectionClass($command))->getReflectionConstant('EXCLUDED_SKUS'); + $excludedSkus = $constant->getValue(); + + $this->assertContains('YUNFEI', $excludedSkus); + $this->assertContains('BCJ', $excludedSkus); + + $method = new ReflectionMethod($command, 'expandComboSku'); + $method->setAccessible(true); + $components = $method->invoke( + null, + 'MKH-YUNFEI-1-BCJ-1-SG006367N1028V01-2', + 3.0, + ); + + $this->assertSame([['SG006367N1028V01', 6.0, true]], $components); + } + /** @return array{0:list>,1:int,2:int} */ private function costLines(array $rows): array {