@lang('warehouses/sales-invoices/show.invoice') {{ $resource->type_as_text }}
@lang('warehouses/sales-invoices/show.invoice_number') :

{{ $resource->bond_number }}

@lang('warehouses/sales-invoices/show.invoice_type') :

{{ $resource->type_as_text }}

@lang('warehouses/sales-invoices/show.branch'):

{{ $resource->branch->name }}

@lang('warehouses/sales-invoices/show.date'):

{{ $resource->date }}

@lang('warehouses/sales-invoices/show.client'):

{{ $resource->client?->name ?? 'نقدي' }}

@lang('warehouses/sales-invoices/show.client_branch') :

{{ $resource->client_brnach?->name }}

@lang('warehouses/sales-invoices/show.required_from') :

{{ $resource->client_name }}

@lang('warehouses/sales-invoices/show.client_tax_number') :

{{ $resource->client?->tax_number }}

@lang('warehouses/sales-invoices/show.price_type') :

{{ $resource->price_type?->name }}

@lang('warehouses/sales-invoices/show.payment_method') :

{{ $overviewBond['bond']->selected_payment_way?? '---' }}

@lang('warehouses/sales-invoices/show.due_date') :

{{ $resource->accured_date }}

@lang('warehouses/sales-invoices/show.delivery_date') :

{{ $resource->delivered_date }}

@lang('warehouses/sales-invoices/show.driver'):

{{ $resource->driver?->name }}

@lang('warehouses/sales-invoices/show.items')

@php $total = 0; $tax_amounts_total = 0; $total_amount_before_normal_discounts = 0; $total_extra_discounts = 0; $client_discount=0; @endphp @foreach ($resource->items as $item) @php $total_amount_before_normal_discounts+= $item->price_after_discount * $item->quantity; $total_extra_discounts+= $item->extra_discount_amount? $item->extra_discount_amount * $item->quantity : 0; $client_discount +=($resource->client_discount_ratio/100)* $item->total_final_price ; $total_price_after_discount = $item->price_after_discount * $item->quantity; $tax_ratio = $item->tax_ratio; $tax_amount = $tax_ratio ? $total_price_after_discount * ($tax_ratio / 100) : 0; $total += $total_price_after_discount + $tax_amount; $tax_amounts_total += $tax_amount; @endphp @if ($item->bonus) @endif @endforeach
@lang('warehouses/sales-invoices/show.unit_code') @lang('warehouses/sales-invoices/show.item_description') @lang('warehouses/sales-invoices/show.unit') @lang('warehouses/sales-invoices/show.quantity') @lang('warehouses/sales-invoices/show.unit_price') @lang('warehouses/sales-invoices/show.total_price') @lang('warehouses/sales-invoices/show.tax_percentage') @lang('warehouses/sales-invoices/show.total') @lang('warehouses/sales-invoices/show.expiration_date') @lang('warehouses/sales-invoices/show.serial_numbers') @lang('warehouses/sales-invoices/show.comments')
{{ $item->barcode->number }} {{ $item->barcode->ar_name }} {{ $item->barcode->unit->name }} {{ dn($item->quantity) }} {{ dn($item->price_after_discount) }} {{ dn($total_price_after_discount) }} {{ $tax_ratio ?? '---' }} {{ dn($total_price_after_discount + $tax_amount) }} {{ $item->expire_date }} @if (is_array($item->serial_items) && count($item->serial_items))
@csrf
@else --- @endif
{{ $item->notice }}
{{ $item->barcode->number }} {{ $item->barcode->ar_name }} {{ $item->barcode->unit->name }} {{ dn($item->bonus) }} {{ dn(0) }} {{ dn(0) }} {{ dn(0) }} {{ dn(0) }} {{ $item->expire_date }} --- {{ $item->notice }}

@lang('warehouses/sales-invoices/show.expenses')

@php $total = 0; @endphp @if ($resource->expenses) @foreach ($resource->expenses as $item) @php $total+= $item->amount; @endphp @endforeach @endif
@lang('warehouses/sales-invoices/show.expense') @lang('warehouses/sales-invoices/show.value') @lang('warehouses/sales-invoices/show.account')
{{ $item->standard_expenses->name }} {{ $item->amount }} {{ $item->standard_expenses->account->name }}
@lang('general.total') {{ $total }}
@lang('warehouses/sales-invoices/show.cash_invoice')
@lang('warehouses/sales-invoices/show.invoice_number') :

