@extends('layouts.app')
@section('title', \App\Helpers\TranslationHelper::transFromDatabase('Invoice Details', __('Invoice Details')))

@section('content')
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header">
                        <h3 class="card-title">
                            {{ \App\Helpers\TranslationHelper::transFromDatabase('Invoice', __('Invoice')) }}:
                            {{ $invoice->invoice_number }}</h3>
                        <div class="card-tools">
                            <a href="{{ route('customer-invoices.print', $invoice->id) }}" class="btn btn-sm btn-info"
                                target="_blank">
                                <i class="fas fa-print"></i>
                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Print', __('Print')) }}
                            </a>
                            <a href="{{ route('customer-invoices.pdf', $invoice->id) }}" class="btn btn-sm btn-danger">
                                <i class="fas fa-file-pdf"></i>
                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Export PDF', __('Export PDF')) }}
                            </a>
                            <div class="btn-group" role="group">
                                <button type="button" class="btn btn-sm btn-success dropdown-toggle"
                                    data-bs-toggle="dropdown">
                                    <i class="fas fa-undo-alt"></i>
                                    {{ \App\Helpers\TranslationHelper::transFromDatabase('Return', __('Return')) }}
                                </button>
                                <div class="dropdown-menu dropdown-menu-end">
                                    <a class="dropdown-item"
                                        href="{{ route('customer-invoice-returns.create-from-invoice', ['invoice' => $invoice->id, 'returnType' => 'sales_return']) }}">
                                        <i class="fas fa-undo-alt"></i>
                                        {{ \App\Helpers\TranslationHelper::transFromDatabase('Sales Return', __('Sales Return')) }}
                                    </a>
                                    <a class="dropdown-item"
                                        href="{{ route('customer-invoice-returns.create-from-invoice', ['invoice' => $invoice->id, 'returnType' => 'credit_note']) }}">
                                        <i class="fas fa-file-invoice-dollar"></i>
                                        {{ \App\Helpers\TranslationHelper::transFromDatabase('Credit Note', __('Credit Note')) }}
                                    </a>
                                </div>
                            </div>
                            @can('update', $invoice)
                                <a href="{{ route('customer-invoices.cost-centers.edit', $invoice->id) }}"
                                    class="btn btn-sm btn-primary">
                                    <i class="fas fa-project-diagram"></i>
                                    {{ \App\Helpers\TranslationHelper::transFromDatabase('Assign Cost Centers', __('Assign Cost Centers')) }}
                                </a>
                                <a href="{{ route('customer-invoices.edit', $invoice->id) }}" class="btn btn-sm btn-warning">
                                    <i class="fas fa-edit"></i>
                                    {{ \App\Helpers\TranslationHelper::transFromDatabase('Edit', __('Edit')) }}
                                </a>
                            @endcan
                            
                            {{-- ZATCA Submission Button --}}
                            <form action="{{ route('zatca.submission.invoice', $invoice->id) }}" method="POST" class="d-inline">
                                @csrf
                                <button type="submit" class="btn btn-sm btn-dark" onclick="return confirm('هل أنت متأكد من إرسال الفاتورة لهيئة الزكاة والدخل؟')">
                                    <i class="fas fa-paper-plane"></i>
                                    إرسال إلى ZATCA
                                </button>
                            </form>

                            <a href="{{ route('customer-invoices.index') }}" class="btn btn-sm btn-secondary">
                                <i class="fas fa-arrow-right"></i>
                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Back', __('Back')) }}
                            </a>
                        </div>
                    </div>
                    <div class="card-body">
                        {{-- معلومات الشركة مع اللوجو --}}
                        <div class="row mb-4 pb-4 border-bottom">
                            @if ($invoice->company->logo)
                                <div class="col-md-1">
                                    <img src="{{ asset('storage/' . $invoice->company->logo) }}"
                                        alt="{{ $invoice->company->name }}" class="img-fluid rounded"
                                        style="max-width: 100px; height: auto;">
                                </div>
                            @endif
                            <div class="col-md-5">
                                <h5 class="fw-bold">{{ $invoice->company->name }}</h5>
                                <small class="text-muted d-block">
                                    <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Tax Number', __('Tax Number')) }}:</strong>
                                    {{ $invoice->company->tax_number }}
                                </small>
                                <small class="text-muted d-block">
                                    <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Commercial Register', __('Commercial Register')) }}:</strong>
                                    {{ $invoice->company->commercial_record }}
                                </small>
                                <small class="text-muted d-block">
                                    <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Address', __('Address')) }}:</strong>
                                    {{ $invoice->company->address }}
                                </small>
                                <small class="text-muted d-block">
                                    <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Phone', __('Phone')) }}:</strong>
                                    {{ $invoice->company->phone }}
                                </small>
                                <small class="text-muted d-block">
                                    <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Email', __('Email')) }}:</strong>
                                    {{ $invoice->company->email }}
                                </small>
                            </div>
                        </div>

                        <div class="row mb-4">
                            <div class="col-md-3">
                                <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Invoice Number', __('Invoice Number')) }}:</strong>
                                <p>{{ $invoice->invoice_number }}</p>
                            </div>
                            <div class="col-md-3">
                                <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Reference Number', __('الرقم المرجعي')) }}:</strong>
                                <p>{{ $invoice->reference_number ?? '-' }}</p>
                            </div>
                            <div class="col-md-3">
                                <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Customer Name', __('Customer Name')) }}:</strong>
                                <p>{{ $invoice->customer_name }}</p>
                            </div>
                            <div class="col-md-3">
                                <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Diverse Customer Name', __('اسم العميل المتنوع')) }}:</strong>
                                <p>{{ $invoice->diverse_customer_name ?? '-' }}</p>
                            </div>
                        </div>

                        <div class="row mb-4">
                            <div class="col-md-3">
                                <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Invoice Date', __('Invoice Date')) }}:</strong>
                                <p>
                                    @if ($invoice->invoice_date_time)
                                        {{ $invoice->invoice_date_time->format('Y-m-d H:i:s') }}
                                    @else
                                        {{ $invoice->invoice_date->format('Y-m-d') }}
                                    @endif
                                </p>

                            </div>
                            <div class="col-md-3">
                                <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Due Date', __('Due Date')) }}:</strong>
                                <p>{{ $invoice->due_date->format('Y-m-d') }}</p>
                            </div>
                        </div>

                        <div class="row mb-4">
                            <div class="col-md-3">
                                <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Status', __('Status')) }}:</strong>
                                <p>
                                    @switch($invoice->status)
                                        @case('draft')
                                            <span
                                                class="badge badge-secondary">{{ \App\Helpers\TranslationHelper::transFromDatabase('Draft', __('Draft')) }}</span>
                                        @break

                                        @case('sent')
                                            <span
                                                class="">{{ \App\Helpers\TranslationHelper::transFromDatabase('Sent', __('Sent')) }}</span>
                                        @break

                                        @case('paid')
                                            <span
                                                class="badge badge-success">{{ \App\Helpers\TranslationHelper::transFromDatabase('Paid', __('Paid')) }}</span>
                                        @break

                                        @case('partially_paid')
                                            <span
                                                class="badge badge-warning">{{ \App\Helpers\TranslationHelper::transFromDatabase('Partially Paid', __('Partially Paid')) }}</span>
                                        @break

                                        @case('overdue')
                                            <span
                                                class="badge badge-danger">{{ \App\Helpers\TranslationHelper::transFromDatabase('Overdue', __('Overdue')) }}</span>
                                        @break

                                        @case('cancelled')
                                            <span
                                                class="badge badge-dark">{{ \App\Helpers\TranslationHelper::transFromDatabase('Cancelled', __('Cancelled')) }}</span>
                                        @break
                                    @endswitch
                                </p>
                            </div>
                            
                            <div class="col-md-3">
                                <strong>حالة الربط مع ZATCA:</strong>
                                <p>
                                    @if($invoice->zatca_compliance_status == 'PASS' || $invoice->zatca_compliance_status == 'WARNING')
                                        <span class="badge badge-success">✅ تم الإرسال ({{ $invoice->zatca_compliance_status }})</span>
                                    @elseif($invoice->zatca_compliance_status == 'REPORTED')
                                        <span class="badge badge-success">✅ تم الإبلاغ (REPORTED)</span>
                                    @elseif($invoice->zatca_compliance_status == 'CLEARED')
                                        <span class="badge badge-success">✅ تم التخليص (CLEARED)</span>
                                    @elseif($invoice->zatca_compliance_status)
                                        <span class="badge badge-danger">❌ {{ $invoice->zatca_compliance_status }}</span>
                                    @else
                                        <span class="badge badge-secondary">⏳ لم يتم الإرسال بعد</span>
                                    @endif
                                </p>
                            </div>

                            @if ($invoice->customer_contract_id)
                                <div class="col-md-3">
                                    <strong>{{ \App\Helpers\TranslationHelper::transFromDatabase('Contract Title', __('Contract Title')) }}:</strong>
                                    <p>{{ $invoice->contract->contract_number }} - {{ $invoice->contract->title }}</p>
                                </div>
                            @endif
                        </div>

                        <div class="form-group mt-4">
                            <h5>{{ \App\Helpers\TranslationHelper::transFromDatabase('Invoice Items', __('Invoice Items')) }}
                            </h5>
                            <div class="table-responsive">
                                <table class="table table-bordered table-sm">
                                    <thead class="bg-light">
                                        <tr>
                                            <th>#</th>
                                            <th>{{ \App\Helpers\TranslationHelper::transFromDatabase('Item Name', __('Item Name')) }}
                                            </th>
                                            <th style="width: 100px;">
                                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Item Unit', __('Item Unit')) }}
                                            </th>
                                            <th>{{ \App\Helpers\TranslationHelper::transFromDatabase('Description', __('Description')) }}
                                            </th>
                                            <th style="width: 80px;">
                                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Quantity', __('Quantity')) }}
                                            </th>
                                            <th style="width: 100px;">
                                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Unit Price', __('Unit Price')) }}
                                            </th>
                                            <th style="width: 80px;">
                                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Discount %', __('Discount %')) }}
                                            </th>
                                            <th style="width: 80px;">
                                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Tax %', __('Tax %')) }}
                                            </th>
                                            <th style="width: 80px;">
                                                {{ \App\Helpers\TranslationHelper::transFromDatabase('WHT %', __('خصم/إضافة %')) }}
                                            </th>
                                            <th style="width: 100px;">
                                                {{ \App\Helpers\TranslationHelper::transFromDatabase('Line Total', __('Line Total')) }}
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @forelse($items as $inde => $item)
                                            <tr>
                                                <td>{{ $inde + 1 }}</td>
                                                <td>{{ $item->item->name ?? '-' }}</td>
                                                <td>{{ $item->itemUnit && $item->itemUnit->unit ? $item->itemUnit->unit->name : '-' }}
                                                </td>
                                                <td>{{ $item->description }}</td>
                                                <td class="text-right">{{ number_format($item->quantity, 2) }}</td>
                                                <td class="text-right">{{ number_format($item->unit_price, 2) }}</td>
                                                <td class="text-right">{{ number_format($item->discount_amount, 2) }}%</td>
                                                <td class="text-right">
                                                    {{ number_format($item->tax_rate + ($item->tax_rate_2 ?? 0), 2) }}%
                                                </td>
                                                <td class="text-right">
                                                    {{ number_format($item->withholding_tax_rate, 2) }}%
                                                </td>
                                                <td class="text-right font-weight-bold text-primary">
                                                    {{ number_format($item->total, 2) }}</td>
                                            </tr>
                                        @empty
                                            <tr>
                                                <td colspan="9" class="text-center text-muted">
                                                    {{ \App\Helpers\TranslationHelper::transFromDatabase('No Items In This Invoice', __('No Items In This Invoice')) }}
                                                </td>
                                            </tr>
                                        @endforelse
                                    </tbody>
                                </table>
                            </div>
                        </div>

                        <div class="row mb-4">
                            <div class="col-md-8"></div>
                            <div class="col-md-4">
                                <div class="card bg-light">
                                    <div class="card-body">
                                        <div class="d-flex justify-content-between mb-2">
                                            <span>{{ \App\Helpers\TranslationHelper::transFromDatabase('Subtotal', __('Subtotal')) }}:</span>
                                            <strong>{{ number_format($invoice->subtotal, 2) }}</strong>
                                        </div>
                                        <div class="d-flex justify-content-between mb-2">
                                            <span>{{ \App\Helpers\TranslationHelper::transFromDatabase('Total Discount', __('Total Discount')) }}:</span>
                                            <strong>{{ number_format($invoice->discount_amount, 2) }}</strong>
                                        </div>
                                        <div class="d-flex justify-content-between mb-2">
                                            <span>{{ \App\Helpers\TranslationHelper::transFromDatabase('Total Tax', __('Total Tax')) }}:</span>
                                            <strong>{{ number_format($invoice->tax_amount, 2) }}</strong>
                                        </div>
                                        <div class="d-flex justify-content-between mb-2">
                                            <span>{{ \App\Helpers\TranslationHelper::transFromDatabase('Total WHT', __('إجمالي الخصم والإضافة')) }}:</span>
                                            <strong class="text-purple">{{ number_format($invoice->total_withholding_tax, 2) }}</strong>
                                        </div>
                                        <hr>
                                        <div class="d-flex justify-content-between mb-2">
                                            <span
                                                class="font-weight-bold">{{ \App\Helpers\TranslationHelper::transFromDatabase('Total Amount', __('Total Amount')) }}:</span>
                                            <strong
                                                class="text-primary h5">{{ number_format($invoice->total_amount, 2) }}</strong>
                                        </div>
                                        <div class="d-flex justify-content-between">
                                            <span
                                                class="font-weight-bold">{{ \App\Helpers\TranslationHelper::transFromDatabase('Net Payable', __('صافي المستحق')) }}:</span>
                                            <strong
                                                class="text-success h5">{{ number_format($invoice->net_payable, 2) }}</strong>
                                        </div>
                                        <div class="d-flex justify-content-between mt-2">
                                            <span>{{ \App\Helpers\TranslationHelper::transFromDatabase('Paid Amount', __('Paid Amount')) }}:</span>
                                            <strong class="text-success">{{ number_format($invoice->paid_amount, 2) }}</strong>
                                        </div>
                                        <div class="d-flex justify-content-between mt-2">
                                            <span>{{ \App\Helpers\TranslationHelper::transFromDatabase('Remaining Amount', __('Remaining Amount')) }}:</span>
                                            <strong class="text-danger">{{ number_format($invoice->remaining_amount, 2) }}</strong>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        @if ($invoice->notes)
                            <div class="row mb-4">
                                <div class="col-md-12">
                                    <h6>{{ \App\Helpers\TranslationHelper::transFromDatabase('Notes', __('Notes')) }}:</h6>
                                    <p>{{ $invoice->notes }}</p>
                                </div>
                            </div>
                        @endif

                        @if ($invoice->attachment)
                            <div class="row mb-4">
                                <div class="col-md-12">
                                    <h6>{{ \App\Helpers\TranslationHelper::transFromDatabase('Attachments', __('Attachments')) }}:
                                    </h6>
                                    <a href="{{ Storage::url($invoice->attachment) }}" class="btn btn-sm btn-info"
                                        target="_blank">
                                        <i class="fas fa-download"></i>
                                        {{ \App\Helpers\TranslationHelper::transFromDatabase('Download File', __('Download File')) }}
                                    </a>
                                </div>
                            </div>
                        @endif

                        <!-- 🔐 QR Code Section -->
                        @if ($qrCode)
                            <div class="row mb-4">
                                <div class="col-md-12">
                                    <div class="card border-primary">
                                        <div class="card-header bg-primary text-white">
                                            <h6 class="mb-0">
                                                <i class="fas fa-qrcode"></i>
                                                رمز الاستجابة السريعة (QR Code)
                                            </h6>
                                        </div>
                                        <div class="card-body text-center">
                                            <!-- QR Code Status -->
                                            <div class="mb-3">
                                                @if ($qrCodeValid)
                                                    <span class="badge badge-success" style="font-size: 14px;">
                                                        ✅ متوافق مع متطلبات الزكاة والدخل
                                                    </span>
                                                @else
                                                    <span class="badge badge-warning" style="font-size: 14px;">
                                                        ⚠️ بيانات غير كاملة
                                                    </span>
                                                @endif
                                            </div>

                                            <!-- QR Code Image -->
                                            <div class="p-3 mb-3"
                                                style="background: white; border: 2px solid #ddd; display: inline-block; border-radius: 8px;">
                                                {!! $qrCode !!}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- QR Code Data Info -->
                            <div class="row mb-4">
                                <div class="col-md-12">
                                    <div class="card border-info">
                                        <div class="card-header bg-info text-white">
                                            <h6 class="mb-0">
                                                <i class="fas fa-info-circle"></i> البيانات المشفرة في QR Code
                                            </h6>
                                        </div>
                                        <div class="card-body">
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <strong>اسم البائع:</strong><br>
                                                    <p class="text-muted">{{ $invoice->company->name ?? 'غير محدد' }}</p>
                                                </div>
                                                <div class="col-md-6">
                                                    <strong>الرقم الضريبي:</strong><br>
                                                    <p class="text-muted">
                                                        {{ $invoice->company->tax_number ?? 'غير محدد' }}</p>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <strong>تاريخ الفاتورة:</strong><br>
                                                    <p class="text-muted">
                                                        @if ($invoice->invoice_date_time)
                                                            {{ $invoice->invoice_date_time->format('Y-m-d H:i:s') }}
                                                        @else
                                                            {{ $invoice->invoice_date->format('Y-m-d H:i:s') }}
                                                        @endif
                                                    </p>
                                                </div>
                                                <div class="col-md-6">
                                                    <strong>إجمالي المبلغ:</strong><br>
                                                    <p class="text-muted">{{ number_format($invoice->total_amount, 2) }}
                                                        {{ $invoice->company->currency ?? 'ريال' }}</p>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <strong>مبلغ الضريبة:</strong><br>
                                                    <p class="text-muted">{{ number_format($invoice->tax_amount, 2) }}
                                                        {{ $invoice->company->currency ?? 'ريال' }}</p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        @endif

                        @if (count($payments) > 0)
                            <div class="row mb-4">
                                <div class="col-md-12">
                                    <h6>{{ \App\Helpers\TranslationHelper::transFromDatabase('Payments', __('Payments')) }}:
                                    </h6>
                                    <div class="table-responsive">
                                        <table class="table table-sm table-bordered">
                                            <thead class="bg-light">
                                                <tr>
                                                    <th>{{ \App\Helpers\TranslationHelper::transFromDatabase('Payment Date', __('Payment Date')) }}
                                                    </th>
                                                    <th>{{ \App\Helpers\TranslationHelper::transFromDatabase('Payment Amount', __('Payment Amount')) }}
                                                    </th>
                                                    <th>{{ \App\Helpers\TranslationHelper::transFromDatabase('Payment Method', __('Payment Method')) }}
                                                    </th>
                                                    <th>{{ \App\Helpers\TranslationHelper::transFromDatabase('Status', __('Status')) }}
                                                    </th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                @foreach ($payments as $payment)
                                                    <tr>
                                                        <td>{{ $payment->created_at->format('Y-m-d') }}</td>
                                                        <td>{{ number_format($payment->amount, 2) }}</td>
                                                        <td>{{ $payment->payment_method }}</td>
                                                        <td>
                                                            <span
                                                                class="badge badge-success">{{ \App\Helpers\TranslationHelper::transFromDatabase('Paid', __('Paid')) }}</span>
                                                        </td>
                                                    </tr>
                                                @endforeach
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        @endif

                        <div class="row">
                            <div class="col-md-12">
                                <a href="{{ route('customer-invoices.print', $invoice->id) }}" class="btn btn-info"
                                    target="_blank">
                                    <i class="fas fa-print"></i>
                                    {{ \App\Helpers\TranslationHelper::transFromDatabase('Print', __('Print')) }}
                                </a>
                                <div class="btn-group" role="group">
                                    <button type="button" class="btn btn-success dropdown-toggle"
                                        data-bs-toggle="dropdown">
                                        <i class="fas fa-undo-alt"></i>
                                        {{ \App\Helpers\TranslationHelper::transFromDatabase('Return', __('Return')) }}
                                    </button>
                                    <div class="dropdown-menu">
                                        <a class="dropdown-item"
                                            href="{{ route('customer-invoice-returns.create-from-invoice', ['invoice' => $invoice->id, 'returnType' => 'sales_return']) }}">
                                            <i class="fas fa-undo-alt"></i>
                                            {{ \App\Helpers\TranslationHelper::transFromDatabase('Sales Return', __('Sales Return')) }}
                                        </a>
                                        <a class="dropdown-item"
                                            href="{{ route('customer-invoice-returns.create-from-invoice', ['invoice' => $invoice->id, 'returnType' => 'credit_note']) }}">
                                            <i class="fas fa-file-invoice-dollar"></i>
                                            {{ \App\Helpers\TranslationHelper::transFromDatabase('Credit Note', __('Credit Note')) }}
                                        </a>
                                    </div>
                                </div>
                                @can('update', $invoice)
                                    <a href="{{ route('customer-invoices.cost-centers.edit', $invoice->id) }}"
                                        class="btn btn-primary">
                                        <i class="fas fa-project-diagram"></i>
                                        {{ \App\Helpers\TranslationHelper::transFromDatabase('Assign Cost Centers', __('Assign Cost Centers')) }}
                                    </a>
                                    <a href="{{ route('customer-invoices.edit', $invoice->id) }}" class="btn btn-warning">
                                        <i class="fas fa-edit"></i>
                                        {{ \App\Helpers\TranslationHelper::transFromDatabase('Edit', __('Edit')) }}
                                    </a>
                                @endcan
                                <a href="{{ route('customer-invoices.index') }}" class="btn btn-secondary">
                                    <i class="fas fa-arrow-right"></i>
                                    {{ \App\Helpers\TranslationHelper::transFromDatabase('Back', __('Back')) }}
                                </a>
                                @can('delete', $invoice)
                                    <button type="button" class="btn btn-danger" data-bs-toggle="modal"
                                        data-bs-target="#deleteModal">
                                        <i class="fas fa-trash"></i>
                                        {{ \App\Helpers\TranslationHelper::transFromDatabase('Delete', __('Delete')) }}
                                    </button>
                                @endcan
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="deleteModalLabel">
                        {{ \App\Helpers\TranslationHelper::transFromDatabase('Confirm Deletion', __('Confirm Deletion')) }}
                    </h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    {{ \App\Helpers\TranslationHelper::transFromDatabase('Are You Sure You Want To Delete This Invoice', __('Are You Sure You Want To Delete This Invoice')) }}?
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary"
                        data-bs-dismiss="modal">{{ \App\Helpers\TranslationHelper::transFromDatabase('Cancel', __('Cancel')) }}</button>
                    <form action="{{ route('customer-invoices.destroy', $invoice->id) }}" method="POST"
                        style="display: inline;">
                        @csrf
                        @method('DELETE')
                        <button type="submit"
                            class="btn btn-danger">{{ \App\Helpers\TranslationHelper::transFromDatabase('Delete', __('Delete')) }}</button>
                    </form>
                </div>
            </div>
        </div>
    </div>

@endsection
