From 526812f8ed595a1f35ac70583a6bb355014f2814 Mon Sep 17 00:00:00 2001 From: mzl Date: Tue, 14 Oct 2025 12:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=88=A9=E6=B6=A6=E8=AE=A1?= =?UTF-8?q?=E7=AE=97&=E7=9B=B4=E6=8E=A5=E5=85=A5=E5=BA=93=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E8=AE=A1=E7=AE=97=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/StockOrdersService.php | 31 +++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/app/common/service/StockOrdersService.php b/app/common/service/StockOrdersService.php index 0929703..ad21787 100644 --- a/app/common/service/StockOrdersService.php +++ b/app/common/service/StockOrdersService.php @@ -485,12 +485,12 @@ class StockOrdersService $this->processVehiclePrices($item, $veh); // 计算利润 - $profit = $this->calculateProfit($veh, $item->mileage, $order); - $item->addMoney('profit', $order->settlement_currency, $profit, $order->contract_exchange_rate, '利润'); + // $profit = $this->calculateProfit($veh, $item->mileage, $order); + // $item->addMoney('profit', $order->settlement_currency, $profit, $order->contract_exchange_rate, '利润'); // 累计到岸价 $cifTotalAmount += $veh['total_price']['amount'] ?? 0; - $profitTotalAmount += $profit; + $profitTotalAmount += $veh['profit']['amount'] ?? 0; // 处理改装项 $this->processModificationItems($item->id, $veh['modify_list'] ?? []); @@ -525,17 +525,18 @@ class StockOrdersService { // 基础费用 $priceFields = [ - 'unit_price' => '单价', - 'total_price' => '总价', - 'handling_fee' => '手续费', + 'unit_price' => '单价', + 'total_price' => '总价', + 'handling_fee' => '手续费', 'fob_transport_fee' => 'FOB运输费', - 'port_misc_fee' => '港杂', - 'retrofit_fee' => '改装费', - 'ocean_freight' => '海运费', - 'commission' => '佣金', - 'purchase_tax' => '购置税', - 'tax_refund' => '预估退税', - 'clearance_price' => '报关价', + 'port_misc_fee' => '港杂', + 'retrofit_fee' => '改装费', + 'ocean_freight' => '海运费', + 'commission' => '佣金', + 'purchase_tax' => '购置税', + 'tax_refund' => '预估退税', + 'clearance_price' => '报关价', + 'profit' => '利润' ]; foreach ($priceFields as $field => $description) { @@ -813,7 +814,9 @@ class StockOrdersService $modificationText = $this->getModificationText($v->options); // 计算单项利润 - $itemProfit = $this->calculateProfit($moneyValues, $v->mileage, $item); + // $itemProfit = $this->calculateProfit($moneyValues, $v->mileage, $item); + // var_dump($moneyValues); + $itemProfit = empty($moneyValues['profit']['amount']) ? 0 : $moneyValues['profit']['amount']; // 构建车辆信息 $vehList[$v->unique_id] = [