{{$item->invoice_id ?? ''}} |
{{$item->client->user->name ?? ''}} |
{{$item->branch->name ?? ''}} |
{{$item->invoice_date ?? ''}} |
{{$item->due_date ?? ''}} |
@php
$totalTax = 0;
if (isset($item->invoiceItems) && $item->invoiceItems->isNotEmpty()) {
foreach ($item->invoiceItems as $invoiceItem) {
if ($invoiceItem->invoiceItemTaxes->isNotEmpty()) {
foreach ($invoiceItem->invoiceItemTaxes as $tax) {
$totalTax += round(($invoiceItem->total * $tax->tax) / 100, 2);
}
}
}
}
echo number_format($totalTax, 2);
@endphp
|
{{$item->amount ?? ''}} |
@php
if (isset($item->discountType) && $item->discountType->type == 'Fixed') {
$discountAmount = $item->discount;
} elseif (isset($item->discountType) && $item->discountType->type == 'Percentege') {
$discountAmount = round(($item->amount + $totalTax) * ($item->discount / 100), 2);
} else {
$discountAmount = 'Not set';
}
@endphp
{{$discountAmount ?? ''}}@if (isset($item->discountType))
({{$item->discountType->type ?? ''}})
@endif
|
{{ number_format(floor($item->final_amount) ?? '', 2) }}
|
{{$statusList[$item->status] ?? 'Unknown' }} |
@endforeach