91 lines
3.7 KiB
PHP
Raw Normal View History

2017-09-14 22:21:00 +03:00
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.customers', 1)]))
@section('content')
2019-11-16 10:21:14 +03:00
<div class="card">
{!! Form::model($customer, [
'method' => 'PATCH',
'route' => ['customers.update', $customer->id],
'role' => 'form',
'id' => 'customer',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'class' => 'form-loading-button',
'novalidate' => 'true'
]) !!}
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'user') }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $customer->currency_code) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
@stack('create_user_input_start')
<div id="customer-create-user" class="form-group col-md-12 margin-top">
<div class="custom-control custom-checkbox">
@if ($customer->user_id)
{{ Form::checkbox('create_user', '1', 1, [
'id' => 'create_user',
'class' => 'custom-control-input',
'disabled' => 'disabled'
]) }}
<label class="custom-control-label" for="create_user">
<strong>{{ trans('customers.user_created') }}</strong>
</label>
@else
{{ Form::checkbox('create_user', '1', null, [
'id' => 'create_user',
'class' => 'custom-control-input',
'v-on:input' => 'onCanLogin($event)'
]) }}
<label class="custom-control-label" for="create_user">
<strong>{{ trans('customers.can_login') }}</strong>
</label>
@endif
</div>
</div>
@stack('create_user_input_end')
<div v-if="can_login" class="row col-md-12">
{{Form::passwordGroup('password', trans('auth.password.current'), 'key', [], 'col-md-6 password')}}
{{Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', [], 'col-md-6 password')}}
</div>
</div>
</div>
2017-09-14 22:21:00 +03:00
2019-11-16 10:21:14 +03:00
@permission('update-incomes-customers')
<div class="card-footer">
<div class="float-right">
{{ Form::saveButtons('incomes/customers') }}
</div>
</div>
@endpermission
2018-09-26 18:05:54 +03:00
2019-11-16 10:21:14 +03:00
{{ Form::hidden('type', 'customer') }}
2017-09-14 22:21:00 +03:00
2019-11-16 10:21:14 +03:00
{!! Form::close() !!}
2017-09-14 22:21:00 +03:00
</div>
@endsection
2019-11-16 10:21:14 +03:00
@push('scripts_start')
<script src="{{ asset('public/js/incomes/customers.js?v=' . version('short')) }}"></script>
2017-11-13 21:55:15 +03:00
@endpush