v2 first commit
This commit is contained in:
@ -3,61 +3,45 @@
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.companies', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
{!! Form::open(['url' => 'common/companies', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('company_name', trans('general.name'), 'id-card-o') }}
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'id' => 'company',
|
||||
'route' => 'companies.store',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
{{ Form::textGroup('domain', trans('companies.domain'), 'globe') }}
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'building') }}
|
||||
|
||||
{{ Form::emailGroup('company_email', trans('general.email'), 'envelope') }}
|
||||
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
|
||||
|
||||
{{ Form::selectGroup('default_currency', trans_choice('general.currencies', 1), 'money', $currencies) }}
|
||||
{{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies) }}
|
||||
|
||||
{{ Form::textareaGroup('company_address', trans('general.address')) }}
|
||||
{{ Form::textGroup('domain', trans('companies.domain'), 'globe', []) }}
|
||||
|
||||
{{ Form::fileGroup('company_logo', trans('companies.logo')) }}
|
||||
{{ Form::textareaGroup('address', trans('general.address')) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
{{ Form::fileGroup('logo', trans('companies.logo')) }}
|
||||
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('common/companies') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('common/companies') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! 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(){
|
||||
$('#enabled_1').trigger('click');
|
||||
$('#company_name').focus();
|
||||
|
||||
$("#default_currency").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
|
||||
});
|
||||
|
||||
$('#company_logo').fancyfile({
|
||||
text : '{{ trans('general.form.select.file') }}',
|
||||
style : 'btn-default',
|
||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
@ -3,91 +3,48 @@
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.companies', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
{!! Form::model($company, [
|
||||
'method' => 'PATCH',
|
||||
'url' => ['common/companies', $company->id],
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button'
|
||||
]) !!}
|
||||
<div class="card">
|
||||
{!! Form::model($company, [
|
||||
'id' => 'company',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['companies.update', $company->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('company_name', trans('general.name'), 'id-card-o') }}
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'building') }}
|
||||
|
||||
{{ Form::textGroup('domain', trans('companies.domain'), 'globe') }}
|
||||
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
|
||||
|
||||
{{ Form::emailGroup('company_email', trans('general.email'), 'envelope') }}
|
||||
{{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $company->currency) }}
|
||||
|
||||
{{ Form::selectGroup('default_currency', trans_choice('general.currencies', 1), 'money', $currencies) }}
|
||||
{{ Form::textGroup('domain', trans('companies.domain'), 'globe', []) }}
|
||||
|
||||
{{ Form::textareaGroup('company_address', trans('general.address')) }}
|
||||
{{ Form::textareaGroup('address', trans('general.address')) }}
|
||||
|
||||
{{ Form::fileGroup('company_logo', trans('companies.logo')) }}
|
||||
{{ Form::fileGroup('logo', trans('companies.logo')) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@permission('update-common-companies')
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('common/companies') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('common/companies') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
{!! 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(){
|
||||
$("#default_currency").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
|
||||
});
|
||||
|
||||
$('#company_logo').fancyfile({
|
||||
text : '{{ trans('general.form.select.file') }}',
|
||||
style : 'btn-default',
|
||||
@if($company->company_logo)
|
||||
placeholder : '{{ $company->company_logo->basename }}'
|
||||
@else
|
||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||
@endif
|
||||
});
|
||||
|
||||
@if($company->company_logo)
|
||||
$.ajax({
|
||||
url: '{{ url('uploads/' . $company->company_logo->id . '/show') }}',
|
||||
type: 'GET',
|
||||
data: {column_name: 'attachment'},
|
||||
dataType: 'JSON',
|
||||
success: function(json) {
|
||||
if (json['success']) {
|
||||
$('.fancy-file').after(json['html']);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@permission('delete-common-uploads')
|
||||
$(document).on('click', '#remove-attachment', function (e) {
|
||||
confirmDelete("#attachment-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->company_logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||
});
|
||||
@endpermission
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
@ -3,95 +3,96 @@
|
||||
@section('title', trans_choice('general.companies', 2))
|
||||
|
||||
@permission('create-common-companies')
|
||||
@section('new_button')
|
||||
<span class="new-button"><a href="{{ url('common/companies/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
@endsection
|
||||
@section('new_button')
|
||||
<span><a href="{{ route('companies.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
@endsection
|
||||
@endpermission
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'common/companies',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row" v-if="!bulk_action.show">
|
||||
<div class="col-12 card-header-search">
|
||||
<span class="table-text hidden-lg">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
{!! Form::open(['url' => 'common/companies', 'role' => 'form', 'method' => 'GET']) !!}
|
||||
<div class="pull-left">
|
||||
<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::button('<span class="fa fa-filter"></span> ' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
|
||||
{{ Form::bulkActionRowGroup('general.companies', $bulk_actions, 'common/companies') }}
|
||||
{!! Form::close() !!}
|
||||
</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="box-body">
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-companies">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1 hidden-xs">@sortablelink('id', trans('general.id'))</th>
|
||||
<th class="col-md-3">@sortablelink('name', trans('general.name'))</th>
|
||||
<th class="col-md-2 hidden-xs">@sortablelink('domain', trans('companies.domain'))</th>
|
||||
<th class="col-md-2 hidden-xs">@sortablelink('email', trans('general.email'))</th>
|
||||
<th class="col-md-2 hidden-xs">@sortablelink('created_at', trans('general.created'))</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>
|
||||
<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-2 col-lg-1 col-xl-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 hidden-sm">@sortablelink('id', trans('general.id'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-3 col-xl-3 o-y">@sortablelink('name', trans('general.name'))</th>
|
||||
<th class="col-md-2 col-lg-2 col-xl-2 hidden-md o-y">@sortablelink('email', trans('general.email'))</th>
|
||||
<th class="col-lg-2 col-xl-2 hidden-lg">@sortablelink('created_at', trans('general.created'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">@sortablelink('enabled', trans('general.enabled'))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($companies as $item)
|
||||
<tr>
|
||||
<td class="hidden-xs">{{ $item->id }}</td>
|
||||
<td><a href="{{ url('common/companies/' . $item->id . '/edit') }}">{{ $item->company_name }}</a></td>
|
||||
<td class="hidden-xs">{{ $item->domain }}</td>
|
||||
<td class="hidden-xs">{{ $item->company_email }}</td>
|
||||
<td class="hidden-xs">{{ Date::parse($item->created_at)->format($date_format) }}</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">
|
||||
@foreach($companies as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 hidden-sm">{{ Form::bulkActionGroup($item->id, $item->name) }}</td>
|
||||
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 hidden-sm"><a class="col-aka">{{ $item->id }}</a></td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-3 col-xl-3 o-y"><a class="text-success" href="{{ url('common/companies/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
||||
<td class="col-md-2 col-lg-2 col-xl-2 hidden-md o-y">{{ $item->email }}</td>
|
||||
<td class="col-lg-2 col-xl-2 hidden-lg border-0">@date($item->created_at)</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">
|
||||
@if (user()->can('update-common-companies'))
|
||||
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<li><a href="{{ route('companies.switch', $item->id) }}">{{ trans('general.switch') }}</a></li>
|
||||
<li class="divider"></li>
|
||||
@endif
|
||||
<li><a href="{{ url('common/companies/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
|
||||
@if ($item->enabled)
|
||||
<li><a href="{{ route('companies.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
|
||||
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
|
||||
@else
|
||||
<li><a href="{{ route('companies.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
|
||||
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
|
||||
@endif
|
||||
@permission('delete-common-companies')
|
||||
<li class="divider"></li>
|
||||
<li>{!! Form::deleteLink($item, 'common/companies', '', 'company_name') !!}</li>
|
||||
@endpermission
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-2 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 py-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">
|
||||
@if ($item->enabled)
|
||||
<a class="dropdown-item" href="{{ route('companies.switch', $item->id) }}">{{ trans('general.switch') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
<a class="dropdown-item" href="{{ url('common/companies/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a>
|
||||
@permission('delete-common-companies')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'common/companies', '', 'company_name') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
@include('partials.admin.pagination', ['items' => $companies, 'type' => 'companies'])
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $companies, 'type' => 'companies'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
@ -1,349 +1,107 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.dashboard'))
|
||||
@section('title', $dashboard->name)
|
||||
|
||||
@section('dashboard_action')
|
||||
<span class="dashboard-action">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-sm items-align-center py-2 mt--1" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-v"></i>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-left dropdown-menu-arrow">
|
||||
{!! Form::button(trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]), array(
|
||||
'type' => 'button',
|
||||
'class' => 'dropdown-item',
|
||||
'title' => trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]),
|
||||
'@click' => 'onCreateWidget()'
|
||||
)) !!}
|
||||
|
||||
{!! Form::button(trans('general.title.edit', ['type' => trans_choice('general.dashboard', 1)]), array(
|
||||
'type' => 'button',
|
||||
'class' => 'dropdown-item',
|
||||
'title' => trans('general.title.edit', ['type' => trans_choice('general.dashboard', 1)]),
|
||||
'@click' => 'onEditDashboard(' . $dashboard->id . ')'
|
||||
)) !!}
|
||||
|
||||
@if ($dashboards->count() > 1)
|
||||
{!! Form::deleteLink($dashboard, 'common/dashboards') !!}
|
||||
@endif
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::button(trans('general.title.add', ['type' => trans_choice('general.dashboard', 1)]), array(
|
||||
'type' => 'button',
|
||||
'class' => 'dropdown-item',
|
||||
'title' => trans('general.title.add', ['type' => trans_choice('general.dashboard', 1)]),
|
||||
'@click' => 'onCreateDashboard()'
|
||||
)) !!}
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
@php
|
||||
$text = json_encode([
|
||||
'name' => trans('general.name'),
|
||||
'type' => 'Type',
|
||||
'width' => 'Width',
|
||||
'sort' => 'Sort',
|
||||
'enabled' => trans('general.enabled'),
|
||||
'yes' => trans('general.yes'),
|
||||
'no' => trans('general.no'),
|
||||
'save' => trans('general.save'),
|
||||
'cancel' => trans('general.cancel')
|
||||
]);
|
||||
|
||||
$placeholder = json_encode([
|
||||
'name' => trans('general.form.enter', ['field' => trans('general.name')]),
|
||||
'type' => trans('general.form.enter', ['field' => 'Type']),
|
||||
'width' => trans('general.form.enter', ['field' => 'Width']),
|
||||
'sort' => trans('general.form.enter', ['field' => 'Sort'])
|
||||
]);
|
||||
@endphp
|
||||
|
||||
<akaunting-dashboard
|
||||
v-if="dashboard_modal"
|
||||
:title="'{{ trans('general.dashboard') }}'"
|
||||
:show="dashboard_modal"
|
||||
:name="dashboard.name"
|
||||
:enabled="dashboard.enabled"
|
||||
:type="dashboard.type"
|
||||
:dashboard_id="dashboard.dashboard_id"
|
||||
:text="{{ $text }}"
|
||||
@cancel="onCancel">
|
||||
</akaunting-dashboard>
|
||||
|
||||
<akaunting-widget
|
||||
v-if="widget_modal"
|
||||
:title="'{{ trans_choice('general.widgets', 1) }}'"
|
||||
:show="widget_modal"
|
||||
:name="widget.name"
|
||||
:width="widget.width"
|
||||
:action="widget.action"
|
||||
:type="widget.type"
|
||||
:sort="widget.sort"
|
||||
:types="widgets"
|
||||
:widget_id="widget.widget_id"
|
||||
:dashboard_id="{{ $dashboard->id }}"
|
||||
:text="{{ $text }}"
|
||||
:placeholder="{{ $placeholder }}"
|
||||
@cancel="onCancel">
|
||||
</akaunting-widget>
|
||||
@endsection
|
||||
|
||||
@section('new_button')
|
||||
<!--Dashboard General Filter-->
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<!---Income-->
|
||||
<div class="col-md-4">
|
||||
<div class="info-box">
|
||||
@if ($auth_user->can('read-reports-income-summary'))
|
||||
<a href="{{ url('reports/income-summary') }}"><span class="info-box-icon bg-aqua"><i class="fa fa-money"></i></span></a>
|
||||
@else
|
||||
<span class="info-box-icon bg-aqua"><i class="fa fa-money"></i></span>
|
||||
@endif
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ trans('dashboard.total_incomes') }}</span>
|
||||
<span class="info-box-number">@money($total_incomes['total'], setting('general.default_currency'), true)</span>
|
||||
<div class="progress-group" title="{{ trans('dashboard.open_invoices') }}: {{ $total_incomes['open_invoice'] }}<br>{{ trans('dashboard.overdue_invoices') }}: {{ $total_incomes['overdue_invoice'] }}" data-toggle="tooltip" data-html="true">
|
||||
<div class="progress sm">
|
||||
<div class="progress-bar progress-bar-aqua" style="width: {{ $total_incomes['progress'] }}%"></div>
|
||||
</div>
|
||||
<span class="progress-text">{{ trans('dashboard.receivables') }}</span>
|
||||
<span class="progress-number">{{ $total_incomes['open_invoice'] }} / {{ $total_incomes['overdue_invoice'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!---Expense-->
|
||||
<div class="col-md-4">
|
||||
<div class="info-box">
|
||||
@if ($auth_user->can('read-reports-expense-summary'))
|
||||
<a href="{{ url('reports/expense-summary') }}"><span class="info-box-icon bg-red"><i class="fa fa-shopping-cart"></i></span></a>
|
||||
@else
|
||||
<span class="info-box-icon bg-red"><i class="fa fa-shopping-cart"></i></span>
|
||||
@endif
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ trans('dashboard.total_expenses') }}</span>
|
||||
<span class="info-box-number">@money($total_expenses['total'], setting('general.default_currency'), true)</span>
|
||||
|
||||
<div class="progress-group" title="{{ trans('dashboard.open_bills') }}: {{ $total_expenses['open_bill'] }}<br>{{ trans('dashboard.overdue_bills') }}: {{ $total_expenses['overdue_bill'] }}" data-toggle="tooltip" data-html="true">
|
||||
<div class="progress sm">
|
||||
<div class="progress-bar progress-bar-red" style="width: {{ $total_expenses['progress'] }}%"></div>
|
||||
</div>
|
||||
<span class="progress-text">{{ trans('dashboard.payables') }}</span>
|
||||
<span class="progress-number">{{ $total_expenses['open_bill'] }} / {{ $total_expenses['overdue_bill'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!---Profit-->
|
||||
<div class="col-md-4">
|
||||
<div class="info-box">
|
||||
@if ($auth_user->can('read-reports-income-expense-summary'))
|
||||
<a href="{{ url('reports/income-expense-summary') }}"><span class="info-box-icon bg-green"><i class="fa fa-heart"></i></span></a>
|
||||
@else
|
||||
<span class="info-box-icon bg-green"><i class="fa fa-heart"></i></span>
|
||||
@endif
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ trans('dashboard.total_profit') }}</span>
|
||||
<span class="info-box-number">@money($total_profit['total'], setting('general.default_currency'), true)</span>
|
||||
|
||||
<div class="progress-group" title="{{ trans('dashboard.open_profit') }}: {{ $total_profit['open'] }}<br>{{ trans('dashboard.overdue_profit') }}: {{ $total_profit['overdue'] }}" data-toggle="tooltip" data-html="true">
|
||||
<div class="progress sm">
|
||||
<div class="progress-bar progress-bar-green" style="width: {{ $total_profit['progress'] }}%"></div>
|
||||
</div>
|
||||
<span class="progress-text">{{ trans('general.upcoming') }}</span>
|
||||
<span class="progress-number">{{ $total_profit['open'] }} / {{ $total_profit['overdue'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!---Income, Expense and Profit Line Chart-->
|
||||
<div class="col-md-12">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('dashboard.cash_flow') }}</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" id="cashflow-monthly" class="btn btn-default btn-sm">{{ trans('general.monthly') }}</button>
|
||||
<button type="button" id="cashflow-quarterly" class="btn btn-default btn-sm">{{ trans('general.quarterly') }}</button>
|
||||
<input type="hidden" name="period" id="period" value="month" />
|
||||
<div class="btn btn-default btn-sm">
|
||||
<div id="cashflow-range" class="pull-right">
|
||||
<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
|
||||
<span></span> <b class="caret"></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body" id="cashflow">
|
||||
{!! $cashflow->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('dashboard.incomes_by_category') }}</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{!! $donut_incomes->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('dashboard.expenses_by_category') }}</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{!! $donut_expenses->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Account Balance List-->
|
||||
<div class="col-md-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('dashboard.account_balance') }}</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@if ($accounts->count())
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
@foreach($accounts as $item)
|
||||
<tr>
|
||||
<td class="text-left">{{ $item->name }}</td>
|
||||
<td class="text-right">@money($item->balance, $item->currency_code, true)</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Latest Incomes List-->
|
||||
<div class="col-md-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('dashboard.latest_incomes') }}</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@if ($latest_incomes->count())
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">{{ trans('general.date') }}</th>
|
||||
<th class="text-left">{{ trans_choice('general.categories', 1) }}</th>
|
||||
<th class="text-right">{{ trans('general.amount') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($latest_incomes as $item)
|
||||
<tr>
|
||||
<td class="text-left">{{ Date::parse($item->paid_at)->format($date_format) }}</td>
|
||||
<td class="text-left">{{ $item->category ? $item->category->name : trans_choice('general.invoices', 2) }}</td>
|
||||
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Latest Expenses List-->
|
||||
<div class="col-md-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('dashboard.latest_expenses') }}</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@if ($latest_expenses->count())
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">{{ trans('general.date') }}</th>
|
||||
<th class="text-left">{{ trans_choice('general.categories', 1) }}</th>
|
||||
<th class="text-right">{{ trans('general.amount') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($latest_expenses as $item)
|
||||
<tr>
|
||||
<td class="text-left">{{ Date::parse($item->paid_at)->format($date_format) }}</td>
|
||||
<td class="text-left">{{ $item->category ? $item->category->name : trans_choice('general.bills', 2) }}</td>
|
||||
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@foreach($widgets as $dashboard_widget)
|
||||
@widget($dashboard_widget->widget->alias, $dashboard_widget->settings)
|
||||
@endforeach
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('public/css/daterangepicker.css') }}" />
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
{!! Charts::assets() !!}
|
||||
<script type="text/javascript" src="{{ asset('public/js/moment/moment.js') }}"></script>
|
||||
@if (is_file(base_path('public/js/moment/locale/' . strtolower(app()->getLocale()) . '.js')))
|
||||
<script type="text/javascript" src="{{ asset('public/js/moment/locale/' . strtolower(app()->getLocale()) . '.js') }}"></script>
|
||||
@elseif (is_file(base_path('public/js/moment/locale/' . language()->getShortCode() . '.js')))
|
||||
<script type="text/javascript" src="{{ asset('public/js/moment/locale/' . language()->getShortCode() . '.js') }}"></script>
|
||||
@endif
|
||||
<script type="text/javascript" src="{{ asset('public/js/daterangepicker/daterangepicker.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var start = moment('{{ $financial_start }}');
|
||||
var end = moment('{{ $financial_start }}').add('1', 'years').subtract('1', 'days');
|
||||
|
||||
function cb(start, end) {
|
||||
$('#cashflow-range span').html(start.format('D MMM YYYY') + ' - ' + end.format('D MMM YYYY'));
|
||||
}
|
||||
|
||||
$('#cashflow-range').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
ranges: {
|
||||
'{{ trans("reports.this_year") }}': [start, end],
|
||||
'{{ trans("reports.previous_year") }}': [moment('{{ $financial_start }}').subtract(1, 'year'), moment('{{ $financial_start }}').subtract('1', 'days')],
|
||||
'{{ trans("reports.this_quarter") }}': [moment().startOf('quarter'), moment().endOf('quarter')],
|
||||
'{{ trans("reports.previous_quarter") }}': [moment().subtract(1, 'quarter').startOf('quarter'), moment().subtract(1, 'quarter').endOf('quarter')],
|
||||
'{{ trans("reports.last_12_months") }}': [moment().subtract(11, 'months').startOf('month'), moment().endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#cashflow-range').on('apply.daterangepicker', function(ev, picker) {
|
||||
var period = $('#period').val();
|
||||
|
||||
range = getRange(picker);
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("common/dashboard/cashflow") }}',
|
||||
type: 'get',
|
||||
dataType: 'html',
|
||||
data: 'period=' + period + '&start=' + picker.startDate.format('YYYY-MM-DD') + '&end=' + picker.endDate.format('YYYY-MM-DD') + '&range=' + range,
|
||||
success: function(data) {
|
||||
$('#cashflow').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#cashflow-monthly').on('click', function() {
|
||||
var picker = $('#cashflow-range').data('daterangepicker');
|
||||
|
||||
$('#period').val('month');
|
||||
|
||||
range = getRange(picker);
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("common/dashboard/cashflow") }}',
|
||||
type: 'get',
|
||||
dataType: 'html',
|
||||
data: 'period=month&start=' + picker.startDate.format('YYYY-MM-DD') + '&end=' + picker.endDate.format('YYYY-MM-DD') + '&range=' + range,
|
||||
success: function(data) {
|
||||
$('#cashflow').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#cashflow-quarterly').on('click', function() {
|
||||
var picker = $('#cashflow-range').data('daterangepicker');
|
||||
|
||||
$('#period').val('quarter');
|
||||
|
||||
range = getRange(picker);
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("common/dashboard/cashflow") }}',
|
||||
type: 'get',
|
||||
dataType: 'html',
|
||||
data: 'period=quarter&start=' + picker.startDate.format('YYYY-MM-DD') + '&end=' + picker.endDate.format('YYYY-MM-DD') + '&range=' + range,
|
||||
success: function(data) {
|
||||
$('#cashflow').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function getRange(picker) {
|
||||
ranges = {
|
||||
'{{ trans("reports.this_year") }}': 'custom',
|
||||
'{{ trans("reports.previous_year") }}': 'custom',
|
||||
'{{ trans("reports.this_quarter") }}': 'this_quarter',
|
||||
'{{ trans("reports.previous_quarter") }}': 'previous_quarter',
|
||||
'{{ trans("reports.last_12_months") }}': 'last_12_months'
|
||||
};
|
||||
|
||||
range = 'custom';
|
||||
|
||||
if (ranges[picker.chosenLabel] != undefined) {
|
||||
range = ranges[picker.chosenLabel];
|
||||
}
|
||||
|
||||
return range;
|
||||
}
|
||||
</script>
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboard.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
@ -1,56 +1,49 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('import.title', ['type' => trans_choice($namespace . 'general.' . snake_case(camel_case($type)), 2)]))
|
||||
@section('title', trans('import.title', ['type' => trans_choice('general.' . $type, 2)]))
|
||||
|
||||
@section('content')
|
||||
<div class="box box-success">
|
||||
{!! Form::open(['url' => $path . '/import', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'url' => $path . '/import',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button'
|
||||
]) !!}
|
||||
|
||||
<div class="box-body">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info alert-important">
|
||||
{!! trans('import.message', ['link' => url('public/files/import/' . $type . '.xlsx')]) !!}
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info alert-important">
|
||||
{!! trans('import.message', ['link' => url('public/files/import/' . $type . '.xlsx')]) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('import_input_start')
|
||||
<div class="form-group col-md-12 required {{ $errors->has('import') ? 'has-error' : '' }}" style="min-height: 59px">
|
||||
{!! Form::label('import', trans('general.form.select.file'), ['class' => 'control-label']) !!}
|
||||
{!! Form::file('import', null, ['class' => 'form-control']) !!}
|
||||
{!! $errors->first('import', '<p class="help-block">:message</p>') !!}
|
||||
</div>
|
||||
@stack('import_input_end')
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group no-margin">
|
||||
@stack('import_input_start')
|
||||
<div class="dropzone dropzone-single" data-toggle="dropzone" data-dropzone-url="#">
|
||||
<div class="fallback">
|
||||
<div class="custom-file">
|
||||
<input type="file" name="import" class="custom-file-input" id="projectCoverUploads">
|
||||
<label class="custom-file-label" for="projectCoverUploads">Choose file</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dz-preview dz-preview-single">
|
||||
<div class="dz-preview-cover">
|
||||
<img class="dz-preview-img" src="..." alt="..." data-dz-thumbnail>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('import', '<p class="help-block">:message</p>') !!}
|
||||
</div>
|
||||
@stack('import_input_end')
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="float-right">
|
||||
<a href="{{ url($path) }}" class="btn btn-outline-secondary"><span class="fa fa-times"></span> {{ trans('general.cancel') }}</a>
|
||||
{!! Form::button('<span class="fa fa-download"></span> ' . trans('import.import'), ['type' => 'submit', 'class' => 'btn btn-success']) !!}
|
||||
<a href="{{ url($path) }}" class="btn btn-default"><span class="fa fa-times-circle"></span> {{ trans('general.cancel') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! 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">
|
||||
$(document).ready(function(){
|
||||
$('#import').fancyfile({
|
||||
text : '{{ trans('general.form.select.file') }}',
|
||||
style : 'btn-default',
|
||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endsection
|
@ -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
|
||||
|
@ -3,30 +3,22 @@
|
||||
@section('title', trans_choice('general.notifications', 2))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="card">
|
||||
<div class="card-header"></div>
|
||||
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table align-items-center table-flush">
|
||||
<thead class="thead-light">
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-notifications">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card-footer">
|
||||
@include('partials.admin.pagination', ['items' => $notifications, 'type' => 'notifications'])
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
@include('partials.admin.pagination', ['items' => $notifications, 'type' => 'notifications'])
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
@endsection
|
||||
|
||||
|
48
resources/views/common/reports/create.blade.php
Normal file
48
resources/views/common/reports/create.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.reports', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'id' => 'report',
|
||||
'route' => 'reports.store',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
|
||||
{{ Form::selectGroup('class', trans_choice('general.types', 1), 'bars', $classes, null, ['required' => 'required', 'change' => 'onChangeClass']) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
|
||||
|
||||
{{ Form::selectGroup('group', trans('general.group_by'), 'folder', $groups, 'category') }}
|
||||
|
||||
{{ Form::selectGroup('period', trans('general.period'), 'calendar', $periods, 'yearly') }}
|
||||
|
||||
{{ Form::selectGroup('basis', trans('general.basis'), 'file', $basises, 'accrual') }}
|
||||
|
||||
{{ Form::selectGroup('chart', trans_choice('general.charts', 1), 'chart-pie', $charts, 'line') }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('common/reports') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
53
resources/views/common/reports/edit.blade.php
Normal file
53
resources/views/common/reports/edit.blade.php
Normal file
@ -0,0 +1,53 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.reports', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($report, [
|
||||
'id' => 'report',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['reports.update', $report->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
|
||||
{{ Form::selectGroup('class', trans_choice('general.types', 1), 'bars', $classes, $report->class, ['required' => 'required', 'change' => 'onChangeClass']) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
|
||||
|
||||
{{ Form::selectGroup('group', trans('general.group_by'), 'folder', $groups, $report->group) }}
|
||||
|
||||
{{ Form::selectGroup('period', trans('general.period'), 'calendar', $periods, $report->period) }}
|
||||
|
||||
{{ Form::selectGroup('basis', trans('general.basis'), 'file', $basises, $report->basis) }}
|
||||
|
||||
{{ Form::selectGroup('chart', trans_choice('general.charts', 1), 'chart-pie', $charts, $report->chart) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('common/reports') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script type="text/javascript">
|
||||
var class =
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
122
resources/views/common/reports/index.blade.php
Normal file
122
resources/views/common/reports/index.blade.php
Normal file
@ -0,0 +1,122 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.reports', 2))
|
||||
|
||||
@section('new_button')
|
||||
@permission('create-common-reports')
|
||||
<span class="new-button">
|
||||
<a href="{{ route('reports.create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a>
|
||||
</span>
|
||||
@endpermission
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row mb-4">
|
||||
|
||||
<div class="col-md-12">
|
||||
<h3 id="stats">{{ trans('reports.income-expense') }}</h3>
|
||||
</div>
|
||||
|
||||
@foreach($reports['income-expense'] as $report)
|
||||
<div class="col-md-4">
|
||||
<div class="card card-stats">
|
||||
<span>
|
||||
<div class="dropdown card-action-button">
|
||||
<a class="btn btn-sm items-align-center py-2 mr-0 shadow-none--hover" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-v text-primary"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
@permission('create-common-reports')
|
||||
<a class="dropdown-item" href="{{ route('reports.edit', $report->id) }}">{{ trans('general.edit') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endpermission
|
||||
@permission('delete-common-reports')
|
||||
{!! Form::deleteLink($report, 'common/reports') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<h5 class="card-title text-uppercase text-muted mb-0">{{ $report->name }}</h5>
|
||||
<span class="h2 font-weight-bold mb-0">{{ $classes[$report->id]->getTotal() }}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<div class="icon icon-shape bg-orange text-white rounded-circle shadow">
|
||||
<i class="{{ $classes[$report->id]->getIcon() }}"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-3 mb-0 text-sm">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<span class="text-nowrap">{{ $report->description }}</span>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<div class="col-md-12">
|
||||
<h3 id="stats">{{ trans('general.accounting') }}</h3>
|
||||
</div>
|
||||
|
||||
@foreach($reports['accounting'] as $report)
|
||||
<div class="col-md-4">
|
||||
<div class="card card-stats">
|
||||
<span>
|
||||
<div class="dropdown card-action-button">
|
||||
<a class="btn btn-sm items-align-center py-2 mr-0 shadow-none--hover" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-v text-primary"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
@permission('create-common-reports')
|
||||
<a class="dropdown-item" href="{{ route('reports.edit', $report->id) }}">{{ trans('general.edit') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endpermission
|
||||
@permission('delete-common-reports')
|
||||
{!! Form::deleteLink($report, 'common/reports') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<h5 class="card-title text-uppercase text-muted mb-0">{{ $report->name }}</h5>
|
||||
<span class="h2 font-weight-bold mb-0">{{ $classes[$report->id]->getTotal() }}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<div class="icon icon-shape bg-orange text-white rounded-circle shadow">
|
||||
<i class="{{ $classes[$report->id]->getIcon() }}"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-3 mb-0 text-sm">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<span class="text-nowrap">{{ $report->description }}</span>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
Reference in New Issue
Block a user