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

{{ $area->area_name }}

@foreach($area->items as $item) @php $detailsRow = $item->details()->first(); $measurement = null; $detailsData = null; if ($detailsRow && $detailsRow->measurement) { $measurement = json_decode($detailsRow->measurement, true); } if ($detailsRow && $detailsRow->details) { $detailsData = json_decode($detailsRow->details, true); } // Calculate dynamically $calc = app(\App\Services\QuotationCalculationService::class)->calculate($item); $qty = $calc['qty'] ?? 0; $rate = $calc['rate'] ?? 0; $total = $calc['total'] ?? 0; $subtotal += $total; @endphp @endforeach
Img Item Size Qty Rate Total
@if($item->variant && $item->variant->primaryImage) @endif {{ ucfirst($item->category) }}
{{ $item->product->name ?? '' }}
{{ $item->variant->sku ?? '' }}
{{ $detailsData['model_name'] ?? '' }}
@if(isset($measurement['width']) && isset($measurement['height'])) {{ $measurement['width'] }} x {{ $measurement['height'] }} {{ $measurement['unit'] ?? '' }} @else - @endif {{ number_format($qty,2) }} @php $unitType = $detailsData['unit_type'] ?? ''; @endphp @if($unitType == 'meter') m @elseif($unitType == 'sqft') sqft @elseif($item->category == 'wallpaper') rolls @endif {{ number_format($rate,2) }} {{ number_format($total,2) }}
@endforeach @php $tax = $subtotal * 0.18; $grandTotal = $subtotal + $tax; @endphp
Subtotal : {{ number_format($quotation->subtotal, 2) }}
GST (18%) : {{ number_format($quotation->tax, 2) }}
Discount : {{ number_format($quotation->discount, 2) }}
Grand Total : {{ number_format($quotation->grand_total, 2) }}
Terms & Conditions
{!! $quotation->terms !!}
@endsection