Expected % *@extends('layouts.app') @section('title', 'Sales Invoice') @section('content')
@if(session('success')) @endif @if(session('error')) @endif

Sales Invoice

Reseller Customer Previous Invoice @if(\App\Helpers\PermissionHelper::isSuperUser(auth()->id()) || in_array(auth()->user()->email, ['mkzwasim@gmail.com', 'sahrior@gmail.com']) || auth()->user()->role === 'admin') Invoice @endif
Total Sales Amount
BDT {{ number_format($stats['total']['sales_amount'], 0) }}
Total Paid Amount
BDT {{ number_format(0, 0) }}
Total Due Amount
BDT {{ number_format($stats['total']['due_amount'], 0) }}
Total Invoices
{{ $stats['total']['invoices'] }}
Total VAT Amount
BDT {{ number_format($stats['total']['vat_amount'], 0) }}
Total Discount
BDT {{ number_format($stats['total']['discount_amount'], 0) }}
Paid Invoices
{{ $stats['total']['paid_invoices'] }}
Due Invoices
{{ $stats['total']['due_invoices'] }}
Filter & Search
Clear @if(\App\Helpers\PermissionHelper::isSuperUser(auth()->id())) @endif
All Current Month ({{ $currentMonthDisplay ?? $currentMonth }}) Invoices {{ $invoices->total() }}
@if($invoices->count() > 0)
@foreach($invoices as $index => $invoice) @endforeach
SN Customer Invoice No Customer Invoice Invoice Month Invoice Date Total VAT Amount Paid Due Status Type Action
{{ $invoices->firstItem() + $index }}
{{ $invoice->customer_name ?? ($invoice->customer->name ?? 'N/A') }}
@if($invoice->customer_email)
{{ $invoice->customer_email }}
@endif
{{ $invoice->invoice_no }} {{ $invoice->customer_invoice ?: 'N/A' }} {{ $invoice->invoice_month }} {{ $invoice->invoice_date ? $invoice->invoice_date->format('d M Y') : 'N/A' }} ৳{{ number_format($invoice->items->sum('total_vat') ?? 0, 2) }} ৳{{ number_format($invoice->invoice_amount, 2) }} ৳{{ number_format($invoice->transections()->where('transaction_type', 'payment')->sum('amount'), 2) }} ৳{{ number_format($invoice->due_amount, 2) }} @if($invoice->due_amount <= 0) Paid @else Due @endif @if($invoice->notes && strpos($invoice->notes, 'Generated from Invoice') !== false) Generated @else Created @endif @php $showNttnCostIcon = false; // Check if any item in the invoice has connection type "NTTN Include" foreach ($invoice->items as $item) { if ($item->connectionType) { $connectionTypeName = strtolower(trim($item->connectionType->name ?? '')); // Check if connection type name contains "nttn" and "include" if (strpos($connectionTypeName, 'nttn') !== false && strpos($connectionTypeName, 'include') !== false) { $showNttnCostIcon = true; break; } } } @endphp @if($showNttnCostIcon) @endif
Showing {{ $invoices->firstItem() }} to {{ $invoices->lastItem() }} of {{ $invoices->total() }} invoices
{{ $invoices->links() }}
@else
No invoices found for current month ({{ $currentMonthDisplay ?? $currentMonth }}).
@endif
@endsection @push('scripts') @endpush