@php $school = $school ?? \App\Models\SchoolProfile::first(); $schoolName = $school->school_name ?? 'BANGLADESH SCIENCE AND TECHNOLOGY MADRASAH'; $schoolAddress = $school->address ?? 'K-85/1/C, Kuratoli Masjid Road, Khilkhet, Dhaka.'; $schoolPhone = $school->phone ?? '01342821459'; $schoolEmail = $school->email ?? 'info@bstm26.com'; $principalName = $school->principal_name ?? 'Principal / Headmaster'; $rawLogo = $school->school_logo ?? null; $schoolLogo = null; if ($rawLogo) { $schoolLogo = str_starts_with($rawLogo, 'http') ? $rawLogo : (str_starts_with($rawLogo, 'storage/') ? asset($rawLogo) : asset('storage/' . $rawLogo)); } $requesterName = $assetTransfer->requester?->name ?? 'System Initiator'; $approverName = $assetTransfer->approver?->name ?? ($assetTransfer->status === 'approved' ? 'Authority' : 'Pending Approval'); $transferDateDisplay = optional($assetTransfer->transfer_date)->format('d-m-Y'); $approvedDateDisplay = $assetTransfer->approved_at ? $assetTransfer->approved_at->format('d-m-Y h:i A') : '-'; $fromAccCode = optional($assetTransfer->fromAccount)->code ?? 'N/A'; $fromAccName = optional($assetTransfer->fromAccount)->name ?? 'N/A'; $fromAccSubtype = ucfirst($assetTransfer->fromAccount?->subtype ?? $assetTransfer->fromAccount?->type ?? 'Asset'); $toAccCode = optional($assetTransfer->toAccount)->code ?? 'N/A'; $toAccName = optional($assetTransfer->toAccount)->name ?? 'N/A'; $toAccSubtype = ucfirst($assetTransfer->toAccount?->subtype ?? $assetTransfer->toAccount?->type ?? 'Asset'); if (!function_exists('assetTransferAmountInWords')) { function assetTransferAmountInWords($number) { $num = (float)$number; if ($num <= 0) return 'Zero Taka Only'; $ones = [ 0 => '', 1 => 'One', 2 => 'Two', 3 => 'Three', 4 => 'Four', 5 => 'Five', 6 => 'Six', 7 => 'Seven', 8 => 'Eight', 9 => 'Nine', 10 => 'Ten', 11 => 'Eleven', 12 => 'Twelve', 13 => 'Thirteen', 14 => 'Fourteen', 15 => 'Fifteen', 16 => 'Sixteen', 17 => 'Seventeen', 18 => 'Eighteen', 19 => 'Nineteen' ]; $tens = [ 0 => '', 1 => '', 2 => 'Twenty', 3 => 'Thirty', 4 => 'Forty', 5 => 'Fifty', 6 => 'Sixty', 7 => 'Seventy', 8 => 'Eighty', 9 => 'Ninety' ]; $convertGroup = function($n) use (&$convertGroup, $ones, $tens) { $out = ''; if ($n >= 100) { $out .= $ones[intdiv($n, 100)] . ' Hundred '; $n %= 100; } if ($n >= 20) { $out .= $tens[intdiv($n, 10)] . ' '; $n %= 10; } if ($n > 0) { $out .= $ones[$n] . ' '; } return trim($out); }; $intPart = (int)$num; $crore = intdiv($intPart, 10000000); $rem = $intPart % 10000000; $lakh = intdiv($rem, 100000); $rem %= 100000; $thousand = intdiv($rem, 1000); $rem %= 1000; $hundred = $rem; $parts = []; if ($crore > 0) $parts[] = $convertGroup($crore) . ' Crore'; if ($lakh > 0) $parts[] = $convertGroup($lakh) . ' Lakh'; if ($thousand > 0) $parts[] = $convertGroup($thousand) . ' Thousand'; if ($hundred > 0) $parts[] = $convertGroup($hundred); $taka = implode(' ', array_filter($parts)); if (empty($taka)) { $taka = 'Zero'; } $taka .= ' Taka'; $paisa = (int)round(($num - floor($num)) * 100); if ($paisa > 0) { $taka .= ' and ' . $convertGroup($paisa) . ' Paisa'; } return $taka . ' Only'; } } $amountInWords = assetTransferAmountInWords($assetTransfer->amount); $journalLines = $assetTransfer->journalEntry?->lines ?? collect(); @endphp
Back to Asset Transfers
@if($schoolLogo) School Logo @else @endif
{{ $schoolName }}
{{ $schoolAddress }}
Phone: {{ $schoolPhone }} | Email: {{ $schoolEmail }} @if(!empty($school->eiin_number)) | EIIN: {{ $school->eiin_number }} @endif
ASSET & FUND TRANSFER VOUCHER
Source (Paid From / Outflow)
{{ $fromAccName }}
Code: {{ $fromAccCode }} • {{ $fromAccSubtype }}
BDT {{ number_format((float) $assetTransfer->amount, 2) }}
INTERNAL TRANSFER
Destination (Deposited To / Inflow)
{{ $toAccName }}
Code: {{ $toAccCode }} • {{ $toAccSubtype }}
Transfer Voucher No: {{ $assetTransfer->transfer_no }} Transfer Date: {{ $transferDateDisplay }}
Transfer Status: {{ strtoupper($assetTransfer->status) }} Transaction Type: Asset to Asset Transfer
Initiated By: {{ $requesterName }} Journal Entry No: {{ optional($assetTransfer->journalEntry)->entry_no ?? 'Pending Approval' }}
Approved By: {{ $approverName }} Approved Date & Time: {{ $approvedDateDisplay }}
TRANSFER PARTICULARS & SUMMARY
SL PURPOSE & DESCRIPTION FROM (CREDIT ACCOUNT) TO (DEBIT ACCOUNT) AMOUNT (BDT)
1
{{ $assetTransfer->purpose }}
@if($assetTransfer->note)
Note: {{ $assetTransfer->note }}
@endif
{{ $fromAccName }}
Code: {{ $fromAccCode }}
{{ $toAccName }}
Code: {{ $toAccCode }}
{{ number_format((float) $assetTransfer->amount, 2) }}
Total Transfer Amount: BDT {{ number_format((float) $assetTransfer->amount, 2) }}
Amount in Words: {{ $amountInWords }}
@if($assetTransfer->approved_note)
@if($assetTransfer->status === 'approved') Approval Note: {{ $assetTransfer->approved_note }} @elseif($assetTransfer->status === 'rejected') Rejection Reason: {{ $assetTransfer->approved_note }} @else Remarks: {{ $assetTransfer->approved_note }} @endif
@endif
ACCOUNTING GENERAL LEDGER POSTINGS (DOUBLE ENTRY)
@if($assetTransfer->status === 'approved' && $journalLines->count() > 0) @foreach($journalLines as $line) @endforeach @else @endif
ENTRY # ACCOUNT CODE & NAME TYPE MEMO / PARTICULARS DEBIT (BDT) CREDIT (BDT)
#{{ $loop->iteration }} {{ optional($line->account)->code }} - {{ optional($line->account)->name }} {{ ucfirst(optional($line->account)->type ?? 'Asset') }} ({{ ucfirst(optional($line->account)->subtype ?? 'Asset') }}) {{ $line->memo ?: 'Asset transfer posting' }} {{ number_format((float) $line->debit, 2) }} {{ number_format((float) $line->credit, 2) }}
Total Postings: {{ number_format((float) $journalLines->sum('debit'), 2) }} {{ number_format((float) $journalLines->sum('credit'), 2) }}
#1 {{ $toAccCode }} - {{ $toAccName }} Asset ({{ $toAccSubtype }}) Asset transfer receive (Debit) {{ number_format((float) $assetTransfer->amount, 2) }} 0.00
#2 {{ $fromAccCode }} - {{ $fromAccName }} Asset ({{ $fromAccSubtype }}) Asset transfer send (Credit) 0.00 {{ number_format((float) $assetTransfer->amount, 2) }}
Total Postings: {{ number_format((float) $assetTransfer->amount, 2) }} {{ number_format((float) $assetTransfer->amount, 2) }}
Prepared By
{{ $requesterName }}
Verified / Accountant
Accounts Department
Authorized By
{{ $approverName ?: $principalName }}
Received / Handed Over
Depositor / In-charge