@extends('layouts.print')
@section('title', 'طباعة مصروف ' . ($expense->expense_number ?? $expense->id) . ' - '.config('app.name'))
@section('company_name', $company?->name ?? config('app.name'))
@section('company_tax', ($company && $company->tax_number) ? 'الرقم الضريبي: ' . $company->tax_number : 'الرقم الضريبي: —')
@section('company_logo')
@if($company && $company->logo_url)
@if(str_starts_with($company->logo_url, 'company/'))
@else
@endif
@elseif(file_exists(public_path('images/logo.png')))
@endif
@endsection
@push('print_styles')
@endpush
@php
$tax = (float) ($expense->tax_amount ?? 0);
$grand = (float) $expense->amount + $tax;
$posted = ($expense->status ?? '') === 'posted' || $expense->journal_entry_id;
$categoryLabel = $expense->expenseCategory?->name_ar ?? ($expense->expenseAccount?->name_ar ?? '—');
$firstImageAtt = ($expense->attachments ?? collect())->sortBy('id')->first(function ($a) {
$m = strtolower((string) ($a->file_type ?? ''));
return $m !== '' && str_starts_with($m, 'image/');
});
$receiptUrl = ($firstImageAtt && $firstImageAtt->file_path)
? asset('storage/'.ltrim($firstImageAtt->file_path, '/'))
: null;
@endphp
@section('doc_type', 'سند مصروف')
@section('document_meta')
| البند | المبلغ (ر.س) |
|---|---|
|
المبلغ قبل الضريبة
@if($expense->notes)
{{ $expense->notes }}
@endif
|
{{ erp_money((float) $expense->amount) }} |
| الضريبة | {{ erp_money($tax) }} |
| الإجمالي | {{ erp_money($grand) }} |
أعدّه / سجّله
المعتمد