@php
if ($currentTier == 1 && !$quotationItemList->is_area && $quotationItemTier1Lists[$tier1Number] != 0) {
echo '
';
if ($shouldPrintBuffer) {
echo $buffer; // Print the buffered content
$buffer = ''; // Clear the buffer
$shouldPrintBuffer = false; // Reset the flag
}
}
@endphp
@if ($quotationItemList->tier_level == 1 && !$quotationItemList->is_area)
{{ $numberTier1 }}.
{!! nl2br(e($quotationItemList->title)) !!}
@elseif ($quotationItemList->tier_level == 2 && !$quotationItemList->is_area)
{{ $numberTier2 }}.
{!! nl2br(e($quotationItemList->title)) !!}
@elseif ($quotationItemList->tier_level == 3 && !$quotationItemList->is_area)
{!! nl2br(e($quotationItemList->title)) !!}
@elseif($quotationItemList->is_area == 1 && empty($quotationItemList->title))
{{-- FOR BLANK SPACE SECTION --}}
@php
$buffer .= '
';
$shouldPrintBuffer = true;
// Buffer the content for the next iteration if the condition is met
if ($index < count($quotationItemLists) - 1) {
// Check if the next loop item does not meet the specified conditions
$nextItem = $quotationItemLists[$index + 1];
if (!($nextItem->tier_level == 1 && !$nextItem->is_area) && !($nextItem->is_area == 1 && empty($nextItem->title))) {
echo '
';
$shouldPrintBuffer = true; // Set the flag to print from the buffer
}
}
@endphp
@elseif ($quotationItemList->is_area == 1)
{!! nl2br(e($quotationItemList->title)) !!}
@endif
@php
if ($quotationItemList->tier_level == 1 && !$quotationItemList->is_area) {
$tier1Number++;
}
@endphp
@if ($quotationItemList->tier_level == 2)
@if ($quotationItemList->amount > 0)
Sub Total
$
{{ number_format($quotationItemList->amount, 2, '.', ',') }}
@endif
@endif
@endif
@php
// Buffer the content for the next iteration if the condition is met
if ($quotationItemList->is_area == 1 && empty($quotationItemList->title)) {
$buffer = $buffer;
$shouldPrintBuffer = true;
} elseif ($index < count($quotationItemLists) - 1) {
// Check if the next loop item does not meet the specified conditions
$nextItem = $quotationItemLists[$index + 1];
if (!($nextItem->tier_level == 1 && !$nextItem->is_area) && !($nextItem->is_area == 1 && empty($nextItem->title))) {
$shouldPrintBuffer = true; // Set the flag to print from the buffer
}
}
@endphp