@extends('pdf.layouts.interior') @section('title','Premium Quotation') @section('content')
| Img | Item | Size | Qty | Rate | Total | |||||
|---|---|---|---|---|---|---|---|---|---|---|
|
@if($item->variant && $item->variant->primaryImage)
|
{{ ucfirst($item->category) }} | @if($item->measurement) {{ $item->measurement->width }} x {{ $item->measurement->height }} @else - @endif | @if($item->is_custom == 0) @if($item->category == 'curtain'){{ $item->quantity }} pcs | @elseif($item->category == 'wallpaper'){{ $item->quantity }} rolls | @else{{ $item->quantity }} | @endif @elseif($item->category == 'curtain' && $item->curtain && $item->measurement) @php $fw = (float) $item->curtain->fabric_width; $ww = (float) $item->measurement->width; $wh = (float) $item->measurement->height; $qty = ($fw > 0) ? ceil($ww / $fw) * $wh : 0; @endphp{{ $qty > 0 ? number_format($qty,2).' m' : '-' }} | @elseif($item->category == 'wallpaper' && $item->wallpaper) @php $rw = (float) $item->wallpaper->roll_width; $rl = (float) $item->wallpaper->roll_length; $ww = (float) $item->wallpaper->wall_width; $wh = (float) $item->wallpaper->wall_height; $rep = (float) ($item->wallpaper->design_repeat ?? 0); $cuttings = ($rw > 0) ? ceil($ww / $rw) : 0; $qty = ($rl > 0) ? ceil(($cuttings * ($wh + $rep)) / $rl) : 0; @endphp{{ $qty > 0 ? $qty.' rolls' : '-' }} | @else- | @endif @php $price = 0.0; $total = 0.0; if ($item->is_custom == 0) { $price = (float) ($item->variant?->offer_price ?? 0); $qty = (int) ($item->quantity ?? 1); $total = $price * $qty; } else { // 🟢 CUSTOM CURTAIN if ($item->category === 'curtain' && $item->curtain && $item->measurement) { $fabricWidth = (float) $item->curtain->fabric_width; $pricePerMeter = (float) $item->curtain->price_per_meter; $wallWidth = (float) $item->measurement->width; $wallHeight = (float) $item->measurement->height; if ($fabricWidth > 0 && $wallWidth > 0 && $wallHeight > 0) { $panels = ceil($wallWidth / $fabricWidth); $fabricRequired = $panels * $wallHeight; $price = $pricePerMeter; $total = $fabricRequired * $pricePerMeter; } } // 🟢 CUSTOM WALLPAPER if ($item->category === 'wallpaper' && $item->wallpaper) { $rollWidth = (float) $item->wallpaper->roll_width; $rollLength = (float) $item->wallpaper->roll_length; $pricePerRoll = (float) $item->wallpaper->price_per_roll; $wallWidth = (float) $item->wallpaper->wall_width; $wallHeight = (float) $item->wallpaper->wall_height; $repeat = (float) ($item->wallpaper->design_repeat ?? 0); if ($rollWidth > 0 && $rollLength > 0) { $cuttings = ceil($wallWidth / $rollWidth); $cuttingHeight = $wallHeight + $repeat; $totalLength = $cuttings * $cuttingHeight; $rolls = ceil($totalLength / $rollLength); $price = $pricePerRoll; $total = $rolls * $pricePerRoll; } } } @endphp{{ $price > 0 ? number_format($price, 2) : '-' }} | {{ $total > 0 ? number_format($total, 2) : '-' }} |