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

Gift Cards, Store Credit, and Digital Vouchers

@if(!$business->storedValueEnabled())
This feature is currently disabled. Enable it under New Features > Gift cards & vouchers before issuing or redeeming value.
@endif
@component('components.widget', ['title' => 'Issue stored value']) {!! Form::open(['route' => 'stored-value.store', 'method' => 'post']) !!}
{!! Form::label('type', 'Type:*') !!} {!! Form::select('type', \App\Utils\StoredValueService::LABELS, null, ['class' => 'form-control', 'required', 'id' => 'stored_value_type']) !!}
{!! Form::label('name', 'Name:*') !!} {!! Form::text('name', null, ['class' => 'form-control', 'required', 'placeholder' => 'Birthday Gift Card']) !!}
{!! Form::label('amount', 'Opening value:*') !!} {!! Form::text('amount', null, ['class' => 'form-control input_number', 'required']) !!}
{!! Form::label('contact_id', 'Customer (required for store credit):') !!} {!! Form::select('contact_id', $contacts, null, ['class' => 'form-control select2', 'placeholder' => 'No customer']) !!}
{!! Form::label('code', 'Custom code (optional):') !!} {!! Form::text('code', null, ['class' => 'form-control', 'placeholder' => 'A secure code is generated if blank']) !!}
{!! Form::label('expires_at', 'Expires at (optional):') !!}
{!! Form::label('location_ids', 'Allowed branches:') !!} {!! Form::select('location_ids[]', $locations, null, ['class' => 'form-control select2', 'multiple', 'data-placeholder' => 'All branches']) !!}

Leave blank to allow every branch.

{!! Form::label('notes', 'Notes:') !!} {!! Form::textarea('notes', null, ['class' => 'form-control', 'rows' => 2]) !!}
{!! Form::close() !!} @endcomponent
@component('components.widget', ['title' => 'Stored-value accounts'])
@forelse($accounts as $account) @empty @endforelse
CodeNameTypeCustomerBalanceStatus
{{ $account->masked_code }} {{ $account->name }} {{ \App\Utils\StoredValueService::LABELS[$account->type] ?? $account->type }} {{ optional($account->contact)->name ?: 'Bearer' }} @format_currency($account->balance) {{ ucfirst($account->status) }} View ledger
No gift cards, credits, or vouchers yet.
{{ $accounts->links() }} @endcomponent
@endsection