@if ($overviewCheck['receipt_check'])
@lang('accounting/checks/api-printing/exchange-check.date'):

{{ $overviewCheck['receipt_check']->date }}

@lang('accounting/checks/api-printing/exchange-check.check_number') :

{{ $overviewCheck['receipt_check']->number }}

@lang('accounting/checks/api-printing/exchange-check.bank') :

{{ $overviewCheck['receipt_check']->bank }}

@php if (! function_exists('arabicTafqeet')) { function arabicTafqeet($value) { return \Tafqeet::inArabic( number_format((float) str_replace(',', '', $value), 3, '.', ''), 'jod' ); } } @endphp
@lang('accounting/checks/api-printing/exchange-check.amount') :

{{ dn($overviewCheck['receipt_check']->amount) }}

{{ arabicTafqeet(dn($overviewCheck['receipt_check']->amount)) }}

@lang('general.description') :
{{ $overviewCheck['receipt_check']->notice }}


@lang('accounting/checks/api-printing/exchange-check.receipt_check')

@lang('accounting/checks/api-printing/exchange-check.value') @lang('accounting/checks/api-printing/exchange-check.check_number') @lang('accounting/checks/api-printing/exchange-check.bank') @lang('accounting/checks/api-printing/exchange-check.status') @lang('accounting/checks/api-printing/exchange-check.creditor') @lang('general.description')
{{ dn($overviewCheck['receipt_check']->amount) }} {{ $overviewCheck['receipt_check']->number }} {{ $overviewCheck['receipt_check']->bank }} {{ $overviewCheck['receipt_check']->status_as_text }} @php $receipt_entry = $overviewCheck['receipt_check']->receipt; @endphp {{ $receipt_entry->credit_account_id ? $receipt_entry->credit_account->name : $receipt_entry->credit_receivable->name }} {{ $item->notice ?? '---' }}

@lang('accounting/checks/api-printing/exchange-check.receipt_check')

@php $last_operation = []; if ($overviewCheck['receipt_check']->status == 'converted') { $converted_operation = $overviewCheck['receipt_check']->converted_operation; $last_operation = [ 'debit_type' => 'receivable', 'debit_account_id' => $converted_operation->receivable_account_id, 'credit_type' => 'account', 'credit_account_id' => $converted_operation->credit_account_id, ]; } else { $last_operation = $overviewCheck['receipt_check']->last_operation; if (is_null($last_operation)) { $last_operation = [ 'debit_type' => 'account', 'debit_account_id' => $overviewCheck['receipt_check']->receipt->debit_account_id, 'credit_type' => $overviewCheck['receipt_check']->receipt->credit_type, 'credit_account_id' => $overviewCheck['receipt_check']->receipt->credit_account_id ?? $overviewCheck['receipt_check']->receipt->credit_receivable_id, ]; } } $last_operation = (object) $last_operation; @endphp @php $debit_account = $last_operation->debit_type == 'account' ? App\Models\Accounting\Account::find($last_operation->debit_account_id) : App\Models\Receivables\ReceivableAccount::find( $last_operation->debit_account_id, ); @endphp @php $credit_account = $last_operation->credit_type == 'account' ? App\Models\Accounting\Account::find($last_operation->credit_account_id) : App\Models\Receivables\ReceivableAccount::find( $last_operation->credit_account_id, ); @endphp
@lang('accounting/checks/api-printing/exchange-check.account_receivable') @lang('accounting/checks/api-printing/exchange-check.debtor') @lang('accounting/checks/api-printing/exchange-check.creditor') @lang('general.description')
{{ $debit_account->name }} {{ dn($overviewCheck['receipt_check']->amount) }} --- {{ $overviewCheck['receipt_check']->notice ?? '---' }}
{{ $credit_account->name }} --- {{ dn($overviewCheck['receipt_check']->amount) }} {{ $overviewCheck['receipt_check']->notice ?? '---' }}
{{ dn($overviewCheck['receipt_check']->amount) }} {{ dn($overviewCheck['receipt_check']->amount) }}