{{ $resource->bond_number }}

@lang('warehouses/sales-invoices/show.branch'):

{{ $resource->branch->name }}

@lang('warehouses/sales-invoices/show.date'):

{{ $resource->date }}

@lang('warehouses/sales-invoices/show.client'):

{{ $resource->client?->name }}

@lang('warehouses/sales-invoices/show.client_tax_number') :

{{ $resource->client?->tax_number }}

@php $debit_sum = 0; $credit_sum = 0; $salesInvoiceService = new App\Services\Tenant\Warehouses\SalesInvoiceService(); $entry_accounts = $salesInvoiceService->buildBondAsEntry($resource); @endphp @if ($entry_accounts && $entry_accounts['debit_accounts']) @foreach ($entry_accounts['debit_accounts'] as $debit_key => $accounts_list) @foreach ($accounts_list as $debit_item_id => $account_info) @php $debit_sum+= $account_info['amount']; @endphp @endforeach @endforeach @endif @if ($entry_accounts && $entry_accounts['credit_accounts']) @foreach ($entry_accounts['credit_accounts'] as $credit_key => $accounts_list) @foreach ($accounts_list as $credit_item_id => $account_info) @php $credit_sum+= $account_info['amount']; @endphp @endforeach @endforeach @endif
@lang('warehouses/sales-invoices/show.account_receivable') @lang('warehouses/sales-invoices/show.debtor') @lang('warehouses/sales-invoices/show.creditor') @lang('warehouses/sales-invoices/show.cost_center') @lang('warehouses/sales-invoices/show.description')
{{ $account_info['account']->name }} {{ dn($account_info['amount']) }} --- ---
{{ $account_info['account']->name }} --- {{ dn($account_info['amount']) }} ---
{{ dn($debit_sum) }} {{ dn($credit_sum) }}

@lang('warehouses/sales-invoices/show.comments') :
{{ $resource->notice }}


@lang('warehouses/sales-invoices/show.goods_received')

@lang('warehouses/sales-invoices/show.goods_received')

@php $signatures = App\Models\Warehouses\WarehousesSignature::byType('sales_invoice') ->active() ->get(); @endphp @if (count($signatures))

@lang('warehouses/sales-invoices/show.signature')

@foreach ($signatures as $signature)

{{ $signature->label }}

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

@endforeach
@endif
@lang('warehouses/sales-invoices/show.total_before_additional_discount') : {{ dn($total_amount_before_normal_discounts) }}
@lang('warehouses/sales-invoices/show.additional_discount') : {{ dn($total_extra_discounts) }}
@lang('warehouses/sales-invoices/show.client_discount') : {{ dn($client_discount) }}
@lang('warehouses/sales-invoices/show.total_after_additional_discount') : {{ dn($total_amount_before_normal_discounts - ($total_extra_discounts+$client_discount)) }}
@lang('warehouses/sales-invoices/show.tax') {{ dn($tax_amounts_total) }}
@lang('warehouses/sales-invoices/show._total') {{ dn($total_amount_before_normal_discounts - ($total_extra_discounts+$client_discount) + $tax_amounts_total ) }}

@lang('warehouses/sales-invoices/show.recipient_name')

@lang('warehouses/sales-invoices/show.recipient_signature')

{{ Tafqeet::inArabic(number_format((float) str_replace(',', '', dn($total_amount_before_normal_discounts - ($total_extra_discounts+$client_discount) + $tax_amounts_total)), 3, '.', ''), 'jod') }}
{!! QrCode::size(100)->generate( route('tenant.show-document', ['type' => 'sales-invoice', 'id' => $resource->id]), ) !!}
@if (Session::get('print_data')['under_tax']) @lang('warehouses/sales-invoices/show.all_prices_above_subject_to_general_tax') @endif
@scriptag('build/js/manifest.js') @scriptag('build/js/vendor.js') @scriptag('build/js/app.js')