This commit is contained in:
Cüneyt Şentürk 2020-01-03 14:04:00 +03:00
parent 1c0697b266
commit 4bafcaccd6
24 changed files with 237 additions and 325 deletions

View File

@ -3,9 +3,7 @@
namespace App\Http\Controllers\Modals;
use App\Abstracts\Http\Controller;
use App\Http\Requests\Setting\Category as Request;
use Illuminate\Http\Request as CRequest;
use App\Models\Setting\Category;
class Categories extends Controller
{
@ -28,17 +26,9 @@ class Categories extends Controller
*/
public function create(CRequest $request)
{
$type = $request['type'];
$type = $request->get('type', 'item');
$category_selector = false;
if (request()->has('category_selector')) {
$category_selector = request()->get('category_selector');
}
$rand = rand();
$html = view('modals.categories.create', compact('currencies', 'type', 'category_selector', 'rand'))->render();
$html = view('modals.categories.create', compact('type'))->render();
return response()->json([
'success' => true,
@ -47,28 +37,4 @@ class Categories extends Controller
'html' => $html,
]);
}
/**
* Store a newly created resource in storage.
*
* @param Request $request
*
* @return Response
*/
public function store(Request $request)
{
$request['enabled'] = 1;
$category = Category::create($request->all());
$message = trans('messages.success.added', ['type' => trans_choice('general.categories', 1)]);
return response()->json([
'success' => true,
'error' => false,
'data' => $category,
'message' => $message,
'html' => 'null',
]);
}
}

View File