@if (array_key_exists('print_type', $overviewCheck) && ($overviewCheck['print_type'] == 'all' || $overviewCheck['print_type'] == 'history-entry'))

@lang('accounting/checks/api-printing/exchange-check.receipt_check')

@php $entry_history_items = []; $check_operations = $overviewCheck['receipt_check'] ->operations() ->oldest() ->get(); $receipt = $overviewCheck['receipt_check']->receipt; foreach ($check_operations as $check_operation) { $entry_history_items[] = (object) [ 'check_operation_id' => $check_operation->id, 'debit_type' => $check_operation->debit_type, 'debit_account_id' => $check_operation->debit_account_id, 'credit_type' => $check_operation->credit_type, 'credit_account_id' => $check_operation->credit_account_id, 'action_type' => 'إيداع', ]; } if ($overviewCheck['receipt_check']->status == 'converted') { $converted_operation = $overviewCheck['receipt_check']->converted_operation; $entry_history_items[] = (object) [ 'check_operation_id' => $converted_operation->id, 'debit_type' => 'receivable', 'debit_account_id' => $converted_operation->receivable_account_id, 'credit_type' => 'account', 'credit_account_id' => $converted_operation->credit_account_id, 'action_type' => 'تجيير', ]; } if ($overviewCheck['receipt_check']->status == 'returned') { $credit_account_id = null; $debit_account_id = $receipt->credit_type == 'account' ? $receipt->credit_account_id : $receipt->credit_receivable_id; $check_operations_count = $check_operations->count(); if ($check_operations_count > 0) { $credit_account_id = $check_operations->last()->debit_account_id; $check_operation_id = $check_operations->last()->id; } else { $credit_account_id = $overviewCheck['receipt_check']->receipt->debit_account_id; } $entry_history_items[] = (object) [ 'check_operation_id' => $check_operation_id, 'debit_type' => $overviewCheck['receipt_check']->receipt->credit_type, 'debit_account_id' => $debit_account_id, 'credit_type' => 'account', 'credit_account_id' => $credit_account_id, 'action_type' => 'الغاء / إرجاع', ]; } @endphp @foreach ($entry_history_items as $entry_history_item) @php $credit_account = $entry_history_item->credit_type == 'account' ? App\Models\Accounting\Account::find( $entry_history_item->credit_account_id, ) : App\Models\Receivables\ReceivableAccount::find( $entry_history_item->credit_account_id, ); @endphp @php $debit_account = $entry_history_item->debit_type == 'account' ? App\Models\Accounting\Account::find( $entry_history_item->debit_account_id, ) : App\Models\Receivables\ReceivableAccount::find( $entry_history_item->debit_account_id, ); @endphp @endforeach
@lang('accounting/checks/api-printing/exchange-check.number') @lang('accounting/checks/api-printing/exchange-check.account_receivable') @lang('accounting/checks/api-printing/exchange-check.debtor') @lang('accounting/checks/api-printing/exchange-check.creditor') @lang('general.description') @lang('accounting/checks/api-printing/exchange-check.transaction_type')
{{ $entry_history_item->check_operation_id }} {{ $credit_account->name }} --- {{ dn($overviewCheck['receipt_check']->amount) }} {{ $overviewCheck['receipt_check']->notice ?? '---' }} {{ $entry_history_item->action_type }}
{{ $entry_history_item->check_operation_id }} {{ $debit_account->name }} {{ dn($overviewCheck['receipt_check']->amount) }} --- {{ $overviewCheck['receipt_check']->notice ?? '---' }} {{ $entry_history_item->action_type }}

@endif @php $signatures = App\Models\Signature::byType('receipt_check')->active()->get(); @endphp @if (count($signatures))

@lang('accounting/checks/api-printing/exchange-check.signature')

@foreach ($signatures as $signature)

{{ $signature->label }}

----------------------------

@endforeach
@endif
@endif @push('script') @endpush