@if(app('request')->input('print')=="y") @endif
@foreach($data as $k => $v) @php $slno = 1 @endphp
{!! QrCode::size(70)->generate($v['qrcode']); !!}
{{ $v['bill_date'] }}
{{ $v['customer_details']['name'] }}
{{ $v['customer_details']['gstin'] }}
@foreach($v['sold_items'] as $vv) @php $slno++ @endphp @endforeach
@php echo $slno @endphp
{{ $vv['remarks'] }}
{{$vv['quantity']}} {{$vv['price_per_quantity']}} {{$vv['tax']}} {{$vv['gtotal']}}
@php $en = new NumberFormatter("en", NumberFormatter::SPELLOUT); $enamt = $en->format($v['net_total']); $enamt = ucwords($enamt); $ar = new NumberFormatter("ar", NumberFormatter::SPELLOUT); $aramt = $ar->format($v['net_total']); if (strpos($v['net_total'], '.') !== false && strpos($enamt, 'Point') !== false) { $net = explode('.', $v['net_total']); $enamtArray = explode('Point', $enamt); if ($net[1] === '10') { $amt = 'Ten'; } elseif ($net[1] === '20') { $amt = 'Twenty'; } elseif ($net[1] === '30') { $amt = 'Thirty'; } elseif ($net[1] === '40') { $amt = 'Fourty'; } elseif ($net[1] === '50') { $amt = 'Fifty'; } elseif ($net[1] === '60') { $amt = 'Sixty'; } elseif ($net[1] === '70') { $amt = 'Seventy'; } elseif ($net[1] === '80') { $amt = 'Eighty'; } elseif ($net[1] === '90') { $amt = 'Ninety'; } else { if (strpos($enamtArray[1], 'Zero') !== false) { $amt = $enamtArray[1]; $amt = explode('Zero', $amt); $amt = $amt[1]; } else { $amt = explode('.', $v['net_total']); $amt = $en->format($amt[1]); $amt = ucwords($amt); } } $enamt = $enamtArray[0] . ' Riyals and ' . $amt . ' Halalas Only'; // $arabic = new GoogleTranslate(); // $arabic->setSource('en'); // $arabic->setTarget('ar'); // $arabic = $arabic->translate($enamt); } else { $enamt = $enamt . ' Riyals Only'; } @endphp
{{ $enamt }} {{ $v['taxable_amt'] }}
{{ $v['discount_amount']}}
{{ $v['net_total'] }}
@endforeach