v2 first commit
This commit is contained in:
@ -3,178 +3,47 @@
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.items', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
{!! Form::open(['route' => 'items.store', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'route' => 'items.store',
|
||||
'id' => 'item',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'tag') }}
|
||||
|
||||
{{ Form::textGroup('sku', trans('items.sku'), 'key') }}
|
||||
{{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, setting('default.tax'), []) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money') }}
|
||||
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money-bill-wave') }}
|
||||
|
||||
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money') }}
|
||||
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
|
||||
|
||||
{{ Form::textGroup('quantity', trans_choice('items.quantities', 1), 'cubes', ['required' => 'required'], '1') }}
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, []) }}
|
||||
|
||||
{{ Form::selectGroup('tax_id', trans_choice('general.taxes', 1), 'percent', $taxes, setting('general.default_tax'), []) }}
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), 'plus') }}
|
||||
|
||||
@stack('category_id_input_start')
|
||||
<div class="form-group col-md-6 required {{ $errors->has('category_id') ? 'has-error' : ''}}">
|
||||
{!! Form::label('category_id', trans_choice('general.categories', 1), ['class' => 'control-label']) !!}
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon"><i class="fa fa-folder-open-o"></i></div>
|
||||
{!! Form::select('category_id', $categories, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)])])) !!}
|
||||
<div class="input-group-btn">
|
||||
<button type="button" id="button-category" class="btn btn-default btn-icon"><i class="fa fa-plus"></i></button>
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('category_id', '<p class="help-block">:message</p>') !!}
|
||||
</div>
|
||||
@stack('category_id_input_end')
|
||||
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('common/items') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('common/items') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
||||
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/colorpicker/bootstrap-colorpicker.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/colorpicker/bootstrap-colorpicker.css') }}">
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var text_yes = '{{ trans('general.yes') }}';
|
||||
var text_no = '{{ trans('general.no') }}';
|
||||
|
||||
$(document).ready(function(){
|
||||
/*$("#sale_price").maskMoney({
|
||||
thousands : '{{ $currency->thousands_separator }}',
|
||||
decimal : '{{ $currency->decimal_mark }}',
|
||||
precision : {{ $currency->precision }},
|
||||
allowZero : true,
|
||||
@if($currency->symbol_first)
|
||||
prefix : '{{ $currency->symbol }}'
|
||||
@else
|
||||
suffix : '{{ $currency->symbol }}'
|
||||
@endif
|
||||
});
|
||||
|
||||
$("#purchase_price").maskMoney({
|
||||
thousands : '{{ $currency->thousands_separator }}',
|
||||
decimal : '{{ $currency->decimal_mark }}',
|
||||
precision : {{ $currency->precision }},
|
||||
allowZero : true,
|
||||
@if($currency->symbol_first)
|
||||
prefix : '{{ $currency->symbol }}'
|
||||
@else
|
||||
suffix : '{{ $currency->symbol }}'
|
||||
@endif
|
||||
});
|
||||
|
||||
$("#sale_price").focusout();
|
||||
$("#purchase_price").focusout();*/
|
||||
|
||||
$('#enabled_1').trigger('click');
|
||||
|
||||
$('#name').focus();
|
||||
|
||||
$('#tax_id').select2({
|
||||
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"></i> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#category_id").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
|
||||
});
|
||||
|
||||
$('#picture').fancyfile({
|
||||
text : '{{ trans('general.form.select.file') }}',
|
||||
style : 'btn-default',
|
||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.select2-results__option.select2-results__message', function(e) {
|
||||
tax_name = $('.select2-search__field').val();
|
||||
|
||||
$('body > .select2-container.select2-container--default.select2-container--open').remove();
|
||||
|
||||
$('#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']);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '#button-category', function (e) {
|
||||
$('#modal-create-category').remove();
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("modals/categories/create") }}',
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: {type: 'item'},
|
||||
success: function(json) {
|
||||
if (json['success']) {
|
||||
$('body').append(json['html']);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('hidden.bs.modal', '#modal-create-tax', function () {
|
||||
$('#tax_id').select2({
|
||||
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-circle"></i> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
@ -3,175 +3,50 @@
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.items', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
{!! Form::model($item, [
|
||||
'method' => 'PATCH',
|
||||
'files' => true,
|
||||
'route' => ['items.update', $item->id],
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button'
|
||||
]) !!}
|
||||
<div class="card">
|
||||
{!! Form::model($item, [
|
||||
'id' => 'item',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['items.update', $item->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'tag') }}
|
||||
|
||||
{{ Form::textGroup('sku', trans('items.sku'), 'key') }}
|
||||
{{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, $item->tax_id, []) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money') }}
|
||||
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money-bill-wave') }}
|
||||
|
||||
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money') }}
|
||||
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
|
||||
|
||||
{{ Form::textGroup('quantity', trans_choice('items.quantities', 1), 'cubes') }}
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, []) }}
|
||||
|
||||
{{ Form::selectGroup('tax_id', trans_choice('general.taxes', 1), 'percent', $taxes, null, []) }}
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
|
||||
|
||||
{{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories, null, []) }}
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
@permission('update-common-items')
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('common/items') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@permission('update-common-items')
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('common/items') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
@endpermission
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var text_yes = '{{ trans('general.yes') }}';
|
||||
var text_no = '{{ trans('general.no') }}';
|
||||
|
||||
$(document).ready(function(){
|
||||
/*$("#sale_price").maskMoney({
|
||||
thousands : '{{ $currency->thousands_separator }}',
|
||||
decimal : '{{ $currency->decimal_mark }}',
|
||||
precision : {{ $currency->precision }},
|
||||
allowZero : true,
|
||||
@if($currency->symbol_first)
|
||||
prefix : '{{ $currency->symbol }}'
|
||||
@else
|
||||
suffix : '{{ $currency->symbol }}'
|
||||
@endif
|
||||
});
|
||||
|
||||
$("#purchase_price").maskMoney({
|
||||
thousands : '{{ $currency->thousands_separator }}',
|
||||
decimal : '{{ $currency->decimal_mark }}',
|
||||
precision : {{ $currency->precision }},
|
||||
allowZero : true,
|
||||
@if($currency->symbol_first)
|
||||
prefix : '{{ $currency->symbol }}'
|
||||
@else
|
||||
suffix : '{{ $currency->symbol }}'
|
||||
@endif
|
||||
});
|
||||
|
||||
$("#sale_price").focusout();
|
||||
$("#purchase_price").focusout();*/
|
||||
|
||||
$('#tax_id').select2({
|
||||
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"></i> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#category_id").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
|
||||
});
|
||||
|
||||
$('#picture').fancyfile({
|
||||
text : '{{ trans('general.form.select.file') }}',
|
||||
style : 'btn-default',
|
||||
@if($item->picture)
|
||||
placeholder : '{{ $item->picture->basename }}'
|
||||
@else
|
||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||
@endif
|
||||
});
|
||||
|
||||
@if($item->picture)
|
||||
$.ajax({
|
||||
url: '{{ url('uploads/' . $item->picture->id . '/show') }}',
|
||||
type: 'GET',
|
||||
data: {column_name: 'picture'},
|
||||
dataType: 'JSON',
|
||||
success: function(json) {
|
||||
if (json['success']) {
|
||||
$('.fancy-file').after(json['html']);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@permission('delete-common-uploads')
|
||||
$(document).on('click', '#remove-picture', function (e) {
|
||||
confirmDelete("#picture-{!! $item->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $item->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||
});
|
||||
@endpermission
|
||||
@endif
|
||||
});
|
||||
|
||||
$(document).on('click', '.select2-results__option.select2-results__message', function(e) {
|
||||
tax_name = $('.select2-search__field').val();
|
||||
|
||||
$('body > .select2-container.select2-container--default.select2-container--open').remove();
|
||||
|
||||
$('#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']);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('hidden.bs.modal', '#modal-create-tax', function () {
|
||||
$('#tax_id').select2({
|
||||
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-circle"></i> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
@ -3,108 +3,109 @@
|
||||
@section('title', trans_choice('general.items', 2))
|
||||
|
||||
@section('new_button')
|
||||
@permission('create-common-items')
|
||||
<span class="new-button"><a href="{{ route('items.create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
<span><a href="{{ route('import.create', ['common', 'items']) }}" class="btn btn-default btn-sm"><span class="fa fa-download"></span> {{ trans('import.import') }}</a></span>
|
||||
@endpermission
|
||||
<span><a href="{{ route('items.export', request()->input()) }}" class="btn btn-default btn-sm"><span class="fa fa-upload"></span> {{ trans('general.export') }}</a></span>
|
||||
@permission('create-common-items')
|
||||
<span><a href="{{ route('items.create') }}" class="btn btn-sm btn-success header-button-top"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
<span><a href="{{ route('import.create', ['common', 'items']) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload "></span> {{ trans('import.import') }}</a></span>
|
||||
@endpermission
|
||||
<span><a href="{{ route('items.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> {{ trans('general.export') }}</a></span>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
{!! Form::open(['route' => 'items.index', 'role' => 'form', 'method' => 'GET']) !!}
|
||||
<div id="items" class="pull-left box-filter">
|
||||
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
|
||||
{!! Form::text('search', request('search'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('general.search_placeholder')]) !!}
|
||||
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
|
||||
{!! Form::button('<span class="fa fa-filter"></span> ' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<span class="title-filter hidden-xs">{{ trans('general.show') }}:</span>
|
||||
{!! Form::select('limit', $limits, request('limit', setting('general.list_limit', '25')), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'route' => 'items.index',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row" v-if="!bulk_action.show">
|
||||
<div class="col-12 card-header-search card-header-space">
|
||||
<span class="table-text hidden-lg card-header-search-text">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1 hidden-xs">{{ trans_choice('general.pictures', 1) }}</th>
|
||||
<th class="col-md-3">@sortablelink('name', trans('general.name'))</th>
|
||||
<th class="col-md-1 hidden-xs">@sortablelink('category', trans_choice('general.categories', 1))</th>
|
||||
<th class="col-md-1 hidden-xs">@sortablelink('quantity', trans_choice('items.quantities', 1))</th>
|
||||
<th class="col-md-2 text-right amount-space">@sortablelink('sale_price', trans('items.sales_price'))</th>
|
||||
<th class="col-md-2 hidden-xs text-right amount-space">@sortablelink('purchase_price', trans('items.purchase_price'))</th>
|
||||
<th class="col-md-1 hidden-xs">@sortablelink('enabled', trans_choice('general.statuses', 1))</th>
|
||||
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
|
||||
{{ Form::bulkActionRowGroup('general.items', $bulk_actions, 'common/items') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-2 col-md-1 col-lg-1 col-xl-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-xs-4 col-sm-4 col-md-4 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-lg-1 col-xl-2 hidden-lg">@sortablelink('category', trans_choice('general.categories', 1))</th>
|
||||
<th class="col-md-3 col-lg-3 col-xl-2 text-right hidden-md">@sortablelink('sale_price', trans('items.sales_price'))</th>
|
||||
<th class="col-lg-2 col-xl-2 text-right hidden-lg">@sortablelink('purchase_price', trans('items.purchase_price'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1">@sortablelink('enabled', trans('general.enabled'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($items as $item)
|
||||
<tr>
|
||||
<td class="hidden-xs"><img src="{{ $item->picture ? Storage::url($item->picture->id) : asset('public/img/akaunting-logo-green.png') }}" class="img-thumbnail" width="50" alt="{{ $item->name }}"></td>
|
||||
<td><a href="{{ route('items.edit', $item->id) }}">{{ $item->name }}</a></td>
|
||||
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
|
||||
<td class="hidden-xs">{{ $item->quantity }}</td>
|
||||
<td class="text-right amount-space">{{ money($item->sale_price, setting('general.default_currency'), true) }}</td>
|
||||
<td class="hidden-xs text-right amount-space">{{ money($item->purchase_price, setting('general.default_currency'), true) }}</td>
|
||||
<td class="hidden-xs">
|
||||
@if ($item->enabled)
|
||||
<span class="label label-success">{{ trans('general.enabled') }}</span>
|
||||
@else
|
||||
<span class="label label-danger">{{ trans('general.disabled') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li><a href="{{ route('items.edit', $item->id) }}">{{ trans('general.edit') }}</a></li>
|
||||
@foreach($items as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 hidden-sm">
|
||||
{{ Form::bulkActionGroup($item->id, $item->name) }}
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-3 col-xl-3 py-2">
|
||||
<img src="{{ $item->picture ? Storage::url($item->picture->id) : asset('public/img/akaunting-logo-green.png') }}" class="avatar image-style p-1 mr-3 item-img hidden-md col-aka" alt="{{ $item->name }}">
|
||||
<a class="text-success" href="{{ route('items.edit', $item->id) }}">{{ $item->name }}</a>
|
||||
</td>
|
||||
<td class="col-lg-1 col-xl-2 hidden-lg">
|
||||
{{ $item->category ? $item->category->name : trans('general.na') }}
|
||||
</td>
|
||||
<td class="col-md-3 col-lg-3 col-xl-2 text-right hidden-md">
|
||||
{{ money($item->sale_price, setting('default.currency'), true) }}
|
||||
</td>
|
||||
<td class="col-lg-2 col-xl-2 text-right hidden-lg">
|
||||
{{ money($item->purchase_price, setting('default.currency'), true) }}
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1">
|
||||
@if (user()->can('update-common-items'))
|
||||
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<li><a href="{{ route('items.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
|
||||
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
|
||||
@else
|
||||
<li><a href="{{ route('items.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
|
||||
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
|
||||
@endif
|
||||
@permission('create-common-items')
|
||||
<li class="divider"></li>
|
||||
<li><a href="{{ route('items.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a></li>
|
||||
@endpermission
|
||||
@permission('delete-common-items')
|
||||
<li class="divider"></li>
|
||||
<li>{!! Form::deleteLink($item, 'common/items') !!}</li>
|
||||
@endpermission
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-neutral btn-sm text-light items-align-center p-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h text-muted"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
<a class="dropdown-item" href="{{ route('items.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@permission('create-common-items')
|
||||
<a class="dropdown-item" href="{{ route('items.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endpermission
|
||||
@permission('delete-common-items')
|
||||
{!! Form::deleteLink($item, 'common/items') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
@include('partials.admin.pagination', ['items' => $items, 'type' => 'items'])
|
||||
<div class="card-footer table-action">
|
||||
<div class="row align-items-center">
|
||||
@include('partials.admin.pagination', ['items' => $items, 'type' => 'items'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#filter-categories").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
Reference in New Issue
Block a user