Enterprise {{ app()->getLocale() == 'en' ? 'Billing Ledger' : 'Buku Besar Penagihan' }}

{{ __('ui.invoices') }}

{{ app()->getLocale() == 'en' ? 'Manage all issued corporate invoices and statuses.' : 'Kelola semua invoice perusahaan yang diterbitkan beserta statusnya.' }}

Reset
@if(auth()->user()->role !== 'staff')

{{ app()->getLocale() == 'en' ? 'Total Issued' : 'Total Diterbitkan' }}

{{ $invoices->total() }}

{{ app()->getLocale() == 'en' ? 'Registered in system' : 'Terdaftar dalam sistem' }}

{{ __('ui.total_collected') }}

Rp {{ number_format(\App\Models\Payment::sum('amount'), 0, ',', '.') }}

{{ app()->getLocale() == 'en' ? 'Verified transactions' : 'Transaksi terverifikasi' }}

{{ __('ui.amount_due') }}

Rp {{ number_format(\App\Models\Invoice::whereIn('status', ['sent', 'dp', 'pending', 'overdue'])->sum('total'), 0, ',', '.') }}

{{ app()->getLocale() == 'en' ? 'Outstanding receivables' : 'Piutang belum tertagih' }}

{{ app()->getLocale() == 'en' ? 'Overdue Count' : 'Jumlah Menunggak' }}

{{ \App\Models\Invoice::where('status', 'overdue')->count() }}

{{ app()->getLocale() == 'en' ? 'Action required immediately' : 'Tindakan segera diperlukan' }}

@endif
@forelse($invoices as $invoice)
{{ $invoice->invoice_number }}
{{ $invoice->client->nama_client }} Rp {{ number_format($invoice->total, 0, ',', '.') }}
{{ app()->getLocale() == 'en' ? 'UNIT' : 'UNIT' }} {{ $invoice->businessUnit ? $invoice->businessUnit->name : '-' }}
{{ app()->getLocale() == 'en' ? 'View' : 'Lihat' }} {{ app()->getLocale() == 'en' ? 'Edit' : 'Ubah' }} @can('delete', $invoice)
@csrf @method('DELETE')
@endcan
@empty

{{ __('ui.empty_data') }}

@endforelse
@if($invoices->hasPages())
{{ $invoices->links() }}
@endif @push('scripts') @endpush