@ -6,9 +6,16 @@
<el-select v-model="real_model" @input="change" disabled filterable v-if="disabled"
:placeholder="placeholder">
<div v-if="addNew" class="el-select-dropdown__wrap" slot="empty">
<div v-if="addNew.status && selectOptions.lenght > 0" class="el-select-dropdown__wrap" slot="empty">
<span></span>
</div>
<div v-if="selectOptions.lenght <= 0" class="el-select-dropdown__wrap" slot="empty">
<span>
<li v-if="addNew.status" class="el-select-dropdown__item hover" @click="onAddItem">
<span>{{ add_new_text }}</span>
</li>
</span>
</div>
<template slot="prefix">
<span class="el-input__suffix-inner el-select-icon">
@ -35,14 +42,14 @@
</el-option>
</el-option-group>
<li v-if="addNew" class="el-select-dropdown__item hover" @click="onAddItem">
<li v-if="addNew.status" class="el-select-dropdown__item hover" @click="onAddItem">
<span>{{ add_new_text }}</span>
</li>
</el-select>
<el-select v-model="real_model" @input="change" filterable v-if="!disabled && !multiple"
:placeholder="placeholder">
<div v-if="addNew" class="el-select-dropdown__wrap" slot="empty">
<div v-if="addNew.status" class="el-select-dropdown__wrap" slot="empty">
<span></span>
</div>
@ -71,14 +78,14 @@
</el-option>
</el-option-group>
<li v-if="addNew" class="el-select-dropdown__item hover" @click="onAddItem">
<li v-if="addNew.status" class="el-select-dropdown__item hover" @click="onAddItem">
<span>{{ add_new_text }}</span>
</li>
</el-select>
<el-select v-model="real_model" @input="change" filterable v-if="!disabled && multiple && !collapse" multiple
:placeholder="placeholder">
<div v-if="addNew" class="el-select-dropdown__wrap" slot="empty">
<div v-if="addNew.status" class="el-select-dropdown__wrap" slot="empty">
<span></span>
</div>
@ -107,14 +114,14 @@
</el-option>
</el-option-group>
<li v-if="addNew" class="el-select-dropdown__item hover" @click="onAddItem">
<li v-if="addNew.status" class="el-select-dropdown__item hover" @click="onAddItem">
<span>{{ add_new_text }}</span>
</li>
</el-select>
<el-select v-model="real_model" @input="change" filterable v-if="!disabled && multiple && collapse" multiple collapse-tags
:placeholder="placeholder">
<div v-if="addNew" class="el-select-dropdown__wrap" slot="empty">
<div v-if="addNew.status" class="el-select-dropdown__wrap" slot="empty">
<span></span>
</div>
@ -143,16 +150,26 @@
</el-option>
</el-option-group>
<li v-if="addNew" class="el-select-dropdown__item hover" @click="onAddItem">
<li v-if="addNew.status" class="el-select-dropdown__item hover" @click="onAddItem">
<span>{{ add_new_text }}</span>
</li>
</el-select>
<component v-bind:is="add_new_html" @interface="onRedirectConfirm"></component>
</base-input>
</template>
<script>
import { Select, Option, OptionGroup } from 'element-ui';
import AkauntingModal from './AkauntingModal';
import AkauntingRadioGroup from './forms/AkauntingRadioGroup';
import AkauntingSelect from './AkauntingSelect';
import AkauntingDate from './AkauntingDate';
import AkauntingRecurring from './AkauntingRecurring';
import Form from './../plugins/form';
export default {
name: "akaunting-select",
@ -183,9 +200,21 @@ export default {
type: String,
description: "Prepend icon (left)"
},
addNew: false,
addNewText: null,
addNewPath: null,
addNew: {
type: Object,
default: function () {
return {
text: 'Add New Item',
status: false,
path: null,
type: 'modal', // modal, inline
field: 'name'
};
},
description: "Selectbox Add New Item Feature"
},
group: false,
multiple:false,
disabled:false,
@ -194,9 +223,10 @@ export default {
data() {
return {
add_new_text: this.addNewText,
add_new_text: this.addNew.text,
selectOptions: this.options,
real_model: this.model,
add_new_html: '',
}
},
@ -208,6 +238,8 @@ export default {
methods: {
change() {
alert('Helooo');
this.$emit('change', this.real_model);
this.$emit('interface', this.real_model);
},
@ -216,12 +248,119 @@ export default {
// Get Select Input value
var value = this.$children[0].$children[0].$children[0].$refs.input.value;
if (this.addNew.type == 'inline') {
this.addInline(value);
} else {
this.onModal(value);
}
/*
this.$emit('new_item', {
value: value,
path: this.addNewPath,
title: this.addNewText,
path: this.addNew.path,
title: this.addNew.text,
});
}
*/
},
addInline(value) {
},
onModal(value) {
let add_new = this.addNew;
axios.get(this.addNew.path)
.then(response => {
add_new.modal = true;
add_new.html = response.data.html;
this.add_new_html = Vue.component('add-new-component', function (resolve, reject) {
resolve({
template: '<div><akaunting-modal :show="addNew.modal" @cancel="addNew.modal = false" :title="addNew.text" :message="addNew.html">' +
+ '<template #card-footer>'
+ '<div class="float-right">'
+ '<button type="button" class="btn btn-outline-secondary">'
+ '<span>Cancel</span>'
+ '</button>'
+ '<button type="button" class="btn btn-success button-submit">'
+ '<div class="aka-loader d-none"></div>'
+ '<span>Confirm</span>'
+ '</button>'
+ '</div>'
+ '</template>'
+ '</akaunting-modal></div>',
components: {
AkauntingRadioGroup,
AkauntingSelect,
AkauntingModal,
AkauntingDate,
AkauntingRecurring,
},
data: function () {
return {
form: new Form('form-create-category'),
addNew: add_new,
}
},
methods: {
onRedirectConfirm() {
let redirect_form = new Form('redirect-form');
this.$emit('interface', redirect_form);
}
}
})
});
/*
this.selectOptions[3] = value;
let newOption = {
value: "3",
currentLabel: value,
label: value
};
this.$children[0].$children[0].handleOptionSelect(newOption);
this.$children[0].$children[0].onInputChange('3');
this.real_model = "3";
this.$emit('change', this.real_model);
*/
})
.catch(e => {
this.errors.push(e);
})
.finally(function () {
// always executed
});
},
onRedirectConfirm() {
this.redirectForm = new Form('redirect-form');
axios.post(this.redirectForm.action, this.redirectForm.data())
.then(response => {
if (response.data.redirect) {
location = response.data.redirect;
}
if (response.data.success) {
location.reload();
}
})
.catch(error => {
this.method_show_html = error.message;
});
},
addModal() {
},
},
watch: {

View File

@ -19,7 +19,7 @@
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'tag') }}
{{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, setting('default.tax'), []) }}
{{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, setting('default.tax'), ['path' => route('modals.taxes.create')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
@ -27,7 +27,7 @@
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, []) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=item']) }}
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), 'plus') }}

View File

