@extends('pdf.layouts.quotation-interior') @section('title','Quotation') @section('content')
| Img | Item | Size | Qty | Rate | Total | ||
|---|---|---|---|---|---|---|---|
|
@if($item->variant && $item->variant->primaryImage)
|
{{ 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 | {{-- Quantity --}} @if($item->category == 'curtain'){{ $item->quantity }} pcs | @elseif($item->category == 'wallpaper'){{ $item->quantity }} rolls | @else{{ round($item->quantity,0) }} | @endif @php $price = (float) ($item->variant?->offer_price ?? 0); $qty = (int) ($item->quantity ?? 1); $total = $price * $qty; @endphp{{ $price > 0 ? number_format($price, 2) : '-' }} | {{ $total > 0 ? number_format($total, 2) : '-' }} |