@extends('dashboard.layout') @php // dd($settings) @endphp @section('content')

INVOICE

Payment Receipt

INV-{{ str_pad($payment->id, 6, '0', STR_PAD_LEFT) }}

Issued: {{ $payment->created_at->format('M d, Y') }}

From

{{ $settings['company_name'] }}

{{ $settings['company_address'] }}

Email: {{ $settings['company_email'] }}

Phone: {{ $settings['company_phone'] }}

Bill To

@php $contactInfo = is_array($payment->project->serviceRequest->contact_info ?? []) ? $payment->project->serviceRequest->contact_info : json_decode($payment->project->serviceRequest->contact_info ?? '[]', true); @endphp

{{ $contactInfo['name'] ?? ($payment->user->name ?? 'N/A') }}

{{ $contactInfo['company'] ?? 'No Company' }}

{{ $contactInfo['email'] ?? ($payment->user->email ?? 'N/A') }}

{{ $contactInfo['phone'] ?? 'N/A' }}

Invoice Date

{{ $payment->created_at->format('M d, Y') }}

Payment Date

{{ \Carbon\Carbon::parse($payment->payment_date)->format('M d, Y') }}

Payment Method

{{ str_replace('_', ' ', $payment->payment_method) }}

Status

{{ ucfirst($payment->status) }}

Project Information

Project Name

{{ $payment->project->name ?? 'N/A' }}

Project ID

{{ $payment->project_id }}

Payment Details

Description

Project Payment - {{ $payment->project->name ?? 'N/A' }}

Payment via {{ str_replace('_', ' ', $payment->payment_method) }} @if($payment->transaction_id) • Transaction: {{ $payment->transaction_id }} @endif

@if($payment->notes)

Note: {{ $payment->notes }}

@endif

Amount

{{ number_format($payment->amount, 2) }} SR

Total Amount:

{{ number_format($payment->amount, 2) }} SR

Payment Summary

Amount Paid

{{ number_format($payment->amount, 2) }} SR

Payment Date

{{ \Carbon\Carbon::parse($payment->payment_date)->format('M d, Y') }}

@php $methodColors = [ 'cash' => 'bg-green-100 text-green-800', 'bank_transfer' => 'bg-blue-100 text-blue-800', 'check' => 'bg-purple-100 text-purple-800', 'online' => 'bg-indigo-100 text-indigo-800', 'mobile_banking' => 'bg-orange-100 text-orange-800', 'card' => 'bg-red-100 text-red-800', ]; $methodIconColors = [ 'cash' => 'text-green-600', 'bank_transfer' => 'text-blue-600', 'check' => 'text-purple-600', 'online' => 'text-indigo-600', 'mobile_banking' => 'text-orange-600', 'card' => 'text-red-600', ]; $methodIcons = [ 'cash' => 'fa-money-bill', 'bank_transfer' => 'fa-university', 'check' => 'fa-file-invoice', 'online' => 'fa-globe', 'mobile_banking' => 'fa-mobile-alt', 'card' => 'fa-credit-card', ]; @endphp

Payment Method

{{ str_replace('_', ' ', $payment->payment_method) }}

Notes

@if($payment->notes)

{{ $payment->notes }}

@else

No additional notes

@endif

Scan to verify

INV-{{ str_pad($payment->id, 6, '0', STR_PAD_LEFT) }}

ID: {{ $payment->id }}

Thank you for your business

This is a computer-generated invoice. No signature required.

@endsection