diff --git a/app/Console/Commands/SyncStoreReceiptProductCost.php b/app/Console/Commands/SyncStoreReceiptProductCost.php index 8ddda55d..75a3848a 100644 --- a/app/Console/Commands/SyncStoreReceiptProductCost.php +++ b/app/Console/Commands/SyncStoreReceiptProductCost.php @@ -307,6 +307,11 @@ class SyncStoreReceiptProductCost extends Command $mismatchRows = 0; foreach ($billByCore as $core => $bill) { + // 展示单号与业绩明细完全一致;$core 只用于订单侧清洗后匹配。 + $displayOrderNo = (string) ($bill->online_order_no ?? ''); + if ($displayOrderNo === '') { + $displayOrderNo = $core; + } foreach ($this->costLines($lines[$core] ?? []) as $line) { $short = $shortNames['by_provider'][$line['warehouse']] ?? ''; $price = $short !== '' ? ($prices[$short . "\0" . $line['sku']] ?? null) : null; @@ -370,7 +375,7 @@ class SyncStoreReceiptProductCost extends Command 'platform' => $bill->platform, 'occurred_date' => $bill->occurred_date, 'store_name' => $bill->store_name, - 'online_order_no' => $core, + 'online_order_no' => $displayOrderNo, 'warehouse' => $line['warehouse'] !== '' ? $line['warehouse'] : null, 'warehouse_short_name' => $short !== '' ? $short : null, 'product_code' => $line['sku'], 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 7c231fc1..3f43c36a 100644 --- a/resources/views/business/pages/financial-operations/product-costs.blade.php +++ b/resources/views/business/pages/financial-operations/product-costs.blade.php @@ -106,6 +106,7 @@
口径:以「业绩明细」的账单行为基数(发生时间 / 店铺名称 / 线上单号),按「店铺 + 线上订单号」展开订单侧商品行, 只取收入金额有数据且不为 0 的账单行,「种菜金额」有数据(>0)的账单行整条排除、不参与匹配; + 线上单号直接展示业绩明细中的原始格式;匹配订单时仍使用清洗后的核心单号。 一行 = 一个发货仓库的一个商品;发货仓库取订单的聚水潭仓库名称, 仓库简称按仓库映射表用「仓储方」匹配「仓库名含主仓」的那条取简称(没有主仓行时认同名仓库, 常州简尚家居有限公司对应映射表里的「配件单仓」行),