@ -20,7 +20,7 @@
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'tag') }}
{{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, $item->tax_id, []) }}
{{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, $item->tax_id, ['path' => route('modals.taxes.create')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
@ -28,7 +28,7 @@
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, []) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=item']) }}
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}

View File

@ -1,99 +1,16 @@
<div class="modal fade create-category-{{ $rand }} d-none" id="modal-create-category">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ trans('general.title.new', ['type' => trans_choice('general.categories', 1)]) }}</h4>
</div>
{!! Form::open([
'id' => 'form-create-category',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'role' => 'form',
'class' => 'form-loading-button',
'route' => 'categories.store',
'novalidate' => true
]) !!}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
<div class="modal-body">
{!! Form::open(['id' => 'form-create-category', 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
@stack('color_input_start')
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'control-label']) !!}
<div id="category-color-picker" class="input-group colorpicker-component">
<div class="input-group-addon"><i></i></div>
{!! Form::text('color', '#00a65a', ['id' => 'color', 'class' => 'form-control', 'required' => 'required']) !!}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
@stack('color_input_end')
{!! Form::hidden('type', $type, []) !!}
{!! Form::hidden('enabled', '1', []) !!}
</div>
{!! Form::close() !!}
</div>
<div class="modal-footer">
<div class="pull-left">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' =>'button-create-category', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading')]) !!}
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</button>
</div>
</div>
</div>
{!! Form::hidden('type', $type, []) !!}
{!! Form::hidden('enabled', '1', []) !!}
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.create-category-{{ $rand }}#modal-create-category').modal('show');
$('.create-category-{{ $rand }} #category-color-picker').colorpicker();
});
$(document).on('click', '.create-category-{{ $rand }} #button-create-category', function (e) {
$('.create-category-{{ $rand }}#modal-create-category .modal-header').before('<span id="span-loading" style="position: absolute; height: 100%; width: 100%; z-index: 99; background: #6da252; opacity: 0.4;"><i class="fa fa-spinner fa-spin" style="font-size: 10em !important; margin-left: 35%;margin-top: 8%;"></i></span>');
$.ajax({
url: '{{ url("modals/categories") }}',
type: 'POST',
dataType: 'JSON',
data: $(".create-category-{{ $rand }} #form-create-category").serialize(),
beforeSend: function () {
$('.create-category-{{ $rand }} #button-create-category').button('loading');
$(".create-category-{{ $rand }} .form-group").removeClass("has-error");
$(".create-category-{{ $rand }} .help-block").remove();
},
complete: function() {
$('.create-category-{{ $rand }} #button-create-category').button('reset');
},
success: function(json) {
var data = json['data'];
$('.create-category-{{ $rand }} #span-loading').remove();
$('.create-category-{{ $rand }}#modal-create-category').modal('hide');
$('#category_id').append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>');
$('#category_id').trigger('change');
$('#category_id').select2('refresh');
@if ($category_selector)
$('{{ $category_selector }}').append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>');
$('{{ $category_selector }}').trigger('change');
$('{{ $category_selector }}').select2('refresh');
@endif
},
error: function(error, textStatus, errorThrown) {
$('.create-category-{{ $rand }} #span-loading').remove();
if (error.responseJSON.name) {
$(".create-category-{{ $rand }}#modal-create-category input[name='name']").parent().parent().addClass('has-error');
$(".create-category-{{ $rand }}#modal-create-category input[name='name']").parent().after('<p class="help-block">' + error.responseJSON.name + '</p>');
}
if (error.responseJSON.color) {
$(".create-category-{{ $rand }}#modal-create-category input[name='color']").parent().parent().addClass('has-error');
$(".create-category-{{ $rand }}#modal-create-category input[name='color']").parent().after('<p class="help-block">' + error.responseJSON.color + '</p>');
}
}
});
});
</script>
{!! Form::close() !!}

View File

@ -6,7 +6,6 @@
'class' => 'form-loading-button',
'route' => 'customers.store',
'novalidate' => true
]) !!}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}

View File

@ -1,7 +1,11 @@
{!! Form::open([
'id' => 'form-create-tax',
'role' => 'form',
'class' => 'form-loading-button'
'id' => 'form-create-tax',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'role' => 'form',
'class' => 'form-loading-button',
'route' => 'taxes.store',
'novalidate' => true
]) !!}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}

View File

