diff --git a/app/Console/Commands/ImportProductMonthlyWeightedAverageBase.php b/app/Console/Commands/ImportProductMonthlyWeightedAverageBase.php index 6eeeb1cf6..d9e2a6d3b 100644 --- a/app/Console/Commands/ImportProductMonthlyWeightedAverageBase.php +++ b/app/Console/Commands/ImportProductMonthlyWeightedAverageBase.php @@ -95,7 +95,8 @@ class ImportProductMonthlyWeightedAverageBase extends Command $payload[$rowKey] = [ 'report_month' => $month->toDateString(), 'row_key' => $rowKey, - 'barcode_warehouse' => $item['warehouse_short_name'] . $item['product_code'], + // 条码+仓库 = 商品编码 + 仓库简称 + 'barcode_warehouse' => $item['product_code'] . $item['warehouse_short_name'], 'warehouse_short_name' => $item['warehouse_short_name'], 'product_code' => $item['product_code'], 'opening_unit_price' => null, @@ -116,7 +117,7 @@ class ImportProductMonthlyWeightedAverageBase extends Command $payload[$rowKey] = [ 'report_month' => $month->toDateString(), 'row_key' => $rowKey, - 'barcode_warehouse' => '南昌樵舍仓' . $code, + 'barcode_warehouse' => $code . '南昌樵舍仓', 'warehouse_short_name' => '南昌樵舍仓', 'product_code' => $code, 'opening_unit_price' => null, @@ -252,7 +253,8 @@ class ImportProductMonthlyWeightedAverageBase extends Command $previousStatus = trim((string) ($cells[15] ?? '')); yield [ - 'barcode_warehouse' => trim((string) ($cells[1] ?? '')) ?: $shortName . $productCode, + // 条码+仓库统一为「仓库简称 + 商品编码」,不再沿用表1 里的单元格写法。 + 'barcode_warehouse' => $shortName . $productCode, 'warehouse_short_name' => $shortName, 'product_code' => mb_strtoupper($productCode), 'opening_unit_price' => $price === '' ? null : round((float) str_replace(',', '', $price), 2),