From e54b7f8d25e6e40d882543415fe2ff02c2771cdc Mon Sep 17 00:00:00 2001 From: chenxi Date: Tue, 29 Sep 2026 20:21:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=97=E6=98=8C=E6=A8=B5=E8=88=8D=E4=BB=93?= =?UTF-8?q?=EF=BC=9A=E6=B1=9F=E8=A5=BF=E4=BB=93=E9=80=81=E8=B4=A7=E7=9A=84?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=8D=95=E6=8D=AE=E6=9D=A1=E7=A0=81=E4=B8=80?= =?UTF-8?q?=E5=B9=B6=E7=BA=B3=E5=85=A5=E8=A1=8C=E7=BB=B4=E5=BA=A6=EF=BC=8C?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=95=B0=E9=87=8F=E5=90=88=E8=AE=A1=E4=B8=8E?= =?UTF-8?q?=E6=B1=9F=E8=A5=BF=E4=BB=93=E9=80=81=E8=B4=A7=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mportProductMonthlyWeightedAverageBase.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/Console/Commands/ImportProductMonthlyWeightedAverageBase.php b/app/Console/Commands/ImportProductMonthlyWeightedAverageBase.php index 85505578..5d2ee2e2 100644 --- a/app/Console/Commands/ImportProductMonthlyWeightedAverageBase.php +++ b/app/Console/Commands/ImportProductMonthlyWeightedAverageBase.php @@ -106,6 +106,27 @@ class ImportProductMonthlyWeightedAverageBase extends Command $isDelivery ? $deliveryRows++ : $mirrorRows++; } + // 南昌樵舍仓的采购数量取自"简尚-江西仓送货主仓",这些条码也要一并纳入行维度, + // 否则只存在于江西仓送货的单据会因为表里没有对应行而丢掉采购数量。 + foreach (array_keys($jiangxiPurchase) as $code) { + $rowKey = $this->rowKey($month, '南昌樵舍仓', $code); + if (isset($payload[$rowKey])) { + continue; + } + $payload[$rowKey] = [ + 'report_month' => $month->toDateString(), + 'row_key' => $rowKey, + 'barcode_warehouse' => '南昌樵舍仓' . $code, + 'warehouse_short_name' => '南昌樵舍仓', + 'product_code' => $code, + 'opening_unit_price' => null, + 'previous_pricing_status' => null, + 'base_source' => 'mirror', + 'imported_at' => $now, + ]; + $mirrorRows++; + } + $matched = 0; foreach ($payload as $key => $row) { $item = $inventory[$row['warehouse_short_name'] . "\0" . $row['product_code']] ?? null;