@ -1,101 +1,23 @@
<div class="modal fade create-vendor-{{ $rand }} d-none" id="modal-create-vendor">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ trans('general.title.new', ['type' => trans_choice('general.vendors', 1)]) }}</h4>
</div>
{!! Form::open([
'id' => 'form-create-vendor',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'role' => 'form',
'class' => 'form-loading-button',
'route' => 'vendors.store',
'novalidate' => true
]) !!}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
<div class="modal-body">
{!! Form::open(['id' => 'form-create-vendor', 'role' => 'form', 'class' => 'form-loading-button']) !!}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('default.currency')) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('default.currency')) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{!! Form::hidden('enabled', '1', []) !!}
</div>
{!! Form::close() !!}
</div>
<div class="modal-footer">
<div class="pull-left">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' =>'button-create-vendor', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading')]) !!}
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</button>
</div>
</div>
</div>
{!! Form::hidden('enabled', '1', []) !!}
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.create-vendor-{{ $rand }}#modal-create-vendor').modal('show');
$(".create-vendor-{{ $rand }}#modal-create-vendor #currency_code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
});
$(document).on('click', '.create-vendor-{{ $rand }} #button-create-vendor', function (e) {
$('.create-vendor-{{ $rand }}#modal-create-vendor .modal-header').before('<span id="span-loading" style="position: absolute; height: 100%; width: 100%; z-index: 99; background: #6da252; opacity: 0.4;"><i class="fa fa-spinner fa-spin" style="font-size: 16em !important;margin-left: 35%;margin-top: 8%;"></i></span>');
$.ajax({
url: '{{ url("modals/vendors") }}',
type: 'POST',
dataType: 'JSON',
data: $(".create-vendor-{{ $rand }} #form-create-vendor").serialize(),
beforeSend: function () {
$('.create-vendor-{{ $rand }} #button-create-vendor').button('loading');
$(".create-vendor-{{ $rand }} .form-group").removeClass("has-error");
$(".create-vendor-{{ $rand }} .help-block").remove();
},
complete: function() {
$('.create-vendor-{{ $rand }} #button-create-vendor').button('reset');
},
success: function(json) {
var data = json['data'];
$('.create-vendor-{{ $rand }} #span-loading').remove();
$('.create-vendor-{{ $rand }}#modal-create-vendor').modal('hide');
$('#contact_id').append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>');
$('#contact_id').trigger('change');
$('#contact_id').select2('refresh');
@if ($contact_selector)
$('{{ $contact_selector }}').append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>');
$('{{ $contact_selector }}').trigger('change');
$('{{ $contact_selector }}').select2('refresh');
@endif
},
error: function(error, textStatus, errorThrown) {
$('.create-vendor-{{ $rand }} #span-loading').remove();
if (error.responseJSON.name) {
$(".create-vendor-{{ $rand }}#modal-create-vendor input[name='name']").parent().parent().addClass('has-error');
$(".create-vendor-{{ $rand }}#modal-create-vendor input[name='name']").parent().after('<p class="help-block">' + error.responseJSON.name + '</p>');
}
if (error.responseJSON.email) {
$(".create-vendor-{{ $rand }}#modal-create-vendor input[name='email']").parent().parent().addClass('has-error');
$(".create-vendor-{{ $rand }}#modal-create-vendor input[name='email']").parent().after('<p class="help-block">' + error.responseJSON.email + '</p>');
}
if (error.responseJSON.currency_code) {
$(".create-vendor-{{ $rand }}#modal-create-vendor select[name='currency_code']").parent().parent().addClass('has-error');
$(".create-vendor-{{ $rand }}#modal-create-vendor select[name='currency_code']").parent().after('<p class="help-block">' + error.responseJSON.currency_code + '</p>');
}
}
});
});
</script>
{!! Form::close() !!}

View File

@ -6,26 +6,5 @@
@stack('content_content_end')
<notifications></notifications>
<akaunting-modal
v-if="addNew.modal"
:show="addNew.modal"
:title="addNew.title"
:message="addNew.html">
<template #card-footer>
<div class="float-right">
<button type="button" class="btn btn-outline-secondary" @click="onCancelNewItem()">
<span>{{ trans('general.cancel') }}</span>
</button>
<button type="button" class="btn btn-success button-submit" @click="onNewItemSubmit()">
<div class="aka-loader d-none"></div>
<span>{{ trans('general.confirm') }}</span>
</button>
</div>
</template>
</akaunting-modal>
</div>
@stack('content_end')

View File

@ -36,7 +36,7 @@
<script type="text/javascript"><!--
window.Laravel = <?php echo json_encode([
'csrfToken' => csrf_token(),
]); ?>
]); ?>;
var aka_currency = 'false';

View File

@ -10,15 +10,16 @@
:value="{{ json_encode(old($name, $selected)) }}"
:icon="'{{ $icon }}'"
:multiple="true"
:add-new="true"
:add-new-text="'{{ trans('general.form.add_new', ['field' => $text]) }}'"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.form.add_new', ['field' => $text]),
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
'field' => isset($attributes['field']) ? $attributes['field'] : 'name'
])}}"
@if (!empty($attributes['collapse']))
:collapse="true"
@endif
@if (!empty($attributes['path']))
:add-new-path="'{{ $attributes['path'] }}'"
@endif
@new_item="onNewItem($event)"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"

