From 57d9ac2d7fde58f029f939a2ccb4dbec68c532b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Sat, 31 Jan 2026 00:29:55 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B0=80=EC=9D=B4=EB=93=9C=EB=A0=88?= =?UTF-8?q?=EC=9D=BC=20=EC=84=B8=ED=8A=B8=EA=B0=80=EA=B2=A9=20=EA=B3=84?= =?UTF-8?q?=EC=82=B0=EC=9D=84=205130=EA=B3=BC=20=EB=8F=99=EC=9D=BC?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 벽면형/측면형: 단가×2 세트가격 후 round(세트가격×길이)×QTY - 혼합형: (벽면단가+측면단가) 합산 후 단일 항목으로 계산 - 기존: round(단가×길이)×2×QTY → 수정: round(단가×2×길이)×QTY - 검증: EGI 84/84 + SUS 44/44 + 가이드타입 36/36 = 164/164 ALL PASS Co-Authored-By: Claude Opus 4.5 --- .../Handlers/KyungdongFormulaHandler.php | 45 ++++++++----------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/app/Services/Quote/Handlers/KyungdongFormulaHandler.php b/app/Services/Quote/Handlers/KyungdongFormulaHandler.php index 47034ad..2239b6d 100644 --- a/app/Services/Quote/Handlers/KyungdongFormulaHandler.php +++ b/app/Services/Quote/Handlers/KyungdongFormulaHandler.php @@ -604,21 +604,21 @@ private function calculateGuideRails( $wallSpec = $specs['wall']; $sideSpec = $specs['side']; - // 5130: round(단가 × 길이m) × QTY (단건 반올림 후 QTY 곱셈) + // 5130: 세트가격(단가×2 또는 wall+side) → round(세트가격 × 길이m) × QTY switch ($guideType) { case '벽면형': $price = $this->priceService->getGuideRailPrice($modelName, $finishingType, $wallSpec); if ($price > 0) { - $guideQty = 2 * $quantity; - $perUnitGuide = round($price * $guideLength); + $setPrice = $price * 2; // 5130: 2개 세트 가격 + $perSetTotal = round($setPrice * $guideLength); $items[] = [ 'category' => 'steel', 'item_name' => '가이드레일', 'specification' => "{$modelName} {$finishingType} {$wallSpec} {$guideLength}m × 2", 'unit' => 'm', - 'quantity' => $guideLength * $guideQty, + 'quantity' => $guideLength * 2 * $quantity, 'unit_price' => $price, - 'total_price' => $perUnitGuide * $guideQty, + 'total_price' => $perSetTotal * $quantity, ]; } break; @@ -626,16 +626,16 @@ private function calculateGuideRails( case '측면형': $price = $this->priceService->getGuideRailPrice($modelName, $finishingType, $sideSpec); if ($price > 0) { - $guideQty = 2 * $quantity; - $perUnitGuide = round($price * $guideLength); + $setPrice = $price * 2; // 5130: 2개 세트 가격 + $perSetTotal = round($setPrice * $guideLength); $items[] = [ 'category' => 'steel', 'item_name' => '가이드레일', 'specification' => "{$modelName} {$finishingType} {$sideSpec} {$guideLength}m × 2", 'unit' => 'm', - 'quantity' => $guideLength * $guideQty, + 'quantity' => $guideLength * 2 * $quantity, 'unit_price' => $price, - 'total_price' => $perUnitGuide * $guideQty, + 'total_price' => $perSetTotal * $quantity, ]; } break; @@ -644,28 +644,19 @@ private function calculateGuideRails( $priceWall = $this->priceService->getGuideRailPrice($modelName, $finishingType, $wallSpec); $priceSide = $this->priceService->getGuideRailPrice($modelName, $finishingType, $sideSpec); - if ($priceWall > 0) { - $perUnitWall = round($priceWall * $guideLength); + // 5130: (wallPrice + sidePrice) → round(합산가격 × 길이m) × QTY (단일 항목) + $setPrice = ($priceWall ?: 0) + ($priceSide ?: 0); + if ($setPrice > 0) { + $perSetTotal = round($setPrice * $guideLength); + $spec = "{$modelName} {$finishingType} {$wallSpec}/{$sideSpec} {$guideLength}m"; $items[] = [ 'category' => 'steel', 'item_name' => '가이드레일', - 'specification' => "{$modelName} {$finishingType} {$wallSpec} {$guideLength}m", + 'specification' => $spec, 'unit' => 'm', - 'quantity' => $guideLength * $quantity, - 'unit_price' => $priceWall, - 'total_price' => $perUnitWall * $quantity, - ]; - } - if ($priceSide > 0) { - $perUnitSide = round($priceSide * $guideLength); - $items[] = [ - 'category' => 'steel', - 'item_name' => '가이드레일', - 'specification' => "{$modelName} {$finishingType} {$sideSpec} {$guideLength}m", - 'unit' => 'm', - 'quantity' => $guideLength * $quantity, - 'unit_price' => $priceSide, - 'total_price' => $perUnitSide * $quantity, + 'quantity' => $guideLength * 2 * $quantity, + 'unit_price' => $setPrice, + 'total_price' => $perSetTotal * $quantity, ]; } break;