@extends('layouts.layoutapp') @section('content')
| Branch Name | Invoice Id | Client Name | Invoice Date | Due Date | Tax | Amount | Discount Type & Amount | Total Amount | Status |
|---|---|---|---|---|---|---|---|---|---|
| {{$item->branch->name ?? ''}} | {{$item->invoice_id ?? ''}} | {{$item->client->user->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' }} |