View File

@ -8,13 +8,14 @@
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"
:icon="'{{ $icon }}'"
:add-new="true"
:add-new-text="'{{ trans('general.form.add_new', ['field' => $text]) }}'"
@if (!empty($attributes['path']))
:add-new-path="'{{ $attributes['path'] }}'"
@endif
@new_item="onNewItem($event)"
@interface="form.{{ $name }} = $event"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.form.add_new', ['field' => $text]),
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
'field' => isset($attributes['field']) ? $attributes['field'] : 'name'
])}}"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif

View File

@ -8,10 +8,15 @@
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"
:icon="'{{ $icon }}'"
:add-new="true"
:add-new-text="'{{ trans('general.form.add_new', ['field' => $text]) }}'"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.form.add_new', ['field' => $text]),
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
'field' => isset($attributes['field']) ? $attributes['field'] : 'name'
])}}"
:group="true"
@interface="form.{{ $name }} = $event"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif

View File

@ -6,12 +6,5 @@
@stack('content_content_end')
<notifications></notifications>
<akaunting-modal
v-if="addNew.modal"
:show="addNew.modal"
:title="addNew.title"
:message="addNew.html">
</akaunting-modal>
</div>
@stack('content_end')

View File

@ -19,12 +19,5 @@
@stack('content_content_end')
<notifications></notifications>
<akaunting-modal
v-if="addNew.modal"
:show="addNew.modal"
:title="addNew.title"
:message="addNew.html">
</akaunting-modal>
</div>
@stack('content_end')

View File

@ -15,11 +15,4 @@
@stack('content_content_end')
<notifications></notifications>
<akaunting-modal
v-if="addNew.modal"
:show="addNew.modal"
:title="addNew.title"
:message="addNew.html">
</akaunting-modal>
@stack('content_end')

View File

@ -17,7 +17,7 @@
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, config('general.vendors'), ['required' => 'required', 'change' => 'onChangeContact']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, config('general.vendors'), ['required' => 'required', 'path' => route('modals.vendors.create'), 'change' => 'onChangeContact']) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
@ -160,7 +160,7 @@
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), []) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense']) }}
{{ Form::recurring('create') }}

View File

@ -18,7 +18,7 @@
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $bill->contact_id, ['required' => 'required', 'change' => 'onChangeContact']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $bill->contact_id, ['required' => 'required', 'path' => route('modals.vendors.create'), 'change' => 'onChangeContact']) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, $bill->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
@ -161,7 +161,7 @@
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $bill->category_id) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $bill->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense']) }}
{{ Form::recurring('edit', $bill) }}

View File

@ -26,7 +26,7 @@
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, setting('default.vendor'), []) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, setting('default.vendor'), ['path' => route('modals.vendors.create')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}

View File

@ -39,11 +39,11 @@
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $payment->account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, []) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, ['path' => route('modals.vendors.create')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required']) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense']) }}
{{ Form::recurring('edit', $payment) }}

View File

@ -17,7 +17,7 @@
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, config('general.customers'), ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.customers.create')]) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, config('general.customers'), ['required' => 'required', 'path' => route('modals.customers.create'), 'change' => 'onChangeContact']) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
@ -162,7 +162,7 @@
{{ Form::textareaGroup('footer', trans('general.footer'), '', setting('invoice.footer')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('defaults.category')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('defaults.category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income']) }}
{{ Form::recurring('create') }}

View File

@ -18,7 +18,7 @@
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $invoice->contact_id, ['required' => 'required', 'change' => 'onChangeContact']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $invoice->contact_id, ['required' => 'required', 'path' => route('modals.customers.create'), 'change' => 'onChangeContact']) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $invoice->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
@ -163,7 +163,7 @@
{{ Form::textareaGroup('footer', trans('general.footer')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $invoice->category_id) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $invoice->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income']) }}
{{ Form::recurring('edit', $invoice) }}

View File

@ -26,11 +26,11 @@
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, setting('default.contact'), []) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, setting('default.contact'), ['path' => route('modals.customers.create')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income']) }}
{{ Form::recurring('create') }}

View File

@ -39,11 +39,11 @@
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $revenue->account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $revenue->contact_id, []) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $revenue->contact_id, ['path' => route('modals.customers.create')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income']) }}
{{ Form::recurring('edit', $revenue) }}