@extends('layouts.master') @section('title', trans('messages.cheque')) @section('content') @php $isRTL = app()->getLocale() === 'ar'; @endphp
{{ trans('messages.cheque_details') }}

{{ trans('messages.cheque_number') }}: {{ $cheque->cheque_number }}

{{ trans('messages.type') }}: {{ $cheque->type === 'customer' ? trans('messages.customers') : trans('messages.suppliers') }}

{{ $cheque->type === 'customer' ? trans('messages.customer') : trans('messages.supplier') }}: @if($cheque->type === 'customer') {{ $cheque->customer->name ?? 'N/A' }} @else {{ $cheque->supplier->name ?? 'N/A' }} @endif

{{ trans('messages.bank_name') }}: {{ $cheque->bank_name }}

@if($cheque->bank_account)

{{ trans('messages.bank_account') }}: {{ $cheque->bank_account }}

@endif

{{ trans('messages.amount') }}: {{ format_currency($cheque->amount) }}

{{ trans('messages.issue_date') }}: {{ $cheque->issue_date->format('Y-m-d') }}

{{ trans('messages.due_date') }}: {{ $cheque->due_date->format('Y-m-d') }}

{{ trans('messages.status') }}: @php $badgeClass = match($cheque->status) { 'paid' => 'success', 'due' => 'warning', 'returned' => 'danger', 'cancelled' => 'secondary', default => 'info' }; @endphp {{ trans('messages.' . $cheque->status) }}

@if($cheque->invoice)

{{ trans('messages.invoice') }}: {{ $cheque->invoice->invoice_number }}

@endif @if($cheque->purchaseInvoice)

{{ trans('messages.purchase_invoice') }}: {{ $cheque->purchaseInvoice->invoice_number }}

@endif
@if($cheque->notes)
{{ trans('messages.notes') }}:

{{ $cheque->notes }}

@endif @if($cheque->isReturned() && $cheque->return_reason)
{{ trans('messages.return_reason') }}: {{ $cheque->return_reason }}
{{ trans('messages.returned_date') }}: {{ $cheque->returned_date->format('Y-m-d') }}
@endif @if($cheque->isPaid() && $cheque->paid_date)
{{ trans('messages.paid_date') }}: {{ $cheque->paid_date->format('Y-m-d') }}
@endif
{{ trans('messages.actions') }}
@if(!$cheque->isPaid() && !$cheque->isReturned() && !$cheque->isCancelled())
@csrf
@endif @if(!$cheque->isPaid() && !$cheque->isReturned() && !$cheque->isCancelled()) @endif @if(!in_array($cheque->status, ['paid', 'returned']))
@csrf
@endif @if(!in_array($cheque->status, ['paid', 'returned']))
@csrf @method('DELETE')
@endif
@endsection