@php $totsqm = 0.00; $prodArray = []; @endphp @foreach ($grouProducts as $val) @php $itemNo = 0; @endphp @foreach ($val as $lkey => $location) @php $itemNo ++; $prodSqm = $location['pWidth'] *$location['pHieght'] /10000; $location['pAreasqm'] = $prodSqm; $totalSqm += $prodSqm; $opArr=[]; @endphp @if(($location['options']!=null)) @foreach($location['options'] as $key => $specProdOption) @php $typevalueLoc=json_decode($specProdOption['typeValue']) ; if(is_array($typevalueLoc)){ $typevalueLoc = implode(', ',$typevalueLoc); } $optName = str_replace(' ', '',strtolower($specProdOption['optionName'])); $opArr[$optName] = $typevalueLoc; @endphp @endforeach @endif @php $hardwareAr = ''; @endphp @foreach ($relatedHardwareGrp as $key3 => $hlocation) @if($location['pSpecId'] == $key3) @foreach($hlocation as $key4 => $llocation) @php $hwstring = $llocation['pQty'].' X '.$llocation['productName']; if($llocation['pWidth'] > 0){ $hwstring = $hwstring .' @ '.$llocation['pWidth'].'mm'; } $hardwareAr = $hardwareAr.$hwstring; @endphp @endforeach @endif @php $genProd = ['sNotes' => $location['sNotes'], 'itemNo'=> $itemNo,'location' => $location['pLocation'],pWidth => $location['pWidth'], pHeight =>$location['pHieght'], 'pSqm' => $prodSqm, 'options'=>$opArr,'adHard' =>$hardwareAr]; array_push($prodArray,$genProd); @endphp @endforeach @endforeach @foreach ($prodArray as $location) @php $opArr = $locations['options']; $standardOpp = ['fit','bladesize','stiles', 'stiledesign','layoutcode','colour','midrailheights','criticalmidrail', 'splitrotationheight','mountingmethod','hingetype','hingecolour','controlstyle', 'frametype','left','right','top','bottom','framedepth','t/bay/cornerpostposition', 'pelmettype','slidingopenorclosed','trackingsystem','paneltype']; @endphp @endforeach @foreach ($prodArray as $location) @php $addOps = ''; @endphp @foreach ($locations['options'] as $okey => $optionP) @if(!(in_array($okey,$standardOpp))) $addOpps = $addOpps . $okey .' : '.$optionP.' |'; @endif @endphp @endforeach @foreach ($prodArray as $location)
Pick Up or Delivery Delivery   Company Name 4878   {{$opportunityQuote.branches.branchName}}    
Date {{$currentDate}}   Order Name/No. {{$additionalInfoHeader['quoteNo']}}   {{$opportunityQuote.Opportunities.deliveryAddress}}  
All Sizes are OPENING Sizes - Supplier to take deductions
Item Room Location Width Height Material Mount Config Blade Type Stile Size Stile Design Code Layout Colour Mid-Rail Split Tiltrod Mounting Method Hinge Type Hinge Colour Tiltrod Type Frame M2
Height Critcal Frame Type Left Right Top Bott. {{$totalSqm}}
{{$location['itemNo']}} {{$location['Location']}} {{$location['pWidth']}} {{$location['pHieght']}} Oasis {{$opArr['fit']?: ''}} {{$opArr['bladesize']?: ''}} {{$opArr['stiles']?: ''}} {{$opArr['stiledesign'] ?: ''}} {{$opArr['layoutcode']?: ''}} {{$opArr['colour']?: ''}}l {{$opArr['midrailheights']?: ''}} {{$opArr['criticalmidrail']?: ''}} {{$opArr['splitrotationheight']?: ''}} {{$opArr['mountingmethod']?: ''}} {{$opArr['hingetype']?: ''}} {{$opArr['hingecolour']?: ''}} {{$opArr['controlstyle']?: ''}} {{$opArr['frametype']?: ''}} {{$opArr['left']?: ''}} {{$opArr['right']?: ''}} {{$opArr['top']?: ''}} {{$opArr['bottom']?: ''}} {{$location['pSqm']}}
T-Post Measurements Sliding/BiFold Options Additional Field Options Additional Hardware
Item T-Posts Frame Size Pelmet Type Open or Closed Tracking System Panel Type
{{$location['itemNo']}} {{$opArr['t/bay/cornerpostposition']?: ''}} {{$opArr['framedepth']?: ''}} {{$opArr['pelmettype']?: ''}} {{$opArr['slidingopenorclosed']?: ''}} {{$opArr['trackingsystem']?: ''}} {{$opArr['paneltype']?: ''}} {{$addOpps}} {{$location['adHard']}}
Item Notes
{{$location['itemNo']}} {{$location['sNotes']}}