@extends('layouts.document') @section('title', '견적서') @push('styles') @endpush @section('content') @php // 견적번호 $quotationNo = 'AQ-' . $quotation->created_at->format('Y') . '-' . str_pad($quotation->id, 3, '0', STR_PAD_LEFT); // 회사 분석 정보 $company = $quotation->analysis_result['company_analysis'] ?? []; // 구현 계획 $plan = $quotation->quotation_result['implementation_plan'] ?? []; $estimatedMonths = $plan['estimated_months'] ?? null; // 금액 계산 $devSubtotal = (int) $quotation->total_dev_cost; $monthlySubtotal = (int) $quotation->total_monthly_fee; $devVat = (int) round($devSubtotal * 0.1); $monthlyVat = (int) round($monthlySubtotal * 0.1); $devTotal = $devSubtotal + $devVat; $monthlyTotal = $monthlySubtotal + $monthlyVat; // 한글 금액 변환 function numberToKorean(int $number): string { if ($number === 0) return '영'; $units = ['', '만', '억', '조']; $digits = ['', '일', '이', '삼', '사', '오', '육', '칠', '팔', '구']; $subUnits = ['', '십', '백', '천']; $result = ''; $unitIndex = 0; while ($number > 0) { $chunk = $number % 10000; if ($chunk > 0) { $chunkStr = ''; $subIndex = 0; $temp = $chunk; while ($temp > 0) { $digit = $temp % 10; if ($digit > 0) { $prefix = ($digit === 1 && $subIndex > 0) ? '' : $digits[$digit]; $chunkStr = $prefix . $subUnits[$subIndex] . $chunkStr; } $temp = (int)($temp / 10); $subIndex++; } $result = $chunkStr . $units[$unitIndex] . $result; } $number = (int)($number / 10000); $unitIndex++; } return $result; } $devTotalKorean = numberToKorean($devSubtotal); // 필수 → 선택 순으로 정렬된 품목 $sortedItems = $quotation->items->sortByDesc('is_required')->values(); @endphp
{{-- 제목 --}}

견 적 서

{{-- 견적 정보 --}}

견적번호: {{ $quotationNo }}

유효기간: 견적일로부터 30일

견적일자: {{ $quotation->created_at->format('Y년 m월 d일') }}

{{-- 수신 / 공급자 --}}
수 신 공 급 자
귀사명 {{ $quotation->title }} 상 호 (주)코드브릿지엑스
업 종 {{ $company['industry'] ?? '-' }} 대 표 권형석
규 모 {{ $company['scale'] ?? '-' }} 주 소 인천 남동구 남동대로 215번길 30
현재시스템 {{ !empty($company['current_systems']) ? implode(', ', $company['current_systems']) : '-' }} 연락처 032-123-4567
{{-- 인사말 + 합계 --}}

아래와 같이 견적합니다.

합계금액: 금 {{ $devTotalKorean }}원정 (₩{{ number_format($devSubtotal) }})

※ 부가가치세 별도 / 월 구독료 {{ number_format($monthlySubtotal) }}원 별도

{{-- 품목 테이블 --}} @foreach($sortedItems as $index => $item) @endforeach
No 구분 품 목 설 명 개발비 (원) 월 구독료 (원)
{{ $index + 1 }} {{ $item->is_required ? '필수' : '선택' }} {{ $item->module_name }} {{ Str::limit($item->reason, 80) }} {{ number_format((int) $item->dev_cost) }} {{ number_format((int) $item->monthly_fee) }}
소 계 {{ number_format($devSubtotal) }} {{ number_format($monthlySubtotal) }}
부가세 (10%) {{ number_format($devVat) }} {{ number_format($monthlyVat) }}
합 계 {{ number_format($devTotal) }} {{ number_format($monthlyTotal) }}
{{-- 비고 --}}
비 고
  1. 상기 금액은 부가가치세 별도입니다.
  2. 개발비 납부 조건: 계약 시 50%, 완료 시 50% 분할 납부
  3. 월 구독료: 서비스 오픈일부터 과금 (월 {{ number_format($monthlyTotal) }}원, VAT 포함)
  4. @if($estimatedMonths)
  5. 예상 구축 기간: {{ $estimatedMonths }}개월
  6. @endif
  7. 본 견적서의 유효기간은 견적일로부터 30일입니다.
  8. 세부 사항은 별도 협의를 통해 조정될 수 있습니다.
{{-- 서명 --}}

(주)코드브릿지엑스

대표이사 권 형 석

(인)
@endsection