@extends('layouts.app') @section('title', 'Stored Value Ledger') @section('content')

{{ $account->name }} {{ $account->masked_code }}

@if(session('stored_value_plain_code'))
New code: {{ session('stored_value_plain_code') }}
Save or print it now. For security, the complete code is not stored and cannot be shown again.
@endif
@component('components.widget', ['title' => 'Account'])
Type
{{ \App\Utils\StoredValueService::LABELS[$account->type] ?? $account->type }}
Customer
{{ optional($account->contact)->name ?: 'Bearer' }}
Initial value
@format_currency($account->initial_balance)
Balance
@format_currency($account->balance)
Status
{{ ucfirst($account->status) }}
Expires
{{ optional($account->expires_at)->format('M d, Y h:i A') ?: 'Never' }}
{!! Form::open(['route' => ['stored-value.status', $account->id], 'method' => 'post', 'style' => 'display:inline']) !!} {!! Form::hidden('status', $account->status === 'active' ? 'suspended' : 'active') !!} {!! Form::close() !!} Back @endcomponent @component('components.widget', ['title' => 'Manager adjustment']) {!! Form::open(['route' => ['stored-value.adjust', $account->id], 'method' => 'post']) !!}
{!! Form::label('amount', 'Amount:*') !!} {!! Form::text('amount', null, ['class' => 'form-control input_number', 'required', 'placeholder' => 'Use a negative number to deduct']) !!}
{!! Form::label('notes', 'Reason:*') !!} {!! Form::textarea('notes', null, ['class' => 'form-control', 'rows' => 2, 'required']) !!}
{!! Form::close() !!} @endcomponent
@component('components.widget', ['title' => 'Balance ledger'])
@foreach($ledger as $entry) @endforeach
DateTypeReferenceNotesChangeBalance
{{ $entry->created_at->format('M d, Y h:i A') }} {{ ucwords(str_replace('_', ' ', $entry->entry_type)) }} {{ $entry->reference }} {{ $entry->notes }} @format_currency($entry->amount) @format_currency($entry->balance_after)
{{ $ledger->links() }} @endcomponent
@endsection