@foreach ($addedInvoice->invoiceItems as $index => $data)
{{-- {{ $index + 1 }} | --}}
{{ $index + 1 }}.{{ $data->product_name ?? '' }} |
{{ $data->price ?? '' }} |
{{ $data->quantity ?? '' }} |
{{ $data->total ?? '' }} |
@endforeach
SubTotal |
{{ $addedInvoice->amount ?? '0' }} |
Tax |
@php
$totalTax = 0;
foreach ($addedInvoice->invoiceItems as $item) {
if ($item->invoiceItemTaxes) {
foreach ($item->invoiceItemTaxes as $tax) {
$totalTax += ($item->total * $tax->tax) / 100;
}
}
}
@endphp
₹{{ number_format($totalTax, 2) }}
|
Discount |
@php
$totalDiscount = 0;
$total = $addedInvoice->amount + $totalTax;
if ($addedInvoice->discount_type == 1) {
$totalDiscount = $addedInvoice->discount;
} elseif ($addedInvoice->discount_type == 2) {
$discountAmount = ($total * $addedInvoice->discount)
/ 100;
$totalDiscount = $discountAmount;
} else {
$totalDiscount = 0;
}
@endphp
₹ {{number_format($totalDiscount ?? 0, 2)}} |
@if($settings->loyalty_config == 'A')
Redeemed Amount |
{{$redeemed_value ?? ''}} |
@endif
Grand Total |
{{number_format(floor(($total - $totalDiscount) - ($settings->loyalty_config == 'A' ? $redeemed_value : 0)) ?? 0, 2)}}
|
Total Menu-item's Qty |
@php
$sumQty = 0;
foreach ($addedInvoice->invoiceItems as $item) {
$sumQty += $item->quantity;
}
@endphp
{{ $sumQty ?? 0}} |