fix: 가이드레일 세트가격 계산을 5130과 동일하게 수정
- 벽면형/측면형: 단가×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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user