Bill item tax multible files added

This commit is contained in:
cuneytsenturk
2018-10-22 16:57:35 +03:00
parent 8fcfccc4b0
commit dedcb9493a
8 changed files with 277 additions and 58 deletions

View File

@@ -130,7 +130,7 @@
{{ Form::recurring('create') }}
{{ Form::fileGroup('attachment', trans('general.attachment'),[]) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('vendor_name', old('vendor_name'), ['id' => 'vendor_name']) }}
{{ Form::hidden('vendor_email', old('vendor_email'), ['id' => 'vendor_email']) }}
@@ -169,7 +169,6 @@
@push('scripts')
<script type="text/javascript">
var item_row = '{{ $item_row }}';
var tax_row = '0';
$(document).on('click', '#button-add-item', function (e) {
var currency_code = $('#currency_code').val();
@@ -190,6 +189,14 @@
placeholder: {
id: '-1', // the value of the option
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
},
escapeMarkup: function (markup) {
return markup;
},
language: {
noResults: function () {
return '<span id="tax-add-new"><i class="fa fa-plus"> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
}
}
});
@@ -249,6 +256,14 @@
placeholder: {
id: '-1', // the value of the option
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
},
escapeMarkup: function (markup) {
return markup;
},
language: {
noResults: function () {
return '<span id="tax-add-new"><i class="fa fa-plus"> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
}
}
});
@@ -270,6 +285,24 @@
placeholder : '{{ trans('general.form.no_file_selected') }}'
});
$(document).on('click', '#tax-add-new', function(e){
tax_name = $('.select2-search__field').val();
$('#modal-create-tax').remove();
$.ajax({
url: '{{ url("modals/taxes/create") }}',
type: 'GET',
dataType: 'JSON',
data: {name: tax_name},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
var autocomplete_path = "{{ url('common/items/autocomplete') }}";
$(document).on('click', '.form-control.typeahead', function() {
@@ -365,8 +398,8 @@
totalItem();
});
var focus = false;
var focus = false;
$(document).on('focusin', '#items .input-price', function(){
focus = true;
});
@@ -439,7 +472,7 @@
url: '{{ url("common/items/totalItem") }}',
type: 'POST',
dataType: 'JSON',
data: $('#currency_code, #discount input[type=\'number\'], #items input[type=\'text\'],#items input[type=\'number\'],#items input[type=\'hidden\'], #items textarea, #items select'),
data: $('#currency_code, #discount input[type=\'number\'], #items input[type=\'text\'],#items input[type=\'number\'],#items input[type=\'hidden\'], #items textarea, #items select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {