@extends('layouts.print') @section('title', 'Voucher '.$voucher->voucher_no) @section('doc_title', 'JOURNAL VOUCHER') @section('doc_no', $voucher->voucher_no.' · '.$voucher->voucher_date->format('d M Y')) @php $debit = (float) $voucher->entries->sum('debit'); $credit = (float) $voucher->entries->sum('credit'); $balanced = abs($debit - $credit) < 0.005; $currency = $voucher->entries->first()?->currency ?: 'BDT'; $money = fn ($v) => number_format((float) $v, 2); @endphp @section('doc_badge') {{ $voucher->status ?: 'draft' }} @endsection @section('document')
Entries {{ $voucher->entries->count() }} {{ Str::plural('line', $voucher->entries->count()) }} · {{ $currency }}
| # | Account | Memo | Debit | Credit |
|---|---|---|---|---|
| {{ $e->line_no ?: $i + 1 }} |
{{ $e->account?->account_name ?? '—' }}
@if ($e->account?->account_code)
{{ $e->account->account_code }}@if ($e->account->account_type) · {{ ucfirst($e->account->account_type) }}@endif
@endif
|
{{ $e->memo ?: '—' }} | {{ (float) $e->debit > 0 ? $money($e->debit) : '' }} | {{ (float) $e->credit > 0 ? $money($e->credit) : '' }} |
| Total | {{ $money($debit) }} | {{ $money($credit) }} | ||
Debits and credits differ by {{ $currency }} {{ $money(abs($debit - $credit)) }}. This voucher is not balanced.
@endunless