@extends('layouts.app') @section('title', 'Bill Details - ISP ERP System') @section('page-title', 'Bill Details') @section('content')

Bill #{{ $bill->id }}

Bill details for {{ $bill->clientInfo->full_name ?? $bill->clientInfo->client->name ?? 'Unknown Client' }} - Created on {{ $bill->created_at->format('M d, Y') }}

Bill Information
#{{ $bill->id }}
{{ $bill->bill_number ?? 'N/A' }}
{{ $bill->month_year ?? ($bill->billing_month ? \Carbon\Carbon::parse($bill->billing_month)->format('M Y') : 'N/A') }}
{{ $bill->clientInfo->full_name ?? $bill->clientInfo->client->name ?? 'N/A' }}
৳{{ number_format($bill->amount, 2) }}
৳{{ number_format($bill->discount ?? 0, 2) }}
৳{{ number_format($bill->late_fee ?? 0, 2) }}
৳{{ number_format($bill->total_amount ?? ($bill->amount - ($bill->discount ?? 0) + ($bill->late_fee ?? 0)), 2) }}
৳{{ number_format($bill->paid_amount ?? 0, 2) }}
৳{{ number_format(($bill->total_amount ?? ($bill->amount - ($bill->discount ?? 0) + ($bill->late_fee ?? 0))) - ($bill->paid_amount ?? 0), 2) }}
{{ ucfirst(str_replace('_', ' ', $bill->status)) }}
{{ $bill->due_date ? $bill->due_date->format('M d, Y') : 'N/A' }}
{{ $bill->expire_date ? $bill->expire_date->format('M d, Y') : 'N/A' }}
{{ $bill->paid_date ? \Carbon\Carbon::parse($bill->paid_date)->format('M d, Y') : ($bill->paid_at ? $bill->paid_at->format('M d, Y') : 'Not Paid') }}
{{ $bill->payment_method ?? 'N/A' }}
{{ $bill->transaction_id ?? 'N/A' }}
{{ $bill->clientInfo->branch->name ?? $bill->clientInfo->client->branch->name ?? 'N/A' }}
{{ $bill->clientInfo->isp->name ?? 'N/A' }}
@if($bill->employee)
{{ $bill->employee->name ?? 'N/A' }}
@endif
@if($bill->notes)

{{ $bill->notes }}

@endif
Client Information
{{ $bill->clientInfo->full_name ?? $bill->clientInfo->client->name ?? 'N/A' }}
{{ $bill->clientInfo->client->username ?? 'N/A' }}
{{ $bill->clientInfo->mobile_number ?? $bill->clientInfo->client->phone ?? 'N/A' }}
{{ $bill->clientInfo->client->email ?? 'N/A' }}
{{ $bill->clientInfo->present_address ?? $bill->clientInfo->client->address ?? 'N/A' }}
@if($bill->clientInfo->permanent_address && $bill->clientInfo->permanent_address !== $bill->clientInfo->present_address)
{{ $bill->clientInfo->permanent_address }}
@endif
{{ $bill->clientInfo->package ?? $bill->clientInfo->package_name ?? 'N/A' }}
৳{{ number_format($bill->clientInfo->monthly_bill ?? 0, 2) }}
৳{{ number_format($bill->clientInfo->service_charge ?? 0, 2) }}
@if($bill->clientInfo->client->mikrotikServer)
{{ $bill->clientInfo->mikrotikServer->name ?? $bill->clientInfo->client->mikrotikServer->name ?? 'N/A' }}
@endif @if($bill->clientInfo->client->mikrotik_profile)
{{ $bill->clientInfo->profile ?? $bill->clientInfo->client->mikrotik_profile ?? 'N/A' }}
@endif @if($bill->clientInfo->client->connection_type)
{{ $bill->clientInfo->connection_type ?? $bill->clientInfo->client->connection_type ?? 'N/A' }}
@endif @if($bill->clientInfo->joining_date)
{{ \Carbon\Carbon::parse($bill->clientInfo->joining_date)->format('M d, Y') }}
@endif @if($bill->clientInfo->billing_start_month)
{{ $bill->clientInfo->billing_start_month }}
@endif
Bill Actions
@if($bill->status !== 'paid')
@csrf @method('PATCH')
@endif Edit Bill
@csrf @method('DELETE')
Audit Information
{{ $bill->creator->name ?? 'System' }}
{{ $bill->created_at->format('M d, Y H:i:s') }}
{{ $bill->updater->name ?? 'N/A' }}
{{ $bill->updated_at->format('M d, Y H:i:s') }}
@endsection