@extends('pdf.layouts.quotation-interior') @section('title','Quotation') @section('content')
Room Wise Quotation
@foreach($quotation->areas as $area)

{{ $area->area_name }}

@foreach($groupedItems[$area->id] ?? [] as $item) {{-- Quantity --}} @if($item->category == 'curtain') @elseif($item->category == 'wallpaper') @else @endif @php $price = (float) ($item->variant?->offer_price ?? 0); $qty = (int) ($item->quantity ?? 1); $total = $price * $qty; @endphp @endforeach
Img Item Size Qty Rate Total
@if($item->variant && $item->variant->primaryImage) @endif {{ ucfirst($item->category) }},
{{ $item->product->name ?? '' }},
{{ $item->variant->sku ?? '' }},
@php $measurement = null; $detailsData = null; $itemDetails = $item->details()->first(); // Decode measurement if ($itemDetails && $itemDetails->measurement) { $decoded = json_decode($itemDetails->measurement, true); if (is_string($decoded)) { $decoded = json_decode($decoded, true); } $measurement = $decoded; } // Decode details (for mattress) if ($itemDetails && $itemDetails->details) { $decodedDetails = json_decode($itemDetails->details, true); if (is_string($decodedDetails)) { $decodedDetails = json_decode($decodedDetails, true); } $detailsData = $decodedDetails; } @endphp @if($item->category == 'curtain' || $item->category == 'wallpaper') @if(isset($measurement['width']) && isset($measurement['height'])) {{ $measurement['width'] }} x {{ $measurement['height'] }} {{ $measurement['unit'] ?? '' }} @elseif(isset($measurement['curtain'])) {{ $measurement['curtain']['width'] ?? '' }} x {{ $measurement['curtain']['height'] ?? '' }} {{ $measurement['curtain']['unit'] ?? '' }} @elseif(isset($measurement['wallpaper'])) {{ $measurement['wallpaper']['width'] ?? '' }} x {{ $measurement['wallpaper']['height'] ?? '' }} {{ $measurement['wallpaper']['unit'] ?? '' }} @else - @endif @elseif($item->category == 'mattress') @if($detailsData && isset($detailsData['size'])) {{ $detailsData['size'] }} {{ $detailsData['unit'] ?? '' }} @else - @endif @else - @endif {{ $item->quantity }} pcs{{ $item->quantity }} rolls{{ round($item->quantity,0) }}{{ $price > 0 ? number_format($price, 2) : '-' }} {{ $total > 0 ? number_format($total, 2) : '-' }}
@endforeach
Subtotal : {{ number_format($quotation->subtotal,2) }}
GST : {{ number_format($quotation->tax,2) }}
Grand Total : {{ number_format($quotation->grand_total,2) }}
Terms & Conditions
{!! $quotation->terms !!}
@endsection