fix: 견적 계산 마구리 수량·각파이프 구조 5130 일치 보정

- 케이스 마구리: 수량 2 고정 → quantity 기반 (5130: maguriPrices × $su)
- 각파이프: 하드코딩 1개 → pipe_3000_qty/pipe_6000_qty 2종 분리 (5130: col68+col69)
- 기본값 fallback: 파이프 수량 미입력 시 W0 기준 자동 결정 유지

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-29 22:28:27 +09:00
parent ca51867cc2
commit e300062f32

View File

@@ -385,7 +385,7 @@ public function calculateSteelItems(array $params): array
$caseCapSpec = $this->convertToCaseCapSpec($caseSpec);
$caseCapPrice = $this->priceService->getCaseCapPrice($caseCapSpec);
if ($caseCapPrice > 0) {
$capQty = 2 * $quantity; // 좌우 2개
$capQty = $quantity; // 5130: maguriPrices × $su (수량)
$items[] = [
'category' => 'steel',
'item_name' => '케이스 마구리',
@@ -618,20 +618,47 @@ public function calculatePartItems(array $params): array
];
}
// 2. 각파이프
// 2. 각파이프 (5130: col68=3000mm 수량, col69=6000mm 수량)
$pipeThickness = '1.4';
$pipeLength = $width > 3000 ? 6000 : 3000;
$pipePrice = $this->getPipePrice($pipeThickness, $pipeLength);
if ($pipePrice > 0) {
$items[] = [
'category' => 'parts',
'item_name' => '각파이프',
'specification' => "{$pipeThickness}T {$pipeLength}mm",
'unit' => 'EA',
'quantity' => $quantity,
'unit_price' => $pipePrice,
'total_price' => $pipePrice * $quantity,
];
$pipe3000Qty = (int) ($params['pipe_3000_qty'] ?? 0);
$pipe6000Qty = (int) ($params['pipe_6000_qty'] ?? 0);
// 기본값: 둘 다 0이면 레거시 로직 (W0 기준 자동 결정)
if ($pipe3000Qty === 0 && $pipe6000Qty === 0) {
if ($width > 3000) {
$pipe6000Qty = 1;
} else {
$pipe3000Qty = 1;
}
}
if ($pipe3000Qty > 0) {
$pipe3000Price = $this->getPipePrice($pipeThickness, 3000);
if ($pipe3000Price > 0) {
$items[] = [
'category' => 'parts',
'item_name' => '각파이프',
'specification' => "{$pipeThickness}T 3000mm",
'unit' => 'EA',
'quantity' => $pipe3000Qty,
'unit_price' => $pipe3000Price,
'total_price' => $pipe3000Price * $pipe3000Qty,
];
}
}
if ($pipe6000Qty > 0) {
$pipe6000Price = $this->getPipePrice($pipeThickness, 6000);
if ($pipe6000Price > 0) {
$items[] = [
'category' => 'parts',
'item_name' => '각파이프',
'specification' => "{$pipeThickness}T 6000mm",
'unit' => 'EA',
'quantity' => $pipe6000Qty,
'unit_price' => $pipe6000Price,
'total_price' => $pipe6000Price * $pipe6000Qty,
];
}
}
// 3. 모터 받침용 앵글 (bracket angle)