@extends('layouts.app') @section('title', 'Opening Balance - ' . $branch->name . ' - Cash Book') @section('content')
| Date | Changed By | Changes |
|---|---|---|
| {{ $history->created_at?->format('Y-m-d H:i') ?? 'N/A' }} | {{ $history->user->name ?? 'N/A' }} |
@foreach($history->changes as $field => $change)
@php
$label = $field === 'cash' ? 'Cash' : 'Bank';
$oldDisplay = number_format($change['old'], 2);
$newDisplay = number_format($change['new'], 2);
if (!empty($change['new_bdt']) || !empty($change['old_bdt'])) {
$rate = $change['rate'] ?? $currencyRate;
$oldDisplay .= $change['old_bdt'] > 0 ? ' [from ' . number_format($change['old_bdt'], 2) . ' BDT @ ' . number_format($rate, 2) . ']' : '';
$newDisplay .= $change['new_bdt'] > 0 ? ' [from ' . number_format($change['new_bdt'], 2) . ' BDT @ ' . number_format($rate, 2) . ']' : '';
}
@endphp
{{ $label }}: {{ $oldDisplay }} → {{ $newDisplay }}
@endforeach
|