@extends('Layouts/dashboard') @section('submenu') @if (isset($company) && $company) @include('Plugins/Payment/Views/Elements/Order/company_list_submenu') @else @include('Plugins/Payment/Views/Elements/Order/list_submenu') @endif {{-- @include('Elements/Venue/submenu') --}} @endsection @section('content') {!! Form::open([ 'data-toggle' => 'validator' ]) !!}

{{ __('Coupon') }}

{!! Form::label('data[Coupon][name]', t('Name')) !!} {!! Form::text( 'data[Coupon][name]', (isset($data->Coupon->name) ? $data->Coupon->name : null), [ 'data-error' => t('This field is required'), 'class' => 'form-control', 'required' ] ) !!}
@if (isset($errors->Coupon->name)) {{ $errors->Coupon->name[0] }} @endif
{!! Form::label('data[Coupon][code]', t('Coupon Code')) !!} {!! Form::text( 'data[Coupon][code]', (isset($data->Coupon->code) ? $data->Coupon->code : null), [ 'data-error' => t('This field is required'), 'class' => 'form-control', 'required' ] ) !!}
@if (isset($errors->Coupon->code)) {{ $errors->Coupon->code[0] }} @endif
{!! Form::label('data[Coupon][type]', t('Discount Type')) !!} {!! Form::select( 'data[Coupon][type]', [ 'fixed' => __('Fixed'), 'fixed-total' => __('Fixed up to exact amount'), 'fixed-person' => __('Fixed per person'), 'fixed-qty' => __('Fixed per quantity'), 'percentage' => __('Percentage'), 'percentage-person' => __('Percentage per person'), 'qty' => __('Qty') ], (isset($data->Coupon->type) ? $data->Coupon->type : null), [ 'class' => 'form-control', 'required' ] ) !!}
@if (isset($errors->Coupon->type)) {{ $errors->Coupon->type[0] }} @endif
{!! Form::label('data[Coupon][discount]', t('Discount')) !!} {!! Form::number( 'data[Coupon][discount]', (isset($data->Coupon->discount) ? $data->Coupon->discount : null), [ 'data-error' => t('This field is required'), 'class' => 'form-control', 'required', 'step' => '0.01', 'min' => 0 ] ) !!}
@if (isset($errors->Coupon->discount)) {{ $errors->Coupon->discount[0] }} @endif
{!! Form::label('data[Coupon][apply_on]', t('Apply On')) !!} {!! Form::select( 'data[Coupon][apply_on]', [ 'total' => __('Gross Total'), 'deposit' => __('Deposit Total') ], (isset($data->Coupon->apply_on) ? $data->Coupon->apply_on : null), [ 'class' => 'form-control' ] ) !!}
{!! Form::label('data[Coupon][multiplier_behaviour]', t('Use Multiplier')) !!} {!! Form::select( 'data[Coupon][multiplier_behaviour]', [ 1 => __('Yes'), 0 => __('No') ], (isset($data->Coupon->multiplier_behaviour) ? $data->Coupon->multiplier_behaviour : null), [ 'class' => 'form-control' ] ) !!}
{!! Form::label('data[Coupon][banner]', t('Display Banner')) !!} {!! Form::textarea( 'data[Coupon][banner]', (isset($data->Coupon->banner) ? $data->Coupon->banner : null), [ 'class' => 'form-control' ] ) !!}
@if (isset($errors->Coupon->start)) {{ $errors->Coupon->start[0] }} @endif
{{ __('Use this field to add message which would be visible in the booking process screens') }}
@if (isset($data->Coupon->type) && $data->Coupon->type == 'fixed-total') @if (isset($splitdown_balance) && $splitdown_balance)

@t('Balance')

@foreach ($splitdown_balance as $row)
@t('Group') @if ($row->min_tier && $row->max_tier) @if ($row->min_tier == $row->max_tier) @t('is %s', $row->min_tier) @else @t('between %s - %s', [$row->min_tier, $row->max_tier]) @endif @elseif ($row->min_tier) @t('is greater or equal than %s', $row->min_tier) @elseif ($row->max_tier) @t('is lower or equal than %s', $row->max_tier) @else @t('any group') @endif
{{ amount($row->balance) }}
@endforeach
@else
@t('Coupon balance: %s', amount($balance))
@endif @endif

{{ __('Limitations') }}

