Commit 9bf95b08 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix invoice print crash: extract enum value before passing to translator

The PaymentMethod and PaymentStatus enums were passed directly to __()
which expects a string, causing "Cannot access offset of type enum on array".
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 0efcf003
...@@ -283,9 +283,9 @@ ...@@ -283,9 +283,9 @@
@foreach($invoice->payments as $payment) @foreach($invoice->payments as $payment)
<tr> <tr>
<td dir="ltr">{{ $payment->created_at?->format('Y-m-d') }}</td> <td dir="ltr">{{ $payment->created_at?->format('Y-m-d') }}</td>
<td>{{ __($payment->method) }}</td> <td>{{ __($payment->method instanceof \BackedEnum ? $payment->method->value : $payment->method) }}</td>
<td dir="ltr">{{ format_money($payment->amount) }}</td> <td dir="ltr">{{ format_money($payment->amount) }}</td>
<td>{{ __($payment->status) }}</td> <td>{{ __($payment->status instanceof \BackedEnum ? $payment->status->value : $payment->status) }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
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