@extends('layouts.layoutapp') @section('content')

Invoice HSN Report

@error('start_date')
{{ $message }}
@enderror
@error('end_date')
{{ $message }}
@enderror
{{--
--}}
{{-- --}} @foreach ($invoice as $item) @foreach ($item->invoiceItems as $invoiceItem) {{-- --}} @endforeach @endforeach
Branch Invoice ID HSN Code Invoice Date Due Date Tax Amount Total AmountStatus
{{ $item->branch->name ?? '' }} {{ $item->invoice_id ?? '' }} {{ $invoiceItem->products->hsn_code ?? '-' }} {{ \Carbon\Carbon::parse($item->invoice_date)->format('d-m-Y') ?? $item->invoice_date ?? '' }} {{ \Carbon\Carbon::parse($item->due_date)->format('d-m-Y') ?? $item->due_date ?? '' }} @php $totalTax = 0; if (isset($invoiceItem->invoiceItemTaxes) && $invoiceItem->invoiceItemTaxes->isNotEmpty()) { foreach ($invoiceItem->invoiceItemTaxes as $tax) { $totalTax += ($invoiceItem->total * $tax->tax) / 100; } } echo number_format(round($totalTax), 2); @endphp {{ $invoiceItem->total ?? 0 }} @php $subtotal = $invoiceItem->total ?? 0; $grandTotal = $subtotal + $totalTax; echo number_format(round($grandTotal), 2); @endphp {{ $statusList[$item->status] ?? 'Unknown' }}
@endsection