{!! Form::label('data[Coupon][start]', t('Start from')) !!} {!! Form::text( 'data[Coupon][start]', (isset($data->Coupon->start) ? $data->Coupon->start : null), [ 'placeholder' => t('Date'), 'class' => 'form-control datepicker', ] ) !!}
@if (isset($errors->Coupon->start)) {{ $errors->Coupon->start[0] }} @endif
{!! Form::label('data[Coupon][end]', t('Valid until')) !!} {!! Form::text( 'data[Coupon][end]', (isset($data->Coupon->end) ? $data->Coupon->end : null), [ 'placeholder' => t('Date'), 'class' => 'form-control datepicker', ] ) !!}
@if (isset($errors->Coupon->end)) {{ $errors->Coupon->end[0] }} @endif

{{ __('Day of Week') }}

@for ($i = 1; $i <= 7; $i++) @endfor
{!! Form::label('data[Coupon][total]', t('Total Coupons')) !!} {!! Form::number( 'data[Coupon][total]', (isset($data->Coupon->total) ? $data->Coupon->total : null), [ 'placeholder' => __('Unlimited'), 'class' => 'form-control', 'step' => '1', 'min' => 1 ] ) !!}
@if (isset($errors->Coupon->total)) {{ $errors->Coupon->total[0] }} @endif
{!! Form::label('data[Coupon][total_per_user]', t('Uses per user')) !!} {!! Form::number( 'data[Coupon][total_per_user]', (isset($data->Coupon->total_per_user) ? $data->Coupon->total_per_user : null), [ 'placeholder' => __('Unlimited'), 'class' => 'form-control', 'step' => '1', 'min' => 1 ] ) !!}
@if (isset($errors->Coupon->total_per_user)) {{ $errors->Coupon->total_per_user[0] }} @endif
{!! Form::label('data[Coupon][interval]', t('Can use again (in minutes)')) !!} {!! Form::number( 'data[Coupon][interval]', (isset($data->Coupon->interval) ? $data->Coupon->interval : null), [ 'placeholder' => __('No limitation'), 'class' => 'form-control', 'step' => '1', 'min' => 1 ] ) !!}
This will prevent the user to use the coupon unless there is interval from previous usage
{!! Form::label('data[Coupon][total_per_user_per_day]', t('Uses per user per day')) !!} {!! Form::number( 'data[Coupon][total_per_user_per_day]', (isset($data->Coupon->total_per_user_per_day) ? $data->Coupon->total_per_user_per_day : null), [ 'placeholder' => __('No limitation'), 'class' => 'form-control', 'step' => '1', 'min' => 1 ] ) !!}
Will limit the usage per user per day. E.g. 2 times per day per user
{!! Form::label('data[Coupon][min_amount]', t('Min Amount')) !!} {!! Form::number( 'data[Coupon][min_amount]', (isset($data->Coupon->min_amount) ? $data->Coupon->min_amount : null), [ 'placeholder' => __('No minimum'), 'class' => 'form-control', 'step' => '0.01', 'min' => 0 ] ) !!}
Coupon will be applied if the total of the cart is bigger than this amount
{!! Form::label('data[Coupon][max_amount]', t('Max Amount')) !!} {!! Form::number( 'data[Coupon][max_amount]', (isset($data->Coupon->max_amount) ? $data->Coupon->max_amount : null), [ 'placeholder' => __('No maximum'), 'class' => 'form-control', 'step' => '0.01', 'min' => 0 ] ) !!}
Applied when discount is percentage. It could put a cap on the discount
{!! Form::label('data[Coupon][min_tier]', t('Min Product Group')) !!} {!! Form::select( 'data[Coupon][min_tier]', numbers(['min' => 1, 'max' => 5]), (isset($data->Coupon->min_tier) ? $data->Coupon->min_tier : null), [ 'class' => 'form-control', 'empty' => true ] ) !!}
{!! Form::label('data[Coupon][max_tier]', t('Max Product Group')) !!} {!! Form::select( 'data[Coupon][max_tier]', numbers(['min' => 1, 'max' => 5]), (isset($data->Coupon->max_tier) ? $data->Coupon->max_tier : null), [ 'class' => 'form-control', 'empty' => true ] ) !!}
{!! Form::submit( __('Submit'), ['class' => 'btn btn-pink btn-wider'] ) !!}
{!! Form::close() !!} @if (isset($has_codes) && $has_codes)

{{ __( 'Warning, this coupon has codes and usage limits (How many times can be used) and (uses per user) doesn\'t take effect.' ) }}
{{ __('See coupon codes')}} {{ __('here') }}

@endif @endsection