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

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

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

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

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

{{ $overviewCheck['exchange_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['exchange_check']->amount) }}

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

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


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

@lang('accounting/checks/api-printing/exchange-check.value') @lang('accounting/checks/api-printing/exchange-check.check_number') @lang('accounting/checks/api-printing/exchange-check.beneficiary_name') @lang('accounting/checks/api-printing/exchange-check.status') @lang('accounting/checks/api-printing/exchange-check.debtor') @lang('general.description')
{{ dn($overviewCheck['exchange_check']->amount) }} {{ $overviewCheck['exchange_check']->number }} {{ $overviewCheck['exchange_check']->beneficiary_name }} {{ $overviewCheck['exchange_check']->status_as_text }} {{ $overviewCheck['exchange_check']->exchange->credit_account->name }} {{ $item->notice ?? '---' }}

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

@php $last_operation = $overviewCheck['exchange_check']->last_operation; @endphp @if ($last_operation) @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 @else {{-- @foreach ($overviewCheck['exchange_check']->exchange->items as $exchange_item) @endforeach @php $credit_account = App\Models\Accounting\Account::find($overviewCheck['exchange_check']->exchange->credit_account_id); @endphp --}} @endif
@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['exchange_check']->amount) }} --- {{ $overviewCheck['exchange_check']->notice ?? '---' }}
{{ $credit_account->name }} --- {{ dn($overviewCheck['exchange_check']->amount) }} {{ $overviewCheck['exchange_check']->notice ?? '---' }}
{{ $debit_account->name }} {{ dn($overviewCheck['exchange_check']->amount) }} --- {{ $overviewCheck['exchange_check']->notice ?? '---' }}
{{ $credit_account->name }} --- {{ dn($overviewCheck['exchange_check']->amount) }} {{ $overviewCheck['exchange_check']->notice ?? '---' }}
{{ dn($overviewCheck['exchange_check']->amount) }} {{ dn($overviewCheck['exchange_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.check_for_exchange_bond')

@php $entry_history_items = []; $check_operations = $overviewCheck['exchange_check'] ->operations() ->oldest() ->get(); $exchange = $overviewCheck['exchange_check']->exchange; 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['exchange_check']->status == 'returned') { $exchange_debit_item = $exchange->debit_items()->first(); $credit_account_id = $exchange_debit_item->receivable_id ?? $exchange_debit_item->account_id; $debit_account_id = $exchange->credit_account_id; $entry_history_items[] = (object) [ 'check_operation_id' => '---', 'debit_type' => 'account', 'debit_account_id' => $debit_account_id, 'credit_type' => $exchange_debit_item->receivable_id ? 'receivable' : '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['exchange_check']->amount) }} {{ $overviewCheck['exchange_check']->notice ?? '---' }} {{ $entry_history_item->action_type }}
{{ $entry_history_item->check_operation_id }} {{ $debit_account->name }} {{ dn($overviewCheck['exchange_check']->amount) }} --- {{ $overviewCheck['exchange_check']->notice ?? '---' }} {{ $entry_history_item->action_type }}

@endif @php $signatures = App\Models\Signature::byType('receipt')->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