107 lines
4.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', []) }}
2020-03-09 11:57:06 +03:00
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $customer->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name']]) }}
2019-11-16 10:21:14 +03:00
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
2021-10-06 10:30:16 +03:00
{{ Form::textareaGroup('address', trans('general.address'), '', $customer->address, ['rows' => '2', 'v-model' => 'form.address']) }}
2019-11-16 10:21:14 +03:00
2021-09-03 12:57:54 +03:00
{{ Form::textGroup('city', trans_choice('general.cities', 1), 'city', []) }}
2021-09-03 12:57:54 +03:00
{{ Form::textGroup('zip_code', trans('general.zip_code'), 'mail-bulk', []) }}
2021-09-03 12:57:54 +03:00
{{ Form::textGroup('state', trans('general.state'), 'city', []) }}
2021-10-06 10:31:45 +03:00
{{ Form::selectGroup('country', trans_choice('general.countries', 1), 'globe-americas', trans('countries'), $customer->country, ['model' => 'form.country']) }}
2019-11-16 10:21:14 +03:00
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
2019-12-14 10:03:41 +03:00
{{ Form::radioGroup('enabled', trans('general.enabled'), $customer->enabled) }}
2019-11-16 10:21:14 +03:00
@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',
2020-03-20 17:25:21 +03:00
'disabled' => 'true'
2019-11-16 10:21:14 +03:00
]) }}
<label class="custom-control-label" for="create_user">
<strong>{{ trans('customers.user_created') }}</strong>
</label>
@else
{{ Form::checkbox('create_user', '1', null, [
'v-model' => 'form.create_user',
2019-11-16 10:21:14 +03:00
'id' => 'create_user',
'class' => 'custom-control-input',
'@input' => 'onCanLogin($event)'
2019-11-16 10:21:14 +03:00
]) }}
<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', ['required' => 'required'], 'col-md-6 password')}}
2019-11-16 10:21:14 +03:00
{{Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', ['required' => 'required'], 'col-md-6 password')}}
2019-11-16 10:21:14 +03:00
</div>
</div>
</div>
2017-09-14 22:21:00 +03:00
2020-10-14 17:07:59 +03:00
@can('update-sales-customers')
2019-11-16 10:21:14 +03:00
<div class="card-footer">
2020-02-15 13:04:37 +03:00
<div class="row save-buttons">
{{ Form::saveButtons('customers.index') }}
2019-11-16 10:21:14 +03:00
</div>
</div>
2020-10-14 17:07:59 +03:00
@endcan
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>
var can_login_errors = {
valid: '{!! trans('validation.required', ['attribute' => 'email']) !!}',
email: '{{ trans('customers.error.email') }}'
};
</script>
2019-12-31 15:49:09 +03:00
<script src="{{ asset('public/js/sales/customers.js?v=' . version('short')) }}"></script>
2017-11-13 21:55:15 +03:00
@endpush