Commit ecdaefbf authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix invoice print for tablets/phones: open dedicated print page instead of window.print()

- Registration wizard now opens /invoices/{uuid}/print in new tab instead of printing whole page
- Print view redesigned: mobile-responsive layout, touch-friendly 48px buttons, proper viewport
- Share button (Web Share API) shows on mobile devices that support it
- Print-receipt-button component changed from window.open popup to target=_blank link
- Added min-height 48px to all action buttons for touch accessibility
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 4cb2acc4
@props(['route', 'size' => 'md']) @props(['route', 'size' => 'md', 'label' => null])
@php @php
$sizeClasses = match($size) { $sizeClasses = match($size) {
'sm' => 'px-3 py-2 text-sm gap-1.5', 'sm' => 'px-3 py-2 text-sm gap-1.5 min-h-[36px]',
'lg' => 'px-6 py-3 text-base gap-2.5', 'lg' => 'px-6 py-3 text-base gap-2.5 min-h-[48px]',
default => 'px-4 py-2.5 text-sm gap-2', default => 'px-4 py-2.5 text-sm gap-2 min-h-[44px]',
}; };
@endphp @endphp
<button <a
type="button" href="{{ $route }}"
x-data target="_blank"
@click=" {{ $attributes->merge(['class' => "inline-flex items-center justify-center {$sizeClasses} bg-green-600 text-white rounded-lg font-medium hover:bg-green-700 active:bg-green-800 active:scale-[0.97] focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 transition-all no-underline"]) }}
const win = window.open('{{ $route }}', '_blank', 'width=350,height=600,scrollbars=yes,resizable=yes');
if (win) {
win.focus();
}
"
{{ $attributes->merge(['class' => "inline-flex items-center justify-center {$sizeClasses} bg-green-600 text-white rounded-lg font-medium hover:bg-green-700 active:bg-green-800 active:scale-[0.97] focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 transition-all"]) }}
> >
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
</svg> </svg>
{{ __('طباعة الإيصال') }} {{ $label ?? __('طباعة الإيصال') }}
</button> </a>
<div> <div>
<style>
@media print {
nav, aside, .sidebar, header, [data-topbar], .print\:hidden { display: none !important; }
main { margin: 0 !important; padding: 0 !important; width: 100% !important; }
body { background: white !important; }
#printable-invoice { border: none !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; max-width: 100% !important; }
}
</style>
{{-- Header --}} {{-- Header --}}
<div class="flex items-center justify-between mb-6 print:hidden"> <div class="flex items-center justify-between mb-6 print:hidden">
...@@ -946,20 +938,20 @@ class="inline-flex items-center gap-2 px-8 py-3 min-h-16 bg-green-600 text-white ...@@ -946,20 +938,20 @@ class="inline-flex items-center gap-2 px-8 py-3 min-h-16 bg-green-600 text-white
</div> </div>
{{-- Actions --}} {{-- Actions --}}
<div class="flex items-center justify-center gap-4 mt-6 print:hidden"> <div class="flex flex-col sm:flex-row items-stretch sm:items-center justify-center gap-3 mt-6 print:hidden">
<button onclick="window.print()" <a href="{{ route('invoices.print', $invoice_uuid) }}" target="_blank"
class="inline-flex items-center gap-2 px-6 py-3 bg-gray-800 text-white rounded-lg hover:bg-gray-900 text-base font-medium transition-colors"> class="inline-flex items-center justify-center gap-2 px-6 py-3 min-h-[48px] bg-gray-800 text-white rounded-lg hover:bg-gray-900 active:bg-gray-950 text-base font-medium transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
</svg> </svg>
{{ __('طباعة الفاتورة') }} {{ __('طباعة الفاتورة') }}
</button> </a>
<a href="{{ route('receptionist.new-registration') }}" wire:navigate <a href="{{ route('receptionist.new-registration') }}" wire:navigate
class="inline-flex items-center gap-2 px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-base font-medium transition-colors"> class="inline-flex items-center justify-center gap-2 px-6 py-3 min-h-[48px] bg-blue-600 text-white rounded-lg hover:bg-blue-700 active:bg-blue-800 text-base font-medium transition-colors">
{{ __('تسجيل آخر') }} {{ __('تسجيل آخر') }}
</a> </a>
<a href="{{ route('receptionist.dashboard') }}" wire:navigate <a href="{{ route('receptionist.dashboard') }}" wire:navigate
class="inline-flex items-center gap-2 px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 text-base font-medium transition-colors"> class="inline-flex items-center justify-center gap-2 px-6 py-3 min-h-[48px] bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 active:bg-gray-300 text-base font-medium transition-colors">
{{ __('العودة للاستقبال') }} {{ __('العودة للاستقبال') }}
</a> </a>
</div> </div>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<html dir="rtl" lang="ar"> <html dir="rtl" lang="ar">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ __('فاتورة') }} - {{ $invoice->number }}</title> <title>{{ __('فاتورة') }} - {{ $invoice->number }}</title>
@php @php
$branding = app(\App\Domain\Shared\Services\SettingsService::class); $branding = app(\App\Domain\Shared\Services\SettingsService::class);
...@@ -11,183 +12,319 @@ ...@@ -11,183 +12,319 @@
$academyName = app()->bound('current_academy') ? app('current_academy')->name_ar : 'الكابتن'; $academyName = app()->bound('current_academy') ? app('current_academy')->name_ar : 'الكابتن';
$branch = \App\Domain\Identity\Models\Branch::where('academy_id', app('current_academy')?->id)->first(); $branch = \App\Domain\Identity\Models\Branch::where('academy_id', app('current_academy')?->id)->first();
@endphp @endphp
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap" rel="stylesheet">
<style> <style>
* { margin: 0; padding: 0; box-sizing: border-box; } * { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Cairo', 'Noto Sans Arabic', sans-serif; direction: rtl; padding: 30px; font-size: 13px; color: #333; } body {
.header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px solid {{ $brandPrimary }}; } font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
.header h1 { font-size: 24px; color: {{ $brandPrimary }}; } direction: rtl;
.header .meta { text-align: left; font-size: 12px; color: #666; } font-size: 14px;
.header .meta p { margin-bottom: 3px; } color: #333;
background: #f3f4f6;
padding: 16px;
}
.invoice-wrapper {
max-width: 700px;
margin: 0 auto;
background: white;
border-radius: 12px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
overflow: hidden;
}
.header {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 20px;
border-bottom: 3px solid {{ $brandPrimary }};
gap: 12px;
flex-wrap: wrap;
}
.header .brand { display: flex; align-items: center; gap: 12px; } .header .brand { display: flex; align-items: center; gap: 12px; }
.header .brand img { height: 50px; object-fit: contain; } .header .brand img { height: 45px; object-fit: contain; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 25px; } .header .brand h1 { font-size: 20px; color: {{ $brandPrimary }}; margin: 0; }
.party { padding: 15px; background: #f8fafc; border-radius: 8px; } .header .meta { text-align: left; font-size: 12px; color: #666; min-width: 140px; }
.party h3 { font-size: 12px; color: #64748b; margin-bottom: 8px; text-transform: uppercase; } .header .meta p { margin-bottom: 3px; }
.party p { margin-bottom: 3px; }
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; } .parties {
th { background: {{ $brandPrimary }}; color: white; padding: 10px 12px; text-align: right; font-size: 12px; } display: grid;
td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; } grid-template-columns: 1fr 1fr;
.totals { margin-right: auto; width: 280px; } gap: 16px;
.totals .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; } padding: 16px 20px;
}
.party { padding: 12px; background: #f8fafc; border-radius: 8px; }
.party h3 { font-size: 11px; color: #64748b; margin-bottom: 6px; text-transform: uppercase; font-weight: 600; }
.party p { margin-bottom: 2px; font-size: 13px; }
.items-table { padding: 0 20px 16px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th { background: {{ $brandPrimary }}; color: white; padding: 10px 12px; text-align: right; font-size: 12px; font-weight: 600; }
td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; font-size: 13px; }
tr:last-child td { border-bottom: none; }
.totals-section { padding: 16px 20px; border-top: 1px solid #e2e8f0; }
.totals { margin-right: auto; width: 100%; max-width: 280px; }
.totals .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.totals .row.total { font-weight: bold; font-size: 16px; border-top: 2px solid #333; padding-top: 10px; margin-top: 5px; } .totals .row.total { font-weight: bold; font-size: 16px; border-top: 2px solid #333; padding-top: 10px; margin-top: 5px; }
.status-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 11px; font-weight: bold; } .totals .row.paid { color: #166534; }
.totals .row.due { color: #dc2626; font-weight: bold; }
.payments-section { padding: 0 20px 16px; }
.payments-section h3 { font-size: 14px; margin-bottom: 8px; font-weight: 600; }
.status-badge {
display: inline-block;
padding: 3px 12px;
border-radius: 12px;
font-size: 11px;
font-weight: bold;
}
.status-paid { background: #dcfce7; color: #166534; } .status-paid { background: #dcfce7; color: #166534; }
.status-sent { background: #dbeafe; color: #1e40af; } .status-sent, .status-pending { background: #dbeafe; color: #1e40af; }
.status-overdue { background: #fef2f2; color: #991b1b; } .status-overdue { background: #fef2f2; color: #991b1b; }
.status-partially_paid { background: #fef9c3; color: #854d0e; } .status-partially_paid { background: #fef9c3; color: #854d0e; }
.payments { margin-top: 20px; } .status-draft { background: #f3f4f6; color: #374151; }
.payments h3 { font-size: 14px; margin-bottom: 10px; } .status-cancelled { background: #f3f4f6; color: #6b7280; }
.footer { margin-top: 40px; text-align: center; font-size: 11px; color: #94a3b8; border-top: 1px solid #e2e8f0; padding-top: 15px; }
.no-print { margin-bottom: 15px; } .footer {
@media print { .no-print { display: none; } body { padding: 15px; } } padding: 16px 20px;
text-align: center;
font-size: 11px;
color: #94a3b8;
border-top: 1px solid #e2e8f0;
}
.actions {
padding: 16px 20px;
display: flex;
justify-content: center;
gap: 12px;
flex-wrap: wrap;
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px 24px;
min-height: 48px;
border: none;
border-radius: 8px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
font-family: inherit;
text-decoration: none;
transition: background 0.15s;
-webkit-tap-highlight-color: transparent;
}
.btn-print { background: {{ $brandPrimary }}; color: white; }
.btn-print:active { opacity: 0.85; }
.btn-share { background: #f3f4f6; color: #374151; }
.btn-share:active { background: #e5e7eb; }
/* Mobile adjustments */
@media (max-width: 600px) {
body { padding: 8px; }
.header { padding: 16px; flex-direction: column; gap: 12px; }
.header .meta { text-align: right; }
.parties { grid-template-columns: 1fr; gap: 10px; padding: 12px 16px; }
.items-table { padding: 0 12px 12px; }
th, td { padding: 8px 6px; font-size: 12px; }
.totals-section { padding: 12px 16px; }
.totals { max-width: 100%; }
.actions { padding: 12px 16px; }
.btn { width: 100%; padding: 14px 20px; }
.footer { padding: 12px 16px; }
}
@media print {
body { background: white; padding: 10px; }
.invoice-wrapper { box-shadow: none; border-radius: 0; }
.actions { display: none !important; }
.items-table { overflow: visible; }
table { min-width: unset; }
}
</style> </style>
</head> </head>
<body> <body>
<div class="no-print"> <div class="invoice-wrapper">
<button onclick="window.print()" style="padding: 8px 20px; background: {{ $brandPrimary }}; color: white; border: none; border-radius: 6px; cursor: pointer;">{{ __('طباعة') }}</button> <div class="header">
</div> <div class="brand">
@if($brandLogo)
<img src="{{ Storage::disk('public')->url($brandLogo) }}" alt="{{ $academyName }}">
@endif
<div>
<h1>{{ __('فاتورة') }}</h1>
<p style="color: #64748b; margin-top: 2px; font-size: 13px;">{{ $academyName }}</p>
@if($branch)
<p style="color: #94a3b8; font-size: 11px;">{{ $branch->name_ar }}</p>
@endif
</div>
</div>
<div class="meta">
<p><strong>{{ __('رقم الفاتورة') }}:</strong> {{ $invoice->number }}</p>
<p><strong>{{ __('التاريخ') }}:</strong> {{ $invoice->issue_date ?? $invoice->created_at?->format('Y-m-d') }}</p>
@if($invoice->due_date)
<p><strong>{{ __('الاستحقاق') }}:</strong> {{ $invoice->due_date }}</p>
@endif
<p style="margin-top: 5px;">
@php $statusValue = $invoice->status?->value ?? $invoice->status ?? 'draft'; @endphp
<span class="status-badge status-{{ $statusValue }}">{{ __($statusValue) }}</span>
</p>
</div>
</div>
<div class="header"> <div class="parties">
<div class="brand"> <div class="party">
@if($brandLogo) <h3>{{ __('العميل') }}</h3>
<img src="{{ Storage::disk('public')->url($brandLogo) }}" alt="{{ $academyName }}"> @if($invoice->billable)
@endif <p><strong>{{ $invoice->billable->full_name ?? $invoice->billable->name_ar ?? $invoice->billable->person?->name_ar ?? '-' }}</strong></p>
<div> @if($invoice->billable->phone ?? $invoice->billable->person?->phone ?? null)
<h1>{{ __('فاتورة') }}</h1> <p dir="ltr" style="color: #666;">{{ $invoice->billable->phone ?? $invoice->billable->person?->phone }}</p>
<p style="color: #64748b; margin-top: 4px;">{{ $academyName }}</p> @endif
@endif
</div>
<div class="party">
<h3>{{ __('من') }}</h3>
<p><strong>{{ $academyName }}</strong></p>
@if($branch) @if($branch)
<p style="color: #64748b; font-size: 11px;">{{ $branch->name_ar }}</p>
@if($branch->address) @if($branch->address)
<p style="color: #94a3b8; font-size: 11px;">{{ $branch->address }}</p> <p style="color: #666;">{{ $branch->address }}</p>
@endif @endif
@if($branch->phone) @if($branch->phone)
<p style="color: #94a3b8; font-size: 11px;" dir="ltr">{{ $branch->phone }}</p> <p dir="ltr" style="color: #666;">{{ $branch->phone }}</p>
@endif @endif
@endif @endif
</div> </div>
</div> </div>
<div class="meta">
<p><strong>{{ __('رقم الفاتورة') }}:</strong> {{ $invoice->number }}</p>
<p><strong>{{ __('التاريخ') }}:</strong> {{ $invoice->issue_date ?? $invoice->created_at?->format('Y-m-d') }}</p>
@if($invoice->due_date)
<p><strong>{{ __('تاريخ الاستحقاق') }}:</strong> {{ $invoice->due_date }}</p>
@endif
<p style="margin-top: 5px;">
<span class="status-badge status-{{ $invoice->status }}">{{ __($invoice->status) }}</span>
</p>
</div>
</div>
<div class="parties"> <div class="items-table">
<div class="party"> <table>
<h3>{{ __('العميل') }}</h3> <thead>
@if($invoice->billable) <tr>
<p><strong>{{ $invoice->billable->full_name ?? $invoice->billable->name_ar ?? '-' }}</strong></p> <th>#</th>
@if($invoice->billable->phone ?? null) <th>{{ __('الوصف') }}</th>
<p dir="ltr">{{ $invoice->billable->phone }}</p> <th>{{ __('الكمية') }}</th>
@endif <th>{{ __('سعر الوحدة') }}</th>
@endif <th>{{ __('الإجمالي') }}</th>
</div> </tr>
<div class="party"> </thead>
<h3>{{ __('تفاصيل') }}</h3> <tbody>
@if($invoice->notes) @forelse($invoice->items as $i => $item)
<p>{{ $invoice->notes }}</p> <tr>
@endif <td>{{ $i + 1 }}</td>
<td>{{ $item->description }}</td>
<td>{{ $item->quantity }}</td>
<td dir="ltr">{{ format_money($item->unit_price) }}</td>
<td dir="ltr">{{ format_money($item->total_amount) }}</td>
</tr>
@empty
<tr><td colspan="5" style="text-align: center; color: #999;">{{ __('لا توجد بنود') }}</td></tr>
@endforelse
</tbody>
</table>
</div> </div>
</div>
<table> <div class="totals-section">
<thead> <div class="totals">
<tr> <div class="row">
<th>#</th> <span>{{ __('المجموع الفرعي') }}</span>
<th>{{ __('الوصف') }}</th> <span dir="ltr">{{ format_money($invoice->subtotal_amount ?? $invoice->total_amount) }}</span>
<th>{{ __('الكمية') }}</th> </div>
<th>{{ __('سعر الوحدة') }}</th> @if($invoice->discount_amount > 0)
<th>{{ __('الإجمالي') }}</th> <div class="row">
</tr> <span>{{ __('الخصم') }}</span>
</thead> <span dir="ltr" style="color: #dc2626;">-{{ format_money($invoice->discount_amount) }}</span>
<tbody> </div>
@forelse($invoice->items as $i => $item) @endif
<tr> @if(($invoice->service_fee_amount ?? 0) > 0)
<td>{{ $i + 1 }}</td> <div class="row">
<td>{{ $item->description }}</td> <span>{{ __('رسوم الخدمة') }}</span>
<td>{{ $item->quantity }}</td> <span dir="ltr">{{ format_money($invoice->service_fee_amount) }}</span>
<td dir="ltr">{{ format_money($item->unit_price) }}</td> </div>
<td dir="ltr">{{ format_money($item->total_amount) }}</td> @endif
</tr> @if($invoice->tax_amount > 0)
@empty <div class="row">
<tr><td colspan="5" style="text-align: center; color: #999;">{{ __('لا توجد بنود') }}</td></tr> <span>{{ __('الضريبة') }}</span>
@endforelse <span dir="ltr">{{ format_money($invoice->tax_amount) }}</span>
</tbody> </div>
</table> @endif
<div class="row total">
<div class="totals"> <span>{{ __('الإجمالي') }}</span>
<div class="row"> <span dir="ltr">{{ format_money($invoice->total_amount) }}</span>
<span>{{ __('المجموع الفرعي') }}</span> </div>
<span dir="ltr">{{ format_money($invoice->subtotal_amount ?? $invoice->total_amount) }}</span> @if($invoice->paid_amount > 0)
</div> <div class="row paid">
@if($invoice->discount_amount > 0) <span>{{ __('المدفوع') }}</span>
<div class="row"> <span dir="ltr">{{ format_money($invoice->paid_amount) }}</span>
<span>{{ __('الخصم') }}</span> </div>
<span dir="ltr" style="color: #dc2626;">-{{ format_money($invoice->discount_amount) }}</span> <div class="row due">
</div> <span>{{ __('المتبقي') }}</span>
@endif <span dir="ltr">{{ format_money($invoice->due_amount) }}</span>
@if(($invoice->service_fee_amount ?? 0) > 0) </div>
<div class="row"> @endif
<span>{{ __('رسوم الخدمة') }}</span> </div>
<span dir="ltr">{{ format_money($invoice->service_fee_amount) }}</span>
</div> </div>
@endif
@if($invoice->tax_amount > 0) @if($invoice->payments && $invoice->payments->count())
<div class="row"> <div class="payments-section">
<span>{{ __('الضريبة') }}</span> <h3>{{ __('المدفوعات') }}</h3>
<span dir="ltr">{{ format_money($invoice->tax_amount) }}</span> <table>
<thead>
<tr>
<th>{{ __('التاريخ') }}</th>
<th>{{ __('الطريقة') }}</th>
<th>{{ __('المبلغ') }}</th>
<th>{{ __('الحالة') }}</th>
</tr>
</thead>
<tbody>
@foreach($invoice->payments as $payment)
<tr>
<td dir="ltr">{{ $payment->created_at?->format('Y-m-d') }}</td>
<td>{{ __($payment->method) }}</td>
<td dir="ltr">{{ format_money($payment->amount) }}</td>
<td>{{ __($payment->status) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
@endif @endif
<div class="row total">
<span>{{ __('الإجمالي') }}</span> <div class="footer">
<span dir="ltr">{{ format_money($invoice->total_amount) }}</span> {{ $receiptFooter }}
</div>
@if($invoice->paid_amount > 0)
<div class="row" style="color: #166534;">
<span>{{ __('المدفوع') }}</span>
<span dir="ltr">{{ format_money($invoice->paid_amount) }}</span>
</div>
<div class="row" style="font-weight: bold; color: #dc2626;">
<span>{{ __('المتبقي') }}</span>
<span dir="ltr">{{ format_money($invoice->due_amount) }}</span>
</div> </div>
@endif
</div>
@if($invoice->payments && $invoice->payments->count()) <div class="actions">
<div class="payments"> <button onclick="window.print()" class="btn btn-print">
<h3>{{ __('المدفوعات') }}</h3> <svg width="20" height="20" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<table> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
<thead> </svg>
<tr> {{ __('طباعة') }}
<th>{{ __('التاريخ') }}</th> </button>
<th>{{ __('الطريقة') }}</th> <button onclick="shareInvoice()" class="btn btn-share" id="share-btn" style="display:none;">
<th>{{ __('المبلغ') }}</th> <svg width="20" height="20" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<th>{{ __('الحالة') }}</th> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"/>
</tr> </svg>
</thead> {{ __('مشاركة') }}
<tbody> </button>
@foreach($invoice->payments as $payment) </div>
<tr>
<td dir="ltr">{{ $payment->created_at?->format('Y-m-d') }}</td>
<td>{{ __($payment->method) }}</td>
<td dir="ltr">{{ format_money($payment->amount) }}</td>
<td>{{ __($payment->status) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
@endif
<div class="footer"> <script>
{{ $receiptFooter }} if (navigator.share) {
</div> document.getElementById('share-btn').style.display = 'inline-flex';
}
function shareInvoice() {
if (navigator.share) {
navigator.share({
title: '{{ __("فاتورة") }} {{ $invoice->number }}',
url: window.location.href
}).catch(function() {});
}
}
</script>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment