v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@ -4,29 +4,25 @@
@section('message', trans('auth.reset_password'))
@section('content')
<form role="form" method="POST" action="{{ url('auth/forgot') }}">
{{ csrf_field() }}
<form role="form" method="POST" action="{{ url('auth/forgot') }}">
{{ csrf_field() }}
@stack('email_input_start')
@stack('email_input_start')
<div class="form-group has-feedback{{ $errors->has('email') ? ' has-error' : '' }}">
<div class="input-group input-group-merge input-group-alternative">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
</div>
<input class="form-control" placeholder="{{ trans('general.email') }}" name="email" type="email">
</div>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
@stack('email_input_end')
<div class="form-group has-feedback{{ $errors->has('email') ? ' has-error' : '' }}">
<input name="email" type="email" class="form-control" placeholder="{{ trans('auth.enter_email') }}" required>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
@stack('email_input_end')
<div class="row">
<!-- /.col -->
<div class="col-sm-offset-8 col-sm-4">
<button type="submit" class="btn btn-success btn-block btn-flat">{{ trans('general.send') }}</button>
</div>
<!-- /.col -->
</div>
</form>
<button type="submit" class="btn btn-success float-right">{{ trans('general.send') }}</button>
</form>
@endsection

View File

@ -1,76 +1,57 @@
@extends('layouts.auth')
@section('title', trans('auth.login'))
@section('message', trans('auth.login_to'))
@section('content')
<form role="form" method="POST" action="{{ url('auth/login') }}" class="form-loading-button">
{{ csrf_field() }}
<div role="alert" class="alert alert-danger d-none" :class="(form.response.error) ? 'show' : ''" v-if="form.response.error" v-html="form.response.message"></div>
{!! Form::open([
'route' => 'login',
'id' => 'login',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
@stack('email_input_start')
<div class="form-group has-feedback{{ $errors->has('email') ? ' has-error' : '' }}">
<input name="email" type="email" class="form-control" placeholder="{{ trans('general.email') }}" required autofocus>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
@stack('email_input_end')
{{ Form::emailGroup('email', false, 'envelope', ['placeholder' => trans('general.email')], null, 'has-feedback', 'input-group-alternative') }}
@stack('password_input_start')
<div class="form-group has-feedback{{ $errors->has('password') ? ' has-error' : '' }}">
<input name="password" type="password" class="form-control" placeholder="{{ trans('auth.password.current') }}" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
@stack('password_input_end')
{{ Form::passwordGroup('password', false, 'unlock-alt', ['placeholder' => trans('auth.password.current')], 'has-feedback', 'input-group-alternative') }}
<div class="row">
@stack('remember_input_start')
<div class="col-sm-8">
<div class="checkbox icheck">
<label>
<input name="remember" type="checkbox" {{ old('remember') ? 'checked' : '' }}> &nbsp;{{ trans('auth.remember_me') }}
</label>
<div class="row">
@stack('remember_input_start')
<div class="col-8">
<div class="custom-control custom-control-alternative custom-checkbox">
{{ Form::checkbox('remember', 1, null, [
'id' => 'checkbox-remember',
'class' => 'custom-control-input',
'v-model' => 'form.remember'
]) }}
<label class="custom-control-label" for="checkbox-remember">
<span class="text-white">{{ trans('auth.remember_me') }}</span>
</label>
</div>
</div>
@stack('remember_input_end')
<div class="col-4">
{!! Form::button(
'<div class="aka-loader"></div> <span>' . trans('auth.login') . '</span>',
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-success float-right', 'data-loading-text' => trans('general.loading')]) !!}
</div>
</div>
@stack('remember_input_end')
<!-- /.col -->
<div class="col-sm-4">
<button type="submit" class="btn btn-success btn-block btn-flat button-submit" data-loading-text="{{ trans('general.loading') }}">{{ trans('auth.login') }}</button>
</div>
<!-- /.col -->
</div>
</form>
<a href="{{ url('auth/forgot') }}">{{ trans('auth.forgot_password') }}</a><br>
@stack('forgotten-password-start')
<div class="mt-5 mb--4">
<a href="{{ url('auth/forgot') }}" class="text-white"><small>{{ trans('auth.forgot_password') }}</small></a>
</div>
@stack('forgotten-password-end')
{!! Form::close() !!}
@endsection
@push('js')
<!-- iCheck -->
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/icheck.min.js') }}"></script>
@endpush
@push('css')
<!-- iCheck -->
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/square/green.css') }}">
@endpush
@push('scripts')
<script>
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
increaseArea: '20%' // optional
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/auth/login.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,23 +3,37 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.permissions', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'auth/permissions', 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'permissions.store',
'id' => 'permission',
'@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('display_name', trans('general.name'), 'id-card-o') }}
<div class="card-body">
<div class="row">
{{ Form::textGroup('display_name', trans('general.name'), 'tasks') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
<!-- /.box-body -->
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
</div>
<div class="box-footer">
{{ Form::saveButtons('auth/permissions') }}
</div>
<!-- /.box-footer -->
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('auth/permissions') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/permissions.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,31 +3,40 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.permissions', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="card">
{!! Form::model($permission, [
'id' => 'permission',
'method' => 'PATCH',
'url' => ['auth/permissions', $permission->id],
'route' => ['permissions.update', $permission->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button'
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="box-body">
{{ Form::textGroup('display_name', trans('general.name'), 'id-card-o') }}
<div class="card-body">
<div class="row">
{{ Form::textGroup('display_name', trans('general.name'), 'tasks') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
<!-- /.box-body -->
@permission('update-auth-permissions')
<div class="box-footer">
{{ Form::saveButtons('auth/permissions') }}
</div>
<!-- /.box-footer -->
@endpermission
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
</div>
@permission('update-auth-permissions')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('auth/permissions') }}
</div>
</div>
@endpermission
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/permissions.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,67 +3,78 @@
@section('title', trans_choice('general.permissions', 2))
@permission('update-auth-permissions')
@section('new_button')
<span class="new-button"><a href="{{ url('auth/permissions/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@section('new_button')
<span><a href="{{ route('permissions.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@endpermission
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'auth/permissions', '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> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
<div class="card">
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
{!! Form::open([
'url' => 'auth/permissions',
'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>
{{ Form::bulkActionRowGroup('general.permissions', $bulk_actions, 'auth/permissions') }}
{!! 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>
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-permissions">
<thead>
<tr>
<th class="col-md-4">@sortablelink('display_name', trans('general.name'))</th>
<th class="col-md-4">@sortablelink('name', trans('general.code'))</th>
<th class="col-md-4 hidden-xs">@sortablelink('description', trans('general.description'))</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-1 col-lg-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-4 col-lg-4">@sortablelink('display_name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-3 o-y">@sortablelink('name', trans('general.code'))</th>
<th class="col-md-2 col-lg-3 o-y hidden-md">@sortablelink('description', trans('general.description'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($permissions as $item)
<tr>
<td><a href="{{ url('auth/permissions/' . $item->id . '/edit') }}">{{ $item->display_name }}</a></td>
<td>{{ $item->name }}</td>
<td class="hidden-xs">{{ $item->description }}</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="{{ url('auth/permissions/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@permission('delete-auth-permissions')
<li>{!! Form::deleteLink($item, 'auth/permissions') !!}</li>
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
@foreach($permissions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 hidden-sm border-0">{{ Form::bulkActionGroup($item->id, $item->name) }}</td>
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-4 border-0"><a class="text-success col-aka" href="{{ route('permissions.edit', $item->id) }}">{{ $item->display_name }}</a></td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-3 o-y border-0">{{ $item->name }}</td>
<td class="col-md-2 col-lg-3 o-y hidden-md border-0">{{ $item->description }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center border-0">
<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">
<a class="dropdown-item" href="{{ route('permissions.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@permission('delete-auth-permissions')
{!! Form::deleteLink($item, 'auth/permissions') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $permissions, 'type' => 'permissions'])
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $permissions, 'type' => 'permissions'])
</div>
</div>
<!-- /.box -->
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/permissions.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -4,53 +4,51 @@
@section('message', trans('auth.reset_password'))
@section('content')
<form role="form" method="POST" action="{{ url('auth/reset') }}">
{{ csrf_field() }}
<form role="form" method="POST" action="{{ route('reset.store') }}">
{{ csrf_field() }}
<input type="hidden" name="token" value="{{ $token }}">
<input type="hidden" name="token" value="{{ $token }}">
@stack('email_input_start')
<div class="form-group has-feedback{{ $errors->has('email') ? ' has-error' : '' }}">
<input name="email" type="email" class="form-control" placeholder="{{ trans('auth.current_email') }}" value="{{ $email or old('email') }}" required autofocus>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
@stack('email_input_end')
@stack('email_input_start')
<div class="form-group has-feedback{{ $errors->has('email') ? ' has-error' : '' }}">
<input name="email" type="email" class="form-control" required autofocus>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
@stack('email_input_end')
@stack('password_input_start')
<div class="form-group has-feedback{{ $errors->has('password') ? ' has-error' : '' }}">
<input name="password" type="password" class="form-control" placeholder="{{ trans('auth.password.new') }}" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
@stack('password_input_end')
@stack('password_input_start')
<div class="form-group has-feedback{{ $errors->has('password') ? ' has-error' : '' }}">
<input name="password" type="password" class="form-control" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
@stack('password_input_end')
@stack('password_confirmation_input_start')
<div class="form-group has-feedback{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<input name="password_confirmation" type="password" class="form-control" placeholder="{{ trans('auth.password.new_confirm') }}" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</div>
@stack('password_confirmation_input_end')
@stack('password_confirmation_input_start')
<div class="form-group has-feedback{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<input name="password_confirmation" type="password" class="form-control" placeholder="{{ trans('auth.password.new_confirm') }}" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</div>
@stack('password_confirmation_input_end')
<div class="row">
<!-- /.col -->
<div class="col-sm-offset-8 col-sm-4">
<button type="submit" class="btn btn-success btn-block btn-flat">{{ trans('auth.reset') }}</button>
<div class="row">
<div class="col-sm-offset-8 col-sm-4">
<button type="submit" class="btn btn-success btn-block btn-flat">{{ trans('auth.reset') }}</button>
</div>
</div>
<!-- /.col -->
</div>
</form>
</form>
@endsection

View File

@ -3,95 +3,90 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.roles', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'auth/roles', 'role' => 'form', 'class' => 'form-loading-button']) !!}
{!! Form::open([
'id' => 'role',
'route' => 'roles.store',
'@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('display_name', trans('general.name'), 'id-card-o') }}
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::textGroup('display_name', trans('general.name'), 'user-tag') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
</div>
</div>
<div id="role-permissions" class="col-md-12">
<label for="permissions" class="control-label">{{trans_choice('general.permissions', 2)}}</label>
<div id="role-permissions">
<label for="permissions" class="form-control-label">{{trans_choice('general.permissions', 2)}}</label>
<br>
<span class="btn btn-outline-primary btn-sm" @click="permissionSelectAll">{{trans('general.select_all')}}</span>
<span class="btn btn-outline-primary btn-sm" @click="permissionUnselectAll">{{trans('general.unselect_all')}}</span>
<br>
<span class="permission-select-button">{{trans('general.select_all')}}</span> |
<span class="permission-unselect-button">{{trans('general.unselect_all')}}</span>
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
@foreach($names as $name)
<li @php echo ($name == 'read') ? 'class="active"' : ''; @endphp><a href="#tab-{{ $name }}" data-toggle="tab" aria-expanded="false">{{ ucwords($name) }}</a></li>
@endforeach
</ul>
<div class="nav-wrapper">
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
@foreach($names as $name)
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 @php echo ($name == 'read') ? 'active' : ''; @endphp" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tab-{{ $name }}" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">{{ ucwords($name) }}</a>
</li>
@endforeach
</ul>
</div>
<div class="card shadow">
<div class="card-body">
<div class="tab-content">
@foreach($permissions as $code => $code_permissions)
<div class="tab-pane in @php echo ($code == 'read') ? 'active' : ''; @endphp" id="tab-{{ $code }}">
<div class="tab-pane fade show @php echo ($code == 'read') ? 'active' : ''; @endphp" id="tab-{{ $code }}" role="tabpanel">
<div class="permission-button-group">
<span class="permission-select-button">{{trans('general.select_all')}}</span>|
<span class="permission-unselect-button">{{trans('general.unselect_all')}}</span>
<span class="btn btn-primary btn-sm" @click="select('{{ $code }}')">{{trans('general.select_all')}}</span>
<span class="btn btn-primary btn-sm" @click="unselect('{{ $code }}')">{{trans('general.unselect_all')}}</span>
</div>
@stack('permissions_input_start')
<div class="form-group col-md-12 {{ $errors->has('permissions') ? 'has-error' : '' }}">
<label class="input-checkbox"></label>
<br>
@foreach($code_permissions as $item)
<div class="col-md-3">
<label class="input-checkbox">{{ Form::checkbox('permissions' . '[]', $item->id) }} &nbsp;{{ $item->display_name }}</label>
<div class="form-group {{ $errors->has('permissions') ? 'has-error' : '' }}">
<div class="row pt-4">
@foreach($code_permissions as $item)
<div class="col-md-3 role-list">
<div class="custom-control custom-checkbox">
{{ Form::checkbox('permissions', $item->id, null, ['id' => 'permissions-' . $item->id, 'class' => 'custom-control-input', 'v-model' => 'form.permissions']) }}
<label class="custom-control-label" for="permissions-{{ $item->id }}">
{{ $item->display_name }}
</label>
</div>
</div>
@if ($item->name == 'read-admin-panel' || $item->name == 'read-client-portal')
{{ Form::hidden($item->name, $item->id, ['id' => $item->name]) }}
@endif
@endforeach
{!! $errors->first('permissions', '<p class="help-block">:message</p>') !!}
</div>
@endforeach
{!! $errors->first('permissions', '<p class="help-block">:message</p>') !!}
</div>
</div>
@stack('permissions_input_end')
</div>
@endforeach
</div>
</div>
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('auth/roles') }}
</div>
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('auth/roles') }}
</div>
<!-- /.box-footer -->
{!! Form::close() !!}
</div>
{!! Form::close() !!}
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/icheck.min.js') }}"></script>
@push('scripts_start')
<script src="{{ asset('public/js/auth/roles.js?v=' . version('short')) }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/square/green.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$('input[type=checkbox]').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
increaseArea: '20%' // optional
});
$('.permission-select-button').on('click', function (event) {
$(this).parent().parent().find('input[type=checkbox]').iCheck('check');
});
$('.permission-unselect-button').on('click', function (event) {
$(this).parent().parent().find('input[type=checkbox]').iCheck('uncheck');
});
});
</script>
@endpush

View File

@ -3,101 +3,93 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.roles', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::model($role, [
'method' => 'PATCH',
'url' => ['auth/roles', $role->id],
'role' => 'form',
'class' => 'form-loading-button'
]) !!}
{!! Form::model($role, [
'id' => 'role',
'method' => 'PATCH',
'route' => ['roles.update', $role->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('display_name', trans('general.name'), 'id-card-o') }}
<div class="card">
<div class="card-body">
<div class="row">
{{ Form::textGroup('display_name', trans('general.name'), 'user-tag') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textGroup('name', trans('general.code'), 'code') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
</div>
</div>
</div>
<div id="role-permissions" class="col-md-12">
<label for="permissions" class="control-label">{{trans_choice('general.permissions', 2)}}</label>
<div id="role-permissions">
<label for="permissions" class="form-control-label">{{trans_choice('general.permissions', 2)}}</label>
<br>
<span class="btn btn-outline-primary btn-sm" @click="permissionSelectAll">{{trans('general.select_all')}}</span>
<span class="btn btn-outline-primary btn-sm" @click="permissionUnselectAll">{{trans('general.unselect_all')}}</span>
<br>
<div class="nav-wrapper">
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
@foreach($names as $name)
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 @php echo ($name == 'read') ? 'active' : ''; @endphp" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tab-{{ $name }}" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">{{ ucwords($name) }}</a>
</li>
@endforeach
</ul>
</div>
<span class="permission-select-button">{{trans('general.select_all')}}</span> |
<span class="permission-unselect-button">{{trans('general.unselect_all')}}</span>
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
@foreach($names as $name)
<li @php echo ($name == 'read') ? 'class="active"' : ''; @endphp><a href="#tab-{{ $name }}" data-toggle="tab" aria-expanded="false">{{ ucwords($name) }}</a></li>
@endforeach
</ul>
<div class="tab-content">
<div class="card shadow">
<div class="card-body">
<div class="tab-content" id="myTabContent">
@foreach($permissions as $code => $code_permissions)
<div class="tab-pane in @php echo ($code == 'read') ? 'active' : ''; @endphp" id="tab-{{ $code }}">
<div class="tab-pane fade show @php echo ($code == 'read') ? 'active' : ''; @endphp" id="tab-{{ $code }}" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
<div class="permission-button-group">
<span class="permission-select-button">{{trans('general.select_all')}}</span> |
<span class="permission-unselect-button">{{trans('general.unselect_all')}}</span>
<span class="btn btn-primary btn-sm" @click="select('{{ $code }}')">{{trans('general.select_all')}}</span>
<span class="btn btn-primary btn-sm" @click="unselect('{{ $code }}')">{{trans('general.unselect_all')}}</span>
</div>
@stack('permissions_input_start')
<div class="form-group col-md-12 {{ $errors->has('permissions') ? 'has-error' : '' }}">
<label class="input-checkbox"></label>
<br/>
@foreach($code_permissions as $item)
<div class="col-md-3">
<label class="input-checkbox">{{ Form::checkbox('permissions' . '[]', $item->id) }} &nbsp;{{ $item->display_name }}</label>
<div class="form-group {{ $errors->has('permissions') ? 'has-error' : '' }}">
<div class="row pt-4">
@foreach($code_permissions as $item)
<div class="col-md-3 role-list">
<div class="custom-control custom-checkbox">
{{ Form::checkbox('permissions', $item->id, null, ['id' => 'permissions-' . $item->id, 'class' => 'custom-control-input', 'v-model' => 'form.permissions']) }}
<label class="custom-control-label" for="permissions-{{ $item->id }}">
{{ $item->display_name }}
</label>
</div>
</div>
@if ($item->name == 'read-admin-panel' || $item->name == 'read-client-portal')
{{ Form::hidden($item->name, $item->id, ['id' => $item->name]) }}
@endif
@endforeach
{!! $errors->first('permissions', '<p class="help-block">:message</p>') !!}
</div>
@endforeach
{!! $errors->first('permissions', '<p class="help-block">:message</p>') !!}
</div>
</div>
@stack('permissions_input_end')
</div>
@endforeach
</div>
</div>
@permission('update-auth-roles')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('auth/roles') }}
</div>
</div>
@endpermission
</div>
</div>
<!-- /.box-body -->
@permission('update-auth-roles')
<div class="box-footer">
{{ Form::saveButtons('auth/roles') }}
</div>
<!-- /.box-footer -->
@endpermission
{!! Form::close() !!}
</div>
{!! Form::close() !!}
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/icheck.min.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/square/green.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$('input[type=checkbox]').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
increaseArea: '20%' // optional
});
$('.permission-select-button').on('click', function (event) {
$(this).parent().parent().find('input[type=checkbox]').iCheck('check');
});
$('.permission-unselect-button').on('click', function (event) {
$(this).parent().parent().find('input[type=checkbox]').iCheck('uncheck');
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/auth/roles.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,67 +3,78 @@
@section('title', trans_choice('general.roles', 2))
@permission('create-auth-roles')
@section('new_button')
<span class="new-button"><a href="{{ url('auth/roles/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@section('new_button')
<span><a href="{{ route('roles.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@endpermission
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'auth/roles', '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> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
<div class="card">
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
{!! Form::open([
'url' => 'auth/roles',
'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>
{{ Form::bulkActionRowGroup('general.roles', $bulk_actions, 'auth/roles') }}
{!! 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>
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-roles">
<thead>
<tr>
<th class="col-md-4">@sortablelink('display_name', trans('general.name'))</th>
<th class="col-md-3">@sortablelink('name', trans('general.code'))</th>
<th class="col-md-4 hidden-xs">@sortablelink('description', trans('general.description'))</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-3 col-md-2 col-lg-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-4 col-lg-4">@sortablelink('display_name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-3 col-md-4 col-lg-3">@sortablelink('name', trans('general.code'))</th>
<th class="col-lg-3 hidden-lg">@sortablelink('description', trans('general.description'))</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($roles as $item)
<tr>
<td><a href="{{ url('auth/roles/' . $item->id . '/edit') }}">{{ $item->display_name }}</a></td>
<td>{{ $item->name }}</td>
<td class="hidden-xs">{{ $item->description }}</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="{{ url('auth/roles/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@permission('delete-auth-roles')
<li>{!! Form::deleteLink($item, 'auth/roles') !!}</li>
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
@foreach($roles as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-3 col-md-2 col-lg-1 hidden-sm border-0">{{ Form::bulkActionGroup($item->id, $item->name) }}</td>
<td class="col-xs-4 col-sm-3 col-md-4 col-lg-4 border-0"><a class="text-success col-aka" href="{{ route('roles.edit', $item->id) }}">{{ $item->display_name }}</a></td>
<td class="col-xs-4 col-sm-3 col-md-4 col-lg-3 border-0">{{ $item->name }}</td>
<td class="col-lg-3 hidden-lg border-0">{{ $item->description }}</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-1 text-center border-0">
<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">
<a class="dropdown-item" href="{{ route('roles.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@permission('delete-auth-roles')
{!! Form::deleteLink($item, 'auth/roles') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $roles, 'type' => 'roles'])
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $roles, 'type' => 'roles'])
</div>
</div>
<!-- /.box -->
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/roles.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,88 +3,65 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.users', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'auth/users', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'users.store',
'id' => 'user',
'@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'), 'user') }}
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
{{ Form::passwordGroup('password', trans('auth.password.current'), 'key') }}
{{ Form::passwordGroup('password', trans('auth.password.current'), 'key') }}
{{ Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key') }}
{{ Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key') }}
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), setting('general.default_locale')) }}
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), setting('default.locale')) }}
@if (setting('general.use_gravatar', '0') == '1')
@stack('picture_input_start')
<div class="form-group col-md-6">
{!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-picture-o"></i></div>
{!! Form::text('fake_picture', null, ['id' => 'fake_picture', 'class' => 'form-control', 'disabled' => 'disabled', 'placeholder' => trans('settings.appearance.use_gravatar')]) !!}
</div>
@if (setting('default.use_gravatar', '0') == '1')
@stack('picture_input_start')
<div class="form-group col-md-6">
{!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-picture-o"></i></div>
{!! Form::text('fake_picture', null, ['id' => 'fake_picture', 'class' => 'form-control', 'disabled' => 'disabled', 'placeholder' => trans('settings.appearance.use_gravatar')]) !!}
</div>
</div>
@stack('picture_input_end')
@else
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
@endif
@permission('read-common-companies')
{{ Form::checkboxGroup('companies', trans_choice('general.companies', 2), $companies, 'name') }}
@endpermission
@permission('read-auth-roles')
{{ Form::checkboxGroup('roles', trans_choice('general.roles', 2), $roles, 'display_name') }}
@endpermission
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
@stack('picture_input_end')
@else
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
@endif
@permission('read-common-companies')
{{ Form::checkboxGroup('companies', trans_choice('general.companies', 2), $companies, 'company_name') }}
@endpermission
@permission('read-auth-roles')
{{ Form::checkboxGroup('roles', trans_choice('general.roles', 2), $roles, 'display_name') }}
@endpermission
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('auth/users') }}
</div>
</div>
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('auth/users') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/icheck.min.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/square/green.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function(){
$("#locale").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.languages', 1)]) }}"
});
@if (setting('general.use_gravatar', '0') != '1')
$('#picture').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '{{ trans('general.form.no_file_selected') }}'
});
@endif
$('input[type=checkbox]').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
increaseArea: '20%' // optional
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/auth/users.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,121 +3,68 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.users', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="card">
{!! Form::model($user, [
'id' => 'user',
'method' => 'PATCH',
'route' => ['users.update', $user->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'url' => ['auth/users', $user->id],
'role' => 'form',
'class' => 'form-loading-button'
'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'), 'user') }}
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
{{ Form::passwordGroup('password', trans('auth.password.current'), 'key', []) }}
{{ Form::passwordGroup('password', trans('auth.password.current'), 'key', []) }}
{{ Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', []) }}
{{ Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', []) }}
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed()) }}
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), $user->locale) }}
@if (setting('general.use_gravatar', '0') == '1')
@stack('picture_input_start')
<div class="form-group col-md-6">
{!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-picture-o"></i></div>
{!! Form::text('fake_picture', null, ['id' => 'fake_picture', 'class' => 'form-control', 'disabled' => 'disabled', 'placeholder' => trans('settings.appearance.use_gravatar')]) !!}
@if (setting('default.use_gravatar', '0') == '1')
@stack('picture_input_start')
<div class="form-group col-md-6">
{!! Form::label('picture', trans_choice('general.pictures', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-picture-o"></i></div>
{!! Form::text('fake_picture', null, ['id' => 'fake_picture', 'class' => 'form-control', 'disabled' => 'disabled', 'placeholder' => trans('settings.appearance.use_gravatar')]) !!}
</div>
</div>
@stack('picture_input_end')
@else
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
@endif
@permission('read-common-companies')
{{ Form::checkboxGroup('companies', trans_choice('general.companies', 2), $companies, 'name') }}
@endpermission
@permission('read-auth-roles')
{{ Form::checkboxGroup('roles', trans_choice('general.roles', 2), $roles, 'display_name') }}
@endpermission
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
</div>
@stack('picture_input_end')
@else
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
@endif
@permission('read-common-companies')
{{ Form::checkboxGroup('companies', trans_choice('general.companies', 2), $companies, 'company_name') }}
@permission('update-auth-users')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('auth/users') }}
</div>
</div>
@endpermission
@permission('read-auth-roles')
{{ Form::checkboxGroup('roles', trans_choice('general.roles', 2), $roles, 'display_name') }}
@endpermission
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
<!-- /.box-body -->
@permission('update-auth-users')
<div class="box-footer">
{{ Form::saveButtons('auth/users') }}
</div>
<!-- /.box-footer -->
@endpermission
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/icheck.min.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/square/green.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function(){
$("#locale").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.languages', 1)]) }}"
});
@if (setting('general.use_gravatar', '0') != '1')
$('#picture').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
@if($user->picture)
placeholder : '{{ $user->picture->basename }}'
@else
placeholder : '{{ trans('general.form.no_file_selected') }}'
@endif
});
@if($user->picture)
$.ajax({
url: '{{ url('uploads/' . $user->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-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $user->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endpermission
@endif
@endif
$('input[type=checkbox]').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
increaseArea: '20%' // optional
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/auth/users.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,99 +3,105 @@
@section('title', trans_choice('general.users', 2))
@permission('create-auth-users')
@section('new_button')
<span class="new-button"><a href="{{ url('auth/users/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@section('new_button')
<span><a href="{{ route('users.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@endpermission
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'auth/users', '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::select('role', $roles, request('role'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
<div class="card">
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
{!! Form::open([
'url' => 'auth/users',
'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>
{{ Form::bulkActionRowGroup('general.users', $bulk_actions, 'auth/users') }}
{!! 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-users">
<thead>
<tr>
<th class="col-md-3">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-3">@sortablelink('email', trans('general.email'))</th>
<th class="col-md-3 hidden-xs">{{ trans_choice('general.roles', 2) }}</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-1 col-lg-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-sm-2 col-md-2 col-lg-3 hidden-sm o-y">@sortablelink('email', trans('general.email'))</th>
<th class="col-md-2 col-lg-2 hidden-md">{{ trans_choice('general.roles', 2) }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($users as $item)
<tr>
<td>
<a href="{{ url('auth/users/' . $item->id . '/edit') }}">
@if (setting('general.use_gravatar', '0') == '1')
<img src="{{ $item->picture }}" class="users-image" alt="{{ $item->name }}" title="{{ $item->name }}">
@else
@if ($item->picture)
<img src="{{ Storage::url($item->picture->id) }}" class="users-image" alt="{{ $item->name }}" title="{{ $item->name }}">
@endif
@endif
{{ $item->name }}
</a>
</td>
<td>{{ $item->email }}</td>
<td class="hidden-xs" style="vertical-align: middle;">
@foreach($item->roles as $role)
<label class="label label-default">{{ $role->display_name }}</label>
@endforeach
</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="{{ url('auth/users/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>@if ($item->enabled)
<li><a href="{{ route('users.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
@foreach($users as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 hidden-sm border-0">{{ Form::bulkActionGroup($item->id, $item->name) }}</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-3 border-0">
<a class="text-success col-aka" href="{{ route('users.edit', $item->id) }}">
@if (setting('default.use_gravatar', '0') == '1')
<img src="{{ $item->picture }}" alt="{{ $item->name }}" title="{{ $item->name }}">
@else
<li><a href="{{ route('users.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
@if ($item->picture)
<img src="{{ Storage::url($item->picture->id) }}" alt="{{ $item->name }}" title="{{ $item->name }}">
@endif
@endif
@permission('delete-auth-users')
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'auth/users') !!}</li>
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
{{ $item->name }}
</a>
</td>
<td class="col-sm-2 hidden-sm col-md-2 col-lg-3 o-y border-0">{{ $item->email }}</td>
<td class="col-md-2 col-lg-2 hidden-md border-0">
@foreach($item->roles as $role)
<label class="label label-default">{{ $role->display_name }}</label>
@endforeach
</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 border-0">
@if (user()->can('update-auth-users'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
@else
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center border-0">
<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">
<a class="dropdown-item" href="{{ route('users.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@permission('delete-auth-users')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'auth/users') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $users, 'type' => 'users'])
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $users, 'type' => 'users'])
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/auth/users.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,97 +3,49 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.accounts', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'banking/accounts', 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'accounts.store',
'id' => 'account',
'@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'), 'font') }}
{{ Form::textGroup('number', trans('accounts.number'), 'pencil') }}
{{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
{{ Form::textGroup('opening_balance', trans('accounts.opening_balance'), 'money', ['required' => 'required'], 0) }}
{{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency], 0) }}
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
{{ Form::radioGroup('default_account', trans('accounts.default_account')) }}
{{ Form::radioGroup('default_account', trans('accounts.default_account')) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('banking/accounts') }}
</div>
<!-- /.box-footer -->
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
</div>
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('banking/accounts') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function(){
$("#opening_balance").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
});
$("#opening_balance").focusout();
$('#enabled_1').trigger('click');
$('#name').focus();
$("#currency_code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
});
$(document).on('change', '#currency_code', function (e) {
$.ajax({
url: '{{ url("settings/currencies/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'code=' + $(this).val(),
success: function(data) {
$('#currency').val(data.code);
$('#currency_code').val(data.code);
$('#currency_rate').val(data.rate);
opening_balance = $('#opening_balance').maskMoney('unmasked')[0];
$("#opening_balance").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#opening_balance').val(opening_balance);
$('#opening_balance').trigger('focusout');
}
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,100 +3,52 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.accounts', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="card">
{!! Form::model($account, [
'id' => 'account',
'method' => 'PATCH',
'url' => ['banking/accounts', $account->id],
'route' => ['accounts.update', $account->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button'
'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'), 'font') }}
{{ Form::textGroup('number', trans('accounts.number'), 'pencil') }}
{{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $account->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
{{ Form::textGroup('opening_balance', trans('accounts.opening_balance'), 'money') }}
{{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency], $account->opening_balance) }}
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
{{ Form::textGroup('bank_name', trans('accounts.bank_name'), 'university', []) }}
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
{{ Form::textGroup('bank_phone', trans('accounts.bank_phone'), 'phone', []) }}
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
{{ Form::textareaGroup('bank_address', trans('accounts.bank_address')) }}
{{ Form::radioGroup('default_account', trans('accounts.default_account')) }}
{{ Form::radioGroup('default_account', trans('accounts.default_account')) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
<!-- /.box-body -->
@permission('update-banking-accounts')
<div class="box-footer">
{{ Form::saveButtons('banking/accounts') }}
</div>
<!-- /.box-footer -->
@endpermission
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
</div>
@permission('update-banking-accounts')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('banking/accounts') }}
</div>
</div>
@endpermission
{!! Form::close() !!}
</div>
@endsection
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function(){
$("#opening_balance").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
});
$("#opening_balance").focusout();
$("#currency_code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
});
$(document).on('change', '#currency_code', function (e) {
$.ajax({
url: '{{ url("settings/currencies/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'code=' + $(this).val(),
success: function(data) {
$('#currency').val(data.code);
$('#currency_code').val(data.code);
$('#currency_rate').val(data.rate);
opening_balance = $('#opening_balance').maskMoney('unmasked')[0];
$("#opening_balance").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#opening_balance').val(opening_balance);
$('#opening_balance').trigger('focusout');
}
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -2,91 +2,93 @@
@section('title', trans_choice('general.accounts', 2))
@permission('create-banking-accounts')
@section('new_button')
<span class="new-button"><a href="{{ url('banking/accounts/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@permission('create-banking-accounts')
<span><a href="{{ route('accounts.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endpermission
@endsection
@endpermission
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'banking/accounts', '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> &nbsp;' . 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([
'url' => 'banking/accounts',
'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-accounts">
<thead>
<tr>
<th class="col-md-4">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-3 hidden-xs">@sortablelink('number', trans('accounts.number'))</th>
<th class="col-md-3 text-right amount-space">@sortablelink('opening_balance', trans('accounts.current_balance'))</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.accounts', $bulk_actions, 'banking/accounts') }}
{!! 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-3 col-lg-3 col-xl-4">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-2 col-lg-2 col-xl-2 text-center hidden-md">@sortablelink('number', trans('accounts.number'))</th>
<th class="col-sm-2 col-md-2 col-lg-3 col-xl-3 text-right hidden-sm">@sortablelink('opening_balance', trans('accounts.current_balance'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-1">@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($accounts as $item)
<tr>
@if ($auth_user->can('read-reports-income-expense-summary'))
<td><a href="{{ url('reports/income-expense-summary?accounts[]=' . $item->id) }}">{{ $item->name }}</a></td>
@else
<td><a href="{{ route('accounts.edit', $item->id) }}">{{ $item->name }}</a></td>
@endif
<td class="hidden-xs">{{ $item->number }}</td>
<td class="text-right amount-space">@money($item->balance, $item->currency_code, 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('accounts.edit', $item->id) }}">{{ trans('general.edit') }}</a></li>
@foreach($accounts 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-3 col-lg-3 col-xl-4"><a class="col-aka text-success" href="{{ route('accounts.edit', $item->id) }}">{{ $item->name }}</a></td>
<td class="col-md-2 col-lg-2 col-xl-2 text-center hidden-md">{{ $item->number }}</td>
<td class="col-sm-2 col-md-2 col-lg-3 col-xl-3 text-right hidden-sm">@money($item->balance, $item->currency_code, true)</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-1">
@if (user()->can('update-banking-accounts'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<li><a href="{{ route('accounts.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
@else
<li><a href="{{ route('accounts.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
@endif
@permission('delete-banking-accounts')
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'banking/accounts') !!}</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 border-0">
<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">
<a class="dropdown-item" href="{{ route('accounts.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@permission('delete-banking-accounts')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'banking/accounts') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $accounts, 'type' => 'accounts'])
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $accounts, 'type' => 'accounts'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/banking/accounts.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,227 +3,133 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.reconciliations', 1)]))
@section('content')
<div class="row">
{!! Form::open(['url' => 'banking/reconciliations/create', 'role' => 'form', 'method' => 'GET']) !!}
<div class="card">
{!! Form::open([
'url' => 'banking/reconciliations/create',
'id' => 'reconciliation',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button mb-0',
'novalidate' => true
]) !!}
<div class="col-md-12">
<div class="box box-success">
<div class="box-body">
{{ Form::textGroup('started_at', trans('reconciliations.start_date'), 'calendar',['id' => 'started_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], request('started_at'), 'col-md-3') }}
<div class="card-body">
<div class="form-row align-items-center">
{{ Form::dateGroup('started_at', trans('reconciliations.start_date'), 'calendar',['id' => 'started_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], request('started_at'), 'col-xl-3') }}
{{ Form::textGroup('ended_at', trans('reconciliations.end_date'), 'calendar',['id' => 'ended_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], request('started_at'), 'col-md-3') }}
{{ Form::dateGroup('ended_at', trans('reconciliations.end_date'), 'calendar',['id' => 'ended_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], request('started_at'), 'col-xl-3') }}
{{ Form::textGroup('closing_balance', trans('reconciliations.closing_balance'), 'money', ['required' => 'required', 'autofocus' => 'autofocus'], '0', 'col-md-2') }}
{{ Form::moneyGroup('closing_balance', trans('reconciliations.closing_balance'), 'balance-scale', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], '0', 'col-xl-2') }}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, request('account_id', setting('general.default_account')), ['required' => 'required'], 'col-md-2') }}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, request('account_id', setting('default.account')), ['required' => 'required'], 'col-xl-2') }}
<div class="form-group col-md-2">
<div class="input-group" style="margin-top: 25px;">
{!! Form::button('<span class="fa fa-list"></span> &nbsp;' . trans('reconciliations.list_transactions'), ['type' => 'submit', 'class' => 'btn btn-success']) !!}
<div class="col-xl-2">
<div class="input-group mt-1">
{!! Form::button('<span class="fa fa-list"></span> &nbsp;' . trans('reconciliations.transactions'), ['type' => 'submit', 'class' => 'btn btn-success header-button-top']) !!}
</div>
</div>
</div>
<!-- /.box-body -->
</div>
</div>
{!! Form::close() !!}
</div>
<div class="col-md-12">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans_choice('general.transactions', 2) }}</h3>
</div>
<div class="box-body">
{!! Form::open(['url' => 'banking/reconciliations', 'role' => 'form', 'class' => 'form-loading-button', 'id' => 'form-reconciliations']) !!}
<div class="card">
<div class="card-header border-0">
<h3 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h3>
</div>
{{ Form::hidden('account_id', $account->id) }}
{{ Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) }}
{{ Form::hidden('opening_balance', $opening_balance, ['id' => 'opening_balance']) }}
{{ Form::hidden('closing_balance', request('closing_balance', '0'), ['id' => 'closing_balance']) }}
{{ Form::hidden('started_at', request('started_at')) }}
{{ Form::hidden('ended_at', request('ended_at')) }}
{{ Form::hidden('reconcile', '0', ['id' => 'hidden-reconcile']) }}
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th class="col-md-2">{{ trans('general.date') }}</th>
<th class="col-md-3">{{ trans('general.description') }}</th>
<th class="col-md-2">{{ trans_choice('general.contacts', 1) }}</th>
<th class="col-md-2 text-right">{{ trans('reconciliations.deposit') }}</th>
<th class="col-md-2 text-right">{{ trans('reconciliations.withdrawal') }}</th>
<th class="col-md-1 text-right">{{ trans('general.clear') }}</th>
{!! Form::open([
'url' => 'banking/reconciliations',
'role' => 'form',
'class' => 'form-loading-button',
'id' => 'form-reconciliations',
'class' => 'mb-0'
]) !!}
{{ Form::hidden('account_id', $account->id) }}
{{ Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) }}
{{ Form::hidden('opening_balance', $opening_balance, ['id' => 'opening_balance']) }}
{{ Form::hidden('closing_balance', request('closing_balance', '0'), ['id' => 'closing_balance']) }}
{{ Form::hidden('started_at', request('started_at')) }}
{{ Form::hidden('ended_at', request('ended_at')) }}
{{ Form::hidden('reconcile', '0', ['id' => 'hidden-reconcile']) }}
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-3 col-md-2 o-y">{{ trans('general.date') }}</th>
<th class="col-md-2 text-center hidden-md">{{ trans('general.description') }}</th>
<th class="col-md-2 col-sm-3 col-md-3 hidden-sm">{{ trans_choice('general.contacts', 1) }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 text-right">{{ trans('reconciliations.deposit') }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 text-right o-y">{{ trans('reconciliations.withdrawal') }}</th>
<th class="col-md-1 text-right hidden-md">{{ trans('general.clear') }}</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-xs-4 col-sm-3 col-md-2 o-y">@date($item->paid_at)</td>
<td class="col-md-2 text-center hidden-md">{{ $item->description }}</td>
<td class="col-sm-3 col-md-3 hidden-sm">{{ $item->contact->name }}</td>
@if ($item->type == 'income')
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-xs-4 col-sm-3 col-md-2 text-right">N/A</td>
@else
<td class="col-xs-4 col-sm-3 col-md-2 text-right">N/A</td>
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
@endif
<td class="col-md-1 text-right hidden-md">{{ Form::checkbox('transactions['. $item->id . '_'. $item->type . ']', $item->amount, $item->reconciled) }}</td>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr>
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td>{{ $item->description }}</td>
<td>@if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif</td>
@if (($item->model == 'App\Models\Income\InvoicePayment') || ($item->model == 'App\Models\Income\Revenue'))
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
<td>&nbsp;</td>
@else
<td>&nbsp;</td>
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
@endif
<td class="text-right">{{ Form::checkbox('transactions['. $item->id . '_'. $item->model . ']', $item->amount, $item->reconciled) }}</td>
</tr>
@endforeach
</tbody>
</table>
@endforeach
</tbody>
</table>
@if ($transactions->count())
<table class="table">
<tbody>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('reconciliations.closing_balance') }}:</th>
<td id="closing-balance" class="col-md-3 col-lg-1 text-right hidden-md">@money(request('closing_balance', '0'), $account->currency_code, true)</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('reconciliations.cleared_amount') }}:</th>
<td id="cleared-amount" class="col-md-3 col-lg-1 text-right hidden-md">@money('0', $account->currency_code, true)</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('general.difference') }}:</th>
<td id="difference" class="col-md-3 col-lg-1 text-right hidden-md">@money('0', $account->currency_code, true)</td>
</tr>
</tbody>
</table>
@endif
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12">
@if ($transactions->count())
<table class="table">
<tbody>
<tr>
<th class="text-right">{{ trans('reconciliations.closing_balance') }}:</th>
<td id="closing-balance" class="col-md-1 text-right">@money(request('closing_balance', '0'), $account->currency_code, true)</td>
</tr>
<tr>
<th class="text-right">{{ trans('reconciliations.cleared_amount') }}:</th>
<td id="cleared-amount" class="col-md-1 text-right">@money('0', $account->currency_code, true)</td>
</tr>
<tr>
<th class="text-right">{{ trans('general.difference') }}:</th>
<td id="difference" class="col-md-1 text-right">@money('0', $account->currency_code, true)</td>
</tr>
</tbody>
</table>
<div class="float-right">
<a href="{{ route('reconciliations.index') }}" class="btn btn-outline-secondary header-button-top"><span class="fa fa-times"></span> &nbsp;{{ trans('general.cancel') }}</a>
{!! Form::button('<span class="fa fa-check"></span> &nbsp;' . trans('reconciliations.reconcile'), ['type' => 'button', 'id' => 'button-reconcile', 'class' => 'btn btn-info button-submit header-button-top', 'data-loading-text' => trans('general.loading'), 'disabled' => 'disabled']) !!}
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-success button-submit header-button-top', 'data-loading-text' => trans('general.loading')]) !!}
</div>
@else
<div class="text-sm text-muted" id="datatable-basic_info" role="status" aria-live="polite">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div>
<div class="box-footer">
@if ($transactions->count())
<div class="form-group no-margin">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-default button-submit', 'data-loading-text' => trans('general.loading')]) !!}
{!! Form::button('<span class="fa fa-check"></span> &nbsp;' . trans('reconciliations.reconcile'), ['type' => 'button', 'id' => 'button-reconcile', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading'), 'disabled' => 'disabled']) !!}
<a href="{{ route('reconciliations.index') }}" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</a>
</div>
@else
{{ trans('general.no_records') }}
@endif
</div>
{!! Form::close() !!}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#closing_balance").maskMoney({
thousands : '{{ $currency->thousands_separator }}',
decimal : '{{ $currency->decimal_mark }}',
precision : {{ $currency->precision }},
allowZero : true,
allowNegative: true,
@if($currency->symbol_first)
prefix : '{{ $currency->symbol }}'
@else
suffix : '{{ $currency->symbol }}'
@endif
});
$("#account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
//Date picker
$('#started_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$('#ended_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
});
$(document).on('change', '#account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('#currency_code').val(data.currency_code);
amount = $('#closing_balance').maskMoney('unmasked')[0];
$("#closing_balance").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#closing_balance').val(amount);
$('#closing_balance').trigger('focus');
}
});
});
$(document).ready(function(){
$('#tbl-transactions input[type="checkbox"]').trigger('change');
});
$(document).on('change', '#tbl-transactions input[type="checkbox"]', function (e) {
amount = $('#closing_balance').maskMoney('unmasked')[0];
$('#form-reconciliations #closing_balance').val(amount);
$.ajax({
url: '{{ url("banking/reconciliations/calculate") }}',
type: 'POST',
dataType: 'JSON',
data: $('#form-reconciliations').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {
if (data.difference_raw != 0) {
$('#button-reconcile').attr('disabled','disabled');
$('#difference').css('background-color', '#f2dede');
} else {
$('#button-reconcile').removeAttr('disabled');
$('#difference').css('background-color', '#d0e9c6');
}
$('#closing-balance').html(data.closing_balance);
$('#cleared-amount').html(data.cleared_amount);
$('#difference').html(data.difference);
}
}
});
});
$(document).on('click', '#button-reconcile', function (e) {
$('#hidden-reconcile').val(1);
$('#form-reconciliations').submit();
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,18 +3,18 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.reconciliations', 1)]))
@section('content')
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans_choice('general.transactions', 2) }}</h3>
</div>
<div class="box-body">
{!! Form::model($reconciliation, [
'method' => 'PATCH',
'url' => ['banking/reconciliations', $reconciliation->id],
'role' => 'form',
'id' => 'form-reconciliations',
'class' => 'form-loading-button'
]) !!}
<div class="card">
{!! Form::model($reconciliation, [
'method' => 'PATCH',
'url' => ['banking/reconciliations', $reconciliation->id],
'role' => 'form',
'id' => 'form-reconciliations',
'class' => 'form-loading-button mb-0'
]) !!}
<div class="card-header border-0">
<h3 class="box-title">{{ trans_choice('general.transactions', 2) }}</h3>
</div>
{{ Form::hidden('account_id', $account->id) }}
{{ Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) }}
@ -23,106 +23,73 @@
{{ Form::hidden('started_at', $reconciliation->started_at) }}
{{ Form::hidden('ended_at', $reconciliation->ended_at) }}
{{ Form::hidden('reconcile', $reconciliation->reconcile, ['id' => 'hidden-reconcile']) }}
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th class="col-md-2">{{ trans('general.date') }}</th>
<th class="col-md-3">{{ trans('general.description') }}</th>
<th class="col-md-2">{{ trans_choice('general.contacts', 1) }}</th>
<th class="col-md-2 text-right">{{ trans('reconciliations.deposit') }}</th>
<th class="col-md-2 text-right">{{ trans('reconciliations.withdrawal') }}</th>
<th class="col-md-1 text-right">{{ trans('general.clear') }}</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr>
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td>{{ $item->description }}</td>
<td>@if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif</td>
@if (($item->model == 'App\Models\Income\InvoicePayment') || ($item->model == 'App\Models\Income\Revenue'))
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
<td>&nbsp;</td>
@else
<td>&nbsp;</td>
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
@endif
<td class="text-right">{{ Form::checkbox('transactions['. $item->id . '_'. $item->model . ']', $item->amount, $item->reconciled) }}</td>
<div class="table-responsive">
<table class="table align-items-center table-flush">
<thead class="thead-light">
<tr class="row">
<th class="col-xs-4 col-sm-3 col-md-2 o-y">{{ trans('general.date') }}</th>
<th class="col-md-2 text-center hidden-md">{{ trans('general.description') }}</th>
<th class="col-md-2 col-sm-3 col-md-3 hidden-sm">{{ trans_choice('general.contacts', 1) }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 text-right">{{ trans('reconciliations.deposit') }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 text-right o-y">{{ trans('reconciliations.withdrawal') }}</th>
<th class="col-md-1 text-right hidden-md">{{ trans('general.clear') }}</th>
</tr>
@endforeach
</thead>
<tbody>
@foreach($transactions as $item)
<tr class="row">
<td class="col-xs-4 col-sm-3 col-md-2 o-y">@date($item->paid_at)</td>
<td class="col-md-2 text-center hidden-md">{{ $item->description }}</td>
<td class="col-sm-3 col-md-3 hidden-sm">{{ $item->contact->name }}</td>
@if ($item->type == 'income')
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-xs-4 col-sm-3 col-md-2 text-right"> </td>
@else
<td class="col-xs-4 col-sm-3 col-md-2 text-right">&nbsp;</td>
<td class="col-xs-4 col-sm-3 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
@endif
<td class="col-md-1 text-right hidden-md">{{ Form::checkbox('transactions['. $item->id . '_'. $item->type . ']', $item->amount, $item->reconciled) }}</td>
</tr>
@endforeach
</tbody>
</table>
@if ($transactions->count())
<table class="table">
<tbody>
<tr>
<th class="text-right">{{ trans('reconciliations.closing_balance') }}:</th>
<td id="closing-balance" class="col-md-1 text-right">@money($reconciliation->closing_balance, $account->currency_code, true)</td>
</tr>
<tr>
<th class="text-right">{{ trans('reconciliations.cleared_amount') }}:</th>
<td id="cleared-amount" class="col-md-1 text-right">@money('0', $account->currency_code, true)</td>
</tr>
<tr>
<th class="text-right">{{ trans('general.difference') }}:</th>
<td id="difference" class="col-md-1 text-right">@money('0', $account->currency_code, true)</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('reconciliations.closing_balance') }}:</th>
<td id="closing-balance" class="col-md-1 text-right">@money($reconciliation->closing_balance, $account->currency_code, true)</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('reconciliations.cleared_amount') }}:</th>
<td id="cleared-amount" class="col-md-3 col-lg-1 text-right hidden-md">@money('0', $account->currency_code, true)</td>
</tr>
<tr class="row">
<th class="col-md-9 col-lg-11 text-right hidden-md">{{ trans('general.difference') }}:</th>
<td id="difference" class="col-md-3 col-lg-1 text-right hidden-md">@money('0', $account->currency_code, true)</td>
</tr>
</tbody>
</table>
@endif
</div>
</div>
<div class="box-footer">
@if ($transactions->count())
<div class="form-group no-margin">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-default button-submit', 'data-loading-text' => trans('general.loading')]) !!}
{!! Form::button('<span class="fa fa-check"></span> &nbsp;' . trans('reconciliations.reconcile'), ['type' => 'button', 'id' => 'button-reconcile', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading'), 'disabled' => 'disabled']) !!}
<a href="{{ route('reconciliations.index') }}" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</a>
<div class="card-footer">
<div class="row float-right">
@if ($transactions->count())
<a href="{{ route('reconciliations.index') }}" class="btn btn-outline-secondary header-button-top"><span class="fa fa-times"></span> &nbsp;{{ trans('general.cancel') }}</a>
{!! Form::button('<span class="fa fa-check"></span> &nbsp;' . trans('reconciliations.reconcile'), ['type' => 'button', 'id' => 'button-reconcile', 'class' => 'btn btn-info button-submit header-button-top', 'data-loading-text' => trans('general.loading'), 'disabled' => 'disabled']) !!}
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-success button-submit header-button-top', 'data-loading-text' => trans('general.loading')]) !!}
@else
<small>{{ trans('general.no_records') }}</small>
@endif
</div>
@else
{{ trans('general.no_records') }}
@endif
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$('#tbl-transactions input[type="checkbox"]').trigger('change');
});
$(document).on('change', '#tbl-transactions input[type="checkbox"]', function (e) {
$.ajax({
url: '{{ url("banking/reconciliations/calculate") }}',
type: 'POST',
dataType: 'JSON',
data: $('#form-reconciliations').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {
if (data.difference_raw != 0) {
$('#button-reconcile').attr('disabled','disabled');
$('#difference').css('background-color', '#f2dede');
} else {
$('#button-reconcile').removeAttr('disabled');
$('#difference').css('background-color', '#d0e9c6');
}
$('#closing-balance').html(data.closing_balance);
$('#cleared-amount').html(data.cleared_amount);
$('#difference').html(data.difference);
}
}
});
});
$(document).on('click', '#button-reconcile', function (e) {
$('#hidden-reconcile').val(1);
$('#form-reconciliations').submit();
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -2,93 +2,93 @@
@section('title', trans_choice('general.reconciliations', 2))
@permission('create-banking-reconciliations')
@section('new_button')
<span class="new-button"><a href="{{ route('reconciliations.create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@permission('create-banking-reconciliations')
<span><a href="{{ route('reconciliations.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endpermission
@endsection
@endpermission
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'banking/reconciliations', 'role' => 'form', 'method' => 'GET']) !!}
<div id="items" class="pull-left box-filter">
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . 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([
'url' => 'banking/reconciliations',
'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-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-reconciliations">
<thead>
<tr>
<th class="col-md-2">@sortablelink('created_at', trans('general.created_date'))</th>
<th class="col-md-3">@sortablelink('account_id', trans_choice('general.accounts', 1))</th>
<th class="col-md-3 hidden-xs">{{ trans('general.period') }}</th>
<th class="col-md-2 text-right amount-space">@sortablelink('closing_balance', trans('reconciliations.closing_balance'))</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.reconciliations', $bulk_actions, 'banking/reconciliations') }}
{!! 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 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-sm-3 col-md-2 col-lg-2 hidden-sm">@sortablelink('created_at', trans('general.created_date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-3 col-md-3 col-lg-3">@sortablelink('account_id', trans_choice('general.accounts', 1))</th>
<th class="col-lg-2 hidden-lg">{{ trans('general.period') }}</th>
<th class="col-md-2 col-lg-2 hidden-md text-right">@sortablelink('closing_balance', trans('reconciliations.closing_balance'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($reconciliations as $item)
<tr>
<td><a href="{{ route('reconciliations.edit', $item->id) }}">{{ Date::parse($item->created_at)->format($date_format) }}</a></td>
<td>{{ $item->account->name }}</td>
<td class="hidden-xs">{{ Date::parse($item->started_at)->format($date_format) }} - {{ Date::parse($item->ended_at)->format($date_format) }}</td>
<td class="text-right amount-space">@money($item->closing_balance, $item->account->currency_code, true)</td>
<td class="hidden-xs">
@if ($item->reconciled)
<span class="label label-success">{{ trans('reconciliations.reconciled') }}</span>
@else
<span class="label label-danger">{{ trans('reconciliations.unreconciled') }}</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('reconciliations.edit', $item->id) }}">{{ trans('general.edit') }}</a></li>
@permission('delete-banking-reconciliations')
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'banking/reconciliations') !!}</li>
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
@foreach($reconciliations as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 hidden-sm">{{ Form::bulkActionGroup($item->id, $item->account->name) }}</td>
<td class="col-sm-3 col-md-2 col-lg-2 hidden-sm"><a class="col-aka text-success" href="{{ route('reconciliations.edit', $item->id) }}">@date($item->created_at)</a></td>
<td class="col-xs-4 col-sm-3 col-md-3 col-lg-3">{{ $item->account->name }}</td>
<td class="col-lg-2 hidden-lg border-0">@date($item->started_at) - @date($item->ended_at)</td>
<td class="col-md-2 col-lg-2 hidden-md text-right">@money($item->closing_balance, $item->account->currency_code, true)</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1">
@if (user()->can('update-banking-reconciliations'))
{{ Form::enabledGroup($item->id, $item->account->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
@else
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-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">
<a class="dropdown-item" href="{{ route('reconciliations.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@permission('delete-banking-reconciliations')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'banking/reconciliations') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $reconciliations, 'type' => 'reconciliations'])
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $reconciliations, 'type' => 'reconciliations'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-accounts").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/banking/reconciliations.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -2,88 +2,65 @@
@section('title', trans_choice('general.transactions', 2))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'banking/transactions', 'role' => 'form', 'method' => 'GET']) !!}
<div id="items" class="pull-left box-filter">
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('type', $types, request('type'), ['class' => 'form-control input-filter input-sm']) !!}
{!! 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> &nbsp;' . 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 -->
@section('new_button')
<span><a href="{{ route('import.create', ['banking', 'transactions']) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload "></span> &nbsp;{{ trans('import.import') }}</a></span>
<span><a href="{{ route('transactions.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> &nbsp;{{ trans('general.export') }}</a></span>
@endsection
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th class="col-md-2">@sortablelink('paid_at', trans('general.date'))</th>
<th class="col-md-2">@sortablelink('account_name', trans('accounts.account_name'))</th>
<th class="col-md-2">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-md-2">@sortablelink('category_name', trans_choice('general.categories', 1))</th>
<th class="col-md-2">@sortablelink('description', trans('general.description'))</th>
<th class="col-md-2 text-right amount-space">@sortablelink('amount', trans('general.amount'))</th>
@section('content')
<div class="card">
<div class="card-header border-bottom-0">
{!! Form::open([
'url' => 'banking/transactions',
'role' => 'form',
'method' => 'GET',
'class' => 'mb-0'
]) !!}
<div class="row">
<div class="col-12 card-header-search">
<span class="table-text hidden-lg">{{ trans('general.search') }}:</span>
<akaunting-search></akaunting-search>
</div>
</div>
{!! Form::close() !!}
</div>
<div class="table-responsive">
<table class="table table-flush">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 hidden-sm">@sortablelink('paid_at', trans('general.date'))</th>
<th class="col-xs-4 col-sm-3 col-md-2">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-3 col-md-2">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-sm-2 col-md-2 hidden-sm">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-md-2 hidden-md">@sortablelink('description', trans('general.description'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr>
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td>{{ $item->account_name }}</td>
<td>{{ $item->type }}</td>
<td>{{ $item->category_name }}</td>
<td>{{ $item->description }}</td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
</tr>
@endforeach
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 hidden-sm">@date($item->paid_at)</td>
<td class="col-xs-4 col-sm-3 col-md-2">{{ $item->account->name }}</td>
<td class="col-xs-4 col-sm-3 col-md-2">{{ trans_choice('general.' . Str::plural($item->type), 1) }}</td>
<td class="col-sm-2 col-md-2 hidden-sm">{{ $item->category->name }}</td>
<td class="col-md-2 hidden-md">{{ $item->description }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-accounts").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#filter-categories").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/banking/transactions.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,117 +3,48 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.transfers', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'banking/transfers', 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'transfers.store',
'id' => 'transfer',
'@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::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts) }}
<div class="card-body">
<div class="row">
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts, null, ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts) }}
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts) }}
{{ Form::textGroup('amount', trans('general.amount'), 'money') }}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency], 0) }}
{{ Form::textGroup('transferred_at', trans('general.date'), 'calendar',['id' => 'transferred_at', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{{ Form::dateGroup('transferred_at', trans('general.date'), 'calendar', ['id' => 'transferred_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('general.default_payment_method')) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{!! Form::hidden('currency_code', null, ['id' => 'currency_code']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('banking/transfers') }}
</div>
<!-- /.box-footer -->
{!! Form::hidden('currency_code', null, ['id' => 'currency_code', 'v-model' => 'form.currency_code']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate', 'v-model' => 'form.currency_rate']) !!}
</div>
</div>
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('banking/transfers') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#amount").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
});
$("#amount").focusout();
//Date picker
$('#transferred_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$("#from_account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#to_account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#payment_method").select2({
placeholder: "{{ trans_choice('general.payment_methods', 1) }}"
});
});
$(document).on('change', '#from_account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('#currency').val(data.currency_code);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
amount = $('#amount').maskMoney('unmasked')[0];
$("#amount").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#amount').val(amount);
$('#amount').trigger('focus');
}
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,124 +3,51 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.transfers', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="card">
{!! Form::model($transfer, [
'id' => 'transfer',
'method' => 'PATCH',
'url' => ['banking/transfers', $transfer->id],
'route' => ['transfers.update', $transfer->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button'
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="box-body">
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts) }}
<div class="card-body">
<div class="row">
{{ Form::selectGroup('from_account_id', trans('transfers.from_account'), 'university', $accounts, $transfer->from_account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts) }}
{{ Form::selectGroup('to_account_id', trans('transfers.to_account'), 'university', $accounts, $transfer->to_account_id) }}
{{ Form::textGroup('amount', trans('general.amount'), 'money') }}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency], $transfer->amount) }}
{{ Form::textGroup('transferred_at', trans('general.date'), 'calendar',['id' => 'transferred_at', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => 'yyyy-mm-dd', 'autocomplete' => 'off']) }}
{{ Form::dateGroup('transferred_at', trans('general.date'), 'calendar', ['id' => 'transferred_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($transfer->transferred_at)->toDateString()) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, null) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $transfer->payment_method) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{!! Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) !!}
{!! Form::hidden('currency_rate', $currency->rate, ['id' => 'currency_rate']) !!}
</div>
<!-- /.box-body -->
@permission('update-banking-transfers')
<div class="box-footer">
{{ Form::saveButtons('banking/transfers') }}
</div>
<!-- /.box-footer -->
@endpermission
{!! Form::hidden('currency_code', $currency->code, ['id' => 'currency_code', 'v-model' => 'form.currency_code']) !!}
{!! Form::hidden('currency_rate', $currency->rate, ['id' => 'currency_rate', 'v-model' => 'form.currency_rate']) !!}
</div>
</div>
@permission('update-banking-transfers')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('banking/transfers') }}
</div>
</div>
@endpermission
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#amount").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
});
$("#amount").focusout();
//Date picker
$('#transferred_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$("#from_account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#to_account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#payment_method").select2({
placeholder: "{{ trans_choice('general.payment_methods', 1) }}"
});
});
$(document).on('change', '#from_account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('#currency').val(data.currency_code);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
amount = $('#amount').maskMoney('unmasked')[0];
$("#amount").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#amount').val(amount);
$('#amount').trigger('focus');
}
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,89 +3,80 @@
@section('title', trans_choice('general.transfers', 2))
@permission('create-banking-transfers')
@section('new_button')
<span class="new-button"><a href="{{ url('banking/transfers/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@section('new_button')
<span><a href="{{ route('transfers.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@endpermission
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'banking/transfers', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-left">
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
{!! Form::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::select('from_account', $accounts, request('from_account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('to_account', $accounts, request('to_account'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . 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' => 'transfers.index',
'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-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-transfers">
<thead>
<tr>
<th class="col-md-2">@sortablelink('payment.paid_at', trans('general.date'))</th>
<th class="col-md-3">@sortablelink('payment.name', trans('transfers.from_account'))</th>
<th class="col-md-3">@sortablelink('revenue.name', trans('transfers.to_account'))</th>
<th class="col-md-3 text-right amount-space">@sortablelink('payment.amount', trans('general.amount'))</th>
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($transfers as $item)
<tr>
<td><a href="{{ url('banking/transfers/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
<td>{{ $item->from_account }}</td>
<td>{{ $item->to_account }}</td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</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="{{ url('banking/transfers/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@permission('delete-banking-transfers')
<li>{!! Form::deleteLink($item, 'banking/transfers') !!}</li>
@endpermission
</ul>
</div>
</td>
{{ Form::bulkActionRowGroup('general.transfers', $bulk_actions, 'banking/transfers') }}
{!! 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 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-md-2 hidden-md">@sortablelink('expense_transaction.paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-sm-2 col-md-3 hidden-sm">@sortablelink('expense_transaction.name', trans('transfers.from_account'))</th>
<th class="col-xs-4 col-sm-4 col-md-2">@sortablelink('income_transaction.name', trans('transfers.to_account'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-right">@sortablelink('expense_transaction.amount', trans('general.amount'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-center">{{ trans('general.actions') }}</th>
</tr>
@endforeach
</thead>
<tbody>
@foreach($transfers as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 hidden-sm">{{ Form::bulkActionGroup($item->id, $item->from_account) }}</td>
<td class="col-md-2 hidden-md"><a class="col-aka text-success" href="{{ route('transfers.edit', $item->id) }}">@date($item->paid_at)</a></td>
<td class="col-sm-2 col-md-3 hidden-sm">{{ $item->from_account }}</td>
<td class="col-xs-4 col-sm-4 col-md-2">{{ $item->to_account }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-xs-4 col-sm-2 col-md-2 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">
<a class="dropdown-item" href="{{ route('transfers.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@permission('delete-banking-transfers')
{!! Form::deleteLink($item, 'banking/transfers') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $items, 'type' => 'transfers'])
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $transfers, 'type' => 'transfers'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@push('scripts_start')
<script src="{{ asset('public/js/banking/transfers.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -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

View File

@ -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

View File

@ -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> &nbsp;{{ 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> &nbsp;{{ 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> &nbsp;' . 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

View File

@ -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>&nbsp;&nbsp;
<button type="button" id="cashflow-quarterly" class="btn btn-default btn-sm">{{ trans('general.quarterly') }}</button>&nbsp;&nbsp;
<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>&nbsp;
<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

View File

@ -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> &nbsp;{{ trans('general.cancel') }}</a>
{!! Form::button('<span class="fa fa-download"></span> &nbsp;' . trans('import.import'), ['type' => 'submit', 'class' => 'btn btn-success']) !!}
<a href="{{ url($path) }}" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ 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

View File

@ -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

View File

@ -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

View File

@ -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> &nbsp;{{ 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> &nbsp;{{ 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> &nbsp;{{ 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> &nbsp;{{ 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> &nbsp;{{ 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> &nbsp;{{ 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> &nbsp;' . 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

View File

@ -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

View 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

View 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

View 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> &nbsp;{{ 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

View File

@ -1,66 +0,0 @@
@extends('layouts.customer')
@section('title', trans('general.dashboard'))
@section('content')
<div class="row">
<!---Income, Expense and Profit Line Chart-->
<div class="col-md-12">
<div class="box box-success">
<div class="box-body" id="chart">
<div class="row">
<div class="col-md-3">
<div class="customer-content">
<div class="pull-left">{{ trans('general.unpaid') }}</div>
<div class="pull-right">{{ $progress['total'] }} / {{ $progress['unpaid'] }}</div>
<div class="progress">
<div class="progress-bar progress-bar-red" role="progressbar" aria-valuenow="{{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['unpaid'] : '0' }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['unpaid'] : '0' }}%">
{{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['unpaid'] : '0' }} %
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="customer-content">
<div class="pull-left">{{ trans('general.paid') }}</div>
<div class="pull-right">{{ $progress['total'] }} / {{ $progress['paid'] }}</div>
<div class="progress">
<div class="progress-bar progress-bar-green" role="progressbar" aria-valuenow="{{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['paid'] : '0' }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['paid'] : '0' }}%">
{{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['paid'] : '0' }}%
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="customer-content">
<div class="pull-left">{{ trans('general.overdue') }}</div>
<div class="pull-right">{{ $progress['total'] }} / {{ $progress['overdue'] }}</div>
<div class="progress">
<div class="progress-bar progress-bar-yellow" role="progressbar" aria-valuenow="{{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['overdue'] : '0' }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['overdue'] : '0' }}%">
{{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['overdue'] : '0' }}%
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="customer-content">
<div class="pull-left">{{ trans('general.partially_paid') }}</div>
<div class="pull-right">{{ $progress['total'] }} / {{ $progress['partially_paid'] }}</div>
<div class="progress">
<div class="progress-bar progress-bar-light-blue" role="progressbar" aria-valuenow="{{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['partially_paid'] : '0' }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['partially_paid'] : '0' }}%">
{{ !empty($progress['total']) ? (100 / $progress['total']) * $progress['partially_paid'] : '0' }}%
</div>
</div>
</div>
</div>
</div>
<hr>
{!! $chart->render() !!}
</div>
</div>
</div>
</div>
@endsection
@push('js')
{!! Charts::assets() !!}
@endpush

View File

@ -1,87 +0,0 @@
@extends('layouts.customer')
@section('title', trans_choice('general.invoices', 2))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'customers/invoices', '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::dateRange('invoice_date', trans('invoices.invoice_date'), 'calendar', []) !!}
{!! Form::select('statuses[]', $statuses, request('statuses'), ['id' => 'filter-statuses', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . 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="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-invoices">
<thead>
<tr>
<th class="col-md-2">@sortablelink('invoice_number', trans_choice('general.numbers', 1))</th>
<th class="col-md-2 text-right amount-space">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-3">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
<th class="col-md-3">@sortablelink('due_at', trans('invoices.due_date'))</th>
<th class="col-md-2">@sortablelink('invoice_status_code', trans_choice('general.statuses', 1))</th>
</tr>
</thead>
<tbody>
@foreach($invoices as $item)
@php $paid = $item->paid; @endphp
<tr>
<td><a href="{{ url('customers/invoices/' . $item->id) }}">{{ $item->invoice_number }}</a></td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td>{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
<td>{{ Date::parse($item->due_at)->format($date_format) }}</td>
<td><span class="label {{ $item->status->label }}">{{ trans('invoices.status.' . $item->status->code) }}</span></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $invoices, 'type' => 'invoices'])
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-categories").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#filter-statuses").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.statuses', 1)]) }}"
});
});
</script>
@endpush

View File

@ -1,151 +0,0 @@
@extends('layouts.invoice')
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
@section('content')
<section class="invoice">
<div class="row invoice-header">
<div class="col-xs-7">
@if ($logo)
<img src="{{ $logo }}" class="invoice-logo" />
@endif
</div>
<div class="col-xs-5 invoice-company">
<address>
<strong>{{ setting('general.company_name') }}</strong><br>
{{ setting('general.company_address') }}<br>
@if (setting('general.company_tax_number'))
{{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}<br>
@endif
<br>
@if (setting('general.company_phone'))
{{ setting('general.company_phone') }}<br>
@endif
{{ setting('general.company_email') }}
</address>
</div>
</div>
<div class="row">
<div class="col-xs-7">
{{ trans('invoices.bill_to') }}
<address>
<strong>{{ $invoice->customer_name }}</strong><br>
{{ $invoice->customer_address }}<br>
@if ($invoice->customer_tax_number)
{{ trans('general.tax_number') }}: {{ $invoice->customer_tax_number }}<br>
@endif
<br>
@if ($invoice->customer_phone)
{{ $invoice->customer_phone }}<br>
@endif
{{ $invoice->customer_email }}
</address>
</div>
<div class="col-xs-5">
<div class="table-responsive">
<table class="table no-border">
<tbody>
<tr>
<th>{{ trans('invoices.invoice_number') }}:</th>
<td class="text-right">{{ $invoice->invoice_number }}</td>
</tr>
@if ($invoice->order_number)
<tr>
<th>{{ trans('invoices.order_number') }}:</th>
<td class="text-right">{{ $invoice->order_number }}</td>
</tr>
@endif
<tr>
<th>{{ trans('invoices.invoice_date') }}:</th>
<td class="text-right">{{ Date::parse($invoice->invoiced_at)->format($date_format) }}</td>
</tr>
<tr>
<th>{{ trans('invoices.payment_due') }}:</th>
<td class="text-right">{{ Date::parse($invoice->due_at)->format($date_format) }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 table-responsive">
<table class="table table-striped">
<tbody>
<tr>
<th>{{ trans_choice('general.items', 1) }}</th>
<th class="text-center">{{ trans('invoices.quantity') }}</th>
<th class="text-right">{{ trans('invoices.price') }}</th>
<th class="text-right">{{ trans('invoices.total') }}</th>
</tr>
@foreach($invoice->items as $item)
<tr>
<td>
{{ $item->name }}
@if ($item->sku)
<br><small>{{ trans('items.sku') }}: {{ $item->sku }}</small>
@endif
</td>
<td class="text-center">{{ $item->quantity }}</td>
<td class="style-price text-right">@money($item->price, $invoice->currency_code, true)</td>
<td class="style-price text-right">@money($item->total, $invoice->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-xs-7">
@if ($invoice->notes)
<p class="lead">{{ trans_choice('general.notes', 2) }}</p>
<p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
{{ $invoice->notes }}
</p>
@endif
</div>
<div class="col-xs-5">
<div class="table-responsive">
<table class="table">
<tbody>
@foreach($invoice->totals as $total)
@if($total->code != 'total')
<tr>
<th>{{ trans($total['name']) }}:</th>
<td class="style-price text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@else
@if ($invoice->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="style-price text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
<tr>
<th>{{ trans($total['name']) }}:</th>
<td class="style-price text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</section>
@endsection
@if (isset($currency_style) && $currency_style)
@push('stylesheet')
<style type="text/css">
.style-price {
font-family: sans-serif;
font-size: 15px;
}
</style>
@endpush
@endif

View File

@ -1,228 +0,0 @@
@extends('layouts.link')
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
@section('new_button')
<span class="new-button"><a href="{{ url('customers') }}" class="btn btn-default btn-sm"><span class="fa fa-user-o"></span> &nbsp;{{ trans('invoices.all_invoices') }}</a></span>
@endsection
@section('content')
<div class="box box-success">
<section class="invoice">
<div id="badge">
<div class="arrow-up"></div>
<div class="label {{ $invoice->status->label }}">{{ trans('invoices.status.' . $invoice->status->code) }}</div>
<div class="arrow-right"></div>
</div>
<div class="row invoice-header">
<div class="col-xs-7">
@if (setting('general.invoice_logo'))
<img src="{{ Storage::url(setting('general.invoice_logo')) }}" class="invoice-logo" />
@elseif (setting('general.company_logo'))
<img src="{{ Storage::url(setting('general.company_logo')) }}" class="invoice-logo" />
@else
<img src="{{ asset('public/img/company.png') }}" class="invoice-logo" />
@endif
</div>
<div class="col-xs-5 invoice-company">
<address>
<strong>{{ setting('general.company_name') }}</strong><br>
{{ setting('general.company_address') }}<br>
@if (setting('general.company_tax_number'))
{{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}<br>
@endif
<br>
@if (setting('general.company_phone'))
{{ setting('general.company_phone') }}<br>
@endif
{{ setting('general.company_email') }}
</address>
</div>
</div>
<div class="row">
<div class="col-xs-7">
{{ trans('invoices.bill_to') }}
<address>
<strong>{{ $invoice->customer_name }}</strong><br>
{{ $invoice->customer_address }}<br>
@if ($invoice->customer_tax_number)
{{ trans('general.tax_number') }}: {{ $invoice->customer_tax_number }}<br>
@endif
<br>
@if ($invoice->customer_phone)
{{ $invoice->customer_phone }}<br>
@endif
{{ $invoice->customer_email }}
</address>
</div>
<div class="col-xs-5">
<div class="table-responsive">
<table class="table no-border">
<tbody>
<tr>
<th>{{ trans('invoices.invoice_number') }}:</th>
<td class="text-right">{{ $invoice->invoice_number }}</td>
</tr>
@if ($invoice->order_number)
<tr>
<th>{{ trans('invoices.order_number') }}:</th>
<td class="text-right">{{ $invoice->order_number }}</td>
</tr>
@endif
<tr>
<th>{{ trans('invoices.invoice_date') }}:</th>
<td class="text-right">{{ Date::parse($invoice->invoiced_at)->format($date_format) }}</td>
</tr>
<tr>
<th>{{ trans('invoices.payment_due') }}:</th>
<td class="text-right">{{ Date::parse($invoice->due_at)->format($date_format) }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 table-responsive">
<table class="table table-striped">
<tbody>
<tr>
<th>{{ trans_choice('general.items', 1) }}</th>
<th class="text-center">{{ trans('invoices.quantity') }}</th>
<th class="text-right">{{ trans('invoices.price') }}</th>
<th class="text-right">{{ trans('invoices.total') }}</th>
</tr>
@foreach($invoice->items as $item)
<tr>
<td>
{{ $item->name }}
@if ($item->sku)
<br><small>{{ trans('items.sku') }}: {{ $item->sku }}</small>
@endif
</td>
<td class="text-center">{{ $item->quantity }}</td>
<td class="text-right">@money($item->price, $invoice->currency_code, true)</td>
<td class="text-right">@money($item->total, $invoice->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-xs-7">
@if ($invoice->notes)
<p class="lead">{{ trans_choice('general.notes', 2) }}</p>
<p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
{{ $invoice->notes }}
</p>
@endif
</div>
<div class="col-xs-5">
<div class="table-responsive">
<table class="table">
<tbody>
@foreach($invoice->totals as $total)
@if($total->code != 'total')
<tr>
<th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@else
@if ($invoice->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
<tr>
<th>{{ trans($total['name']) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<div class="box-footer row no-print">
<div class="col-md-10">
<a href="{{ $print_action }}" target="_blank" class="btn btn-default">
<i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }}
</a>
<a href="{{ $pdf_action }}" class="btn btn-default" data-toggle="tooltip" title="{{ trans('invoices.download_pdf') }}">
<i class="fa fa-file-pdf-o"></i>&nbsp; {{ trans('general.download') }}
</a>
</div>
<div class="col-md-2 no-padding-right">
@if($invoice->invoice_status_code != 'paid')
@if ($payment_methods)
{!! Form::select('payment_method', $payment_methods, null, array_merge(['id' => 'payment-method', 'class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)])])) !!}
{!! Form::select('payment_method_actions', $payment_actions, null, array_merge(['id' => 'payment-method-actions', 'class' => 'form-control hidden'])) !!}
{!! Form::hidden('invoice_id', $invoice->id, []) !!}
@else
@endif
@endif
</div>
<div id="confirm" class="col-md-12"></div>
</div>
</section>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$(document).on('change', '#payment-method', function (e) {
var payment_method = $(this).val();
gateway = payment_method.split('.');
$('#payment-method-actions').val(gateway[0]);
var url = $('#payment-method-actions').find('option:selected').text();
$.ajax({
url: url,
type: 'POST',
dataType: 'JSON',
data: $('.box-footer input, .box-footer select'),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
beforeSend: function() {
$('#confirm').html('');
$('#confirm').append('<div id="loading" class="text-center"><i class="fa fa-spinner fa-spin fa-5x checkout-spin"></i></div>');
},
complete: function() {
$('#loading').remove();
},
success: function(data) {
if (data['error']) {
}
if (data['redirect']) {
location = data['redirect'];
}
if (data['html']) {
$('#confirm').append(data['html']);
}
},
error: function(data){
}
});
});
});
</script>
@endpush

View File

@ -1,304 +0,0 @@
@extends('layouts.customer')
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
@section('content')
<div class="box box-success">
<section class="invoice">
@stack('invoice_badge_start')
<div id="badge">
<div class="arrow-up"></div>
<div class="label {{ $invoice->status->label }}">{{ trans('invoices.status.' . $invoice->status->code) }}</div>
<div class="arrow-right"></div>
</div>
@stack('invoice_badge_end')
@stack('invoice_header_start')
<div class="row invoice-header">
<div class="col-xs-7">
@if (setting('general.invoice_logo'))
<img src="{{ Storage::url(setting('general.invoice_logo')) }}" class="invoice-logo" />
@elseif (setting('general.company_logo'))
<img src="{{ Storage::url(setting('general.company_logo')) }}" class="invoice-logo" />
@else
<img src="{{ asset('public/img/company.png') }}" class="invoice-logo" />
@endif
</div>
<div class="col-xs-5 invoice-company">
<address>
<strong>{{ setting('general.company_name') }}</strong><br>
{!! nl2br(setting('general.company_address')) !!}<br>
@if (setting('general.company_tax_number'))
{{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}<br>
@endif
<br>
@if (setting('general.company_phone'))
{{ setting('general.company_phone') }}<br>
@endif
{{ setting('general.company_email') }}
</address>
</div>
</div>
@stack('invoice_header_end')
@stack('invoice_information_start')
<div class="row">
<div class="col-xs-7">
{{ trans('invoices.bill_to') }}
<address>
@stack('name_input_start')
<strong>{{ $invoice->customer_name }}</strong><br>
@stack('name_input_end')
@stack('address_input_start')
{!! nl2br($invoice->customer_address) !!}<br>
@stack('address_input_end')
@stack('tax_number_input_start')
@if ($invoice->customer_tax_number)
{{ trans('general.tax_number') }}: {{ $invoice->customer_tax_number }}<br>
@endif
@stack('tax_number_input_end')
<br>
@stack('phone_input_start')
@if ($invoice->customer_phone)
{{ $invoice->customer_phone }}<br>
@endif
@stack('phone_input_end')
@stack('email_start')
{{ $invoice->customer_email }}
@stack('email_input_end')
</address>
</div>
<div class="col-xs-5">
<div class="table-responsive">
<table class="table no-border">
<tbody>
@stack('invoice_number_input_start')
<tr>
<th>{{ trans('invoices.invoice_number') }}:</th>
<td class="text-right">{{ $invoice->invoice_number }}</td>
</tr>
@stack('invoice_number_input_end')
@stack('order_number_input_start')
@if ($invoice->order_number)
<tr>
<th>{{ trans('invoices.order_number') }}:</th>
<td class="text-right">{{ $invoice->order_number }}</td>
</tr>
@endif
@stack('order_number_input_end')
@stack('invoiced_at_input_start')
<tr>
<th>{{ trans('invoices.invoice_date') }}:</th>
<td class="text-right">{{ Date::parse($invoice->invoiced_at)->format($date_format) }}</td>
</tr>
@stack('invoiced_at_input_end')
@stack('due_at_input_start')
<tr>
<th>{{ trans('invoices.payment_due') }}:</th>
<td class="text-right">{{ Date::parse($invoice->due_at)->format($date_format) }}</td>
</tr>
@stack('due_at_input_end')
</tbody>
</table>
</div>
</div>
</div>
@stack('invoice_information_end')
@stack('invoice_item_start')
<div class="row">
<div class="col-xs-12 table-responsive">
<table class="table table-striped">
<tbody>
<tr>
@stack('actions_th_start')
@stack('actions_th_end')
@stack('name_th_start')
<th>{{ trans_choice($text_override['items'], 2) }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="text-center">{{ trans($text_override['quantity']) }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="text-right">{{ trans($text_override['price']) }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
@stack('taxes_th_end')
@stack('total_th_start')
<th class="text-right">{{ trans('invoices.total') }}</th>
@stack('total_th_end')
</tr>
@foreach($invoice->items as $item)
<tr>
@stack('actions_td_start')
@stack('actions_td_end')
@stack('name_td_start')
<td>
{{ $item->name }}
@if ($item->sku)
<br><small>{{ trans('items.sku') }}: {{ $item->sku }}</small>
@endif
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="text-center">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="text-right">@money($item->price, $invoice->currency_code, true)</td>
@stack('price_td_end')
@stack('taxes_td_start')
@stack('taxes_td_end')
@stack('total_td_start')
<td class="text-right">@money($item->total, $invoice->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@stack('invoice_item_end')
@stack('invoice_total_start')
<div class="row">
<div class="col-xs-7">
@stack('notes_input_start')
@if ($invoice->notes)
<p class="lead">{{ trans_choice('general.notes', 2) }}</p>
<p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
{{ $invoice->notes }}
</p>
@endif
@stack('notes_input_end')
</div>
<div class="col-xs-5">
<div class="table-responsive">
<table class="table">
<tbody>
@foreach ($invoice->totals as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
<tr>
<th>{{ trans($total->title) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@stack($total->code . '_td_end')
@else
@if ($invoice->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>{{ trans($total->name) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@stack('grand_total_td_end')
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@stack('invoice_total_end')
@stack('box_footer_start')
<div class="box-footer row no-print">
<div class="col-md-10">
@stack('button_print_start')
<a href="{{ url('customers/invoices/' . $invoice->id . '/print') }}" target="_blank" class="btn btn-default">
<i class="fa fa-print"></i>&nbsp; {{ trans('general.print') }}
</a>
@stack('button_print_end')
@stack('button_pdf_start')
<a href="{{ url('customers/invoices/' . $invoice->id . '/pdf') }}" class="btn btn-default" data-toggle="tooltip" title="{{ trans('invoices.download_pdf') }}">
<i class="fa fa-file-pdf-o"></i>&nbsp; {{ trans('general.download') }}
</a>
@stack('button_pdf_end')
</div>
<div class="col-md-2 no-padding-right">
@if($invoice->invoice_status_code != 'paid')
@if ($payment_methods)
{!! Form::select('payment_method', $payment_methods, null, array_merge(['id' => 'payment-method', 'class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)])])) !!}
{!! Form::hidden('invoice_id', $invoice->id, []) !!}
@else
@endif
@endif
</div>
<div id="confirm" class="col-md-12"></div>
</div>
@stack('box_footer_end')
</section>
</div>
@stack('invoice_end')
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$(document).on('change', '#payment-method', function (e) {
var payment_method = $(this).val();
gateway = payment_method.split('.');
$.ajax({
url: '{{ url("customers/invoices/" . $invoice->id) }}/' + gateway[0],
type: 'GET',
dataType: 'JSON',
data: $('.box-footer input, .box-footer select'),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
beforeSend: function() {
$('#confirm').html('');
$('#confirm').append('<div id="loading" class="text-center"><i class="fa fa-spinner fa-spin fa-5x checkout-spin"></i></div>');
},
complete: function() {
$('#loading').remove();
},
success: function(data) {
if (data['error']) {
}
if (data['redirect']) {
location = data['redirect'];
}
if (data['html']) {
$('#confirm').append(data['html']);
}
},
error: function(data){
}
});
});
});
</script>
@endpush

View File

@ -1,54 +0,0 @@
@extends('layouts.customer')
@section('title', trans_choice('general.payments', 1))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'customers/payments', '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::select('category_id', $categories, request('category_id'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('payment_method', $payment_methods, request('payment_method'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . 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="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-revenues">
<thead>
<tr>
<th>@sortablelink('paid_at', trans('general.date'))</th>
<th>@sortablelink('amount', trans('general.amount'))</th>
<th>@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th>@sortablelink('payment_method', trans_choice('general.payment_methods', 1))</th>
</tr>
</thead>
<tbody>
@foreach($payments as $item)
<tr>
<td><a href="{{ url('customers/payments/' . $item->id) }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
<td>@money($item->amount, $item->currency_code, true)</td>
<td>{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td>{{ $payment_methods[$item->payment_method] }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $payments, 'type' => 'payments'])
</div>
</div>
<!-- /.box -->
@endsection

View File

@ -1,107 +0,0 @@
@extends('layouts.customer')
@section('title', trans_choice('general.invoices', 1))
@section('content')
<div class="box box-success">
<div class="invoice"><span class="badge" style="background-color : {{ $payment->category->color }}">{{ $payment->category->name }}</span>
<div class="row">
<div class="col-xs-12">
<h2 class="page-header">
<i class="fa fa-globe"></i> {{ $payment->customer->name }}
<small class="pull-right">{{ trans('general.date') }}: {{ Date::parse($payment->paid_at)->format($date_format) }}</small>
</h2>
</div>
</div>
<div class="row invoice-info">
<div class="col-sm-4 invoice-col">
{{ trans('general.from') }}
<address>
<strong>{{ setting('general.company_name') }}</strong><br>
{{ setting('general.company_address') }}<br>
{{ trans('general.phone') }}: (804) 123-5432<br>
{{ trans('general.email') }}: {{ setting('general.company_email') }}
</address>
</div>
<div class="col-sm-4 invoice-col">
{{ trans('general.to') }}
<address>
<strong>{{ $payment->customer->name }}</strong><br>
{{ $payment->customer->address }}<br>
{{ trans('general.phone') }}: {{ $payment->customer->phone }}<br>
{{ trans('general.email') }}: {{ $payment->customer->email }}
</address>
</div>
<div class="col-sm-4 invoice-col">
<b>{{ trans('invoices.payment_due') }}:</b> {{ Date::parse($payment->paid_at)->format($date_format) }}
</div>
</div>
<div class="row">
<div class="col-xs-12 table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
<th>{{ trans_choice('general.payment_methods', 1) }}</th>
<th>{{ trans('general.reference') }}</th>
<th>{{ trans('general.amount') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $payment->category->name }}</td>
<td>{{ $payment_methods[$payment->payment_method] }}</td>
<td>{{ $payment->reference }}</td>
<td>@money($payment->amount, $payment->currency_code, true)</td>
</tr>
</tbody>
</table>
</div>
</div>
@if ($payment->description)
<div class="row">
<div class="col-xs-12">
<p class="lead">{{ trans('general.description') }}:</p>
<p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
{{ $payment->description }}
</p>
</div>
</div>
@endif
@if ($payment->attachment)
<div class="box-footer">
<ul class="mailbox-attachments clearfix">
@if (1)
<li>
<span class="mailbox-attachment-icon"><i class="fa fa-file-pdf-o"></i></span>
<div class="mailbox-attachment-info">
<a href="#" class="mailbox-attachment-name"><i class="fa fa-paperclip"></i> {{ basename($payment->attachment) }}</a>
<span class="mailbox-attachment-size">
<a href="#" class="btn btn-default btn-xs pull-right"><i class="fa fa-cloud-download"></i></a>
</span>
</div>
</li>
@else
<li>
<span class="mailbox-attachment-icon has-img"><img src="{{ asset($payment->attachment) }}" alt="Attachment"></span>
<div class="mailbox-attachment-info">
<a href="#" class="mailbox-attachment-name"><i class="fa fa-camera"></i> {{ basename($payment->attachment) }}</a>
<span class="mailbox-attachment-size">
<a href="#" class="btn btn-default btn-xs pull-right"><i class="fa fa-cloud-download"></i></a>
</span>
</div>
</li>
@endif
</ul>
</div>
@endif
</div>
</div>
@endsection

View File

@ -1,56 +0,0 @@
@extends('layouts.customer')
@section('title', trans_choice('general.transactions', 2))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'customers/transactions', '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> &nbsp;' . 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="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th>@sortablelink('paid_at', trans('general.date'))</th>
<th>@sortablelink('account.name', trans('accounts.account_name'))</th>
<th>@sortablelink('type', trans_choice('general.types', 1))</th>
<th>@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th>@sortablelink('description', trans('general.description'))</th>
<th>@sortablelink('amount', trans('general.amount'))</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr>
<td>{{ Date::parse($item->date)->format($date_format) }}</td>
<td>{{ $item->account }}</td>
<td>{{ $item->type }}</td>
<td>{{ $item->category }}</td>
<td>{{ $item->description }}</td>
<td>@money($item->amount, $item->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection

View File

@ -3,13 +3,14 @@
@section('title', trans('errors.forbidden_access'))
@section('content')
<div class="error-page">
<h2 class="headline text-red">403</h2>
<div class="card">
<div class="card-header">
<h2 class="mb-0 text-warning">403 Forbidden</h2>
</div>
<div class="card-body">
<h3><i class="fa fa-exclamation-triangle text-danger"></i> {{ trans('errors.body.forbidden_access') }}</h3>
<div class="error-content">
<h3><i class="fa fa-ban text-red"></i> {{ trans('errors.body.forbidden_access') }}</h3>
<p>{!! trans('errors.messages.forbidden_access', ['link' => url('/') ]) !!}</p>
<p>{!! trans('errors.messages.forbidden_access', ['link' => url('/') ]) !!}</p>
</div>
</div>
</div>
@endsection

View File

@ -3,13 +3,14 @@
@section('title', trans('errors.page_not_found'))
@section('content')
<div class="error-page">
<h2 class="headline text-yellow"> 404</h2>
<div class="card">
<div class="card-header">
<h2 class="mb-0 text-yellow">404 Not Found</h2>
</div>
<div class="card-body">
<h3><i class="fa fa-exclamation-triangle text-yellow"></i> {{ trans('errors.body.page_not_found') }}</h3>
<div class="error-content">
<h3><i class="fa fa-warning text-yellow"></i> {{ trans('errors.body.page_not_found') }}</h3>
<p>{!! trans('errors.messages.page_not_found', ['link' => url('/')]) !!}</p>
<p>{!! trans('errors.messages.page_not_found', ['link' => url('/')]) !!}</p>
</div>
</div>
</div>
@endsection

View File

@ -3,13 +3,14 @@
@section('title', trans('errors.error_page'))
@section('content')
<div class="error-page">
<h2 class="headline text-red">500</h2>
<div class="card">
<div class="card-header">
<h2 class="mb-0 text-danger">500 Internal Server Error</h2>
</div>
<div class="card-body">
<h3><i class="fa fa-exclamation-triangle text-danger"></i> {{ trans('errors.body.error_page') }}</h3>
<div class="error-content">
<h3><i class="fa fa-warning text-red"></i> {{ trans('errors.body.error_page') }}</h3>
<p>{!! trans('errors.messages.error_page', ['link' => url('/') ]) !!}</p>
<p>{!! trans('errors.messages.error_page', ['link' => url('/') ]) !!}</p>
</div>
</div>
</div>
@endsection

View File

@ -3,179 +3,267 @@
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number)
@section('content')
<div class="row header">
<div class="col-58">
@if ($logo)
<img src="{{ $logo }}" class="logo" />
@endif
</div>
<div class="col-42">
<div class="text company">
<strong>{{ setting('general.company_name') }}</strong><br>
{!! nl2br(setting('general.company_address')) !!}<br>
@if (setting('general.company_tax_number'))
{{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}<br>
@endif
<br>
@if (setting('general.company_phone'))
{{ setting('general.company_phone') }}<br>
@endif
{{ setting('general.company_email') }}
<div class="mt-6">
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
@if ($logo)
<img src="{{ $logo }}"/>
@endif
</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ setting('company.name') }}
</th>
</tr>
<tr>
<th>
{!! nl2br(setting('company.address')) !!}
</th>
</tr>
<tr>
<th>
@if (setting('company.tax_number'))
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
@endif
</th>
</tr>
<tr>
<th>
@if (setting('company.phone'))
{{ setting('company.phone') }}
@endif
</th>
</tr>
<tr>
<th>
{{ setting('company.email') }}
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-58">
<div class="text">
{{ trans('bills.bill_from') }}<br><br>
@stack('name_input_start')
<strong>{{ $bill->vendor_name }}</strong><br>
@stack('name_input_end')
@stack('address_input_start')
{!! nl2br($bill->vendor_address) !!}<br>
@stack('address_input_end')
@stack('tax_number_input_start')
@if ($bill->vendor_tax_number)
{{ trans('general.tax_number') }}: {{ $bill->vendor_tax_number }}<br>
@endif
@stack('tax_number_input_end')
<br>
@stack('phone_input_start')
@if ($bill->vendor_phone)
{{ $bill->vendor_phone }}<br>
@endif
@stack('phone_input_end')
@stack('email_start')
{{ $bill->vendor_email }}
@stack('email_input_end')
<div class="dropdown-divider"></div>
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ trans('bills.bill_from') }}
@stack('name_input_start')
<strong class="d-block">{{ $bill->contact_name }}</strong><br>
@stack('name_input_end')
</th>
</tr>
<tr>
<th>
@stack('address_input_start')
{!! nl2br($bill->contact_address) !!}
@stack('address_input_end')
</th>
</tr>
<tr>
<th>
@stack('tax_number_input_start')
@if ($bill->contact_tax_number)
{{ trans('general.tax_number') }}: {{ $bill->contact_tax_number }}
@endif
@stack('tax_number_input_end')
</th>
</tr>
<tr>
<th>
@stack('phone_input_start')
@if ($bill->contact_phone)
{{ $bill->contact_phone }}
@endif
@stack('phone_input_end')
</th>
</tr>
<tr>
<th>
@stack('email_start')
{{ $bill->contact_email }}
@stack('email_input_end')
</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
@stack('bill_number_input_start')
<tr>
<th>{{ trans('bills.bill_number') }}:</th>
<td class="text-right">{{ $bill->bill_number }}</td>
</tr>
@stack('bill_number_input_end')
@stack('order_number_input_start')
@if ($bill->order_number)
<tr>
<th>{{ trans('bills.order_number') }}:</th>
<td class="text-right">{{ $bill->order_number }}</td>
</tr>
@endif
@stack('order_number_input_end')
@stack('billed_at_input_start')
<tr>
<th>{{ trans('bills.bill_date') }}:</th>
<td class="text-right">@date($bill->billed_at)</td>
</tr>
@stack('billed_at_input_end')
@stack('due_at_input_start')
<tr>
<th>{{ trans('bills.payment_due') }}:</th>
<td class="text-right">@date($bill->due_at)</td>
</tr>
@stack('due_at_input_end')
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-42">
<div class="text">
<table>
<tbody>
@stack('bill_number_input_start')
<tr>
<th>{{ trans('bills.bill_number') }}:</th>
<td class="text-right">{{ $bill->bill_number }}</td>
</tr>
@stack('bill_number_input_end')
@stack('order_number_input_start')
@if ($bill->order_number)
<tr>
<th>{{ trans('bills.order_number') }}:</th>
<td class="text-right">{{ $bill->order_number }}</td>
</tr>
@endif
@stack('order_number_input_end')
@stack('billed_at_input_start')
<tr>
<th>{{ trans('bills.bill_date') }}:</th>
<td class="text-right">{{ Date::parse($bill->billed_at)->format($date_format) }}</td>
</tr>
@stack('billed_at_input_end')
@stack('due_at_input_start')
<tr>
<th>{{ trans('bills.payment_due') }}:</th>
<td class="text-right">{{ Date::parse($bill->due_at)->format($date_format) }}</td>
</tr>
@stack('due_at_input_end')
</tbody>
</table>
</div>
</div>
</div>
<table class="lines">
<thead>
<tr>
@stack('actions_th_start')
@stack('actions_th_end')
@stack('name_th_start')
<th class="item">{{ trans_choice('general.items', 1) }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="quantity">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="price">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
@stack('taxes_th_end')
@stack('total_th_start')
<th class="total">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@foreach($bill->items as $item)
<tr>
@stack('actions_td_start')
@stack('actions_td_end')
@stack('name_td_start')
<td class="item">
{{ $item->name }}
@if ($item->sku)
<br><small>{{ trans('items.sku') }}: {{ $item->sku }}</small>
@endif
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="quantity">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="style-price price">@money($item->price, $bill->currency_code, true)</td>
@stack('price_td_end')
@stack('taxes_td_start')
@stack('taxes_td_end')
@stack('total_td_start')
<td class="style-price total">@money($item->total, $bill->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
</tbody>
</table>
<table class="table table-striped">
<thead>
<tr>
@stack('actions_th_start')
@stack('actions_th_end')
<div class="row">
<div class="col-58">
@stack('notes_input_start')
@if ($bill->notes)
<table class="text" style="page-break-inside: avoid;">
<tr><th>{{ trans_choice('general.notes', 2) }}</th></tr>
<tr><td>{{ $bill->notes }}</td></tr>
</table>
@endif
@stack('notes_input_end')
</div>
<div class="col-42">
<table class="text" style="page-break-inside: avoid;">
@stack('name_th_start')
<th>{{ trans_choice('general.items', 1) }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="text-center">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="text-center pr-5">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
@stack('taxes_th_end')
@stack('total_th_start')
<th class="text-right">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@foreach ($bill->totals as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
@foreach($bill->items as $item)
<tr>
<th>{{ trans($total->title) }}:</th>
<td class="style-price text-right">@money($total->amount, $bill->currency_code, true)</td>
@stack('name_td_start')
<td>{{ $item->name }}</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="text-center">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="text-center pr-5">@money($item->price, $bill->currency_code, true)</td>
@stack('price_td_end')
@stack('total_td_start')
<td class="text-right">@money($item->total, $bill->currency_code, true)</td>
@stack('total_td_end')
</tr>
@stack($total->code . '_td_end')
@else
@if ($bill->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="style-price text-right">- @money($bill->paid, $bill->currency_code, true)</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>{{ trans($total->name) }}:</th>
<td class="style-price text-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</td>
</tr>
@stack('grand_total_td_end')
@endif
@endforeach
@endforeach
</tbody>
</table>
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
@stack('notes_input_start')
@if ($bill->notes)
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ trans_choice('general.notes', 2) }}
</th>
</tr>
<tr>
<th>
{{ $bill->notes }}
</th>
</tr>
</tbody>
</table>
@endif
@stack('notes_input_end')
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
@foreach ($bill->totals as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
<tr>
<th>
{{ trans($total->title) }}:
</th>
<td class="text-right">
@money($total->amount, $bill->currency_code, true)
</td>
</tr>
@stack($total->code . '_td_end')
@else
@if ($bill->paid)
<tr class="text-success">
<th>
{{ trans('invoices.paid') }}:
</th>
<td class="text-right">
- @money($bill->paid, $bill->currency_code, true)
</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>
{{ trans($total->name) }}:
</th>
<td class="text-right">
@money($total->amount - $bill->paid, $bill->currency_code, true)
</td>
</tr>
@stack('grand_total_td_end')
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -3,579 +3,193 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.bills', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'expenses/bills', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'bills.store',
'id' => 'bill',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="box-body">
@stack('vendor_id_input_start')
<div class="form-group col-md-6 required {{ $errors->has('vendor_id') ? 'has-error' : ''}}">
{!! Form::label('vendor_id', trans_choice('general.vendors', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-user"></i></div>
{!! Form::select('vendor_id', $vendors, null, array_merge(['id' => 'vendor_id', 'class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)])])) !!}
<span class="input-group-btn">
<button type="button" id="button-vendor" class="btn btn-default btn-icon"><i class="fa fa-plus"></i></button>
</span>
</div>
{!! $errors->first('vendor_id', '<p class="help-block">:message</p>') !!}
</div>
@stack('vendor_id_input_end')
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, config('general.vendors'), ['required' => 'required', 'change' => 'onChangeContact']) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
{{ Form::textGroup('billed_at', trans('bills.bill_date'), 'calendar',['id' => 'billed_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy/mm/dd\'', 'data-mask' => '', 'autocomplete' => 'off'],Date::now()->toDateString()) }}
{{ Form::dateGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{{ Form::textGroup('due_at', trans('bills.due_date'), 'calendar',['id' => 'due_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy/mm/dd\'', 'data-mask' => '', 'autocomplete' => 'off'],Date::now()->toDateString()) }}
{{ Form::dateGroup('due_at', trans('bills.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file-text-o') }}
{{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file') }}
{{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }}
{{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }}
<div class="form-group col-md-12">
{!! Form::label('items', trans_choice('general.items', 2), ['class' => 'control-label']) !!}
<div class="table-responsive">
<table class="table table-bordered" id="items">
<thead>
<tr style="background-color: #f9f9f9;">
@stack('actions_th_start')
<th width="5%" class="text-center">{{ trans('general.actions') }}</th>
@stack('actions_th_end')
@stack('name_th_start')
<th width="40%" class="text-left">{{ trans('general.name') }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th width="5%" class="text-center">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th width="10%" class="text-right">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
<th width="15%" class="text-right">{{ trans_choice('general.taxes', 1) }}</th>
@stack('taxes_th_end')
@stack('total_th_start')
<th width="10%" class="text-right">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@php $item_row = 0; @endphp
@if(old('item'))
@foreach(old('item') as $old_item)
@php $item = (object) $old_item; @endphp
@include('expenses.bills.item')
@php $item_row++; @endphp
@endforeach
@else
@include('expenses.bills.item')
@endif
@php $item_row++; @endphp
@stack('add_item_td_start')
<tr id="addItem">
<td class="text-center"><button type="button" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-xs btn-primary" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
<td class="text-right" colspan="5"></td>
</tr>
@stack('add_item_td_end')
@stack('sub_total_td_start')
<tr id="tr-subtotal">
<td class="text-right" colspan="5"><strong>{{ trans('bills.sub_total') }}</strong></td>
<td class="text-right"><span id="sub-total">0</span></td>
</tr>
@stack('sub_total_td_end')
@stack('add_discount_td_start')
<tr id="tr-discount">
<td class="text-right" style="vertical-align: middle;" colspan="5">
<a href="javascript:void(0)" id="discount-text" rel="popover">{{ trans('bills.add_discount') }}</a>
</td>
<td class="text-right">
<span id="discount-total"></span>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right']) !!}
</td>
</tr>
@stack('add_discount_td_end')
@stack('tax_total_td_start')
<tr id="tr-tax">
<td class="text-right" colspan="5">
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
</td>
<td class="text-right"><span id="tax-total">0</span></td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr id="tr-total">
<td class="text-right" colspan="5"><strong>{{ trans('bills.total') }}</strong></td>
<td class="text-right"><span id="grand-total">0</span></td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
</div>
</div>
<div class="col-md-12 mb-4">
{!! Form::label('items', trans_choice('general.items', 2), ['class' => 'form-control-label']) !!}
<div class="table-responsive">
<table class="table table-bordered" id="items">
<thead class="thead-light">
<tr class="row">
@stack('actions_th_start')
<th class="col-md-1 action-column border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
@stack('actions_th_end')
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
@stack('name_th_start')
<th class="col-md-3 text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
@stack('name_th_end')
@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>
@stack('quantity_th_start')
<th class="col-md-2 text-center border-right-0 border-bottom-0">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
@stack('taxes_th_end')
@stack('total_th_start')
<th class="col-md-2 text-right border-bottom-0">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody id="bill-item-rows">
@include('expenses.bills.item')
@stack('add_item_td_start')
<tr class="row" id="addItem">
<td class="col-md-1 action-column border-right-0 border-bottom-0"><button type="button" @click="onAddItem" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-icon btn-outline-success btn-lg" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
<td class="col-md-11 text-right border-bottom-0"></td>
</tr>
@stack('add_item_td_end')
@stack('sub_total_td_start')
<tr class="row" id="tr-subtotal">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<strong>{{ trans('bills.sub_total') }}</strong>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="sub-total" v-html="totals.sub">0</span>
</td>
</tr>
@stack('sub_total_td_end')
@stack('add_discount_td_start')
<tr class="row" id="tr-discount">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<el-popover
popper-class="p-0 h-0"
placement="bottom"
width="300"
v-model="discount">
<div class="card">
<div class="discount card-body">
<div class="row align-items-center">
<div class="col-md-6">
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text" id="input-discount">
<i class="fa fa-percent"></i>
</span>
</div>
{!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}
</div>
</div>
<div class="col-md-6">
<div class="discount-description">
<strong>{{ trans('invoices.discount_desc') }}</strong>
</div>
</div>
</div>
</div>
<div class="discount card-footer">
<div class="row text-center">
<div class="col-md-12">
<a href="javascript:void(0)" @click="discount = false" class="btn btn-icon btn-outline-secondary">
<span class="btn-inner--icon"><i class="fas fa-times"></i></span>
<span class="btn-inner--text">{{ trans('general.cancel') }}</span>
</a>
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
</div>
</div>
</div>
</div>
<el-link slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
</el-popover>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="discount-total" v-html="totals.discount"></span>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
</td>
</tr>
@stack('add_discount_td_end')
@stack('tax_total_td_start')
<tr class="row" id="tr-tax">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="tax-total" v-html="totals.tax">0</span>
</td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr class="row" id="tr-total">
<td class="col-md-10 text-right border-right-0">
<strong>{{ trans('bills.total') }}</strong>
</td>
<td class="col-md-2 text-right">
<span id="grand-total" v-html="totals.total">0</span>
</td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
</div>
</div>
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), []) }}
{{ Form::recurring('create') }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('contact_name', old('contact_name'), ['id' => 'contact_name', 'v-model' => 'form.contact_name']) }}
{{ Form::hidden('contact_email', old('contact_email'), ['id' => 'contact_email', 'v-model' => 'form.contact_email']) }}
{{ Form::hidden('contact_tax_number', old('contact_tax_number'), ['id' => 'contact_tax_number', 'v-model' => 'form.contact_tax_number']) }}
{{ Form::hidden('contact_phone', old('contact_phone'), ['id' => 'contact_phone', 'v-model' => 'form.contact_phone']) }}
{{ Form::hidden('contact_address', old('contact_address'), ['id' => 'contact_address', 'v-model' => 'form.contact_address']) }}
{{ Form::hidden('currency_rate', old('currency_rate', 1), ['id' => 'currency_rate', 'v-model' => 'form.contact_rate']) }}
{{ Form::hidden('bill_status_code', old('bill_status_code', 'draft'), ['id' => 'bill_status_code', 'v-model' => 'form.bill_status_code']) }}
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
</div>
</div>
{!! $errors->first('category_id', '<p class="help-block">:message</p>') !!}
</div>
@stack('category_id_input_end')
{{ Form::recurring('create') }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('vendor_name', old('vendor_name'), ['id' => 'vendor_name']) }}
{{ Form::hidden('vendor_email', old('vendor_email'), ['id' => 'vendor_email']) }}
{{ Form::hidden('vendor_tax_number', old('vendor_tax_number'), ['id' => 'vendor_tax_number']) }}
{{ Form::hidden('vendor_phone', old('vendor_phone'), ['id' => 'vendor_phone']) }}
{{ Form::hidden('vendor_address', old('vendor_address'), ['id' => 'vendor_address']) }}
{{ Form::hidden('currency_rate', old('currency_rate'), ['id' => 'currency_rate']) }}
{{ Form::hidden('bill_status_code', old('bill_status_code', 'draft'), ['id' => 'bill_status_code']) }}
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount']) }}
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('expenses/bills') }}
</div>
</div>
{!! Form::close() !!}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('expenses/bills') }}
</div>
<!-- /.box-footer -->
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.1/bootstrap3-typeahead.min.js"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/colorpicker/bootstrap-colorpicker.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.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('stylesheet')
<style type="text/css">
.select2-results__option.select2-results__message:hover {
color: white;
background: #6da252;
cursor: pointer;
}
</style>
@endpush
@push('scripts')
@push('scripts_start')
<script type="text/javascript">
var focus = false;
var item_row = '{{ $item_row }}';
var autocomplete_path = "{{ url('common/items/autocomplete') }}";
$(document).ready(function() {
@if (old('item'))
$('#vendor_id').trigger('change');
@endif
itemTableResize();
$('.input-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
});
$('.input-price').trigger('focusout');
//Date picker
$('#billed_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
//Date picker
$('#due_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$('.tax-select2').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>';
}
}
});
$('#vendor_id').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)]) }}"
});
$('#currency_code').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
$('#category_id').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
// Discount popover
$('a[rel=popover]').popover({
html: true,
placement: 'bottom',
title: '{{ trans('bills.discount') }}',
content: function () {
html = '<div class="discount box-body">';
html += ' <div class="col-md-6">';
html += ' <div class="input-group" id="input-discount">';
html += ' {!! Form::number('pre-discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}';
html += ' <div class="input-group-addon"><i class="fa fa-percent"></i></div>';
html += ' </div>';
html += ' </div>';
html += ' <div class="col-md-6">';
html += ' <div class="discount-description">';
html += ' {{ trans('bills.discount_desc') }}';
html += ' </div>';
html += ' </div>';
html += '</div>';
html += '<div class="discount box-footer">';
html += ' <div class="col-md-12">';
html += ' <div class="form-group no-margin">';
html += ' {!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount','class' => 'btn btn-success']) !!}';
html += ' <a href="javascript:void(0)" id="cancel-discount" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</a>';
html += ' </div>';
html += ' </div>';
html += '</div>';
return html;
}
});
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '{{ trans('general.form.no_file_selected') }}'
});
@if(old('item'))
totalItem();
@endif
});
$(document).on('click', '#button-add-item', function (e) {
$.ajax({
url: '{{ url("expenses/bills/addItem") }}',
type: 'GET',
dataType: 'JSON',
data: {item_row: item_row, currency_code : $('#currency_code').val()},
success: function(json) {
if (json['success']) {
$('#items tbody #addItem').before(json['html']);
//$('[rel=tooltip]').tooltip();
$('[data-toggle="tooltip"]').tooltip('hide');
$('#item-row-' + item_row + ' .tax-select2').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"> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
}
}
});
var currency = json['data']['currency'];
$('#item-price-' + item_row).maskMoney({
thousands : currency.thousands_separator,
decimal : currency.decimal_mark,
precision : currency.precision,
allowZero : true,
prefix : (currency.symbol_first) ? currency.symbol : '',
suffix : (currency.symbol_first) ? '' : currency.symbol
});
$('#item-price-' + item_row).trigger('focusout');
item_row++;
}
}
});
});
$(document).on('click', '.form-control.typeahead', function() {
input_id = $(this).attr('id').split('-');
item_id = parseInt(input_id[input_id.length-1]);
$(this).typeahead({
minLength: 3,
displayText:function (data) {
return data.name + ' (' + data.sku + ')';
},
source: function (query, process) {
$.ajax({
url: autocomplete_path,
type: 'GET',
dataType: 'JSON',
data: 'query=' + query + '&type=bill&currency_code=' + $('#currency_code').val(),
success: function(data) {
return process(data);
}
});
},
afterSelect: function (data) {
$('#item-id-' + item_id).val(data.item_id);
$('#item-quantity-' + item_id).val('1');
$('#item-price-' + item_id).val(data.purchase_price);
$('#item-tax-' + item_id).val(data.tax_id);
// This event Select2 Stylesheet
$('#item-price-' + item_id).trigger('focusout');
$('#item-tax-' + item_id).trigger('change');
$('#item-total-' + item_id).html(data.total);
totalItem();
}
});
});
$(document).on('click', '#tax-add-new', 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, tax_selector: '.tax-select2'},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
$(document).on('keyup', '#pre-discount', function(e){
e.preventDefault();
$('#discount').val($(this).val());
totalItem();
});
$(document).on('click', '#save-discount', function(){
$('a[rel=popover]').trigger('click');
});
$(document).on('click', '#cancel-discount', function(){
$('#discount').val('');
totalItem();
$('a[rel=popover]').trigger('click');
});
$(document).on('change', '#currency_code, #items tbody select', function(){
totalItem();
});
$(document).on('focusin', '#items .input-price', function(){
focus = true;
});
$(document).on('blur', '#items .input-price', function(){
if (focus) {
totalItem();
focus = false;
}
});
$(document).on('keyup', '#items tbody .form-control', function(){
if (!$(this).hasClass('input-price')) {
totalItem();
}
});
$(document).on('change', '#vendor_id', function (e) {
$.ajax({
url: '{{ url("expenses/vendors/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'vendor_id=' + $(this).val(),
success: function(data) {
$('#vendor_name').val(data.name);
$('#vendor_email').val(data.email);
$('#vendor_tax_number').val(data.tax_number);
$('#vendor_phone').val(data.phone);
$('#vendor_address').val(data.address);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
$('.input-price').each(function(){
input_price_id = $(this).attr('id');
input_currency_id = input_price_id.replace('price', 'currency');
$('#' + input_currency_id).val(data.currency_code);
amount = $(this).maskMoney('unmasked')[0];
$(this).maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$(this).val(amount);
$(this).trigger('focusout');
});
// This event Select2 Stylesheet
$('#currency_code').trigger('change');
}
});
});
$(document).on('click', '#button-vendor', function (e) {
$('#modal-create-vendor').remove();
$.ajax({
url: '{{ url("modals/vendors/create") }}',
type: 'GET',
dataType: 'JSON',
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: 'expense'},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
$(document).on('hidden.bs.modal', '#modal-create-tax', function () {
$('.tax-select2').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>';
}
}
});
});
function totalItem() {
$.ajax({
url: '{{ url("common/items/totalItem") }}',
type: 'POST',
dataType: 'JSON',
data: $('#currency_code, #discount input[type=\'number\'], #items input[type=\'text\'],#items input[type=\'number\'],#items input[type=\'hidden\'], #items textarea, #items select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {
$.each( data.items, function( key, value ) {
$('#item-total-' + key).html(value);
});
$('#discount-text').text(data.discount_text);
$('#sub-total').html(data.sub_total);
$('#discount-total').html(data.discount_total);
$('#tax-total').html(data.tax_total);
$('#grand-total').html(data.grand_total);
$('.input-price').each(function(){
input_price_id = $(this).attr('id');
input_currency_id = input_price_id.replace('price', 'currency');
$('#' + input_currency_id).val(data.currency_code);
amount = $(this).maskMoney('unmasked')[0];
$(this).maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$(this).val(amount);
$(this).trigger('focusout');
});
}
}
});
}
var bill_items = false;
</script>
<script src="{{ asset('public/js/expenses/bills.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,545 +3,196 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.bills', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::model($bill, ['method' => 'PATCH', 'files' => true, 'url' => ['expenses/bills', $bill->id], 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::model($bill, [
'id' => 'bill',
'method' => 'PATCH',
'route' => ['bills.update', $bill->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::selectGroup('vendor_id', trans_choice('general.vendors', 1), 'user', $vendors) }}
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $bill->contact_id, ['required' => 'required', 'change' => 'onChangeContact']) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, $bill->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
{{ Form::textGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::parse($bill->billed_at)->toDateString()) }}
{{ Form::dateGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($bill->billed_at)->toDateString()) }}
{{ Form::textGroup('due_at', trans('bills.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::parse($bill->due_at)->toDateString()) }}
{{ Form::dateGroup('due_at', trans('bills.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($bill->due_at)->toDateString()) }}
{{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file-text-o') }}
{{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file-text-o') }}
{{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }}
{{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }}
<div class="form-group col-md-12">
{!! Form::label('items', trans_choice('general.items', 2), ['class' => 'control-label']) !!}
<div class="table-responsive">
<table class="table table-bordered" id="items">
<thead>
<tr style="background-color: #f9f9f9;">
@stack('actions_th_start')
<th width="5%" class="text-center">{{ trans('general.actions') }}</th>
@stack('actions_th_end')
@stack('name_th_start')
<th width="40%" class="text-left">{{ trans('general.name') }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th width="5%" class="text-center">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th width="10%" class="text-right">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
<th width="15%" class="text-right">{{ trans_choice('general.taxes', 1) }}</th>
@stack('taxes_th_end')
@stack('total_th_start')
<th width="10%" class="text-right">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@php $item_row = 0; $tax_row = 0; @endphp
@if(old('item'))
@foreach(old('item') as $old_item)
@php $item = (object) $old_item; @endphp
<div class="col-md-12 mb-4">
{!! Form::label('items', trans_choice('general.items', 2), ['class' => 'control-label']) !!}
<div class="table-responsive">
<table class="table table-bordered" id="items">
<thead class="thead-light">
<tr class="row">
@stack('actions_th_start')
<th class="col-md-1 action-column border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
@stack('actions_th_end')
@stack('name_th_start')
<th class="col-md-3 text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="col-md-2 text-center border-right-0 border-bottom-0">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
@stack('taxes_th_end')
@stack('total_th_start')
<th class="col-md-2 text-right border-bottom-0">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@include('expenses.bills.item')
@php $item_row++; @endphp
@endforeach
@else
@foreach($bill->items as $item)
@include('expenses.bills.item')
@php $item_row++; @endphp
@endforeach
@if (empty($bill->items))
@include('expenses.bills.item')
@endif
@endif
@php $item_row++; @endphp
@stack('add_item_td_start')
<tr id="addItem">
<td class="text-center"><button type="button" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-xs btn-primary" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
<td class="text-right" colspan="5"></td>
</tr>
@stack('add_item_td_end')
@stack('sub_total_td_start')
<tr id="tr-subtotal">
<td class="text-right" colspan="5"><strong>{{ trans('bills.sub_total') }}</strong></td>
<td class="text-right"><span id="sub-total">0</span></td>
</tr>
@stack('sub_total_td_end')
@stack('add_discount_td_start')
<tr id="tr-discount">
<td class="text-right" style="vertical-align: middle;" colspan="5">
<a href="javascript:void(0)" id="discount-text" rel="popover">{{ trans('bills.add_discount') }}</a>
</td>
<td class="text-right">
<span id="discount-total"></span>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right']) !!}
</td>
</tr>
@stack('add_discount_td_end')
@stack('tax_total_td_start')
<tr id="tr-tax">
<td class="text-right" colspan="5">
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
</td>
<td class="text-right"><span id="tax-total">0</span></td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr id="tr-total">
<td class="text-right" colspan="5"><strong>{{ trans('bills.total') }}</strong></td>
<td class="text-right"><span id="grand-total">0</span></td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
@stack('add_item_td_start')
<tr class="row" id="addItem">
<td class="col-md-1 action-column border-right-0 border-bottom-0"><button type="button" @click="onAddItem" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-icon btn-outline-success btn-lg" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
<td class="col-md-11 text-right border-bottom-0"></td>
</tr>
@stack('add_item_td_end')
@stack('sub_total_td_start')
<tr class="row" id="tr-subtotal">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<strong>{{ trans('bills.sub_total') }}</strong>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="sub-total" v-html="totals.sub">0</span>
</td>
</tr>
@stack('sub_total_td_end')
@stack('add_discount_td_start')
<tr class="row" id="tr-discount">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<el-popover
popper-class="p-0 h-0"
placement="bottom"
width="300"
v-model="discount">
<div class="card">
<div class="discount card-body">
<div class="row align-items-center">
<div class="col-md-6">
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text" id="input-discount">
<i class="fa fa-percent"></i>
</span>
</div>
{!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}
</div>
</div>
<div class="col-md-6">
<div class="discount-description">
<strong>{{ trans('invoices.discount_desc') }}</strong>
</div>
</div>
</div>
</div>
<div class="discount card-footer">
<div class="row text-center">
<div class="col-md-12">
<a href="javascript:void(0)" @click="discount = false" class="btn btn-icon btn-outline-secondary">
<span class="btn-inner--icon"><i class="fas fa-times"></i></span>
<span class="btn-inner--text">{{ trans('general.cancel') }}</span>
</a>
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
</div>
</div>
</div>
</div>
<el-link slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
</el-popover>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="discount-total" v-html="totals.discount"></span>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
</td>
</tr>
@stack('add_discount_td_end')
@stack('tax_total_td_start')
<tr class="row" id="tr-tax">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="tax-total" v-html="totals.tax">0</span>
</td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr class="row" id="tr-total">
<td class="col-md-10 text-right border-right-0">
<strong>{{ trans('bills.total') }}</strong>
</td>
<td class="col-md-2 text-right">
<span id="grand-total" v-html="totals.total">0</span>
</td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
</div>
</div>
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $bill->category_id) }}
{{ Form::recurring('edit', $bill) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('contact_name', old('contact_name'), ['id' => 'contact_name', 'v-model' => 'form.contact_name']) }}
{{ Form::hidden('contact_email', old('contact_email'), ['id' => 'contact_email', 'v-model' => 'form.contact_email']) }}
{{ Form::hidden('contact_tax_number', old('contact_tax_number'), ['id' => 'contact_tax_number', 'v-model' => 'form.contact_tax_number']) }}
{{ Form::hidden('contact_phone', old('contact_phone'), ['id' => 'contact_phone', 'v-model' => 'form.contact_phone']) }}
{{ Form::hidden('contact_address', old('contact_address'), ['id' => 'contact_address', 'v-model' => 'form.contact_address']) }}
{{ Form::hidden('currency_rate', old('currency_rate', 1), ['id' => 'currency_rate', 'v-model' => 'form.contact_rate']) }}
{{ Form::hidden('bill_status_code', old('bill_status_code', 'draft'), ['id' => 'bill_status_code', 'v-model' => 'form.bill_status_code']) }}
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
</div>
</div>
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories) }}
{{ Form::recurring('edit', $bill) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('vendor_name', old('customer_name', null), ['id' => 'vendor_name']) }}
{{ Form::hidden('vendor_email', old('vendor_email', null), ['id' => 'vendor_email']) }}
{{ Form::hidden('vendor_tax_number', old('vendor_tax_number', null), ['id' => 'vendor_tax_number']) }}
{{ Form::hidden('vendor_phone', old('vendor_phone', null), ['id' => 'vendor_phone']) }}
{{ Form::hidden('vendor_address', old('vendor_address', null), ['id' => 'vendor_address']) }}
{{ Form::hidden('currency_rate', old('currency_rate', null), ['id' => 'currency_rate']) }}
{{ Form::hidden('bill_status_code', old('bill_status_code', null), ['id' => 'bill_status_code']) }}
{{ Form::hidden('amount', old('amount', null), ['id' => 'amount']) }}
</div>
<!-- /.box-body -->
@permission('update-expenses-bills')
<div class="box-footer">
{{ Form::saveButtons('expenses/bills') }}
</div>
<!-- /.box-footer -->
@endpermission
@permission('update-expenses-bills')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('expenses/bills') }}
</div>
</div>
@endpermission
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.1/bootstrap3-typeahead.min.js"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
@endpush
@push('scripts')
@push('scripts_start')
<script type="text/javascript">
var focus = false;
var item_row = '{{ $item_row }}';
var autocomplete_path = "{{ url('common/items/autocomplete') }}";
$(document).ready(function() {
$('#vendor_id').trigger('change');
itemTableResize();
$('.input-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
});
$('.input-price').trigger('focusout');
totalItem();
//Date picker
$('#billed_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
//Date picker
$('#due_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$('.tax-select2').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>';
}
}
});
$('#vendor_id').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)]) }}"
});
$('#currency_code').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
$('#category_id').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
// Discount popover
$('a[rel=popover]').popover({
html: true,
placement: 'bottom',
title: '{{ trans('bills.discount') }}',
content: function () {
html = '<div class="discount box-body">';
html += ' <div class="col-md-6">';
html += ' <div class="input-group" id="input-discount">';
html += ' {!! Form::number('pre-discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}';
html += ' <div class="input-group-addon"><i class="fa fa-percent"></i></div>';
html += ' </div>';
html += ' </div>';
html += ' <div class="col-md-6">';
html += ' <div class="discount-description">';
html += ' {{ trans('bills.discount_desc') }}';
html += ' </div>';
html += ' </div>';
html += '</div>';
html += '<div class="discount box-footer">';
html += ' <div class="col-md-12">';
html += ' <div class="form-group no-margin">';
html += ' {!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount','class' => 'btn btn-success']) !!}';
html += ' <a href="javascript:void(0)" id="cancel-discount" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</a>';
html += ' </div>';
html += ' </div>';
html += '</div>';
return html;
}
});
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
@if($bill->attachment)
placeholder : '{{ $bill->attachment->basename }}'
@else
placeholder : '{{ trans('general.form.no_file_selected') }}'
@endif
});
@if($bill->attachment)
$.ajax({
url: '{{ url('uploads/' . $bill->attachment->id . '/show') }}',
type: 'GET',
data: {column_name: 'attachment'},
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$('.fancy-file').after(json['html']);
}
}
});
@endif
@if(old('item'))
totalItem();
@endif
});
@permission('delete-common-uploads')
@if($bill->attachment)
$(document).on('click', '#remove-attachment', function (e) {
confirmDelete("#attachment-{!! $bill->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $bill->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endif
@endpermission
$(document).on('click', '#button-add-item', function (e) {
$.ajax({
url: '{{ url("expenses/bills/addItem") }}',
type: 'GET',
dataType: 'JSON',
data: {item_row: item_row, currency_code : $('#currency_code').val()},
success: function(json) {
if (json['success']) {
$('#items tbody #addItem').before(json['html']);
//$('[rel=tooltip]').tooltip();
$('[data-toggle="tooltip"]').tooltip('hide');
$('#item-row-' + item_row + ' .tax-select2').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"> {{ trans('general.title.new', ['type' => trans_choice('general.tax_rates', 1)]) }}</span>';
}
}
});
var currency = json['data']['currency'];
$('#item-price-' + item_row).maskMoney({
thousands : currency.thousands_separator,
decimal : currency.decimal_mark,
precision : currency.precision,
allowZero : true,
prefix : (currency.symbol_first) ? currency.symbol : '',
suffix : (currency.symbol_first) ? '' : currency.symbol
});
$('#item-price-' + item_row).trigger('focusout');
item_row++;
}
}
});
});
$(document).on('click', '.form-control.typeahead', function() {
input_id = $(this).attr('id').split('-');
item_id = parseInt(input_id[input_id.length-1]);
$(this).typeahead({
minLength: 3,
displayText:function (data) {
return data.name + ' (' + data.sku + ')';
},
source: function (query, process) {
$.ajax({
url: autocomplete_path,
type: 'GET',
dataType: 'JSON',
data: 'query=' + query + '&type=bill&currency_code=' + $('#currency_code').val(),
success: function(data) {
return process(data);
}
});
},
afterSelect: function (data) {
$('#item-id-' + item_id).val(data.item_id);
$('#item-quantity-' + item_id).val('1');
$('#item-price-' + item_id).val(data.purchase_price);
$('#item-tax-' + item_id).val(data.tax_id);
// This event Select2 Stylesheet
$('#item-price-' + item_id).trigger('focusout');
$('#item-tax-' + item_id).trigger('change');
$('#item-total-' + item_id).html(data.total);
totalItem();
}
});
});
$(document).on('click', '#tax-add-new', 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, tax_selector: '.tax-select2'},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
$(document).on('keyup', '#pre-discount', function(e){
e.preventDefault();
$('#discount').val($(this).val());
totalItem();
});
$(document).on('click', '#save-discount', function(){
$('a[rel=popover]').trigger('click');
});
$(document).on('click', '#cancel-discount', function(){
$('#discount').val('');
totalItem();
$('a[rel=popover]').trigger('click');
});
$(document).on('change', '#currency_code, #items tbody select', function(){
totalItem();
});
$(document).on('focusin', '#items .input-price', function(){
focus = true;
});
$(document).on('blur', '#items .input-price', function(){
if (focus) {
totalItem();
focus = false;
}
});
$(document).on('keyup', '#items tbody .form-control', function(){
if (!$(this).hasClass('input-price')) {
totalItem();
}
});
$(document).on('change', '#vendor_id', function (e) {
$.ajax({
url: '{{ url("expenses/vendors/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'vendor_id=' + $(this).val(),
success: function(data) {
$('#vendor_name').val(data.name);
$('#vendor_email').val(data.email);
$('#vendor_tax_number').val(data.tax_number);
$('#vendor_phone').val(data.phone);
$('#vendor_address').val(data.address);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
$('.input-price').each(function(){
input_price_id = $(this).attr('id');
input_currency_id = input_price_id.replace('price', 'currency');
$('#' + input_currency_id).val(data.currency_code);
amount = $(this).maskMoney('unmasked')[0];
$(this).maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$(this).val(amount);
$(this).trigger('focusout');
});
// This event Select2 Stylesheet
$('#currency_code').trigger('change');
}
});
});
$(document).on('hidden.bs.modal', '#modal-create-tax', function () {
$('.tax-select2').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>';
}
}
});
});
function totalItem() {
$.ajax({
url: '{{ url("common/items/totalItem") }}',
type: 'POST',
dataType: 'JSON',
data: $('#currency_code, #discount input[type=\'number\'], #items input[type=\'text\'], #items input[type=\'number\'], #items input[type=\'hidden\'], #items textarea, #items select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {
$.each( data.items, function( key, value ) {
$('#item-total-' + key).html(value);
});
$('#discount-text').text(data.discount_text);
$('#sub-total').html(data.sub_total);
$('#discount-total').html(data.discount_total);
$('#tax-total').html(data.tax_total);
$('#grand-total').html(data.grand_total);
$('.input-price').each(function(){
input_price_id = $(this).attr('id');
input_currency_id = input_price_id.replace('price', 'currency');
$('#' + input_currency_id).val(data.currency_code);
amount = $(this).maskMoney('unmasked')[0];
$(this).maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$(this).val(amount);
$(this).trigger('focusout');
});
}
}
});
}
var bill_items = {!! json_encode($bill->items()->select(['item_id', 'name', 'quantity', 'price', 'total', 'tax'])->get()) !!};
</script>
<script src="{{ asset('public/js/expenses/bills.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,127 +3,98 @@
@section('title', trans_choice('general.bills', 2))
@section('new_button')
@permission('create-expenses-bills')
<span class="new-button"><a href="{{ url('expenses/bills/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/expenses/bills') }}" class="btn btn-default btn-sm"><span class="fa fa-download"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('bills.export', request()->input()) }}" class="btn btn-default btn-sm"><span class="fa fa-upload"></span> &nbsp;{{ trans('general.export') }}</a></span>
@permission('create-expenses-bills')
<span><a href="{{ route('bills.create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/expenses/bills') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('bills.export', request()->input()) }}" class="btn btn-white btn-sm header-button-bottom"><span class="fa fa-download"></span> &nbsp;{{ trans('general.export') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'expenses/bills', '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('vendors[]', $vendors, request('vendors'), ['id' => 'filter-vendors', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::dateRange('bill_date', trans('bills.bill_date'), 'calendar', []) !!}
{!! Form::select('statuses[]', $statuses, request('statuses'), ['id' => 'filter-statuses', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . 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([
'url' => 'expenses/bills',
'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-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-bills">
<thead>
<tr>
<th class="col-md-2">@sortablelink('bill_number', trans_choice('general.numbers', 1))</th>
<th class="col-md-2">@sortablelink('vendor_name', trans_choice('general.vendors', 1))</th>
<th class="col-md-2 text-right amount-space">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2">@sortablelink('billed_at', trans('bills.bill_date'))</th>
<th class="col-md-2">@sortablelink('due_at', trans('bills.due_date'))</th>
<th class="col-md-1">@sortablelink('bill_status_code', trans_choice('general.statuses', 1))</th>
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
{{ Form::bulkActionRowGroup('general.bills', $bulk_actions, 'expenses/bills') }}
{!! 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-sm-2 col-md-2 col-lg-1 col-xl-1 hidden-sm">@sortablelink('bill_number', trans_choice('general.numbers', 1), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2">@sortablelink('contact_name', trans_choice('general.vendors', 1))</th>
<th class="col-md-2 col-lg-2 col-xl-2 hidden-md text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-lg-2 col-xl-2 hidden-lg">@sortablelink('billed_at', trans('bills.bill_date'))</th>
<th class="col-lg-2 col-xl-2 hidden-lg">@sortablelink('due_at', trans('bills.due_date'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">@sortablelink('bill_status_code', trans_choice('general.statuses', 1))</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($bills as $item)
@php $paid = $item->paid; @endphp
<tr>
<td><a href="{{ url('expenses/bills/' . $item->id . ' ') }}">{{ $item->bill_number }}</a></td>
<td>{{ $item->vendor_name }}</td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td>{{ Date::parse($item->billed_at)->format($date_format) }}</td>
<td>{{ Date::parse($item->due_at)->format($date_format) }}</td>
<td><span class="label {{ $item->status->label }}">{{ trans('bills.status.' . $item->status->code) }}</span></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="{{ url('expenses/bills/' . $item->id) }}">{{ trans('general.show') }}</a></li>
@if (!$item->reconciled)
<li><a href="{{ url('expenses/bills/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@endif
@permission('create-expenses-bills')
<li class="divider"></li>
<li><a href="{{ url('expenses/bills/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-expenses-bills')
@if (!$item->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'expenses/bills') !!}</li>
@endif
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
@foreach($bills as $item)
@php $paid = $item->paid; @endphp
<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->bill_number) }}</td>
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 hidden-sm"><a class="col-aka text-success" href="{{ route('bills.show', $item->id) }}">{{ $item->bill_number }}</a></td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2">{{ $item->contact_name }}</td>
<td class="col-md-2 col-lg-2 col-xl-2 hidden-md text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-lg-2 col-xl-2 hidden-lg">@date($item->billed_at)</td>
<td class="col-lg-2 col-xl-2 hidden-lg">@date($item->due_at)</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">
<span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('bills.status.' . $item->status->code) }}</span>
</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">
<a class="dropdown-item" href="{{ route('bills.show', $item->id) }}">{{ trans('general.show') }}</a>
@if (!$item->reconciled)
<a class="dropdown-item" href="{{ route('bills.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@endif
<div class="dropdown-divider"></div>
@permission('create-expenses-bills')
<a class="dropdown-item" href="{{ route('bills.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
@endpermission
@permission('delete-expenses-bills')
<div class="dropdown-divider"></div>
@if (!$item->reconciled)
{!! Form::deleteLink($item, 'expenses/bills') !!}
@endif
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $bills, 'type' => 'bills'])
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $bills, 'type' => 'bills'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@push('scripts_start')
<script src="{{ asset('public/js/expenses/bills.js?v=' . version('short')) }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-categories").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#filter-vendors").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)]) }}"
});
$("#filter-statuses").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.statuses', 1)]) }}"
});
});
</script>
@endpush

View File

@ -1,54 +1,121 @@
<tr id="item-row-{{ $item_row }}">
<tr class="row" v-for="(row, index) in form.items"
:index="index">
@stack('actions_td_start')
<td class="text-center" style="vertical-align: middle;">
@stack('actions_button_start')
<button type="button" onclick="$(this).tooltip('destroy'); $('#item-row-{{ $item_row }}').remove(); totalItem();" data-toggle="tooltip" title="{{ trans('general.delete') }}" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i></button>
@stack('actions_button_end')
</td>
<td class="col-md-1 action-column border-right-0 border-bottom-0">
@stack('actions_button_start')
<button type="button"
@click="onDeleteItem(index)"
data-toggle="tooltip"
title="{{ trans('general.delete') }}"
class="btn btn-icon btn-outline-danger btn-lg"><i class="fa fa-trash"></i>
</button>
@stack('actions_button_end')
</td>
@stack('actions_td_end')
@stack('name_td_start')
<td {!! $errors->has('item.' . $item_row . '.name') ? 'class="has-error"' : '' !!}>
@stack('name_input_start')
<input value="{{ empty($item) ? '' : $item->name }}" class="form-control typeahead" required="required" placeholder="{{ trans('general.form.enter', ['field' => trans_choice('bills.item_name', 1)]) }}" name="item[{{ $item_row }}][name]" type="text" id="item-name-{{ $item_row }}" autocomplete="off">
<input value="{{ empty($item) ? '' : $item->item_id }}" name="item[{{ $item_row }}][item_id]" type="hidden" id="item-id-{{ $item_row }}">
{!! $errors->first('item.' . $item_row . '.name', '<p class="help-block">:message</p>') !!}
@stack('name_input_end')
</td>
<td class="col-md-3 border-right-0 border-bottom-0">
@stack('name_input_start')
<input class="form-control"
data-item="name"
required="required"
name="items[][name]"
v-model="row.name"
@input="onGetItem($event, index)"
type="text"
autocomplete="off">
<div class="dropdown-menu item-show dropdown-menu-center" ref="menu" :class="[{show: row.show}]">
<div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" v-for="(item, item_index) in items" @click="onSelectItem(item, index)">
<div class="row align-items-center">
<div class="col ml--2">
<div class="d-flex justify-content-between align-items-center">
<div>
<div class="name" v-text="item.name"></div>
</div>
</div>
</div>
</div>
</a>
</div>
</div>
<input name="items[][show]"
value="false"
v-model="row.show"
data-item="show"
type="hidden">
<input name="items[][item_id]"
v-model="row.item_id"
data-item="item_id"
type="hidden">
{!! $errors->first('item.name', '<p class="help-block">:message</p>') !!}
@stack('name_input_end')
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td {{ $errors->has('item.' . $item_row . '.quantity') ? 'class="has-error"' : '' }}>
@stack('quantity_input_start')
<input value="{{ empty($item) ? 1 : $item->quantity }}" class="form-control text-center" required="required" name="item[{{ $item_row }}][quantity]" type="text" id="item-quantity-{{ $item_row }}">
{!! $errors->first('item.' . $item_row . '.quantity', '<p class="help-block">:message</p>') !!}
@stack('quantity_input_end')
</td>
<td class="col-md-2 border-right-0 border-bottom-0">
@stack('quantity_input_start')
<input class="form-control text-center"
required="required"
data-item="quantity"
v-model="row.quantity"
@input="onCalculateTotal"
name="item[][quantity]"
type="text">
{!! $errors->first('item.quantity', '<p class="help-block">:message</p>') !!}
@stack('quantity_input_end')
</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td {{ $errors->has('item.' . $item_row . 'price') ? 'class="has-error"' : '' }}>
@stack('price_input_start')
<input value="{{ empty($item) ? '' : $item->price }}" class="form-control text-right input-price" required="required" name="item[{{ $item_row }}][price]" type="text" id="item-price-{{ $item_row }}">
<input value="{{ $currency->code }}" name="item[{{ $item_row }}][currency]" type="hidden" id="item-currency-{{ $item_row }}">
{!! $errors->first('item.' . $item_row . 'price', '<p class="help-block">:message</p>') !!}
@stack('price_input_end')
</td>
<td class="col-md-2 border-right-0 border-bottom-0">
@stack('price_input_start')
<input class="form-control text-right input-price"
required="required"
data-item="price"
v-model.lazy="row.price"
v-money="money"
@input="onCalculateTotal"
name="items[][price]"
type="text">
<input name="items[][currency]"
data-item="currency"
v-model="row.currency"
@input="onCalculateTotal"
type="hidden">
{!! $errors->first('item.price', '<p class="help-block">:message</p>') !!}
@stack('price_input_end')
</td>
@stack('price_td_end')
@stack('taxes_td_start')
<td {{ $errors->has('item.' . $item_row . '.tax_id') ? 'class="has-error"' : '' }}>
@stack('tax_id_input_start')
{!! Form::select('item[' . $item_row . '][tax_id][]', $taxes, (empty($item) || empty($item->taxes)) ? setting('general.default_tax') : $item->taxes->pluck('tax_id'), ['id'=> 'item-tax-' . $item_row, 'class' => 'form-control tax-select2', 'multiple' => 'true']) !!}
{!! $errors->first('item.' . $item_row . '.tax_id', '<p class="help-block">:message</p>') !!}
@stack('tax_id_input_end')
</td>
<td class="col-md-2 border-right-0 border-bottom-0">
@stack('tax_id_input_start')
{{ Form::multiSelectAddNewGroup('tax_id', '', '', $taxes, '', [
'data-item' => 'tax_id',
'v-model' => 'row.tax_id',
'change' => 'onCalculateTotal',
'class' => 'form-control'
], 'mb-0 select-tax') }}
@stack('tax_id_input_end')
</td>
@stack('taxes_td_end')
@stack('total_td_start')
<td class="text-right" style="vertical-align: middle;">
@stack('total_input_start')
@if (empty($item) || !isset($item->total))
<span id="item-total-{{ $item_row }}">0</span>
@else
<span id="item-total-{{ $item_row }}">@money($item->total, $bill->currency_code, true)</span>
@endif
@stack('total_input_end')
</td>
<td class="col-md-2 text-right total-column border-bottom-0">
<input name="item[][total]"
data-item="total"
v-model.lazy="row.total"
v-money="money"
type="hidden">
@stack('total_input_start')
@if (empty($item) || !isset($item->total))
<span id="item-total" v-html="row.total">0</span>
@else
<span id="item-total" v-html="row.total">@money($item->total, $bill->currency_code, true)</span>
@endif
@stack('total_input_end')
</td>
@stack('total_td_end')
</tr>

File diff suppressed because it is too large Load Diff

View File

@ -3,207 +3,58 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.payments', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'expenses/payments', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'payments.store',
'id' => 'payment',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button needs-validation',
'novalidate' => 'true'
]) !!}
<div class="box-body">
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar',['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
<div class="card-body">
<div class="row">
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', '', ['id' => 'currency_rate']) !!}
{!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', '1', ['id' => 'currency_rate']) !!}
{{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], 0) }}
@stack('account_id_input_start')
<div class="form-group col-md-6 form-small">
{!! Form::label('account_id', trans_choice('general.accounts', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-university"></i></div>
{!! Form::select('account_id', $accounts, setting('general.default_account'), array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
<div class="input-group-append">
{!! Form::text('currency', $account_currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
</div>
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, setting('default.vendor'), []) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), ['required' => 'required']) }}
{{ Form::recurring('create') }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::selectGroup('document_id', trans_choice('general.bills', 1), 'file-invoice', [], null, ['disabled']) }}
</div>
</div>
@stack('account_id_input_end')
@stack('vendor_id_input_start')
<div class="form-group col-md-6">
{!! Form::label('vendor_id', trans_choice('general.vendors', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-user"></i></div>
{!! Form::select('vendor_id', $vendors, null, array_merge(['id' => 'vendor_id', 'class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)])])) !!}
<span class="input-group-btn">
<button type="button" id="button-vendor" class="btn btn-default btn-icon"><i class="fa fa-plus"></i></button>
</span>
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('expenses/payments') }}
</div>
</div>
@stack('vendor_id_input_end')
{{ Form::textareaGroup('description', trans('general.description')) }}
@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>
</div>
</div>
{!! $errors->first('category_id', '<p class="help-block">:message</p>') !!}
</div>
@stack('category_id_input_end')
{{ Form::recurring('create') }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('general.default_payment_method')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o',[]) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('expenses/payments') }}
</div>
<!-- /.box-footer -->
{{ Form::hidden('type', 'expense') }}
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
<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('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.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">
$(document).ready(function(){
$("#amount").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
});
$('#amount').trigger('focus');
$('#account_id').trigger('change');
//Date picker
$('#paid_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$("#account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#category_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#vendor_id").select2({
placeholder: {
id: '-1', // the value of the option
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)]) }}"
}
});
$("#payment_method").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
});
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '{{ trans('general.form.no_file_selected') }}'
});
});
$(document).on('change', '#account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('#currency').val(data.currency_code);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
amount = $('#amount').maskMoney('unmasked')[0];
$("#amount").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#amount').val(amount);
$('#amount').trigger('focus');
}
});
});
$(document).on('click', '#button-vendor', function (e) {
$('#modal-create-vendor').remove();
$.ajax({
url: '{{ url("modals/vendors/create") }}',
type: 'GET',
dataType: 'JSON',
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: 'expense'},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/expenses/payments.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -15,183 +15,62 @@
</div>
@endif
<!-- Default box -->
<div class="box box-success">
<div class="card">
{!! Form::model($payment, [
'method' => 'PATCH',
'files' => true,
'url' => ['expenses/payments', $payment->id],
'route' => ['payments.update', $payment->id],
'role' => 'form',
'class' => 'form-loading-button'
'id' => 'payment',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'class' => 'form-loading-button',
'novalidate' => 'true'
]) !!}
<div class="box-body">
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::parse($payment->paid_at)->toDateString()) }}
<div class="card-body">
<div class="row">
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($payment->paid_at)->toDateString()) }}
{!! Form::hidden('currency_code', $payment->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
{!! Form::hidden('currency_code', $payment->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
{{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], $payment->amount) }}
@stack('account_id_input_start')
<div class="form-group col-md-6 form-small">
{!! Form::label('account_id', trans_choice('general.accounts', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-university"></i></div>
{!! Form::select('account_id', $accounts, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
<div class="input-group-append">
{!! Form::text('currency', $payment->currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
</div>
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $payment->account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, []) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required']) }}
{{ Form::recurring('edit', $payment) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $payment->payment_method) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
@if ($payment->bill)
{{ Form::textGroup('document_id', trans_choice('general.bills', 1), 'file-invoice', ['disabled'], $payment->bill->bill_number) }}
@endif
</div>
</div>
@stack('account_id_input_end')
{{ Form::selectGroup('vendor_id', trans_choice('general.vendors', 1), 'user', $vendors, null, []) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories) }}
{{ Form::recurring('edit', $payment) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o',[]) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
</div>
<!-- /.box-body -->
@permission('update-expenses-payments')
<div class="box-footer">
{{ Form::saveButtons('expenses/payments') }}
</div>
<!-- /.box-footer -->
@endpermission
@permission('update-expenses-payments')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('expenses/payments') }}
</div>
</div>
@endpermission
{{ Form::hidden('type', 'expense') }}
{!! Form::close() !!}
</div>
{!! Form::close() !!}
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#amount").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
});
$('#amount').trigger('focus');
$('#account_id').trigger('change');
//Date picker
$('#paid_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$("#account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#category_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#vendor_id").select2({
placeholder: {
id: '-1', // the value of the option
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)]) }}"
}
});
$("#payment_method").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
});
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
@if($payment->attachment)
placeholder : '{{ $payment->attachment->basename }}'
@else
placeholder : '{{ trans('general.form.no_file_selected') }}'
@endif
});
@if($payment->attachment)
$.ajax({
url: '{{ url('uploads/' . $payment->attachment->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-{!! $payment->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $payment->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endpermission
@endif
});
$(document).on('change', '#account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('#currency').val(data.currency_code);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
amount = $('#amount').maskMoney('unmasked')[0];
$("#amount").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#amount').val(amount);
$('#amount').trigger('focus');
}
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/expenses/payments.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,128 +3,105 @@
@section('title', trans_choice('general.payments', 2))
@section('new_button')
@permission('create-expenses-payments')
<span class="new-button"><a href="{{ url('expenses/payments/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/expenses/payments') }}" class="btn btn-default btn-sm"><span class="fa fa-download"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('payments.export', request()->input()) }}" class="btn btn-default btn-sm"><span class="fa fa-upload"></span> &nbsp;{{ trans('general.export') }}</a></span>
@permission('create-expenses-payments')
<span><a href="{{ route('payments.create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/expenses/payments') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('payments.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> &nbsp;{{ trans('general.export') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'expenses/payments', '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::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::select('vendors[]', $vendors, request('vendors'), ['id' => 'filter-vendors', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . 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>
<div class="card">
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
{!! Form::open([
'url' => 'expenses/payments',
'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-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-payments">
<thead>
<tr>
<th class="col-md-2">@sortablelink('paid_at', trans('general.date'))</th>
<th class="col-md-2 text-right amount-space">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-3 hidden-xs">@sortablelink('vendor.name', trans_choice('general.vendors', 1))</th>
<th class="col-md-2 hidden-xs">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-md-2 hidden-xs">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
{{ Form::bulkActionRowGroup('general.payments', $bulk_actions, 'expenses/payments') }}
{!! 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-2 col-lg-1 col-xl-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3">@sortablelink('paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2 col-lg-2 col-xl-3 hidden-md">@sortablelink('contact.name', trans_choice('general.vendors', 1))</th>
<th class="col-lg-2 col-xl-2 hidden-lg">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-lg-2 col-xl-1 hidden-lg">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
</tr>
</thead>
<tbody>
@foreach($payments as $item)
@php $is_transfer = ($item->category && ($item->category->id == $transfer_cat_id)); @endphp
<tr>
@if ($item->reconciled)
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
@else
<td><a href="{{ url('expenses/payments/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
@endif
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td class="hidden-xs">{{ !empty($item->vendor->name) ? $item->vendor->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->account ? $item->account->name : trans('general.na') }}</td>
<td class="text-center">
@if (!$is_transfer)
<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">
@if (!$item->reconciled)
<li><a href="{{ url('expenses/payments/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
<li class="divider"></li>
@endif
@permission('create-expenses-payments')
<li><a href="{{ url('expenses/payments/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-expenses-payments')
@if (!$item->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'expenses/payments') !!}</li>
@endif
@endpermission
</ul>
</div>
@foreach($payments as $item)
@php $is_transfer = ($item->category && ($item->category->id == $transfer_cat_id)); @endphp
<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->contact->name) }}</td>
@if ($item->reconciled)
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3">@date($item->paid_at)</td>
@else
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3"><a class="col-aka text-success " href="{{ route('payments.edit', $item->id) }}">@date($item->paid_at)</a></td>
@endif
</td>
</tr>
@endforeach
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-2 col-xl-3 hidden-md">{{ !empty($item->contact->name) ? $item->contact->name : trans('general.na') }}</td>
<td class="col-lg-2 col-xl-2 hidden-lg">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="col-lg-2 col-xl-1 hidden-lg">{{ $item->account ? $item->account->name : trans('general.na') }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
@if (!$is_transfer)
<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->reconciled)
<a class="dropdown-item" href="{{ route('payments.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@endif
@permission('create-expenses-payments')
<a class="dropdown-item" href="{{ route('payments.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
@endpermission
@permission('delete-expenses-payments')
@if (!$item->reconciled)
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'expenses/payments') !!}
@endif
@endpermission
</div>
</div>
@else
<div class="dropdown">
<button class="btn btn-white btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="tooltip" aria-haspopup="true" aria-expanded="false" title="This Transfer, If you want to action redirect">
<i class="fa fa-exchange-alt text-muted"></i>
</button>
</div>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $payments, 'type' => 'payments'])
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $payments, 'type' => 'payments'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-categories").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#filter-vendors").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)]) }}"
});
$("#filter-accounts").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/expenses/payments.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,70 +3,53 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.vendors', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'expenses/vendors', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'vendors.store',
'id' => 'vendor',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button needs-validation',
'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'), 'user') }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency')) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
{{ Form::textGroup('website', trans('general.website'), 'globe', []) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::fileGroup('logo', trans_choice('general.pictures', 1)) }}
{{ Form::fileGroup('logo', trans_choice('general.pictures', 1)) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('expenses/vendors') }}
</div>
<!-- /.box-footer -->
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('expenses/vendors') }}
</div>
</div>
{{ Form::hidden('type', 'vendor') }}
{!! 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');
$('#name').focus();
$("#currency_code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
$('#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/expenses/vendors.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,97 +3,56 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.vendors', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="card">
{!! Form::model($vendor, [
'id' => 'vendor',
'method' => 'PATCH',
'route' => ['vendors.update', $vendor->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'url' => ['expenses/vendors', $vendor->id],
'role' => 'form',
'class' => 'form-loading-button'
'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'), 'user') }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $vendor->currency_code) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::fileGroup('logo', trans_choice('general.logos', 1)) }}
{{ Form::fileGroup('logo', trans_choice('general.logos', 1)) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
</div>
</div>
<!-- /.box-body -->
@permission('update-expenses-vendors')
<div class="card-footer">
<div class="float-right">
{{ Form::saveButtons('expenses/vendors') }}
</div>
</div>
@endpermission
@permission('update-expenses-vendors')
<div class="box-footer">
{{ Form::saveButtons('expenses/vendors') }}
</div>
<!-- /.box-footer -->
@endpermission
{{ Form::hidden('type', 'vendor') }}
{!! 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(){
$("#currency_code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
$('#logo').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
@if($vendor->logo)
placeholder : '{{ $vendor->logo->basename }}'
@else
placeholder : '{{ trans('general.form.no_file_selected') }}'
@endif
});
@if($vendor->logo)
$.ajax({
url: '{{ url('uploads/' . $vendor->logo->id . '/show') }}',
type: 'GET',
data: {column_name: 'logo'},
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$('.fancy-file').after(json['html']);
}
}
});
@permission('delete-common-uploads')
$(document).on('click', '#remove-logo', function (e) {
confirmDelete("#logo-{!! $vendor->logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $vendor->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/expenses/vendors.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,95 +3,109 @@
@section('title', trans_choice('general.vendors', 2))
@section('new_button')
@permission('create-expenses-vendors')
<span class="new-button"><a href="{{ url('expenses/vendors/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/expenses/vendors') }}" class="btn btn-default btn-sm"><span class="fa fa-download"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('vendors.export', request()->input()) }}" class="btn btn-default btn-sm"><span class="fa fa-upload"></span> &nbsp;{{ trans('general.export') }}</a></span>
@permission('create-expenses-vendors')
<span><a href="{{ route('vendors.create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/expenses/vendors') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('vendors.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> &nbsp;{{ trans('general.export') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'expenses/vendors', '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> &nbsp;' . 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([
'url' => 'expenses/vendors',
'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-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-vendors">
<thead>
<tr>
<th class="col-md-3">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-3 hidden-xs">@sortablelink('email', trans('general.email'))</th>
<th class="col-md-2">@sortablelink('phone', trans('general.phone'))</th>
<th class="col-md-2 hidden-xs">@sortablelink('unpaid', trans('general.unpaid'))</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.vendors', $bulk_actions, 'expenses/vendors') }}
{!! 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-3 col-md-3 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-2 col-lg-2 col-xl-2 hidden-md">@sortablelink('email', trans('general.email'))</th>
<th class="col-sm-3 col-md-2 col-lg-2 col-xl-2 hidden-sm">@sortablelink('phone', trans('general.phone'))</th>
<th class="col-lg-2 col-xl-2 text-right hidden-lg">@sortablelink('unpaid', trans('general.unpaid'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">@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($vendors as $item)
<tr>
<td><a href="{{ url('expenses/vendors/' . $item->id) }}">{{ $item->name }}</a></td>
<td class="hidden-xs">{{ !empty($item->email) ? $item->email : trans('general.na') }}</td>
<td>{{ $item->phone }}</td>
<td>@money($item->unpaid, 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="{{ url('expenses/vendors/' . $item->id) }}">{{ trans('general.show') }}</a></li>
@permission('read-reports-expense-summary')
<li><a href="{{ url('reports/expense-summary?vendors[]=' . $item->id) }}">{{ trans_choice('general.reports', 1) }}</a></li>
@endpermission
<li><a href="{{ url('expenses/vendors/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>@if ($item->enabled)
<li><a href="{{ route('vendors.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
@foreach($vendors 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-3 col-md-3 col-lg-3 col-xl-3">
<a class="col-aka text-success " href="{{ route('vendors.show', $item->id) }}">{{ $item->name }}</a>
</td>
<td class="col-md-2 col-lg-2 col-xl-2 hidden-md o-y">
{{ !empty($item->email) ? $item->email : trans('general.na') }}
</td>
<td class="col-sm-3 col-md-2 col-lg-2 col-xl-2 hidden-sm o-y">
{{ $item->phone }}
</td>
<td class="col-lg-2 col-xl-2 text-right hidden-lg o-y">
@money($item->unpaid, setting('default.currency'), true)
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">
@if (user()->can('update-expenses-vendors'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
@else
<li><a href="{{ route('vendors.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
@endif
@permission('create-expenses-vendors')
<li class="divider"></li>
<li><a href="{{ url('expenses/vendors/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-expenses-vendors')
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'expenses/vendors') !!}</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">
<a class="dropdown-item" href="{{ route('vendors.show', $item->id) }}">{{ trans('general.show') }}</a>
<a class="dropdown-item" href="{{ route('vendors.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@permission('create-expenses-vendors')
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ route('vendors.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
@endpermission
@permission('delete-expenses-vendors')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'expenses/vendors') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $vendors, 'type' => 'vendors'])
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $vendors, 'type' => 'vendors'])
</div>
</div>
<!-- /.box-footer -->
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/expenses/vendors.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -4,211 +4,183 @@
@section('content')
<div class="row">
<div class="col-md-3">
<!-- Stats -->
<div class="box box-success">
<div class="box-body box-profile">
<ul class="list-group list-group-unbordered">
<li class="list-group-item" style="border-top: 0;">
<b>{{ trans_choice('general.bills', 2) }}</b> <a class="pull-right">{{ $counts['bills'] }}</a>
</li>
<li class="list-group-item">
<b>{{ trans_choice('general.payments', 2) }}</b> <a class="pull-right">{{ $counts['payments'] }}</a>
</li>
</ul>
<div class="col-xl-3">
<div class="card">
<div class="card-header border-bottom-0 show-transaction-card-header">
<a class="text-sm">{{ trans_choice('general.bills', 2) }}</a> <a class="float-right text-xs">{{ $counts['bills'] }}</a>
</div>
<div class="card-footer show-transaction-card-footer">
<a class="text-sm">{{ trans_choice('general.transactions', 2) }}</a> <a class="float-right text-xs">{{ $counts['transactions'] }}</a>
</div>
<!-- /.box-body -->
</div>
<!-- Profile -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('auth.profile') }}</h3>
<div class="card">
<div class="card-header">
<h4 class="mb-0">{{ trans('auth.profile') }}</h4>
</div>
<div class="box-body box-profile">
<ul class="list-group list-group-unbordered">
<li class="list-group-item" style="border-top: 0;">
<b>{{ trans('general.email') }}</b> <a class="pull-right">{{ $vendor->email }}</a>
</li>
<li class="list-group-item">
<b>{{ trans('general.phone') }}</b> <a class="pull-right">{{ $vendor->phone }}</a>
</li>
<li class="list-group-item">
<b>{{ trans('general.website') }}</b> <a class="pull-right">{{ $vendor->website }}</a>
</li>
<li class="list-group-item">
<b>{{ trans('general.tax_number') }}</b> <a class="pull-right">{{ $vendor->tax_number }}</a>
</li>
@if ($vendor->refence)
<li class="list-group-item">
<b>{{ trans('general.reference') }}</b> <a class="pull-right">{{ $vendor->refence }}</a>
</li>
@endif
</ul>
<div class="card-body d-grid">
<a class="text-sm font-weight-600">{{ trans('general.email') }}</a> <a class="text-xs o-y">{{ $vendor->email }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.phone') }}</a> <a class="text-xs o-y">{{ $vendor->phone }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.website') }}</a> <a class="text-xs o-y">{{ $vendor->website }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.tax_number') }}</a> <a class="text-xs o-y">{{ $vendor->tax_number }}</a>
@if ($vendor->reference)
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.reference') }}</a> <a class="text-xs o-y">{{ $vendor->reference }}</a>
@endif
</div>
<!-- /.box-body -->
</div>
<!-- Address Box -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('general.address') }}</h3>
<div class="card">
<div class="card-header">
<h4 class="mb-0">{{ trans('general.address') }}</h4>
</div>
<!-- /.box-header -->
<div class="box-body">
<p class="text-muted">
<div class="card-body">
<a class="text-xs m-0">
{{ $vendor->address }}
</p>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<!-- Edit -->
<div>
<a href="{{ url('expenses/vendors/' . $vendor->id . '/edit') }}" class="btn btn-primary btn-block"><b>{{ trans('general.edit') }}</b></a>
<!-- /.box-body -->
</div>
<a href="{{ url('expenses/vendors/' . $vendor->id . '/edit') }}" class="btn btn-default btn-block edit-sv"><i class="fas fa-edit"></i><b>{{ trans('general.edit') }}</b></a>
</div>
<!-- /.col -->
<div class="col-md-9">
<div class="row">
<div class="col-md-4 col-sm-8 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-green"><i class="fa fa-shopping-cart"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('general.paid') }}</span>
<span class="info-box-number">@money($amounts['paid'], setting('general.default_currency'), true)</span>
<div class="col-xl-9">
<div class="row mb--3">
<div class="col-md-4">
<div class="card bg-gradient-success border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('general.paid') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['paid'], setting('default.currency'), true)</span>
</div>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-4 col-sm-8 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-paper-plane-o"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('dashboard.open_bills') }}</span>
<span class="info-box-number">@money($amounts['open'], setting('general.default_currency'), true)</span>
<div class="col-md-4">
<div class="card bg-gradient-warning border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('dashboard.open_bills') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['open'], setting('default.currency'), true)</span>
</div>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-4 col-sm-8 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-red"><i class="fa fa-warning"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('dashboard.overdue_bills') }}</span>
<span class="info-box-number">@money($amounts['overdue'], setting('general.default_currency'), true)</span>
<div class="col-md-4">
<div class="card bg-gradient-danger border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('dashboard.overdue_bills') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['overdue'], setting('default.currency'), true)</span>
</div>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#transactions" data-toggle="tab" aria-expanded="true">{{ trans_choice('general.transactions', 2) }}</a></li>
<li class=""><a href="#bills" data-toggle="tab" aria-expanded="false">{{ trans_choice('general.bills', 2) }}</a></li>
<li class=""><a href="#payments" data-toggle="tab" aria-expanded="false">{{ trans_choice('general.payments', 2) }}</a></li>
<div class="col-md-12">
<div class="nav-wrapper">
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 active" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true"><i class="fas fa-hand-holding-usd mr-2"></i>{{ trans_choice('general.transactions', 2) }}</a>
</li>
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0" id="tabs-icons-text-2-tab" data-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="tabs-icons-text-2" aria-selected="false"><i class="fa fa-shopping-cart mr-2"></i>{{ trans_choice('general.bills', 2) }}</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane tab-margin active" id="transactions">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th class="col-md-3">{{ trans('general.date') }}</th>
<th class="col-md-2 text-right amount-space">{{ trans('general.amount') }}</th>
<th class="col-md-4 hidden-xs">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-md-3 hidden-xs">{{ trans_choice('general.accounts', 1) }}</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr>
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->account->name }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
</div>
<div class="tab-pane tab-margin" id="bills">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-bills">
<thead>
<tr>
<th class="col-md-2">{{ trans_choice('general.numbers', 1) }}</th>
<th class="col-md-2 text-right amount-space">{{ trans('general.amount') }}</th>
<th class="col-md-2">{{ trans('bills.bill_date') }}</th>
<th class="col-md-2">{{ trans('bills.due_date') }}</th>
<th class="col-md-2">{{ trans_choice('general.statuses', 1) }}</th>
</tr>
<div class="card shadow">
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
<div class="table-responsive">
<table class="table table-flush" id="tbl-transactions">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-6 col-sm-3">{{ trans('general.date') }}</th>
<th class="col-xs-6 col-sm-2">{{ trans('general.amount') }}</th>
<th class="col-sm-4 hidden-sm">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-sm-3 hidden-sm">{{ trans_choice('general.accounts', 1) }}</th>
</tr>
</thead>
<tbody>
@foreach($bills as $item)
<tr>
<td><a href="{{ url('expenses/bills/' . $item->id . ' ') }}">{{ $item->bill_number }}</a></td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td>{{ Date::parse($item->billed_at)->format($date_format) }}</td>
<td>{{ Date::parse($item->due_at)->format($date_format) }}</td>
<td><span class="label {{ $item->status->label }}">{{ trans('bills.status.' . $item->status->code) }}</span></td>
</tr>
@endforeach
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-xs-6 col-sm-3">@date($item->paid_at)</td>
<td class="col-xs-6 col-sm-2">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-4 hidden-sm">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="col-sm-3 hidden-sm">{{ $item->account->name }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@include('partials.admin.pagination', ['items' => $bills, 'type' => 'bills'])
<div class="card-footer py-4 table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
</div>
</div>
</div>
<div class="tab-pane tab-margin" id="payments">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-payments">
<thead>
<tr>
<th class="col-md-3">{{ trans('general.date') }}</th>
<th class="col-md-3 text-right amount-space">{{ trans('general.amount') }}</th>
<th class="col-md-3 hidden-xs">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-md-3 hidden-xs">{{ trans_choice('general.accounts', 1) }}</th>
</tr>
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
<div class="table-responsive">
<table class="table table-flush" id="tbl-bills">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-3">{{ trans_choice('general.numbers', 1) }}</th>
<th class="col-xs-4 col-sm-3">{{ trans('general.amount') }}</th>
<th class="col-sm-2 hidden-sm">{{ trans('bills.bill_date') }}</th>
<th class="col-sm-2 hidden-sm">{{ trans('bills.due_date') }}</th>
<th class="col-xs-4 col-sm-2">{{ trans_choice('general.statuses', 1) }}</th>
</tr>
</thead>
<tbody>
@foreach($payments as $item)
<tr>
<td><a href="{{ url('expenses/payments/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->account->name }}</td>
</tr>
@endforeach
@foreach($bills as $item)
<tr class="row align-items-center border-top-1">
<td class="col-xs-4 col-sm-3"><a href="{{ url('expenses/bills/' . $item->id . ' ') }}">{{ $item->bill_number }}</a></td>
<td cclass="col-xs-4 col-sm-3">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-2 hidden-sm">@date($item->billed_at)</td>
<td class="col-sm-2 hidden-sm">@date($item->due_at)</td>
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('bills.status.' . $item->status->code) }}</span></td>
</tr>
@endforeach
</tbody>
</table>
</div>
@include('partials.admin.pagination', ['items' => $payments, 'type' => 'payments'])
<div class="card-footer py-4 table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $bills, 'type' => 'bills'])
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.box -->
</div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/expenses/vendors.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,164 +3,83 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.customers', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'incomes/customers', 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'customers.store',
'id' => 'customer',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'autocomplete' => "off",
'class' => 'form-loading-button needs-validation',
'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'), 'user') }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', ['autocomplete' => 'off']) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency')) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe', []) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
@stack('create_user_input_start')
<div id="customer-create-user" class="form-group col-md-12 margin-top">
<div class="custom-control custom-checkbox">
{{ Form::checkbox('create_user', '1', null, [
'v-model' => 'form.create_user',
'id' => 'create_user',
'class' => 'custom-control-input',
'@input' => 'onCanLogin($event)'
]) }}
@stack('create_user_input_start')
<div id="customer-create-user" class="form-group col-md-12 margin-top">
<strong>{{ trans('customers.allow_login') }}</strong> &nbsp; {{ Form::checkbox('create_user', '1', null, ['id' => 'create_user']) }}
<label class="custom-control-label" for="create_user">
<strong>{{ trans('customers.can_login') }}</strong>
</label>
</div>
</div>
@stack('create_user_input_end')
<div v-if="can_login" class="row col-md-12">
{{Form::passwordGroup('password', trans('auth.password.current'), 'key', [], 'col-md-6 password')}}
{{Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', [], 'col-md-6 password')}}
</div>
</div>
@stack('create_user_input_end')
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('incomes/customers') }}
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('incomes/customers') }}
</div>
</div>
<!-- /.box-footer -->
{{ Form::hidden('type', 'customer') }}
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/icheck.min.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/square/green.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');
$('#name').focus();
$("#currency_code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
$('#create_user').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
increaseArea: '20%'
});
$('#create_user').on('ifClicked', function (event) {
$('input[name="user_id"]').remove();
if ($(this).prop('checked')) {
$('.col-md-6.password').remove();
$('input[name="email"]').parent().parent().removeClass('has-error');
$('input[name="email"]').parent().parent().find('.help-block').remove();
} else {
var email = $('input[name="email"]').val();
if (!email) {
$('input[name="email"]').parent().parent().removeClass('has-error');
$('input[name="email"]').parent().parent().find('.help-block').remove();
$('input[name="email"]').parent().parent().addClass('has-error');
$('input[name="email"]').parent().after('<p class="help-block">{{ trans('validation.required', ['attribute' => 'email']) }}</p>');
$('input[name="email"]').focus();
unselect();
return false;
}
$.ajax({
url: '{{ url("auth/users/autocomplete") }}',
type: 'GET',
dataType: 'JSON',
data: {column: 'email', value: email},
beforeSend: function() {
$('.iCheck-helper').parent().after('<i class="fa fa-spinner fa-pulse fa-fw loading" style="margin-left: 10px;"></i>');
$('input[name="email"]').parent().parent().removeClass('has-error');
$('input[name="email"]').parent().parent().find('.help-block').remove();
$('.box-footer .btn').attr('disabled', true);
},
success: function(json) {
if (json['errors']) {
if (json['data']) {
$('input[name="email"]').parent().parent().addClass('has-error');
$('input[name="email"]').parent().after('<p class="help-block">' + json['data'] + '</p>');
$('input[name="email"]').focus();
return false;
}
fields = [];
fields[0] = 'password';
fields[1] = 'password_confirmation';
$.ajax({
url: '{{ url("incomes/customers/field") }}',
type: 'POST',
dataType: 'JSON',
data: {fields: fields},
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
complete: function() {
$('.box-footer .btn').attr('disabled', false);
$('.loading').remove();
},
success: function(json) {
$('#customer-create-user').after(json['html']);
}
});
}
if (json['success']) {
unselect();
$('input[name="email"]').parent().parent().addClass('has-error');
$('input[name="email"]').parent().after('<p class="help-block">{{ trans('customers.error.email') }}</p>');
$('input[name="email"]').focus();
$('.box-footer .btn').attr('disabled', false);
$('.loading').remove();
return false;
}
}
});
}
});
});
function unselect() {
setTimeout(function(){
$('#create_user').iCheck('uncheck');
}, 550);
}
@push('scripts_start')
<script>
var can_login_errors = {
valid: '{{ trans('validation.required', ['attribute' => 'email']) }}',
email: '{{ trans('customers.error.email') }}'
};
</script>
<script src="{{ asset('public/js/incomes/customers.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,170 +3,88 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.customers', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::model($customer, [
'method' => 'PATCH',
'url' => ['incomes/customers', $customer->id],
'role' => 'form',
'class' => 'form-loading-button'
]) !!}
<div class="card">
{!! Form::model($customer, [
'method' => 'PATCH',
'route' => ['customers.update', $customer->id],
'role' => 'form',
'id' => 'customer',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'class' => 'form-loading-button',
'novalidate' => 'true'
]) !!}
<div class="box-body">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'user') }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $customer->currency_code) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
@stack('create_user_input_start')
<div id="customer-create-user" class="form-group col-md-12 margin-top">
@if ($customer->user_id)
<strong>{{ trans('customers.user_created') }}</strong> &nbsp; {{ Form::checkbox('create_user', '1', 1, ['id' => 'create_user', 'disabled' => 'disabled']) }}
@else
<strong>{{ trans('customers.allow_login') }}</strong> &nbsp; {{ Form::checkbox('create_user', '1', null, ['id' => 'create_user']) }}
@endif
@stack('create_user_input_start')
<div id="customer-create-user" class="form-group col-md-12 margin-top">
<div class="custom-control custom-checkbox">
@if ($customer->user_id)
{{ Form::checkbox('create_user', '1', 1, [
'id' => 'create_user',
'class' => 'custom-control-input',
'disabled' => 'disabled'
]) }}
<label class="custom-control-label" for="create_user">
<strong>{{ trans('customers.user_created') }}</strong>
</label>
@else
{{ Form::checkbox('create_user', '1', null, [
'id' => 'create_user',
'class' => 'custom-control-input',
'v-on:input' => 'onCanLogin($event)'
]) }}
<label class="custom-control-label" for="create_user">
<strong>{{ trans('customers.can_login') }}</strong>
</label>
@endif
</div>
</div>
@stack('create_user_input_end')
<div v-if="can_login" class="row col-md-12">
{{Form::passwordGroup('password', trans('auth.password.current'), 'key', [], 'col-md-6 password')}}
{{Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', [], 'col-md-6 password')}}
</div>
</div>
</div>
@stack('create_user_input_end')
</div>
<!-- /.box-body -->
@permission('update-incomes-customers')
<div class="box-footer">
{{ Form::saveButtons('incomes/customers') }}
</div>
<!-- /.box-footer -->
@endpermission
@permission('update-incomes-customers')
<div class="card-footer">
<div class="float-right">
{{ Form::saveButtons('incomes/customers') }}
</div>
</div>
@endpermission
{!! Form::close() !!}
</div>
{{ Form::hidden('type', 'customer') }}
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/icheck.min.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/iCheck/square/green.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function(){
$("#currency_code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
$('#create_user').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
increaseArea: '20%' // optional
});
$('#create_user').on('ifClicked', function (event) {
$('input[name="user_id"]').remove();
if ($(this).prop('checked')) {
$('.col-md-6.password').remove();
$('input[name="email"]').parent().parent().removeClass('has-error');
$('input[name="email"]').parent().parent().find('.help-block').remove();
} else {
var email = $('input[name="email"]').val();
if (!email) {
$('input[name="email"]').parent().parent().removeClass('has-error');
$('input[name="email"]').parent().parent().find('.help-block').remove();
$('input[name="email"]').parent().parent().addClass('has-error');
$('input[name="email"]').parent().after('<p class="help-block">{{ trans('validation.required', ['attribute' => 'email']) }}</p>');
$('input[name="email"]').focus();
unselect();
return false;
}
$.ajax({
url: '{{ url("auth/users/autocomplete") }}',
type: 'GET',
dataType: 'JSON',
data: {column: 'email', value: $('input[name="email"]').val()},
beforeSend: function() {
$('.iCheck-helper').parent().after('<i class="fa fa-spinner fa-pulse fa-fw loading" style="margin-left: 10px;"></i>');
$('input[name="email"]').parent().parent().removeClass('has-error');
$('input[name="email"]').parent().parent().find('.help-block').remove();
$('.box-footer .btn').attr('disabled', true);
},
success: function(json) {
if (json['errors']) {
if (json['data']) {
$('input[name="email"]').parent().parent().addClass('has-error');
$('input[name="email"]').parent().after('<p class="help-block">' + json['data'] + '</p>');
$('input[name="email"]').focus();
return false;
}
fields = [];
fields[0] = 'password';
fields[1] = 'password_confirmation';
$.ajax({
url: '{{ url("incomes/customers/field") }}',
type: 'POST',
dataType: 'JSON',
data: {fields: fields},
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
complete: function() {
$('.box-footer .btn').attr('disabled', false);
$('.loading').remove();
},
success: function(json) {
$('#customer-create-user').after(json['html']);
}
});
}
if (json['success']) {
unselect();
$('input[name="email"]').parent().parent().addClass('has-error');
$('input[name="email"]').parent().after('<p class="help-block">{{ trans('customers.error.email') }}</p>');
$('input[name="email"]').focus();
$('.box-footer .btn').attr('disabled', false);
$('.loading').remove();
return false;
}
}
});
}
});
});
function unselect() {
setTimeout(function(){
$('#create_user').iCheck('uncheck');
}, 550);
}
</script>
@push('scripts_start')
<script src="{{ asset('public/js/incomes/customers.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,97 +3,111 @@
@section('title', trans_choice('general.customers', 2))
@section('new_button')
@permission('create-incomes-customers')
<span class="new-button"><a href="{{ url('incomes/customers/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/incomes/customers') }}" class="btn btn-default btn-sm"><span class="fa fa-download"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('customers.export', request()->input()) }}" class="btn btn-default btn-sm"><span class="fa fa-upload"></span> &nbsp;{{ trans('general.export') }}</a></span>
@permission('create-incomes-customers')
<span><a href="{{ url('incomes/customers/create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/incomes/customers') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('customers.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> &nbsp;{{ trans('general.export') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'incomes/customers', '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> &nbsp;' . 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([
'url' => 'incomes/customers',
'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-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-customers">
<thead>
<tr>
<th class="col-md-3">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-3 hidden-xs">@sortablelink('email', trans('general.email'))</th>
<th class="col-md-2">@sortablelink('phone', trans('general.phone'))</th>
<th class="col-md-2 hidden-xs">@sortablelink('unpaid', trans('general.unpaid'))</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.customers', $bulk_actions, 'incomes/customers') }}
{!! 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-3 col-md-3 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-2 col-lg-2 col-xl-2 hidden-md">@sortablelink('email', trans('general.email'))</th>
<th class="col-sm-3 col-md-2 col-lg-2 col-xl-2 hidden-sm">@sortablelink('phone', trans('general.phone'))</th>
<th class="col-lg-2 col-xl-2 text-right hidden-lg">@sortablelink('unpaid', trans('general.unpaid'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">@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($customers as $item)
<tr>
<td><a href="{{ url('incomes/customers/' . $item->id) }}">{{ $item->name }}</a></td>
<td class="hidden-xs">{{ !empty($item->email) ? $item->email : trans('general.na') }}</td>
<td>{{ $item->phone }}</td>
<td>@money($item->unpaid, 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="{{ url('incomes/customers/' . $item->id) }}">{{ trans('general.show') }}</a></li>
@permission('read-reports-income-summary')
<li><a href="{{ url('reports/income-summary?customers[]=' . $item->id) }}">{{ trans_choice('general.reports', 1) }}</a></li>
@endpermission
<li><a href="{{ url('incomes/customers/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@foreach($customers 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-3 col-md-3 col-lg-3 col-xl-3">
<a class="col-aka text-success" href="{{ route('customers.show', $item->id) }}">{{ $item->name }}</a>
</td>
<td class="col-md-2 col-lg-2 col-xl-2 hidden-md o-y">
{{ !empty($item->email) ? $item->email : trans('general.na') }}
</td>
<td class="col-sm-3 col-md-2 col-lg-2 col-xl-2 hidden-sm o-y">
{{ $item->phone }}
</td>
<td class="col-lg-2 col-xl-2 text-right hidden-lg o-y">
@money($item->unpaid, setting('default.currency'), true)
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">
@if (user()->can('update-incomes-customers'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<li><a href="{{ route('customers.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
@else
<li><a href="{{ route('customers.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
@endif
@permission('create-incomes-customers')
<li class="divider"></li>
<li><a href="{{ url('incomes/customers/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-incomes-customers')
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'incomes/customers') !!}</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">
<a class="dropdown-item" href="{{ route('customers.show', $item->id) }}">{{ trans('general.show') }}</a>
<a class="dropdown-item" href="{{ route('customers.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@permission('create-incomes-customers')
<a class="dropdown-item" href="{{ route('customers.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
<div class="dropdown-divider"></div>
@endpermission
@permission('delete-incomes-customers')
{!! Form::deleteLink($item, 'incomes/customers') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $customers, 'type' => 'customers'])
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $customers, 'type' => 'customers'])
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/incomes/customers.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -4,213 +4,177 @@
@section('content')
<div class="row">
<div class="col-md-3">
<!-- Stats -->
<div class="box box-success">
<div class="box-body box-profile">
<ul class="list-group list-group-unbordered">
<li class="list-group-item" style="border-top: 0;">
<b>{{ trans_choice('general.invoices', 2) }}</b> <a class="pull-right">{{ $counts['invoices'] }}</a>
</li>
<li class="list-group-item">
<b>{{ trans_choice('general.revenues', 2) }}</b> <a class="pull-right">{{ $counts['revenues'] }}</a>
</li>
</ul>
<div class="col-xl-3">
<div class="card">
<div class="card-header border-bottom-0 show-transaction-card-header">
<a class="text-sm font-weight-600">{{ trans_choice('general.invoices', 2) }}</a> <a class="float-right text-xs">{{ $counts['invoices'] }}</a>
</div>
<div class="card-footer show-transaction-card-footer">
<a class="text-sm font-weight-600">{{ trans_choice('general.transactions', 2) }}</a> <a class="float-right text-xs">{{ $counts['transactions'] }}</a>
</div>
<!-- /.box-body -->
</div>
<!-- Profile -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('auth.profile') }}</h3>
<div class="card">
<div class="card-header">
<h4 class="mb-0">{{ trans('auth.profile') }}</h4>
</div>
<div class="box-body box-profile">
<ul class="list-group list-group-unbordered">
<li class="list-group-item" style="border-top: 0;">
<b>{{ trans('general.email') }}</b> <a class="pull-right">{{ $customer->email }}</a>
</li>
<li class="list-group-item">
<b>{{ trans('general.phone') }}</b> <a class="pull-right">{{ $customer->phone }}</a>
</li>
<li class="list-group-item">
<b>{{ trans('general.website') }}</b> <a class="pull-right">{{ $customer->website }}</a>
</li>
<li class="list-group-item">
<b>{{ trans('general.tax_number') }}</b> <a class="pull-right">{{ $customer->tax_number }}</a>
</li>
@if ($customer->refence)
<li class="list-group-item">
<b>{{ trans('general.reference') }}</b> <a class="pull-right">{{ $customer->refence }}</a>
</li>
@endif
</ul>
<div class="card-body d-grid">
<a class="text-sm font-weight-600">{{ trans('general.email') }}</a> <a class="text-xs o-y">{{ $customer->email }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.phone') }}</a> <a class="text-xs o-y">{{ $customer->phone }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.website') }}</a> <a class="text-xs o-y">{{ $customer->website }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.tax_number') }}</a> <a class="text-xs o-y">{{ $customer->tax_number }}</a>
@if ($customer->reference)
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.reference') }}</a> <a class="text-xs o-y">{{ $customer->reference }}</a>
@endif
</div>
<!-- /.box-body -->
</div>
<!-- Address Box -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('general.address') }}</h3>
<div class="card">
<div class="card-header">
<h4 class="mb-0">{{ trans('general.address') }}</h4>
</div>
<!-- /.box-header -->
<div class="box-body">
<p class="text-muted">
<div class="card-body">
<a class="text-xs m-0">
{{ $customer->address }}
</p>
</a>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<!-- Edit -->
<div>
<a href="{{ url('incomes/customers/' . $customer->id . '/edit') }}" class="btn btn-primary btn-block"><b>{{ trans('general.edit') }}</b></a>
<!-- /.box-body -->
</div>
<a href="{{ url('incomes/customers/' . $customer->id . '/edit') }}" class="btn btn-default btn-block edit-sv"><i class="fas fa-edit"></i><b>{{ trans('general.edit') }}</b></a>
</div>
<!-- /.col -->
<div class="col-md-9">
<div class="row">
<div class="col-md-4 col-sm-8 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-green"><i class="fa fa-money"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('general.paid') }}</span>
<span class="info-box-number">@money($amounts['paid'], setting('general.default_currency'), true)</span>
<div class="col-xl-9">
<div class="row mb--3">
<div class="col-md-4">
<div class="card bg-gradient-success border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('general.paid') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['paid'], setting('default.currency'), true)</span>
</div>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-4 col-sm-8 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-paper-plane-o"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('dashboard.open_invoices') }}</span>
<span class="info-box-number">@money($amounts['open'], setting('general.default_currency'), true)</span>
<div class="col-md-4">
<div class="card bg-gradient-warning border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('dashboard.open_invoices') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['open'], setting('default.currency'), true)</span>
</div>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-md-4 col-sm-8 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-red"><i class="fa fa-warning"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('dashboard.overdue_invoices') }}</span>
<span class="info-box-number">@money($amounts['overdue'], setting('general.default_currency'), true)</span>
<div class="col-md-4">
<div class="card bg-gradient-danger border-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('dashboard.overdue_invoices') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['overdue'], setting('default.currency'), true)</span>
</div>
</div>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#transactions" data-toggle="tab" aria-expanded="true">{{ trans_choice('general.transactions', 2) }}</a></li>
<li class=""><a href="#invoices" data-toggle="tab" aria-expanded="false">{{ trans_choice('general.invoices', 2) }}</a></li>
<li class=""><a href="#revenues" data-toggle="tab" aria-expanded="false">{{ trans_choice('general.revenues', 2) }}</a></li>
<div class="col-md-12">
<div class="nav-wrapper">
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 active" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true"><i class="fas fa-hand-holding-usd mr-2"></i>{{ trans_choice('general.transactions', 2) }}</a>
</li>
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0" id="tabs-icons-text-2-tab" data-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="tabs-icons-text-2" aria-selected="false"><i class="fa fa-money-bill mr-2"></i>{{ trans_choice('general.invoices', 2) }}</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane tab-margin active" id="transactions">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th class="col-md-3">{{ trans('general.date') }}</th>
<th class="col-md-2 text-right amount-space">{{ trans('general.amount') }}</th>
<th class="col-md-4 hidden-xs">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-md-3 hidden-xs">{{ trans_choice('general.accounts', 1) }}</th>
</tr>
</div>
<div class="card shadow">
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
<div class="table-responsive">
<table class="table table-flush" id="tbl-transactions">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-6 col-sm-3">{{ trans('general.date') }}</th>
<th class="col-xs-6 col-sm-3">{{ trans('general.amount') }}</th>
<th class="col-sm-3 hidden-sm">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-sm-3 hidden-sm">{{ trans_choice('general.accounts', 1) }}</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr>
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->account->name }}</td>
</tr>
@endforeach
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-xs-6 col-sm-3">@date($item->paid_at)</td>
<td class="col-xs-6 col-sm-3">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-3 hidden-sm">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="col-sm-3 hidden-sm">{{ $item->account->name }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
<div class="card-footer py-4 table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
</div>
</div>
</div>
<div class="tab-pane tab-margin" id="invoices">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-invoices">
<thead>
<tr>
<th class="col-md-2">{{ trans_choice('general.numbers', 1) }}</th>
<th class="col-md-2 text-right amount-space">{{ trans('general.amount') }}</th>
<th class="col-md-2">{{ trans('invoices.invoice_date') }}</th>
<th class="col-md-2">{{ trans('invoices.due_date') }}</th>
<th class="col-md-2">{{ trans_choice('general.statuses', 1) }}</th>
</tr>
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
<div class="table-responsive">
<table class="table table-flush" id="tbl-invoices">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-3">{{ trans_choice('general.numbers', 1) }}</th>
<th class="col-xs-4 col-sm-3">{{ trans('general.amount') }}</th>
<th class="col-sm-2 hidden-sm">{{ trans('invoices.invoice_date') }}</th>
<th class="col-sm-2 hidden-sm">{{ trans('invoices.due_date') }}</th>
<th class="col-xs-4 col-sm-2">{{ trans_choice('general.statuses', 1) }}</th>
</tr>
</thead>
<tbody>
@foreach($invoices as $item)
<tr>
<td><a href="{{ url('incomes/invoices/' . $item->id . ' ') }}">{{ $item->invoice_number }}</a></td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td>{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
<td>{{ Date::parse($item->due_at)->format($date_format) }}</td>
<td><span class="label {{ $item->status->label }}">{{ trans('invoices.status.' . $item->status->code) }}</span></td>
</tr>
@endforeach
@foreach($invoices as $item)
<tr class="row align-items-center border-top-1">
<td class="col-xs-4 col-sm-3"><a href="{{ url('incomes/invoices/' . $item->id . ' ') }}">{{ $item->invoice_number }}</a></td>
<td class="col-xs-4 col-sm-3">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-2 hidden-sm">@date($item->invoiced_at)</td>
<td class="col-sm-2 hidden-sm">@date($item->due_at)</td>
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('invoices.status.' . $item->status->code) }}</span></td>
</tr>
@endforeach
</tbody>
</table>
</div>
@include('partials.admin.pagination', ['items' => $invoices, 'type' => 'invoices'])
</div>
<div class="tab-pane tab-margin" id="revenues">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-revenues">
<thead>
<tr>
<th class="col-md-3">{{ trans('general.date') }}</th>
<th class="col-md-3 text-right amount-space">{{ trans('general.amount') }}</th>
<th class="col-md-3 hidden-xs">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-md-3 hidden-xs">{{ trans_choice('general.accounts', 1) }}</th>
</tr>
</thead>
<tbody>
@foreach($revenues as $item)
<tr>
<td><a href="{{ url('incomes/revenues/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->account->name }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="card-footer py-4 table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $invoices, 'type' => 'invoices'])
</div>
</div>
@include('partials.admin.pagination', ['items' => $revenues, 'type' => 'revenues'])
</div>
</div>
</div>
</div>
</div>
<!-- /.box -->
</div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/incomes/customers.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,580 +3,195 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.invoices', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'incomes/invoices', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'invoices.store',
'id' => 'invoice',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="box-body">
@stack('customer_id_input_start')
<div class="form-group col-md-6 required {{ $errors->has('customer_id') ? 'has-error' : ''}}">
{!! Form::label('customer_id', trans_choice('general.customers', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-user"></i></div>
{!! Form::select('customer_id', $customers, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)])])) !!}
<div class="input-group-btn">
<button type="button" id="button-customer" class="btn btn-default btn-icon"><i class="fa fa-plus"></i></button>
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, config('general.customers'), ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.customers.create')]) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
{{ Form::dateGroup('invoiced_at', trans('invoices.invoice_date'), 'calendar', ['id' => 'invoiced_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{{ Form::dateGroup('due_at', trans('invoices.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->addDays(setting('invoice.payment_terms', 0))->toDateString()) }}
{{ Form::textGroup('invoice_number', trans('invoices.invoice_number'), 'file', ['required' => 'required'], $number) }}
{{ Form::textGroup('order_number', trans('invoices.order_number'), 'shopping-cart', []) }}
<div class="col-md-12 mb-4">
{!! Form::label('items', trans_choice($text_override['items'], 2), ['class' => 'form-control-label']) !!}
<div class="table-responsive">
<table class="table table-bordered" id="items">
<thead class="thead-light">
<tr class="row">
@stack('actions_th_start')
<th class="col-md-1 action-column border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
@stack('actions_th_end')
@stack('name_th_start')
<th class="col-md-3 text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="col-md-2 text-center border-right-0 border-bottom-0">{{ trans($text_override['quantity']) }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans($text_override['price']) }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
@stack('taxes_th_end')
@stack('total_th_start')
<th class="col-md-2 text-right border-bottom-0">{{ trans('invoices.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody id="invoice-item-rows">
@include('incomes.invoices.item')
@stack('add_item_td_start')
<tr class="row" id="addItem">
<td class="col-md-1 action-column border-right-0 border-bottom-0"><button type="button" @click="onAddItem" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-icon btn-outline-success btn-lg" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
<td class="col-md-11 text-right border-bottom-0"></td>
</tr>
@stack('add_item_td_end')
@stack('sub_total_td_start')
<tr class="row" id="tr-subtotal">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<strong>{{ trans('invoices.sub_total') }}</strong>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="sub-total" v-html="totals.sub">0</span>
</td>
</tr>
@stack('sub_total_td_end')
@stack('add_discount_td_start')
<tr class="row" id="tr-discount">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<el-popover
popper-class="p-0 h-0"
placement="bottom"
width="300"
v-model="discount">
<div class="card">
<div class="discount card-body">
<div class="row align-items-center">
<div class="col-md-6">
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text" id="input-discount">
<i class="fa fa-percent"></i>
</span>
</div>
{!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control']) !!}
</div>
</div>
<div class="col-md-6">
<div class="discount-description">
<strong>{{ trans('invoices.discount_desc') }}</strong>
</div>
</div>
</div>
</div>
<div class="discount card-footer">
<div class="row text-center">
<div class="col-md-12">
<a href="javascript:void(0)" @click="discount = false" class="btn btn-icon btn-outline-secondary">
<span class="btn-inner--icon"><i class="fas fa-times"></i></span>
<span class="btn-inner--text">{{ trans('general.cancel') }}</span>
</a>
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
</div>
</div>
</div>
</div>
<el-link slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
</el-popover>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="discount-total" v-html="totals.discount"></span>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
</td>
</tr>
@stack('add_discount_td_end')
@stack('tax_total_td_start')
<tr class="row" id="tr-tax">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="tax-total" v-html="totals.tax">0</span>
</td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr class="row" id="tr-total">
<td class="col-md-10 text-right border-right-0">
<strong>{{ trans('invoices.total') }}</strong>
</td>
<td class="col-md-2 text-right">
<span id="grand-total" v-html="totals.total">0</span>
</td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
</div>
</div>
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2), '', setting('invoice.notes')) }}
{{ Form::textareaGroup('footer', trans('general.footer'), '', setting('invoice.footer')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('defaults.category')) }}
{{ Form::recurring('create') }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('contact_name', old('contact_name'), ['id' => 'contact_name', 'v-model' => 'form.contact_name']) }}
{{ Form::hidden('contact_email', old('contact_email'), ['id' => 'contact_email', 'v-model' => 'form.contact_email']) }}
{{ Form::hidden('contact_tax_number', old('contact_tax_number'), ['id' => 'contact_tax_number', 'v-model' => 'form.contact_tax_number']) }}
{{ Form::hidden('contact_phone', old('contact_phone'), ['id' => 'contact_phone', 'v-model' => 'form.contact_phone']) }}
{{ Form::hidden('contact_address', old('contact_address'), ['id' => 'contact_address', 'v-model' => 'form.contact_address']) }}
{{ Form::hidden('currency_rate', old('currency_rate', 1), ['id' => 'currency_rate', 'v-model' => 'form.contact_rate']) }}
{{ Form::hidden('invoice_status_code', old('invoice_status_code', 'draft'), ['id' => 'invoice_status_code', 'v-model' => 'form.invoice_status_code']) }}
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
</div>
</div>
{!! $errors->first('customer_id', '<p class="help-block">:message</p>') !!}
</div>
@stack('customer_id_input_end')
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }}
{{ Form::textGroup('invoiced_at', trans('invoices.invoice_date'), 'calendar',['id' => 'invoiced_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy/mm/dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{{ Form::textGroup('due_at', trans('invoices.due_date'), 'calendar',['id' => 'due_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy/mm/dd\'', 'data-mask' => '', 'autocomplete' => 'off']) }}
{{ Form::textGroup('invoice_number', trans('invoices.invoice_number'), 'file-text-o', ['required' => 'required'], $number) }}
{{ Form::textGroup('order_number', trans('invoices.order_number'), 'shopping-cart', []) }}
<div class="form-group col-md-12">
{!! Form::label('items', trans_choice($text_override['items'], 2), ['class' => 'control-label']) !!}
<div class="table-responsive">
<table class="table table-bordered" id="items">
<thead>
<tr style="background-color: #f9f9f9;">
@stack('actions_th_start')
<th width="5%" class="text-center">{{ trans('general.actions') }}</th>
@stack('actions_th_end')
@stack('name_th_start')
<th width="40%" class="text-left">{{ trans('general.name') }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th width="5%" class="text-center">{{ trans($text_override['quantity']) }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th width="10%" class="text-right">{{ trans($text_override['price']) }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
<th width="15%" class="text-right">{{ trans_choice('general.taxes', 1) }}</th>
@stack('taxes_th_end')
@stack('total_th_start')
<th width="10%" class="text-right">{{ trans('invoices.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@php $item_row = 0; @endphp
@if(old('item'))
@foreach(old('item') as $old_item)
@php $item = (object) $old_item; @endphp
@include('incomes.invoices.item')
@php $item_row++; @endphp
@endforeach
@else
@include('incomes.invoices.item')
@endif
@php $item_row++; @endphp
@stack('add_item_td_start')
<tr id="addItem">
<td class="text-center"><button type="button" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-xs btn-primary" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
<td class="text-right" colspan="5"></td>
</tr>
@stack('add_item_td_end')
@stack('sub_total_td_start')
<tr id="tr-subtotal">
<td class="text-right" colspan="5"><strong>{{ trans('invoices.sub_total') }}</strong></td>
<td class="text-right"><span id="sub-total">0</span></td>
</tr>
@stack('sub_total_td_end')
@stack('add_discount_td_start')
<tr id="tr-discount">
<td class="text-right" style="vertical-align: middle;" colspan="5">
<a href="javascript:void(0)" id="discount-text" rel="popover">{{ trans('invoices.add_discount') }}</a>
</td>
<td class="text-right">
<span id="discount-total"></span>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right']) !!}
</td>
</tr>
@stack('add_discount_td_end')
@stack('tax_total_td_start')
<tr id="tr-tax">
<td class="text-right" colspan="5">
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
</td>
<td class="text-right"><span id="tax-total">0</span></td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr id="tr-total">
<td class="text-right" colspan="5"><strong>{{ trans('invoices.total') }}</strong></td>
<td class="text-right"><span id="grand-total">0</span></td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
</div>
</div>
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
@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>
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('incomes/invoices') }}
</div>
</div>
{!! $errors->first('category_id', '<p class="help-block">:message</p>') !!}
</div>
@stack('category_id_input_end')
{{ Form::recurring('create') }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('customer_name', old('customer_name'), ['id' => 'customer_name']) }}
{{ Form::hidden('customer_email', old('customer_email'), ['id' => 'customer_email']) }}
{{ Form::hidden('customer_tax_number', old('customer_tax_number'), ['id' => 'customer_tax_number']) }}
{{ Form::hidden('customer_phone', old('customer_phone'), ['id' => 'customer_phone']) }}
{{ Form::hidden('customer_address', old('customer_address'), ['id' => 'customer_address']) }}
{{ Form::hidden('currency_rate', old('currency_rate'), ['id' => 'currency_rate']) }}
{{ Form::hidden('invoice_status_code', old('invoice_status_code', 'draft'), ['id' => 'invoice_status_code']) }}
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount']) }}
{!! Form::close() !!}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('incomes/invoices') }}
</div>
<!-- /.box-footer -->
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.1/bootstrap3-typeahead.min.js"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/colorpicker/bootstrap-colorpicker.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.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('stylesheet')
<style type="text/css">
.select2-results__option.select2-results__message:hover {
color: white;
background: #6da252;
cursor: pointer;
}
</style>
@endpush
@push('scripts')
@push('scripts_start')
<script type="text/javascript">
var focus = false;
var item_row = '{{ $item_row }}';
var autocomplete_path = "{{ url('common/items/autocomplete') }}";
$(document).ready(function() {
itemTableResize();
@if (old('item'))
$('#customer_id').trigger('change');
@endif
$('.input-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
});
$('.input-price').trigger('focusout');
//Date picker
$('#invoiced_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
//Date picker
$('#due_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$('.tax-select2').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>';
}
}
});
$('#customer_id').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
});
$('#currency_code').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
$('#category_id').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
// Discount popover
$('a[rel=popover]').popover({
html: true,
placement: 'bottom',
title: '{{ trans('invoices.discount') }}',
content: function () {
html = '<div class="discount box-body">';
html += ' <div class="col-md-6">';
html += ' <div class="input-group" id="input-discount">';
html += ' {!! Form::number('pre-discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}';
html += ' <div class="input-group-addon"><i class="fa fa-percent"></i></div>';
html += ' </div>';
html += ' </div>';
html += ' <div class="col-md-6">';
html += ' <div class="discount-description">';
html += ' {{ trans('invoices.discount_desc') }}';
html += ' </div>';
html += ' </div>';
html += '</div>';
html += '<div class="discount box-footer">';
html += ' <div class="col-md-12">';
html += ' <div class="form-group no-margin">';
html += ' {!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount','class' => 'btn btn-success']) !!}';
html += ' <a href="javascript:void(0)" id="cancel-discount" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</a>';
html += ' </div>';
html += ' </div>';
html += '</div>';
return html;
}
});
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '{{ trans('general.form.no_file_selected') }}'
});
@if(old('item'))
totalItem();
@endif
});
$(document).on('click', '#button-add-item', function (e) {
$.ajax({
url: '{{ url("incomes/invoices/addItem") }}',
type: 'GET',
dataType: 'JSON',
data: {item_row: item_row, currency_code : $('#currency_code').val()},
success: function(json) {
if (json['success']) {
$('#items tbody #addItem').before(json['html']);
//$('[rel=tooltip]').tooltip();
$('[data-toggle="tooltip"]').tooltip('hide');
$('#item-row-' + item_row + ' .tax-select2').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>';
}
}
});
var currency = json['data']['currency'];
$('#item-price-' + item_row).maskMoney({
thousands : currency.thousands_separator,
decimal : currency.decimal_mark,
precision : currency.precision,
allowZero : true,
prefix : (currency.symbol_first) ? currency.symbol : '',
suffix : (currency.symbol_first) ? '' : currency.symbol
});
$('#item-price-' + item_row).trigger('focusout');
item_row++;
}
}
});
});
$(document).on('click', '.form-control.typeahead', function() {
input_id = $(this).attr('id').split('-');
item_id = parseInt(input_id[input_id.length-1]);
$(this).typeahead({
minLength: 3,
displayText:function (data) {
return data.name + ' (' + data.sku + ')';
},
source: function (query, process) {
$.ajax({
url: autocomplete_path,
type: 'GET',
dataType: 'JSON',
data: 'query=' + query + '&type=invoice&currency_code=' + $('#currency_code').val(),
success: function(data) {
return process(data);
}
});
},
afterSelect: function (data) {
$('#item-id-' + item_id).val(data.item_id);
$('#item-quantity-' + item_id).val('1');
$('#item-price-' + item_id).val(data.sale_price);
$('#item-tax-' + item_id).val(data.tax_id);
// This event Select2 Stylesheet
$('#item-price-' + item_id).trigger('focusout');
$('#item-tax-' + item_id).trigger('change');
$('#item-total-' + item_id).html(data.total);
totalItem();
}
});
});
$(document).on('click', '#tax-add-new', 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, tax_selector: '.tax-select2'},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
$(document).on('keyup', '#pre-discount', function(e){
e.preventDefault();
$('#discount').val($(this).val());
totalItem();
});
$(document).on('click', '#save-discount', function(){
$('a[rel=popover]').trigger('click');
});
$(document).on('click', '#cancel-discount', function(){
$('#discount').val('');
totalItem();
$('a[rel=popover]').trigger('click');
});
$(document).on('change', '#currency_code, #items tbody select', function(){
totalItem();
});
$(document).on('focusin', '#items .input-price', function(){
focus = true;
});
$(document).on('blur', '#items .input-price', function(){
if (focus) {
totalItem();
focus = false;
}
});
$(document).on('keyup', '#items tbody .form-control', function(){
if (!$(this).hasClass('input-price')) {
totalItem();
}
});
$(document).on('change', '#customer_id', function (e) {
$.ajax({
url: '{{ url("incomes/customers/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'customer_id=' + $(this).val(),
success: function(data) {
$('#customer_name').val(data.name);
$('#customer_email').val(data.email);
$('#customer_tax_number').val(data.tax_number);
$('#customer_phone').val(data.phone);
$('#customer_address').val(data.address);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
$('.input-price').each(function(){
input_price_id = $(this).attr('id');
input_currency_id = input_price_id.replace('price', 'currency');
$('#' + input_currency_id).val(data.currency_code);
amount = $(this).maskMoney('unmasked')[0];
$(this).maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$(this).val(amount);
$(this).trigger('focusout');
});
// This event Select2 Stylesheet
$('#currency_code').trigger('change');
}
});
});
$(document).on('click', '#button-customer', function (e) {
$('#modal-create-customer').remove();
$.ajax({
url: '{{ url("modals/customers/create") }}',
type: 'GET',
dataType: 'JSON',
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: 'income'},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
$(document).on('hidden.bs.modal', '#modal-create-tax', function () {
$('.tax-select2').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>';
}
}
});
});
function totalItem() {
$.ajax({
url: '{{ url("common/items/totalItem") }}',
type: 'POST',
dataType: 'JSON',
data: $('#currency_code, #discount input[type=\'number\'], #items input[type=\'text\'],#items input[type=\'number\'],#items input[type=\'hidden\'], #items textarea, #items select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {
$.each( data.items, function( key, value ) {
$('#item-total-' + key).html(value);
});
$('#discount-text').text(data.discount_text);
$('#sub-total').html(data.sub_total);
$('#discount-total').html(data.discount_total);
$('#tax-total').html(data.tax_total);
$('#grand-total').html(data.grand_total);
$('.input-price').each(function(){
input_price_id = $(this).attr('id');
input_currency_id = input_price_id.replace('price', 'currency');
$('#' + input_currency_id).val(data.currency_code);
amount = $(this).maskMoney('unmasked')[0];
$(this).maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$(this).val(amount);
$(this).trigger('focusout');
});
}
}
});
}
var invoice_items = false;
</script>
<script src="{{ asset('public/js/incomes/invoices.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,545 +3,198 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.invoices', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::model($invoice, ['method' => 'PATCH', 'files' => true, 'url' => ['incomes/invoices', $invoice->id], 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::model($invoice, [
'id' => 'invoice',
'method' => 'PATCH',
'route' => ['invoices.update', $invoice->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::selectGroup('customer_id', trans_choice('general.customers', 1), 'user', $customers, config('general.customers')) }}
<div class="card-body">
<div class="row">
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $invoice->contact_id, ['required' => 'required', 'change' => 'onChangeContact']) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $invoice->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
{{ Form::textGroup('invoiced_at', trans('invoices.invoice_date'), 'calendar', ['id' => 'invoiced_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::parse($invoice->invoiced_at)->toDateString()) }}
{{ Form::dateGroup('invoiced_at', trans('invoices.invoice_date'), 'calendar', ['id' => 'invoiced_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($invoice->invoiced_at)->toDateString()) }}
{{ Form::textGroup('due_at', trans('invoices.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::parse($invoice->due_at)->toDateString()) }}
{{ Form::dateGroup('due_at', trans('invoices.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($invoice->due_at)->toDateString()) }}
{{ Form::textGroup('invoice_number', trans('invoices.invoice_number'), 'file-text-o') }}
{{ Form::textGroup('invoice_number', trans('invoices.invoice_number'), 'file') }}
{{ Form::textGroup('order_number', trans('invoices.order_number'), 'shopping-cart',[]) }}
{{ Form::textGroup('order_number', trans('invoices.order_number'), 'shopping-cart',[]) }}
<div class="form-group col-md-12">
{!! Form::label('items', trans_choice($text_override['items'], 2), ['class' => 'control-label']) !!}
<div class="table-responsive">
<table class="table table-bordered" id="items">
<thead>
<tr style="background-color: #f9f9f9;">
@stack('actions_th_start')
<th width="5%" class="text-center">{{ trans('general.actions') }}</th>
@stack('actions_th_end')
@stack('name_th_start')
<th width="40%" class="text-left">{{ trans('general.name') }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th width="5%" class="text-center">{{ trans($text_override['quantity']) }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th width="10%" class="text-right">{{ trans($text_override['price']) }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
<th width="15%" class="text-right">{{ trans_choice('general.taxes', 1) }}</th>
@stack('taxes_th_end')
@stack('total_th_start')
<th width="10%" class="text-right">{{ trans('invoices.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@php $item_row = 0; $tax_row = 0; @endphp
@if(old('item'))
@foreach(old('item') as $old_item)
@php $item = (object) $old_item; @endphp
<div class="col-md-12 mb-4">
{!! Form::label('items', trans_choice($text_override['items'], 2), ['class' => 'control-label']) !!}
<div class="table-responsive">
<table class="table table-bordered" id="items">
<thead class="thead-light">
<tr class="row">
@stack('actions_th_start')
<th class="col-md-1 action-column border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
@stack('actions_th_end')
@stack('name_th_start')
<th class="col-md-3 text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="col-md-2 text-center border-right-0 border-bottom-0">{{ trans($text_override['quantity']) }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans($text_override['price']) }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
@stack('taxes_th_end')
@stack('total_th_start')
<th class="col-md-2 text-right border-bottom-0">{{ trans('invoices.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody id="invoice-item-rows">
@include('incomes.invoices.item')
@php $item_row++; @endphp
@endforeach
@else
@foreach($invoice->items as $item)
@include('incomes.invoices.item')
@php $item_row++; @endphp
@endforeach
@if (empty($invoice->items))
@include('incomes.invoices.item')
@endif
@endif
@php $item_row++; @endphp
@stack('add_item_td_start')
<tr id="addItem">
<td class="text-center"><button type="button" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-xs btn-primary" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
<td class="text-right" colspan="5"></td>
</tr>
@stack('add_item_td_end')
@stack('sub_total_td_start')
<tr id="tr-subtotal">
<td class="text-right" colspan="5"><strong>{{ trans('invoices.sub_total') }}</strong></td>
<td class="text-right"><span id="sub-total">0</span></td>
</tr>
@stack('sub_total_td_end')
@stack('add_discount_td_start')
<tr id="tr-discount">
<td class="text-right" style="vertical-align: middle;" colspan="5">
<a href="javascript:void(0)" id="discount-text" rel="popover">{{ trans('invoices.add_discount') }}</a>
</td>
<td class="text-right">
<span id="discount-total"></span>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right']) !!}
</td>
</tr>
@stack('add_discount_td_end')
@stack('tax_total_td_start')
<tr id="tr-tax">
<td class="text-right" colspan="5">
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
</td>
<td class="text-right"><span id="tax-total">0</span></td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr id="tr-total">
<td class="text-right" colspan="5"><strong>{{ trans('invoices.total') }}</strong></td>
<td class="text-right"><span id="grand-total">0</span></td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
@stack('add_item_td_start')
<tr class="row" id="addItem">
<td class="col-md-1 action-column border-right-0 border-bottom-0"><button type="button" @click="onAddItem" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-icon btn-outline-success btn-lg" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
<td class="col-md-11 text-right border-bottom-0"></td>
</tr>
@stack('add_item_td_end')
@stack('sub_total_td_start')
<tr class="row" id="tr-subtotal">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<strong>{{ trans('invoices.sub_total') }}</strong>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="sub-total" v-html="totals.sub">0</span>
</td>
</tr>
@stack('sub_total_td_end')
@stack('add_discount_td_start')
<tr class="row" id="tr-discount">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<el-popover
popper-class="p-0 h-0"
placement="bottom"
width="300"
v-model="discount">
<div class="card">
<div class="discount card-body">
<div class="row align-items-center">
<div class="col-md-6">
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text" id="input-discount">
<i class="fa fa-percent"></i>
</span>
</div>
{!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}
</div>
</div>
<div class="col-md-6">
<div class="discount-description">
<strong>{{ trans('invoices.discount_desc') }}</strong>
</div>
</div>
</div>
</div>
<div class="discount card-footer">
<div class="row text-center">
<div class="col-md-12">
<a href="javascript:void(0)" @click="discount = false" class="btn btn-icon btn-outline-secondary">
<span class="btn-inner--icon"><i class="fas fa-times"></i></span>
<span class="btn-inner--text">{{ trans('general.cancel') }}</span>
</a>
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
</div>
</div>
</div>
</div>
<el-link slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
</el-popover>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="discount-total" v-html="totals.discount"></span>
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
</td>
</tr>
@stack('add_discount_td_end')
@stack('tax_total_td_start')
<tr class="row" id="tr-tax">
<td class="col-md-10 text-right border-right-0 border-bottom-0">
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
</td>
<td class="col-md-2 text-right border-bottom-0">
<span id="tax-total" v-html="totals.tax">0</span>
</td>
</tr>
@stack('tax_total_td_end')
@stack('grand_total_td_start')
<tr class="row" id="tr-total">
<td class="col-md-10 text-right border-right-0">
<strong>{{ trans('invoices.total') }}</strong>
</td>
<td class="col-md-2 text-right">
<span id="grand-total" v-html="totals.total">0</span>
</td>
</tr>
@stack('grand_total_td_end')
</tbody>
</table>
</div>
</div>
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::textareaGroup('footer', trans('general.footer')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $invoice->category_id) }}
{{ Form::recurring('edit', $invoice) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('contact_name', old('contact_name'), ['id' => 'contact_name', 'v-model' => 'form.contact_name']) }}
{{ Form::hidden('contact_email', old('contact_email'), ['id' => 'contact_email', 'v-model' => 'form.contact_email']) }}
{{ Form::hidden('contact_tax_number', old('contact_tax_number'), ['id' => 'contact_tax_number', 'v-model' => 'form.contact_tax_number']) }}
{{ Form::hidden('contact_phone', old('contact_phone'), ['id' => 'contact_phone', 'v-model' => 'form.contact_phone']) }}
{{ Form::hidden('contact_address', old('contact_address'), ['id' => 'contact_address', 'v-model' => 'form.contact_address']) }}
{{ Form::hidden('currency_rate', old('currency_rate', 1), ['id' => 'currency_rate', 'v-model' => 'form.contact_rate']) }}
{{ Form::hidden('invoice_status_code', old('invoice_status_code', 'draft'), ['id' => 'invoice_status_code', 'v-model' => 'form.invoice_status_code']) }}
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
</div>
</div>
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
{{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories) }}
{{ Form::recurring('edit', $invoice) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('customer_name', old('customer_name', null), ['id' => 'customer_name']) }}
{{ Form::hidden('customer_email', old('customer_email', null), ['id' => 'customer_email']) }}
{{ Form::hidden('customer_tax_number', old('customer_tax_number', null), ['id' => 'customer_tax_number']) }}
{{ Form::hidden('customer_phone', old('customer_phone', null), ['id' => 'customer_phone']) }}
{{ Form::hidden('customer_address', old('customer_address', null), ['id' => 'customer_address']) }}
{{ Form::hidden('currency_rate', old('currency_rate', null), ['id' => 'currency_rate']) }}
{{ Form::hidden('invoice_status_code', old('invoice_status_code', null), ['id' => 'invoice_status_code']) }}
{{ Form::hidden('amount', old('amount', null), ['id' => 'amount']) }}
</div>
<!-- /.box-body -->
@permission('update-incomes-invoices')
<div class="box-footer">
{{ Form::saveButtons('incomes/invoices') }}
</div>
<!-- /.box-footer -->
@endpermission
@permission('update-incomes-invoices')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('incomes/invoices') }}
</div>
</div>
@endpermission
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-3-typeahead/4.0.1/bootstrap3-typeahead.min.js"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
@endpush
@push('scripts')
@push('scripts_start')
<script type="text/javascript">
var focus = false;
var item_row = '{{ $item_row }}';
var autocomplete_path = "{{ url('common/items/autocomplete') }}";
$(document).ready(function(){
$('#customer_id').trigger('change');
itemTableResize();
$('.input-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
});
$('.input-price').trigger('focusout');
totalItem();
//Date picker
$('#invoiced_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
//Date picker
$('#due_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$('.tax-select2').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>';
}
}
});
$('#customer_id').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
});
$('#currency_code').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
});
$('#category_id').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
// Discount popover
$('a[rel=popover]').popover({
html: true,
placement: 'bottom',
title: '{{ trans('invoices.discount') }}',
content: function () {
html = '<div class="discount box-body">';
html += ' <div class="col-md-6">';
html += ' <div class="input-group" id="input-discount">';
html += ' {!! Form::number('pre-discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}';
html += ' <div class="input-group-addon"><i class="fa fa-percent"></i></div>';
html += ' </div>';
html += ' </div>';
html += ' <div class="col-md-6">';
html += ' <div class="discount-description">';
html += ' {{ trans('invoices.discount_desc') }}';
html += ' </div>';
html += ' </div>';
html += '</div>';
html += '<div class="discount box-footer">';
html += ' <div class="col-md-12">';
html += ' <div class="form-group no-margin">';
html += ' {!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount','class' => 'btn btn-success']) !!}';
html += ' <a href="javascript:void(0)" id="cancel-discount" class="btn btn-default"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</a>';
html += ' </div>';
html += ' </div>';
html += '</div>';
return html;
}
});
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
@if($invoice->attachment)
placeholder : '{{ $invoice->attachment->basename }}'
@else
placeholder : '{{ trans('general.form.no_file_selected') }}'
@endif
});
@if($invoice->attachment)
$.ajax({
url: '{{ url('uploads/' . $invoice->attachment->id . '/show') }}',
type: 'GET',
data: {column_name: 'attachment'},
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$('.fancy-file').after(json['html']);
}
}
});
@endif
@if(old('item'))
totalItem();
@endif
});
@permission('delete-common-uploads')
@if($invoice->attachment)
$(document).on('click', '#remove-attachment', function (e) {
confirmDelete("#attachment-{!! $invoice->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $invoice->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endif
@endpermission
$(document).on('click', '#button-add-item', function (e) {
$.ajax({
url: '{{ url("incomes/invoices/addItem") }}',
type: 'GET',
dataType: 'JSON',
data: {item_row: item_row, currency_code : $('#currency_code').val()},
success: function(json) {
if (json['success']) {
$('#items tbody #addItem').before(json['html']);
//$('[rel=tooltip]').tooltip();
$('[data-toggle="tooltip"]').tooltip('hide');
$('#item-row-' + item_row + ' .tax-select2').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>';
}
}
});
var currency = json['data']['currency'];
$('#item-price-' + item_row).maskMoney({
thousands : currency.thousands_separator,
decimal : currency.decimal_mark,
precision : currency.precision,
allowZero : true,
prefix : (currency.symbol_first) ? currency.symbol : '',
suffix : (currency.symbol_first) ? '' : currency.symbol
});
$('#item-price-' + item_row).trigger('focusout');
item_row++;
}
}
});
});
$(document).on('click', '.form-control.typeahead', function() {
input_id = $(this).attr('id').split('-');
item_id = parseInt(input_id[input_id.length-1]);
$(this).typeahead({
minLength: 3,
displayText:function (data) {
return data.name + ' (' + data.sku + ')';
},
source: function (query, process) {
$.ajax({
url: autocomplete_path,
type: 'GET',
dataType: 'JSON',
data: 'query=' + query + '&type=invoice&currency_code=' + $('#currency_code').val(),
success: function(data) {
return process(data);
}
});
},
afterSelect: function (data) {
$('#item-id-' + item_id).val(data.item_id);
$('#item-quantity-' + item_id).val('1');
$('#item-price-' + item_id).val(data.sale_price);
$('#item-tax-' + item_id).val(data.tax_id);
// This event Select2 Stylesheet
$('#item-price-' + item_id).trigger('focusout');
$('#item-tax-' + item_id).trigger('change');
$('#item-total-' + item_id).html(data.total);
totalItem();
}
});
});
$(document).on('click', '#tax-add-new', 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, tax_selector: '.tax-select2'},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
$(document).on('keyup', '#pre-discount', function(e){
e.preventDefault();
$('#discount').val($(this).val());
totalItem();
});
$(document).on('click', '#save-discount', function(){
$('a[rel=popover]').trigger('click');
});
$(document).on('click', '#cancel-discount', function(){
$('#discount').val('');
totalItem();
$('a[rel=popover]').trigger('click');
});
$(document).on('change', '#currency_code, #items tbody select', function(){
totalItem();
});
$(document).on('focusin', '#items .input-price', function(){
focus = true;
});
$(document).on('blur', '#items .input-price', function(){
if (focus) {
totalItem();
focus = false;
}
});
$(document).on('keyup', '#items tbody .form-control', function(){
if (!$(this).hasClass('input-price')) {
totalItem();
}
});
$(document).on('change', '#customer_id', function (e) {
$.ajax({
url: '{{ url("incomes/customers/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'customer_id=' + $(this).val(),
success: function(data) {
$('#customer_name').val(data.name);
$('#customer_email').val(data.email);
$('#customer_tax_number').val(data.tax_number);
$('#customer_phone').val(data.phone);
$('#customer_address').val(data.address);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
$('.input-price').each(function(){
input_price_id = $(this).attr('id');
input_currency_id = input_price_id.replace('price', 'currency');
$('#' + input_currency_id).val(data.currency_code);
amount = $(this).maskMoney('unmasked')[0];
$(this).maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$(this).val(amount);
$(this).trigger('focusout');
});
// This event Select2 Stylesheet
$('#currency_code').trigger('change');
}
});
});
$(document).on('hidden.bs.modal', '#modal-create-tax', function () {
$('.tax-select2').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>';
}
}
});
});
function totalItem() {
$.ajax({
url: '{{ url("common/items/totalItem") }}',
type: 'POST',
dataType: 'JSON',
data: $('#currency_code, #discount input[type=\'number\'], #items input[type=\'text\'], #items input[type=\'number\'], #items input[type=\'hidden\'], #items textarea, #items select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(data) {
if (data) {
$.each( data.items, function( key, value ) {
$('#item-total-' + key).html(value);
});
$('#discount-text').text(data.discount_text);
$('#sub-total').html(data.sub_total);
$('#discount-total').html(data.discount_total);
$('#tax-total').html(data.tax_total);
$('#grand-total').html(data.grand_total);
$('.input-price').each(function(){
input_price_id = $(this).attr('id');
input_currency_id = input_price_id.replace('price', 'currency');
$('#' + input_currency_id).val(data.currency_code);
amount = $(this).maskMoney('unmasked')[0];
$(this).maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$(this).val(amount);
$(this).trigger('focusout');
});
}
}
});
}
var invoice_items = {!! json_encode($invoice->items()->select(['item_id', 'name', 'quantity', 'price', 'total', 'tax'])->get()) !!};
</script>
<script src="{{ asset('public/js/incomes/invoices.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,126 +3,100 @@
@section('title', trans_choice('general.invoices', 2))
@section('new_button')
@permission('create-incomes-invoices')
<span class="new-button"><a href="{{ url('incomes/invoices/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/incomes/invoices') }}" class="btn btn-default btn-sm"><span class="fa fa-download"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('invoices.export', request()->input()) }}" class="btn btn-default btn-sm"><span class="fa fa-upload"></span> &nbsp;{{ trans('general.export') }}</a></span>
@permission('create-incomes-invoices')
<span><a href="{{ route('invoices.create') }}" class="btn btn-primary btn-sm btn-success header-button-top"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/incomes/invoices') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('invoices.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> &nbsp;{{ trans('general.export') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'incomes/invoices', '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('customers[]', $customers, request('customers'), ['id' => 'filter-customers', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::dateRange('invoice_date', trans('invoices.invoice_date'), 'calendar', []) !!}
{!! Form::select('statuses[]', $statuses, request('statuses'), ['id' => 'filter-statuses', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
<div class="card">
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
{!! Form::open([
'url' => 'incomes/invoices',
'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>
{{ Form::bulkActionRowGroup('general.invoices', $bulk_actions, 'incomes/invoices') }}
{!! 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-invoices">
<thead>
<tr>
<th class="col-md-2">@sortablelink('invoice_number', trans_choice('general.numbers', 1))</th>
<th class="col-md-2">@sortablelink('customer_name', trans_choice('general.customers', 1))</th>
<th class="col-md-2 text-right amount-space">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
<th class="col-md-2">@sortablelink('due_at', trans('invoices.due_date'))</th>
<th class="col-md-1">@sortablelink('invoice_status_code', 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-1 col-lg-1 col-xl-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-md-2 col-lg-2 col-xl-2 hidden-md">@sortablelink('invoice_number', trans_choice('general.numbers', 1), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-4 col-lg-2 col-xl-2">@sortablelink('contact_name', trans_choice('general.customers', 1))</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-lg-2 col-xl-2 hidden-lg">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
<th class="col-lg-2 col-xl-2 hidden-lg">@sortablelink('due_at', trans('invoices.due_date'))</th>
<th class="col-lg-1 col-xl-1 hidden-lg">@sortablelink('invoice_status_code', trans_choice('general.statuses', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
</tr>
</thead>
<tbody>
@foreach($invoices as $item)
@php $paid = $item->paid; @endphp
<tr>
<td><a href="{{ url('incomes/invoices/' . $item->id) }}">{{ $item->invoice_number }}</a></td>
<td>{{ $item->customer_name }}</td>
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td>{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
<td>{{ Date::parse($item->due_at)->format($date_format) }}</td>
<td><span class="label {{ $item->status->label }}">{{ trans('invoices.status.' . $item->status->code) }}</span></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="{{ url('incomes/invoices/' . $item->id) }}">{{ trans('general.show') }}</a></li>
@if (!$item->reconciled)
<li><a href="{{ url('incomes/invoices/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@endif
@permission('create-incomes-invoices')
<li class="divider"></li>
<li><a href="{{ url('incomes/invoices/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-incomes-invoices')
@if (!$item->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'incomes/invoices') !!}</li>
@endif
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
@foreach($invoices as $item)
@php $paid = $item->paid; @endphp
<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->invoice_number) }}</td>
<td class="col-md-2 col-lg-2 col-xl-2 hidden-md"><a class="col-aka text-success" href="{{ route('invoices.show' , $item->id) }}">{{ $item->invoice_number }}</a></td>
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-2 col-xl-2">{{ $item->contact_name }}</td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-lg-2 col-xl-2 hidden-lg">@date($item->invoiced_at)</td>
<td class="col-lg-2 col-xl-2 hidden-lg">@date($item->due_at)</td>
<td class="col-lg-1 col-xl-1 hidden-lg">
<span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('invoices.status.' . $item->status->code) }}</span>
</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">
<a class="dropdown-item" href="{{ route('invoices.show', $item->id) }}">{{ trans('general.show') }}</a>
@if (!$item->reconciled)
<a class="dropdown-item" href="{{ route('invoices.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@endif
<div class="dropdown-divider"></div>
@permission('create-incomes-invoices')
<a class="dropdown-item" href="{{ route('invoices.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
<div class="dropdown-divider"></div>
@endpermission
@permission('delete-incomes-invoices')
@if (!$item->reconciled)
{!! Form::deleteLink($item, 'incomes/invoices') !!}
@endif
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $invoices, 'type' => 'invoices'])
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $invoices, 'type' => 'invoices'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@push('scripts_start')
<script src="{{ asset('public/js/incomes/invoices.js?v=' . version('short')) }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-categories").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#filter-customers").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
});
$("#filter-statuses").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.statuses', 1)]) }}"
});
});
</script>
@endpush

View File

@ -3,190 +3,270 @@
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
@section('content')
<div class="row header">
<div class="col-58">
@if ($logo)
<img src="{{ $logo }}" class="logo" />
<div class="mt-6">
<div class="row mx--4">
<div class="col-md-7 border-bottom-1">
<div class="table-responsive mt-2">
<table class="table table-borderless">
<tbody>
<tr>
<th>
@if ($logo)
<img src="{{ $logo }}"/>
@endif
</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-5 border-bottom-1">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ setting('company.name') }}
</th>
</tr>
<tr>
<th>
{!! nl2br(setting('company.address')) !!}
</th>
</tr>
<tr>
<th>
@if (setting('company.tax_number'))
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
@endif
</th>
</tr>
<tr>
<th>
@if (setting('company.phone'))
{{ setting('company.phone') }}
@endif
</th>
</tr>
<tr>
<th>
{{ setting('company.email') }}
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ trans('invoices.bill_to') }}
@stack('name_input_start')
<strong class="d-block">{{ $invoice->contact_name }}</strong>
@stack('name_input_end')
</th>
</tr>
<tr>
<th>
@stack('address_input_start')
{!! nl2br($invoice->contact_address) !!}
@stack('address_input_end')
</th>
</tr>
<tr>
<th>
@stack('tax_number_input_start')
@if ($invoice->contact_tax_number)
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}<br>
@endif
@stack('tax_number_input_end')
</th>
</tr>
<tr>
<th>
@stack('phone_input_start')
@if ($invoice->contact_phone)
{{ $invoice->contact_phone }}
@endif
@stack('phone_input_end')
</th>
</tr>
<tr>
<th>
@stack('email_start')
{{ $invoice->contact_email }}
@stack('email_input_end')
</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
@stack('invoice_number_input_start')
<tr>
<th>{{ trans('invoices.invoice_number') }}:</th>
<td class="text-right">{{ $invoice->invoice_number }}</td>
</tr>
@stack('invoice_number_input_end')
@stack('order_number_input_start')
@if ($invoice->order_number)
<tr>
<th>{{ trans('invoices.order_number') }}:</th>
<td class="text-right">{{ $invoice->order_number }}</td>
</tr>
@endif
@stack('order_number_input_end')
@stack('invoiced_at_input_start')
<tr>
<th>{{ trans('invoices.invoice_date') }}:</th>
<td class="text-right">@date($invoice->invoiced_at)</td>
</tr>
@stack('invoiced_at_input_end')
@stack('due_at_input_start')
<tr>
<th>{{ trans('invoices.payment_due') }}:</th>
<td class="text-right">@date($invoice->due_at)</td>
</tr>
@stack('due_at_input_end')
</tbody>
</table>
</div>
</div>
</div>
<div class="row show-table">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr class="row">
@stack('name_th_start')
<th class="col-xs-4 col-sm-3 pl-5">{{ trans_choice($text_override['items'], 2) }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="col-xs-4 col-sm-3 text-center">{{ trans($text_override['quantity']) }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="col-sm-3 text-center hidden-sm pl-5">{{ trans($text_override['price']) }}</th>
@stack('price_th_end')
@stack('total_th_start')
<th class="col-xs-4 col-sm-3 text-right pr-5">{{ trans('invoices.total') }}</th>
@stack('total_th_end')
</tr>
@foreach($invoice->items as $item)
<tr class="row">
@stack('name_td_start')
<td class="col-xs-4 col-sm-3 pl-5">
{{ $item->name }}
@if ($item->desc)
<br><small>{!! $item->desc !!}</small>
@endif
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="col-xs-4 col-sm-3 text-center">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="col-sm-3 text-center hidden-sm pl-5">@money($item->price, $invoice->currency_code, true)</td>
@stack('price_td_end')
@stack('total_td_start')
<td class="col-xs-4 col-sm-3 text-right pr-5">@money($item->total, $invoice->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
@stack('notes_input_start')
@if ($invoice->notes)
<table class="table table-borderless">
<tbody>
<tr>
<th>
<p class="form-control-label">{{ trans_choice('general.notes', 2) }}</p>
<p class="form-control text-muted show-note">{{ $invoice->notes }}</p>
</th>
</tr>
</tbody>
</table>
@endif
@stack('notes_input_end')
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table">
<tbody>
@foreach ($invoice->totals as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
<tr>
<th>
{{ trans($total->title) }}:
</th>
<td class="text-right">
@money($total->amount, $invoice->currency_code, true)
</td>
</tr>
@stack($total->code . '_td_end')
@else
@if ($invoice->paid)
<tr>
<th>
{{ trans('invoices.paid') }}:
</th>
<td class="text-right">
- @money($invoice->paid, $invoice->currency_code, true)
</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>
{{ trans($total->name) }}:
</th>
<td class="text-right">
@money($total->amount - $invoice->paid, $invoice->currency_code, true)
</td>
</tr>
@stack('grand_total_td_end')
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@if ($item->footer)
<div class="row">
{!! $item->footer !!}
</div>
@endif
</div>
<div class="col-42">
<div class="text company">
<strong>{{ setting('general.company_name') }}</strong><br>
{!! nl2br(setting('general.company_address')) !!}<br>
@if (setting('general.company_tax_number'))
{{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}<br>
@endif
<br>
@if (setting('general.company_phone'))
{{ setting('general.company_phone') }}<br>
@endif
{{ setting('general.company_email') }}
</div>
</div>
</div>
<div class="row">
<div class="col-58">
<div class="text">
{{ trans('invoices.bill_to') }}<br><br>
@stack('name_input_start')
<strong>{{ $invoice->customer_name }}</strong><br>
@stack('name_input_end')
@stack('address_input_start')
{!! nl2br($invoice->customer_address) !!}<br>
@stack('address_input_end')
@stack('tax_number_input_start')
@if ($invoice->customer_tax_number)
{{ trans('general.tax_number') }}: {{ $invoice->customer_tax_number }}<br>
@endif
@stack('tax_number_input_end')
<br>
@stack('phone_input_start')
@if ($invoice->customer_phone)
{{ $invoice->customer_phone }}<br>
@endif
@stack('phone_input_end')
@stack('email_start')
{{ $invoice->customer_email }}
@stack('email_input_end')
</div>
</div>
<div class="col-42">
<div class="text">
<table>
<tbody>
@stack('invoice_number_input_start')
<tr>
<th>{{ trans('invoices.invoice_number') }}:</th>
<td class="text-right">{{ $invoice->invoice_number }}</td>
</tr>
@stack('invoice_number_input_end')
@stack('order_number_input_start')
@if ($invoice->order_number)
<tr>
<th>{{ trans('invoices.order_number') }}:</th>
<td class="text-right">{{ $invoice->order_number }}</td>
</tr>
@endif
@stack('order_number_input_end')
@stack('invoiced_at_input_start')
<tr>
<th>{{ trans('invoices.invoice_date') }}:</th>
<td class="text-right">{{ Date::parse($invoice->invoiced_at)->format($date_format) }}</td>
</tr>
@stack('invoiced_at_input_end')
@stack('due_at_input_start')
<tr>
<th>{{ trans('invoices.payment_due') }}:</th>
<td class="text-right">{{ Date::parse($invoice->due_at)->format($date_format) }}</td>
</tr>
@stack('due_at_input_end')
</tbody>
</table>
</div>
</div>
</div>
<table class="lines">
<thead>
<tr>
@stack('actions_th_start')
@stack('actions_th_end')
@stack('name_th_start')
<th class="item">{{ trans_choice($text_override['items'], 2) }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="quantity">{{ trans($text_override['quantity']) }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="price">{{ trans($text_override['price']) }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
@stack('taxes_th_end')
@stack('total_th_start')
<th class="total">{{ trans('invoices.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@foreach($invoice->items as $item)
<tr>
@stack('actions_td_start')
@stack('actions_td_end')
@stack('name_td_start')
<td class="item">
{{ $item->name }}
@if ($item->sku)
<br><small>{{ trans('items.sku') }}: {{ $item->sku }}</small>
@endif
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="quantity">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="style-price price">@money($item->price, $invoice->currency_code, true)</td>
@stack('price_td_end')
@stack('taxes_td_start')
@stack('taxes_td_end')
@stack('total_td_start')
<td class="style-price total">@money($item->total, $invoice->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
</tbody>
</table>
<div class="row">
<div class="col-58">
@stack('notes_input_start')
@if ($invoice->notes)
<table class="text" style="page-break-inside: avoid;">
<tr><th>{{ trans_choice('general.notes', 2) }}</th></tr>
<tr><td>{{ $invoice->notes }}</td></tr>
</table>
@endif
@stack('notes_input_end')
</div>
<div class="col-42">
<table class="text" style="page-break-inside: avoid;">
<tbody>
@foreach ($invoice->totals as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
<tr>
<th>{{ trans($total->title) }}:</th>
<td class="style-price text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@stack($total->code . '_td_end')
@else
@if ($invoice->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="style-price text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>{{ trans($total->name) }}:</th>
<td class="style-price text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@stack('grand_total_td_end')
@endif
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@if (isset($currency_style) && $currency_style)
@push('stylesheet')
<style type="text/css">
.style-price {
font-family: sans-serif;
font-size: 15px;
}
</style>
@endpush
@endif

View File

@ -1,54 +1,121 @@
<tr id="item-row-{{ $item_row }}">
<tr class="row" v-for="(row, index) in form.items"
:index="index">
@stack('actions_td_start')
<td class="text-center" style="vertical-align: middle;">
@stack('actions_button_start')
<button type="button" onclick="$(this).tooltip('destroy'); $('#item-row-{{ $item_row }}').remove(); totalItem();" data-toggle="tooltip" title="{{ trans('general.delete') }}" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i></button>
@stack('actions_button_end')
</td>
<td class="col-md-1 action-column border-right-0 border-bottom-0">
@stack('actions_button_start')
<button type="button"
@click="onDeleteItem(index)"
data-toggle="tooltip"
title="{{ trans('general.delete') }}"
class="btn btn-icon btn-outline-danger btn-lg"><i class="fa fa-trash"></i>
</button>
@stack('actions_button_end')
</td>
@stack('actions_td_end')
@stack('name_td_start')
<td {!! $errors->has('item.' . $item_row . '.name') ? 'class="has-error"' : '' !!}>
@stack('name_input_start')
<input value="{{ empty($item) ? '' : $item->name }}" class="form-control typeahead" required="required" placeholder="{{ trans('general.form.enter', ['field' => trans_choice('invoices.item_name', 1)]) }}" name="item[{{ $item_row }}][name]" type="text" id="item-name-{{ $item_row }}" autocomplete="off">
<input value="{{ empty($item) ? '' : $item->item_id }}" name="item[{{ $item_row }}][item_id]" type="hidden" id="item-id-{{ $item_row }}">
{!! $errors->first('item.' . $item_row . '.name', '<p class="help-block">:message</p>') !!}
@stack('name_input_end')
</td>
<td class="col-md-3 border-right-0 border-bottom-0">
@stack('name_input_start')
<input class="form-control"
data-item="name"
required="required"
name="items[][name]"
v-model="row.name"
@input="onGetItem($event, index)"
type="text"
autocomplete="off">
<div class="dropdown-menu item-show dropdown-menu-center" ref="menu" :class="[{show: row.show}]">
<div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" v-for="(item, item_index) in items" @click="onSelectItem(item, index)">
<div class="row align-items-center">
<div class="col ml--2">
<div class="d-flex justify-content-between align-items-center">
<div>
<div class="name" v-text="item.name"></div>
</div>
</div>
</div>
</div>
</a>
</div>
</div>
<input name="items[][show]"
value="false"
v-model="row.show"
data-item="show"
type="hidden">
<input name="items[][item_id]"
v-model="row.item_id"
data-item="item_id"
type="hidden">
{!! $errors->first('item.name', '<p class="help-block">:message</p>') !!}
@stack('name_input_end')
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td {{ $errors->has('item.' . $item_row . '.quantity') ? 'class="has-error"' : '' }}>
@stack('quantity_input_start')
<input value="{{ empty($item) ? 1 : $item->quantity }}" class="form-control text-center" required="required" name="item[{{ $item_row }}][quantity]" type="text" id="item-quantity-{{ $item_row }}">
{!! $errors->first('item.' . $item_row . '.quantity', '<p class="help-block">:message</p>') !!}
@stack('quantity_input_end')
</td>
<td class="col-md-2 border-right-0 border-bottom-0">
@stack('quantity_input_start')
<input class="form-control text-center"
required="required"
data-item="quantity"
v-model="row.quantity"
@input="onCalculateTotal"
name="item[][quantity]"
type="text">
{!! $errors->first('item.quantity', '<p class="help-block">:message</p>') !!}
@stack('quantity_input_end')
</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td {{ $errors->has('item.' . $item_row . 'price') ? 'class="has-error"' : '' }}>
@stack('price_input_start')
<input value="{{ empty($item) ? '' : $item->price }}" class="form-control text-right input-price" required="required" name="item[{{ $item_row }}][price]" type="text" id="item-price-{{ $item_row }}">
<input value="{{ $currency->code }}" name="item[{{ $item_row }}][currency]" type="hidden" id="item-currency-{{ $item_row }}">
{!! $errors->first('item.' . $item_row . 'price', '<p class="help-block">:message</p>') !!}
@stack('price_input_end')
</td>
<td class="col-md-2 border-right-0 border-bottom-0">
@stack('price_input_start')
<input class="form-control text-right input-price"
required="required"
data-item="price"
v-model.lazy="row.price"
v-money="money"
@input="onCalculateTotal"
name="items[][price]"
type="text">
<input name="items[][currency]"
data-item="currency"
v-model="row.currency"
@input="onCalculateTotal"
type="hidden">
{!! $errors->first('item.price', '<p class="help-block">:message</p>') !!}
@stack('price_input_end')
</td>
@stack('price_td_end')
@stack('taxes_td_start')
<td {{ $errors->has('item.' . $item_row . '.tax_id') ? 'class="has-error"' : '' }}>
@stack('tax_id_input_start')
{!! Form::select('item[' . $item_row . '][tax_id][]', $taxes, (empty($item) || empty($item->taxes)) ? setting('general.default_tax') : $item->taxes->pluck('tax_id'), ['id'=> 'item-tax-' . $item_row, 'class' => 'form-control tax-select2', 'multiple' => 'true']) !!}
{!! $errors->first('item.' . $item_row . '.tax_id', '<p class="help-block">:message</p>') !!}
@stack('tax_id_input_end')
</td>
<td class="col-md-2 border-right-0 border-bottom-0">
@stack('tax_id_input_start')
{{ Form::multiSelectAddNewGroup('tax_id', '', '', $taxes, '', [
'data-item' => 'tax_id',
'v-model' => 'row.tax_id',
'change' => 'onCalculateTotal',
'class' => 'form-control'
], 'mb-0 select-tax') }}
@stack('tax_id_input_end')
</td>
@stack('taxes_td_end')
@stack('total_td_start')
<td class="text-right" style="vertical-align: middle;">
@stack('total_input_start')
@if (empty($item) || !isset($item->total))
<span id="item-total-{{ $item_row }}">0</span>
@else
<span id="item-total-{{ $item_row }}">@money($item->total, $invoice->currency_code, true)</span>
@endif
@stack('total_input_end')
</td>
<td class="col-md-2 text-right total-column border-bottom-0">
<input name="item[][total]"
data-item="total"
v-model.lazy="row.total"
v-money="money"
type="hidden">
@stack('total_input_start')
@if (empty($item) || !isset($item->total))
<span id="item-total" v-html="row.total">0</span>
@else
<span id="item-total" v-html="row.total">@money($item->total, $invoice->currency_code, true)</span>
@endif
@stack('total_input_end')
</td>
@stack('total_td_end')
</tr>

File diff suppressed because it is too large Load Diff

View File

@ -3,207 +3,58 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.revenues', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'incomes/revenues', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'revenues.store',
'id' => 'revenue',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button needs-validation',
'novalidate' => 'true'
]) !!}
<div class="box-body">
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar',['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
<div class="card-body">
<div class="row">
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', '', ['id' => 'currency_rate']) !!}
{!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', '1', ['id' => 'currency_rate']) !!}
{{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], 0) }}
@stack('account_id_input_start')
<div class="form-group col-md-6 form-small">
{!! Form::label('account_id', trans_choice('general.accounts', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-university"></i></div>
{!! Form::select('account_id', $accounts, setting('general.default_account'), array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
<div class="input-group-append">
{!! Form::text('currency', $account_currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, setting('default.contact'), []) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category')) }}
{{ Form::recurring('create') }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::selectGroup('document_id', trans_choice('general.invoices', 1), 'file-invoice', [], null, ['disabled']) }}
</div>
</div>
</div>
@stack('account_id_input_end')
@stack('customer_id_input_start')
<div class="form-group col-md-6">
{!! Form::label('customer_id', trans_choice('general.customers', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-user"></i></div>
{!! Form::select('customer_id', $customers, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)])])) !!}
<span class="input-group-btn">
<button type="button" id="button-customer" class="btn btn-default btn-icon"><i class="fa fa-plus"></i></button>
</span>
</div>
</div>
@stack('customer_id_input_end')
{{ Form::textareaGroup('description', trans('general.description')) }}
@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>
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('incomes/revenues') }}
</div>
</div>
{!! $errors->first('category_id', '<p class="help-block">:message</p>') !!}
</div>
@stack('category_id_input_end')
{{ Form::recurring('create') }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('general.default_payment_method')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
{{ Form::hidden('type', 'income') }}
{!! Form::close() !!}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('incomes/revenues') }}
</div>
<!-- /.box-footer -->
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
<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('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.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">
$(document).ready(function(){
$("#amount").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
});
$('#amount').trigger('focus');
$('#account_id').trigger('change');
//Date picker
$('#paid_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$("#account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#category_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#customer_id").select2({
placeholder: {
id: '-1', // the value of the option
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
}
});
$("#payment_method").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
});
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '{{ trans('general.form.no_file_selected') }}'
});
});
$(document).on('change', '#account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('#currency').val(data.currency_code);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
amount = $('#amount').maskMoney('unmasked')[0];
$("#amount").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#amount').val(amount);
$('#amount').trigger('focus');
}
});
});
$(document).on('click', '#button-customer', function (e) {
$('#modal-create-customer').remove();
$.ajax({
url: '{{ url("modals/customers/create") }}',
type: 'GET',
dataType: 'JSON',
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: 'income'},
success: function(json) {
if (json['success']) {
$('body').append(json['html']);
}
}
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/incomes/revenues.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -15,183 +15,63 @@
</div>
@endif
<!-- Default box -->
<div class="box box-success">
<div class="card">
{!! Form::model($revenue, [
'method' => 'PATCH',
'files' => true,
'url' => ['incomes/revenues', $revenue->id],
'route' => ['revenues.update', $revenue->id],
'role' => 'form',
'class' => 'form-loading-button'
'id' => 'revenue',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'class' => 'form-loading-button',
'novalidate' => 'true'
]) !!}
<div class="box-body">
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::parse($revenue->paid_at)->toDateString()) }}
<div class="card-body">
<div class="row">
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($revenue->paid_at)->toDateString()) }}
{!! Form::hidden('currency_code', $revenue->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
{!! Form::hidden('currency_code', $revenue->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
{{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], $revenue->amount) }}
@stack('account_id_input_start')
<div class="form-group col-md-6 form-small">
{!! Form::label('account_id', trans_choice('general.accounts', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-university"></i></div>
{!! Form::select('account_id', $accounts, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
<div class="input-group-append">
{!! Form::text('currency', $revenue->currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
</div>
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $revenue->account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }}
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $revenue->contact_id, []) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id) }}
{{ Form::recurring('edit', $revenue) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $revenue->payment_method) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
@if ($revenue->invoice)
{{ Form::textGroup('document_id', trans_choice('general.invoices', 1), 'file-invoice', ['disabled'], $revenue->invoice->invoice_number) }}
@endif
</div>
</div>
@stack('account_id_input_end')
{{ Form::selectGroup('customer_id', trans_choice('general.customers', 1), 'user', $customers, null, []) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories) }}
{{ Form::recurring('edit', $revenue) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o',[]) }}
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
</div>
<!-- /.box-body -->
@permission('update-incomes-revenues')
<div class="box-footer">
{{ Form::saveButtons('incomes/revenues') }}
</div>
<!-- /.box-footer -->
@endpermission
@permission('update-incomes-revenues')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('incomes/revenues') }}
</div>
</div>
@endpermission
{{ Form::hidden('type', 'income') }}
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#amount").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
});
$('#amount').trigger('focus');
$('#account_id').trigger('change');
//Date picker
$('#paid_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$("#account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$("#category_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#customer_id").select2({
placeholder: {
id: '-1', // the value of the option
text: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
}
});
$("#payment_method").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
});
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
@if($revenue->attachment)
placeholder : '{{ $revenue->attachment->basename }}'
@else
placeholder : '{{ trans('general.form.no_file_selected') }}'
@endif
});
@if($revenue->attachment)
$.ajax({
url: '{{ url('uploads/' . $revenue->attachment->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-{!! $revenue->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $revenue->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endif
@endpermission
});
$(document).on('change', '#account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('#currency').val(data.currency_code);
$('#currency_code').val(data.currency_code);
$('#currency_rate').val(data.currency_rate);
amount = $('#amount').maskMoney('unmasked')[0];
$("#amount").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('#amount').val(amount);
$('#amount').trigger('focus');
}
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/incomes/revenues.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,129 +3,106 @@
@section('title', trans_choice('general.revenues', 2))
@section('new_button')
@permission('create-incomes-revenues')
<span class="new-button"><a href="{{ url('incomes/revenues/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/incomes/revenues') }}" class="btn btn-default btn-sm"><span class="fa fa-download"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('revenues.export', request()->input()) }}" class="btn btn-default btn-sm"><span class="fa fa-upload"></span> &nbsp;{{ trans('general.export') }}</a></span>
@permission('create-incomes-revenues')
<span><a href="{{ route('revenues.create') }}" class="btn btn-primary btn-sm btn-success header-button-top"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/incomes/revenues') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('revenues.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> &nbsp;{{ trans('general.export') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
{!! Form::open(['url' => 'incomes/revenues', '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::dateRange('date', trans('general.date'), 'calendar', []) !!}
{!! Form::select('customers[]', $customers, request('customers'), ['id' => 'filter-customers', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('categories[]', $categories, request('categories'), ['id' => 'filter-categories', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::select('accounts[]', $accounts, request('accounts'), ['id' => 'filter-accounts', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
<div class="card">
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
{!! Form::open([
'url' => 'incomes/revenues',
'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>
{{ Form::bulkActionRowGroup('general.revenues', $bulk_actions, 'incomes/revenues') }}
{!! 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-revenues">
<thead>
<tr>
<th class="col-md-2">@sortablelink('paid_at', trans('general.date'))</th>
<th class="col-md-2 text-right amount-space">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-3 hidden-xs">@sortablelink('customer.name', trans_choice('general.customers', 1))</th>
<th class="col-md-2 hidden-xs">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-md-2 hidden-xs">@sortablelink('account.name', trans_choice('general.accounts', 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-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3">@sortablelink('paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2 col-lg-2 col-xl-3 hidden-md">@sortablelink('contact.name', trans_choice('general.customers', 1))</th>
<th class="col-lg-2 col-xl-2 hidden-lg">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-lg-2 col-xl-1 hidden-lg">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
</tr>
</thead>
<tbody>
@foreach($revenues as $item)
@php $is_transfer = ($item->category && ($item->category->id == $transfer_cat_id)); @endphp
<tr>
@if ($item->reconciled)
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
@else
<td><a href="{{ url('incomes/revenues/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
@endif
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
<td class="hidden-xs">{{ !empty($item->customer->name) ? $item->customer->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="hidden-xs">{{ $item->account ? $item->account->name : trans('general.na') }}</td>
<td class="text-center">
@if (!$is_transfer)
<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">
@if (!$item->reconciled)
<li><a href="{{ url('incomes/revenues/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
<li class="divider"></li>
@endif
@permission('create-incomes-revenues')
<li><a href="{{ url('incomes/revenues/' . $item->id . '/duplicate') }}">{{ trans('general.duplicate') }}</a></li>
@endpermission
@permission('delete-incomes-revenues')
@if (!$item->reconciled)
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'incomes/revenues') !!}</li>
@endif
@endpermission
</ul>
</div>
@foreach($revenues as $item)
@php $is_transfer = ($item->category && ($item->category->id == $transfer_cat_id)); @endphp
<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->contact->name) }}</td>
@if ($item->reconciled)
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3">@date($item->paid_at)</td>
@else
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3"><a class="text-success col-aka" href="{{ route('revenues.edit', $item->id) }}">@date($item->paid_at)</a></td>
@endif
</td>
</tr>
@endforeach
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-2 col-xl-3 hidden-md">{{ !empty($item->contact->name) ? $item->contact->name : trans('general.na') }}</td>
<td class="col-lg-2 col-xl-2 hidden-lg">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="col-lg-2 col-xl-1 hidden-lg">{{ $item->account ? $item->account->name : trans('general.na') }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
@if (!$is_transfer)
<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->reconciled)
<a class="dropdown-item" href="{{ route('revenues.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@endif
@permission('create-incomes-revenues')
<a class="dropdown-item" href="{{ route('revenues.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
@endpermission
@permission('delete-incomes-revenues')
@if (!$item->reconciled)
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'incomes/revenues') !!}
@endif
@endpermission
</div>
</div>
@else
<div class="dropdown">
<button class="btn btn-secondary btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="tooltip" aria-haspopup="true" aria-expanded="false" title="This Transfer, If you want to action redirect">
<i class="fa fa-exchange-alt text-muted"></i>
</button>
</div>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $revenues, 'type' => 'revenues'])
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $revenues, 'type' => 'revenues'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/moment.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.js') }}"></script>
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/locales/bootstrap-datepicker.' . language()->getShortCode() . '.js') }}"></script>
@endif
@push('scripts_start')
<script src="{{ asset('public/js/incomes/revenues.js?v=' . version('short')) }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/daterangepicker/daterangepicker.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-categories").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$("#filter-customers").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
});
$("#filter-accounts").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
});
</script>
@endpush

View File

@ -3,35 +3,13 @@
@section('header', trans('install.steps.database'))
@section('content')
{{ Form::textGroup('hostname', trans('install.database.hostname'), 'server', ['required' => 'required'], old('hostname', 'localhost'), 'col-md-12') }}
<div class="row">
{{ Form::textGroup('hostname', trans('install.database.hostname'), 'server', ['required' => 'required'], old('hostname', 'localhost'), 'col-md-12') }}
{{ Form::textGroup('username', trans('install.database.username'), 'user', ['required' => 'required'], old('username'), 'col-md-12') }}
{{ Form::textGroup('username', trans('install.database.username'), 'user', ['required' => 'required'], old('username'), 'col-md-12') }}
{{ Form::passwordGroup('password', trans('install.database.password'), 'key', [], old('password'), 'col-md-12') }}
{{ Form::passwordGroup('password', trans('install.database.password'), 'key', [], 'col-md-12') }}
{{ Form::textGroup('database', trans('install.database.name'), 'database', ['required' => 'required'], old('database'), 'col-md-12') }}
{{ Form::textGroup('database', trans('install.database.name'), 'database', ['required' => 'required'], old('database'), 'col-md-12 mb--2') }}
</div>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function() {
$('#next-button').attr('disabled', true);
$('#hostname, #username, #database').keyup(function() {
inputCheck();
});
});
function inputCheck() {
hostname = $('#hostname').val();
username = $('#username').val();
database = $('#database').val();
if (hostname != '' && username != '' && database != '') {
$('#next-button').attr('disabled', false);
} else {
$('#next-button').attr('disabled', true);
}
}
</script>
@endpush

View File

@ -3,13 +3,15 @@
@section('header', trans('install.steps.language'))
@section('content')
<div class="form-group">
<div class="row">
<div class="col-md-12">
<select name="lang" id="lang" size="17" class="form-control">
@foreach (language()->allowed() as $code => $name)
<option value="{{ $code }}" @if ($code == 'en-GB') {{ 'selected="selected"' }} @endif>{{ $name }}</option>
@endforeach
</select>
<div class="form-group mb-0">
<select name="lang" id="lang" size="14" class="col-xl-12 form-control-label">
@foreach (language()->allowed() as $code => $name)
<option value="{{ $code }}" @if ($code == 'en-GB') {{ 'selected="selected"' }} @endif>{{ $name }}</option>
@endforeach
</select>
</div>
</div>
</div>
@endsection

View File

@ -1,3 +1,3 @@
@extends('layouts.install')
@section('header', trans('install.steps.requirements'))
@section('header', trans('install.steps.requirements'))

View File

@ -3,36 +3,13 @@
@section('header', trans('install.steps.settings'))
@section('content')
{{ Form::textGroup('company_name', trans('install.settings.company_name'), 'id-card-o', ['required' => 'required'], old('company_name'), 'col-md-12') }}
<div class="row">
{{ Form::textGroup('company_name', trans('install.settings.company_name'), 'building', ['required' => 'required'], old('company_name'), 'col-md-12') }}
{{ Form::textGroup('company_email', trans('install.settings.company_email'), 'envelope', ['required' => 'required'], old('company_email'), 'col-md-12') }}
{{ Form::textGroup('company_email', trans('install.settings.company_email'), 'envelope', ['required' => 'required'], old('company_email'), 'col-md-12') }}
{{ Form::textGroup('user_email', trans('install.settings.admin_email'), 'envelope', ['required' => 'required'], old('user_email'), 'col-md-12') }}
{{ Form::textGroup('user_email', trans('install.settings.admin_email'), 'envelope', ['required' => 'required'], old('user_email'), 'col-md-12') }}
{{ Form::passwordGroup('user_password', trans('install.settings.admin_password'), 'key', ['required' => 'required'], old('user_password'), 'col-md-12') }}
{{ Form::passwordGroup('user_password', trans('install.settings.admin_password'), 'key', ['required' => 'required'], 'col-md-12 mb--2') }}
</div>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function() {
$('#next-button').attr('disabled', true);
$('#company_name, #company_email, #user_email, #user_password').keyup(function() {
inputCheck();
});
});
function inputCheck() {
company_name = $('#company_name').val();
company_email = $('#company_email').val();
user_email = $('#user_email').val();
user_password = $('#user_password').val();
if (company_name != '' && company_email != '' && user_email != '' && user_password != '') {
$('#next-button').attr('disabled', false);
} else {
$('#next-button').attr('disabled', true);
}
}
</script>
@endpush

View File

@ -3,115 +3,111 @@
@section('title', trans_choice('general.updates', 2))
@section('new_button')
<span class="new-button"><a href="{{ url('install/updates/check') }}" class="btn btn-warning btn-sm"><span class="fa fa-history"></span> &nbsp;{{ trans('updates.check') }}</a></span>
<span class="new-button"><a href="{{ route('updates.check') }}" class="btn btn-warning btn-sm"><span class="fa fa-history"></span> &nbsp;{{ trans('updates.check') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
<i class="fa fa-gear"></i>
<h3 class="box-title">{{ $name }}</h3>
</div>
<!-- /.box-header -->
<div class="card">
<div class="card-header">
<span class="title-filter hidden-xs">{{ $name }}</span>
</div>
<div class="box-body">
<p>
<div class="progress">
<div id="progress-bar" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
<span class="sr-only">{{ trans('modules.installation.start', ['module' => $name]) }}</span>
<div class="card-body">
<p>
<div class="progress">
<div id="progress-bar" class="progress-bar progress-bar-success w-0" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">{{ trans('modules.installation.start', ['module' => $name]) }}</span>
</div>
</div>
</div>
<div id="progress-text"></div>
</p>
<div id="progress-text"></div>
</p>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
@endsection
@push('scripts')
<script type="text/javascript">
var step = new Array();
var total = 0;
var path = '';
<script type="text/javascript">
var step = new Array();
var total = 0;
var path = '';
$(document).ready(function() {
$.ajax({
url: '{{ url("install/updates/steps") }}',
type: 'post',
dataType: 'json',
data: {name: '{{ $name }}', version: '{{ $version }}'},
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
if (json['errorr']) {
$('#progress-bar').addClass('progress-bar-danger');
$('#progress-text').html('<div class="text-danger">' + json['error'] + '</div>');
}
if (json['step']) {
step = json['step'];
total = step.length;
next();
}
}
});
});
function next() {
data = step.shift();
if (data) {
$('#progress-bar').css('width', (100 - (step.length / total) * 100) + '%');
$.each($('#progress-text .text-default'), function( index, value ) {
// Remove Loading font
$(this).find('.update-spin').remove();
// Remove Check font
$(this).find('.update-check').remove();
// Add Check font
$(this).append(' <i class="fa fa-check update-check text-success"></i>');
});
$('#progress-text').append('<span class="text-default"><i class="fa fa-spinner fa-spin update-spin"></i> ' + data['text'] + '</span> </br>');
setTimeout(function() {
$.ajax({
url: data.url,
type: 'post',
dataType: 'json',
data: {path: path, alias: '{{ $alias }}', installed: '{{ $installed }}', version: '{{ $version }}'},
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
if (json['errors']) {
$('#progress-bar').addClass('progress-bar-danger');
$('#progress-text').append('<div class="text-danger"><i class="fa fa-times update-error"></i> ' + json['errors'] + '</div>');
}
if (json['success']) {
$('#progress-bar').removeClass('progress-bar-danger');
$('#progress-bar').addClass('progress-bar-success');
}
if (json['data']['path']) {
path = json['data']['path'];
}
if (!json['errors'] && !json['redirect']) {
next();
}
if (json['redirect']) {
window.location = json['redirect'];
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
$(document).ready(function() {
$.ajax({
url: '{{ route("updates.steps") }}',
type: 'post',
dataType: 'json',
data: {name: '{{ $name }}', version: '{{ $version }}'},
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
if (json['errorr']) {
$('#progress-bar').addClass('progress-bar-danger');
$('#progress-text').html('<div class="text-danger">' + json['error'] + '</div>');
}
if (json['step']) {
step = json['step'];
total = step.length;
next();
}
}
});
});
function next() {
data = step.shift();
if (data) {
$('#progress-bar').css('width', (100 - (step.length / total) * 100) + '%');
$.each($('#progress-text .text-default'), function( index, value ) {
// Remove Loading font
$(this).find('.update-spin').remove();
// Remove Check font
$(this).find('.update-check').remove();
// Add Check font
$(this).append(' <i class="fa fa-check update-check text-success"></i>');
});
}, 800);
$('#progress-text').append('<span class="text-default"><i class="fa fa-spinner fa-spin update-spin"></i> ' + data['text'] + '</span> </br>');
setTimeout(function() {
$.ajax({
url: data.url,
type: 'post',
dataType: 'json',
data: {path: path, alias: '{{ $alias }}', installed: '{{ $installed }}', version: '{{ $version }}'},
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
if (json['errors']) {
$('#progress-bar').addClass('progress-bar-danger');
$('#progress-text').append('<div class="text-danger"><i class="fa fa-times update-error"></i> ' + json['errors'] + '</div>');
}
if (json['success']) {
$('#progress-bar').removeClass('progress-bar-danger');
$('#progress-bar').addClass('progress-bar-success');
}
if (json['data']['path']) {
path = json['data']['path'];
}
if (!json['errors'] && !json['redirect']) {
next();
}
if (json['redirect']) {
window.location = json['redirect'];
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}, 800);
}
}
}
</script>
</script>
@endpush

View File

@ -3,70 +3,74 @@
@section('title', trans_choice('general.updates', 2))
@section('new_button')
<span class="new-button"><a href="{{ url('install/updates/check') }}" class="btn btn-warning btn-sm"><span class="fa fa-history"></span> &nbsp;{{ trans('updates.check') }}</a></span>
<span><a href="{{ route('updates.check') }}" class="btn btn-warning btn-sm btn-alone"><span class="fa fa-history"></span> &nbsp;{{ trans('updates.check') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
<i class="fa fa-gear"></i>
<h3 class="box-title">Akaunting</h3>
<div class="card">
<div class="card-header">
<span class="table-text text-primary">Akaunting</span>
</div>
<div class="card-body">
<div class="row">
@if (empty($core))
<div class="col-md-12">
{{ trans('updates.latest_core') }}
</div>
@else
<div class="col-sm-2 col-md-6 o-y">
{{ trans('updates.new_core') }}
</div>
<div class="col-sm-10 col-md-6 text-right">
<a href="{{ url('install/updates/update', ['alias' => 'core', 'version' => $core]) }}" data-toggle="tooltip" title="{{ trans('updates.update', ['version' => $core]) }}" class="btn btn-info btn-sm header-button-top o-y"><i class="fa fa-refresh"></i> &nbsp;{{ trans('updates.update', ['version' => $core]) }}</a>
<a href="{{ route('updates.changelog') }}" data-toggle="tooltip" title="{{ trans('updates.changelog') }}" class="btn btn-white btn-sm header-button-bottom"><i class="fa fa-exchange-alt"></i> &nbsp;{{ trans('updates.changelog') }}</a>
</div>
@endif
</div>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
@if (empty($core))
{{ trans('updates.latest_core') }}
@else
{{ trans('updates.new_core') }}
<a href="{{ url('install/updates/update', ['alias' => 'core', 'version' => $core]) }}" data-toggle="tooltip" title="{{ trans('updates.update', ['version' => $core]) }}" class="btn btn-warning btn-xs"><i class="fa fa-refresh"></i> &nbsp;{{ trans('updates.update', ['version' => $core]) }}</a>
<a href="{{ url('install/updates/changelog') }}" data-toggle="tooltip" title="{{ trans('updates.changelog') }}" class="btn btn-default btn-xs popup"><i class="fa fa-exchange"></i> &nbsp;{{ trans('updates.changelog') }}</a>
@endif
</div>
<!-- /.box-body -->
<div class="card">
<div class="card-header border-bottom-0">
<span class="table-text">{{ trans_choice('general.modules', 2) }}</span>
</div>
</div>
<!-- /.box -->
<!-- Default box -->
<div class="box box-success">
<div class="box-header with-border">
<i class="fa fa-rocket"></i>
<h3 class="box-title">{{ trans_choice('general.modules', 2) }}</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-translations">
<thead>
<tr>
<th class="col-md-4">{{ trans('general.name') }}</th>
<th class="col-md-2">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-md-2">{{ trans('updates.installed_version') }}</th>
<th class="col-md-2">{{ trans('updates.latest_version') }}</th>
<th class="col-md-2">{{ trans('general.actions') }}</th>
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-translations">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-4 col-md-4">{{ trans('general.name') }}</th>
<th class="col-md-2 hidden-md">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-sm-3 col-md-2 hidden-sm">{{ trans('updates.installed_version') }}</th>
<th class="col-xs-4 col-sm-3 col-md-2">{{ trans('updates.latest_version') }}</th>
<th class="col-xs-4 col-sm-2 col-md-2 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($modules as $module)
<tr>
<td>{{ $module->name }}</td>
<td>{{ $module->category }}</td>
<td>{{ $module->installed }}</td>
<td>{{ $module->latest }}</td>
<td>
<a href="{{ url('install/updates/update/' . $module->alias . '/' . $module->latest) }}" class="btn btn-warning btn-xs"><i class="fa fa-refresh" aria-hidden="true"></i> {{ trans_choice('general.updates', 1) }}</a>
</td>
</tr>
@endforeach
@if ($modules)
@foreach($modules as $module)
<tr class="row align-items-center border-top-1">
<td class="col-xs-4 col-sm-4 col-md-4">{{ $module->name }}</td>
<td class="col-md-2 hidden-md">{{ $module->category }}</td>
<td class="col-sm-3 col-md-2 hidden-sm">{{ $module->installed }}</td>
<td class="col-xs-4 col-md-2 col-sm-3">{{ $module->latest }}</td>
<td class="col-xs-4 col-sm-2 col-md-2 text-center">
<a href="{{ url('install/updates/update/' . $module->alias . '/' . $module->latest) }}" class="btn btn-warning btn-sm"><i class="fa fa-refresh" aria-hidden="true"></i> {{ trans_choice('general.updates', 1) }}</a>
</td>
</tr>
@endforeach
@else
<tr class="row">
<td class="col-12">
<div class="text-sm text-muted" id="datatable-basic_info" role="status" aria-live="polite">
<small>{{ trans('general.no_records') }}</small>
</div>
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
@endsection

View File

@ -1,20 +1,37 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.admin.head')
<body class="hold-transition {{ setting('general.admin_theme', 'skin-green-light') }} sidebar-mini fixed">
@stack('body_start')
<body class="g-sidenav-show g-sidenav-pinned">
<!-- Site wrapper -->
<div class="wrapper">
@include('partials.admin.header')
@stack('body_start')
@include('partials.admin.menu')
@include('partials.admin.content')
<div class="main-content" id="panel">
@include('partials.admin.footer')
</div>
@include('partials.admin.navbar')
<div id="main-body">
@include('partials.admin.header')
<div class="container-fluid content-layout mt--6">
@include('partials.admin.content')
@include('partials.admin.footer')
</div>
</div>
</div>
@stack('body_end')
@include('partials.admin.scripts')
</body>
</html>

View File

@ -1,38 +1,71 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.auth.head')
<body class="hold-transition login-page">
<body class="login-page">
@stack('body_start')
<div class="login-box">
@stack('login_box_start')
<div class="main-content">
<div class="header py-5">
<div class="container">
<div class="header-body text-center mb-5">
<div class="row justify-content-center">
<div class="col-xl-5 col-lg-6 col-md-8">
<img class="login-logo pb-5" src="{{ asset('public/img/akaunting-logo-white.png') }}" alt="Akaunting" />
</div>
</div>
</div>
</div>
</div>
@stack('login_box_start')
<div class="container mt--7 pb-5">
<div class="row justify-content-center">
<div class="col-lg-5 col-md-7">
<div class="card mb-0 login-card-bg">
<div class="card-body px-lg-5 py-lg-5">
<div class="text-center text-white mb-4">
<small>@yield('message')</small>
</div>
<div id="app">
@stack('login_content_start')
@yield('content')
@stack('login_content_end')
<notifications></notifications>
</div>
</div>
</div>
</div>
</div>
</div>
@stack('login_box_end')
@yield('forgotten-password')
<footer>
<div class="container">
<div class="row align-items-center justify-content-xl-between">
<div class="col-xl-12">
<div class="copyright text-center text-lg-center text-white">
<small>
<a>{{ trans('footer.powered') }}:</a> <a class="text-success" href="{{ trans('footer.link') }}" target="_blank">{{ trans('footer.software') }}</a>
</small>
</div>
</div>
</div>
</div>
</footer>
<div class="login-logo">
<img src="{{ asset('public/img/akaunting-logo-white.png') }}" alt="Akaunting" />
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg">@yield('message')</p>
@include('flash::message')
@stack('login_content_start')
@yield('content')
@stack('login_content_end')
</div>
<!-- /.login-box-body -->
<div class="login-box-footer">
{{ trans('footer.powered') }}: <a href="{{ trans('footer.link') }}" target="_blank">{{ trans('footer.software') }}</a>
</div>
<!-- /.login-box-footer -->
@stack('login_box_end')
</div>
@stack('body_end')
@include('partials.auth.scripts')
</body>
</html>

View File

@ -1,15 +1,15 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.bill.head')
<body onload="window.print();">
@stack('body_start')
<!-- Content Wrapper. Contains page content -->
<div class="wrapper" style="margin-left: 0; page-break-after: always;">
@yield('content')
</div>
<!-- /.content-wrapper -->
@stack('body_end')
</body>
</html>

View File

@ -1,20 +0,0 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.customer.head')
<body class="hold-transition skin-green-light sidebar-mini fixed">
@stack('body_start')
<!-- Site wrapper -->
<div class="wrapper">
@include('partials.customer.header')
@include('partials.customer.menu')
@include('partials.customer.content')
@include('partials.customer.footer')
</div>
@stack('body_end')
</body>
</html>

View File

@ -1,62 +1,73 @@
<html>
@include('partials.install.head')
<body class="hold-transition">
<div class="install-image"></div>
<body class="installation-page">
<div class="install-content">
<div class="install-logo">
<img src="{{ asset('public/img/akaunting-logo-white.png') }}" alt="Akaunting" />
<div class="main-content">
<div class="header pt-3 pb-2">
<div class="container">
<div class="header-body text-center mb-5">
<div class="row justify-content-center">
<div class="col-xl-5 col-lg-6 col-md-8">
<img class="login-logo pb-6" src="{{ asset('public/img/akaunting-logo-white.png') }}" alt="Akaunting"/>
</div>
</div>
</div>
</div>
</div>
<div class="box box-success box-solid">
<div class="box-header">
<div class="col-md-12">
<h3 class="box-title">@yield('header')</h3>
</div>
</div>
<!-- /.box-header -->
<div class="container mt--7 pb-5">
<div class="row justify-content-center">
<div class="col-lg-5 col-md-7">
<div class="card">
{!! Form::open([
'url' => url()->current(),
'@submit.prevent' => 'onSubmit',
'role' => 'form',
'id' => 'form-install'
]) !!}
<div id="app">
<div class="card-body">
<div class="text-center text-muted mt-2 mb-4">
<small>@yield('header')</small>
</div>
<div id="install-form">
{!! Form::open(['url' => url()->current(), 'role' => 'form']) !!}
@include('flash::message')
<div class="box-body">
<div id="install-loading"></div>
@yield('content')
</div>
<div class="form-group">
<div class="col-md-12">
@include('flash::message')
</div>
</div>
@yield('content')
</div>
<!-- /.box-body -->
<div class="box-footer">
<div class="form-group">
<div class="col-md-4 col-md-offset-8 text-right">
@if (Request::is('install/requirements'))
<a href="{{ url('install/requirements') }}" class="btn btn-success"> {{ trans('install.refresh') }} &nbsp;<i class="fa fa-refresh"></i></a>
@else
{!! Form::button(trans('install.next') . ' &nbsp;<i class="fa fa-arrow-right"></i>', ['type' => 'submit', 'id' => 'next-button', 'class' => 'btn btn-success']) !!}
@endif
<div class="card-footer">
<div class="float-right">
@if (Request::is('install/requirements'))
<a href="{{ url('install/requirements') }}" class="btn btn-success"> {{ trans('install.refresh') }} &nbsp;<i class="fa fa-refresh"></i></a>
@else
{!! Form::button(
'<i v-if="loading" :class="(loading) ? \'show \' : \'\'" class="fas fa-spinner fa-spin d-none"></i> ' .
trans('install.next') .
' &nbsp;<i class="fa fa-arrow-right"></i>',
[
':disabled' => 'loading',
'type' => 'submit',
'id' => 'next-button',
'class' => 'btn btn-success',
'data-loading-text' => trans('general.loading')
]
) !!}
@endif
</div>
</div>
</div>
{!! Form::close() !!}
</div>
</div>
{!! Form::close() !!}
</div>
<script type="text/javascript">
$('div.alert').not('.alert-important').delay(3000).fadeOut(350);
$('#next-button').on('click', function() {
$('#install-loading').html('<span class="install-loading-bar"><span class="install-loading-spin"><i class="fa fa-spinner fa-spin"></i></span></span>');
$('.install-loading-bar').css({"height": $('#install-form').height() - 12});
});
</script>
</div>
</div>
@include('partials.install.scripts')
</body>
</html>

View File

@ -1,11 +1,15 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.invoice.head')
<body onload="window.print();">
@stack('body_start')
@yield('content')
@yield('content')
@stack('body_end')
</body>
</html>

View File

@ -1,16 +0,0 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.link.head')
<body class="hold-transition skin-green-light sidebar-mini fixed link">
@stack('body_start')
<!-- Site wrapper -->
<div class="wrapper">
@include('partials.link.content')
@include('partials.link.footer')
</div>
@stack('body_end')
</body>
</html>

View File

@ -1,20 +1,37 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.modules.head')
<body class="hold-transition {{ setting('general.admin_theme', 'skin-green-light') }} sidebar-mini fixed">
@stack('body_start')
<body class="g-sidenav-show g-sidenav-pinned">
<!-- Site wrapper -->
<div class="wrapper">
@include('partials.admin.header')
@stack('body_start')
@include('partials.admin.menu')
@include('partials.admin.content')
<div class="main-content" id="panel">
@include('partials.admin.footer')
</div>
@include('partials.admin.navbar')
<div id="main-body">
@include('partials.admin.header')
<div class="container-fluid content-layout mt--6">
@include('partials.admin.content')
@include('partials.admin.footer')
</div>
</div>
</div>
@stack('body_end')
@include('partials.admin.scripts')
</body>
</html>

View File

@ -0,0 +1,37 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.portal.head')
<body class="g-sidenav-show g-sidenav-pinned">
@stack('body_start')
@include('partials.portal.menu')
<div class="main-content" id="panel">
@include('partials.portal.navbar')
<div id="main-body">
@include('partials.portal.header')
<div class="container-fluid content-layout mt--6">
@include('partials.portal.content')
@include('partials.portal.footer')
</div>
</div>
</div>
@stack('body_end')
@include('partials.portal.scripts')
</body>
</html>

View File

@ -1,16 +1,15 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.admin.head')
@push('css')
<!-- Bootstrap 3 print fix -->
<link rel="stylesheet" href="{{ asset('public/css/bootstrap3-print-fix.css?v=1.2') }}">
@endpush
<body onload="window.print();">
<body onload="window.print();" class="print-width">
@stack('body_start')
@yield('content')
@yield('content')
@stack('body_end')
</body>
</html>

View File

@ -0,0 +1,20 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.signed.head')
<body>
@stack('body_start')
<div class="container-fluid content-layout mt-4">
@include('partials.signed.content')
@include('partials.signed.footer')
</div>
@stack('body_end')
</body>
</html>

View File

@ -0,0 +1,15 @@
<div id="@yield('widget-id', 'widget-' . Str::random())" class="@yield('widget-class', 'col-md-12')">
<div class="card @yield('widget-card-class', 'col-md-12')">
@include('partials.widget.head')
<div class="card-body">
@include('partials.widget.content')
</div>
</div>
</div>

View File

@ -1,20 +1,24 @@
<html lang="{{ app()->getLocale() }}">
@include('partials.wizard.head')
<body class="hold-transition {{ setting('general.admin_theme', 'skin-green-light') }} sidebar-mini fixed">
@stack('body_start')
<body class="wizard-page">
<div class="container mt--5">
@stack('body_start')
<div id="app">
@include('partials.wizard.content')
</div>
@stack('body_end')
<!-- Site wrapper -->
<div class="wrapper">
@include('partials.wizard.content')
</div>
@stack('body_end')
@include('partials.wizard.scripts')
<script type="text/javascript">
$('#wizard-skip, .stepwizard .btn.btn-default').on('click', function() {
$('#wizard-loading').html('<span class="wizard-loading-bar"><span class="wizard-loading-spin"><i class="fa fa-spinner fa-spin"></i></span></span>');
});
</script>
</body>
</html>

View File

@ -1,187 +1,45 @@
<div class="modal fade add-payment-{{ $rand }}" id="modal-add-payment" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="modal-body">
{!! Form::open([
'url' => 'modals/bills/' . $bill->id . '/transactions',
'id' => 'transaction',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'transaction_form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="row">
<base-alert type="warning" v-if="typeof transaction_form.response !== 'undefined' && transaction_form.response.error" v-html="transaction_form.response.message"></base-alert>
<h4 class="modal-title">{{ trans('general.title.new', ['type' => trans_choice('general.payments', 1)]) }}</h4>
</div>
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'v-model' => 'transaction_form.paid_at', 'v-error' => 'payment.errors.get("paid_at")', 'v-error-message' => 'payment.errors.get("paid_at")'], Date::now()->toDateString()) }}
<div class="modal-body">
<div class="modal-message"></div>
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'v-model' => 'transaction_form.amount', 'v-error' => 'payment.errors.get("amount")', 'v-error-message' => 'payment.errors.get("amount")', 'currency' => $currency], $bill->grand_total) }}
{!! Form::open(['id' => 'form-add-payment', 'role' => 'form', 'class' => 'form-loading-button']) !!}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'v-model' => 'transaction_form.account_id', 'v-error' => 'payment.errors.get("account_id")', 'v-error-message' => 'payment.errors.get("account_id")', 'change' => 'onChangePaymentAccount']) }}
<div class="row">
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar',['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus'], $bill->grand_total) }}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('general.default_account')) }}
@stack('currency_code_input_start')
<div class="form-group col-md-6 required">
{!! Form::label('currency_code', trans_choice('general.currencies', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-exchange"></i></div>
{!! Form::text('currency', $currencies[$bill->currency_code], ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
{!! Form::hidden('currency_code', $bill->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
</div>
@stack('currency_code_input_start')
<div class="form-group col-md-6 required">
{!! Form::label('currency_code', trans_choice('general.currencies', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-exchange"></i></div>
{!! Form::text('currency', $currencies[$bill->currency_code], ['v-model' => 'transaction_form.currency', 'v-error' => 'payment.errors.get("currency")', 'v-error-message' => 'payment.errors.get("currency")','id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
</div>
@stack('currency_code_input_end')
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('general.default_payment_method')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o',[]) }}
{!! Form::hidden('bill_id', $bill->id, ['id' => 'bill_id', 'class' => 'form-control', 'required' => 'required']) !!}
</div>
@stack('currency_code_input_end')
{!! Form::close() !!}
</div>
{{ Form::textareaGroup('description', trans('general.description'), '', null, ['rows' => '3', 'v-model' => 'transaction_form.description', 'v-error' => 'payment.errors.get("description")', 'v-error-message' => 'payment.errors.get("description")']) }}
<div class="modal-footer">
<div class="pull-left">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' =>'button-add-payment', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading')]) !!}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method'), ['required' => 'requied', 'v-model' => 'transaction_form.payment_method', 'v-error' => 'payment.errors.get("payment_method")', 'v-error-message' => 'payment.errors.get("payment_method")']) }}
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</button>
</div>
</div>
{{ Form::textGroup('reference', trans('general.reference'), 'fa fa-file', ['v-model' => 'transaction_form.reference', 'v-error' => 'payment.errors.get("reference")', 'v-error-message' => 'payment.errors.get("reference")']) }}
{!! Form::hidden('bill_id', $bill->id, ['id' => 'bill_id', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('category_id', $bill->category->id, ['id' => 'category_id', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_code', $bill->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', $bill->currency_rate, ['id' => 'currency_rate', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('type', 'expense') !!}
</div>
</div>
{!! Form::close() !!}
</div>
<script type="text/javascript">
$('.add-payment-{{ $rand }}#modal-add-payment #amount').focus();
$(document).ready(function(){
$('.add-payment-{{ $rand }}#modal-add-payment').modal('show');
$(".add-payment-{{ $rand }}#modal-add-payment #amount").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
});
$('.add-payment-{{ $rand }}#modal-add-payment #amount').trigger('focusout');
$('.add-payment-{{ $rand }}#modal-add-payment #paid_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$(".add-payment-{{ $rand }}#modal-add-payment #account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$(".add-payment-{{ $rand }}#modal-add-payment #payment_method").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
});
});
$(document).on('change', '.add-payment-{{ $rand }}#modal-add-payment #account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('.add-payment-{{ $rand }}#modal-add-payment #currency').val(data.currency_name);
$('.add-payment-{{ $rand }}#modal-add-payment #currency_code').val(data.currency_code);
amount = $('.add-payment-{{ $rand }}#modal-add-payment #amount').maskMoney('unmasked')[0];
$(".add-payment-{{ $rand }}#modal-add-payment #amount").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('.add-payment-{{ $rand }}#modal-add-payment #amount').val(amount);
$('.add-payment-{{ $rand }}#modal-add-payment #amount').focus();
}
});
});
$(document).on('click', '.add-payment-{{ $rand }} #button-add-payment', function (e) {
$('.add-payment-{{ $rand }} .help-block').remove();
$.ajax({
url: '{{ url("modals/bills/" . $bill->id . "/payment") }}',
type: 'POST',
dataType: 'JSON',
data: $(".add-payment-{{ $rand }} #form-add-payment").serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
beforeSend: function() {
$('.add-payment-{{ $rand }} #button-add-payment').button('loading');
$('.add-payment-{{ $rand }}#modal-add-payment .modal-content').append('<div id="loading" class="text-center"><i class="fa fa-spinner fa-spin fa-5x checkout-spin"></i></div>');
},
complete: function() {
$('.add-payment-{{ $rand }} #button-add-payment').button('reset');
$('.add-payment-{{ $rand }} #loading').remove();
},
success: function(json) {
if (json['error']) {
$('.add-payment-{{ $rand }}#modal-add-payment .modal-message').append('<div class="alert alert-danger">' + json['message'] + '</div>');
$('.add-payment-{{ $rand }} div.alert-danger').delay(3000).fadeOut(350);
}
if (json['success']) {
$('.add-payment-{{ $rand }}#modal-add-payment .modal-message').before('<div class="alert alert-success">' + json['message'] + '</div>');
$('.add-payment-{{ $rand }} div.alert-success').delay(3000).fadeOut(350);
setTimeout(function(){
$(".add-payment-{{ $rand }}#modal-add-payment").modal('hide');
location.reload();
}, 3000);
}
},
error: function(data){
var errors = data.responseJSON;
if (typeof errors !== 'undefined') {
if (errors.paid_at) {
$('.add-payment-{{ $rand }}#modal-add-payment #paid_at').parent().after('<p class="help-block">' + errors.paid_at + '</p>');
}
if (errors.amount) {
$('.add-payment-{{ $rand }}#modal-add-payment #amount').parent().after('<p class="help-block">' + errors.amount + '</p>');
}
if (errors.account_id) {
$('.add-payment-{{ $rand }}#modal-add-payment #account_id').parent().after('<p class="help-block">' + errors.account_id + '</p>');
}
if (errors.currency_code) {
$('.add-payment-{{ $rand }}#modal-add-payment #currency_code').parent().after('<p class="help-block">' + errors.currency_code + '</p>');
}
if (errors.category_id) {
$('.add-payment-{{ $rand }}#modal-add-payment #category_id').parent().after('<p class="help-block">' + errors.category_id + '</p>');
}
if (errors.payment_method) {
$('.add-payment-{{ $rand }}#modal-add-payment #payment_method').parent().after('<p class="help-block">' + errors.payment_method + '</p>');
}
}
}
});
});
</script>

View File

@ -1,4 +1,4 @@
<div class="modal fade create-category-{{ $rand }}" id="modal-create-category" style="display: none;">
<div class="modal fade create-category-{{ $rand }} d-none" id="modal-create-category">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
@ -12,14 +12,14 @@
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
@stack('color_input_start')
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'control-label']) !!}
<div id="category-color-picker" class="input-group colorpicker-component">
<div class="input-group-addon"><i></i></div>
{!! Form::text('color', '#00a65a', ['id' => 'color', 'class' => 'form-control', 'required' => 'required']) !!}
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'control-label']) !!}
<div id="category-color-picker" class="input-group colorpicker-component">
<div class="input-group-addon"><i></i></div>
{!! Form::text('color', '#00a65a', ['id' => 'color', 'class' => 'form-control', 'required' => 'required']) !!}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
@stack('color_input_end')
{!! Form::hidden('type', $type, []) !!}
@ -48,7 +48,7 @@
});
$(document).on('click', '.create-category-{{ $rand }} #button-create-category', function (e) {
$('.create-category-{{ $rand }}#modal-create-category .modal-header').before('<span id="span-loading" style="position: absolute; height: 100%; width: 100%; z-index: 99; background: #6da252; opacity: 0.4;"><i class="fa fa-spinner fa-spin" style="font-size: 10em !important;margin-left: 35%;margin-top: 8%;"></i></span>');
$('.create-category-{{ $rand }}#modal-create-category .modal-header').before('<span id="span-loading" style="position: absolute; height: 100%; width: 100%; z-index: 99; background: #6da252; opacity: 0.4;"><i class="fa fa-spinner fa-spin" style="font-size: 10em !important; margin-left: 35%;margin-top: 8%;"></i></span>');
$.ajax({
url: '{{ url("modals/categories") }}',

View File

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

View File

@ -1,188 +1,45 @@
<div class="modal fade add-payment-{{ $rand }}" id="modal-add-payment" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="modal-body">
{!! Form::open([
'url' => 'modals/invoices/' . $invoice->id . '/transactions',
'id' => 'transaction',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'transaction_form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="row">
<base-alert type="warning" v-if="typeof transaction_form.response !== 'undefined' && transaction_form.response.error" v-html="transaction_form.response.message"></base-alert>
<h4 class="modal-title">{{ trans('general.title.new', ['type' => trans_choice('general.payments', 1)]) }}</h4>
</div>
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'v-model' => 'transaction_form.paid_at', 'v-error' => 'payment.errors.get("paid_at")', 'v-error-message' => 'payment.errors.get("paid_at")'], Date::now()->toDateString()) }}
<div class="modal-body">
<div class="modal-message"></div>
{!! Form::open(['id' => 'form-add-payment', 'role' => 'form', 'class' => 'form-loading-button']) !!}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'v-model' => 'transaction_form.amount', 'v-error' => 'payment.errors.get("amount")', 'v-error-message' => 'payment.errors.get("amount")', 'currency' => $currency], $invoice->grand_total) }}
<div class="row">
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar',['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'v-model' => 'transaction_form.account_id', 'v-error' => 'payment.errors.get("account_id")', 'v-error-message' => 'payment.errors.get("account_id")', 'change' => 'onChangePaymentAccount']) }}
{{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus'], $invoice->grand_total) }}
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('general.default_account')) }}
@stack('currency_code_input_start')
<div class="form-group col-md-6 required">
{!! Form::label('currency_code', trans_choice('general.currencies', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-exchange"></i></div>
{!! Form::text('currency', $currencies[$invoice->currency_code], ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
{!! Form::hidden('currency_code', $invoice->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
</div>
@stack('currency_code_input_start')
<div class="form-group col-md-6 required">
{!! Form::label('currency_code', trans_choice('general.currencies', 1), ['class' => 'control-label']) !!}
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-exchange"></i></div>
{!! Form::text('currency', $currencies[$invoice->currency_code], ['v-model' => 'transaction_form.currency', 'v-error' => 'payment.errors.get("currency")', 'v-error-message' => 'payment.errors.get("currency")','id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
</div>
@stack('currency_code_input_end')
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('general.default_payment_method')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o',[]) }}
{!! Form::hidden('invoice_id', $invoice->id, ['id' => 'invoice_id', 'class' => 'form-control', 'required' => 'required']) !!}
</div>
@stack('currency_code_input_end')
{!! Form::close() !!}
</div>
{{ Form::textareaGroup('description', trans('general.description'), '', null, ['rows' => '3', 'v-model' => 'transaction_form.description', 'v-error' => 'payment.errors.get("description")', 'v-error-message' => 'payment.errors.get("description")']) }}
<div class="modal-footer">
<div class="pull-left">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'button', 'id' =>'button-add-payment', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading')]) !!}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method'), ['required' => 'requied', 'v-model' => 'transaction_form.payment_method', 'v-error' => 'payment.errors.get("payment_method")', 'v-error-message' => 'payment.errors.get("payment_method")']) }}
<a href="{{ url('apps/categories/payment-gateway') }}" class="btn btn-default"><span class="fa fa-money"></span> &nbsp;{{ trans('invoices.accept_payments') }}</a>
{{ Form::textGroup('reference', trans('general.reference'), 'fa fa-file', ['v-model' => 'transaction_form.reference', 'v-error' => 'payment.errors.get("reference")', 'v-error-message' => 'payment.errors.get("reference")']) }}
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-times-circle"></span> &nbsp;{{ trans('general.cancel') }}</button>
</div>
</div>
{!! Form::hidden('invoice_id', $invoice->id, ['id' => 'invoice_id', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('category_id', $invoice->category->id, ['id' => 'category_id', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_code', $invoice->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', $invoice->currency_rate, ['id' => 'currency_rate', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('type', 'income') !!}
</div>
</div>
{!! Form::close() !!}
</div>
<script type="text/javascript">
$('.add-payment-{{ $rand }}#modal-add-payment #amount').focus();
$(document).ready(function(){
$('.add-payment-{{ $rand }}#modal-add-payment').modal('show');
$(".add-payment-{{ $rand }}#modal-add-payment #amount").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
});
$('.add-payment-{{ $rand }}#modal-add-payment #amount').trigger('focusout');
$('.add-payment-{{ $rand }}#modal-add-payment #paid_at').datepicker({
format: 'yyyy-mm-dd',
todayBtn: 'linked',
weekStart: 1,
autoclose: true,
language: '{{ language()->getShortCode() }}'
});
$(".add-payment-{{ $rand }}#modal-add-payment #account_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
});
$(".add-payment-{{ $rand }}#modal-add-payment #payment_method").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
});
});
$(document).on('change', '.add-payment-{{ $rand }}#modal-add-payment #account_id', function (e) {
$.ajax({
url: '{{ url("banking/accounts/currency") }}',
type: 'GET',
dataType: 'JSON',
data: 'account_id=' + $(this).val(),
success: function(data) {
$('.add-payment-{{ $rand }}#modal-add-payment #currency').val(data.currency_name);
$('.add-payment-{{ $rand }}#modal-add-payment #currency_code').val(data.currency_code);
amount = $('.add-payment-{{ $rand }}#modal-add-payment #amount').maskMoney('unmasked')[0];
$(".add-payment-{{ $rand }}#modal-add-payment #amount").maskMoney({
thousands : data.thousands_separator,
decimal : data.decimal_mark,
precision : data.precision,
allowZero : true,
prefix : (data.symbol_first) ? data.symbol : '',
suffix : (data.symbol_first) ? '' : data.symbol
});
$('.add-payment-{{ $rand }}#modal-add-payment #amount').val(amount);
$('.add-payment-{{ $rand }}#modal-add-payment #amount').focus();
}
});
});
$(document).on('click', '.add-payment-{{ $rand }} #button-add-payment', function (e) {
$('.add-payment-{{ $rand }} .help-block').remove();
$.ajax({
url: '{{ url("modals/invoices/" . $invoice->id . "/payment") }}',
type: 'POST',
dataType: 'JSON',
data: $(".add-payment-{{ $rand }} #form-add-payment").serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
beforeSend: function() {
$('.add-payment-{{ $rand }} #button-add-payment').button('loading');
$('.add-payment-{{ $rand }}#modal-add-payment .modal-content').append('<div id="loading" class="text-center"><i class="fa fa-spinner fa-spin fa-5x checkout-spin"></i></div>');
},
complete: function() {
$('.add-payment-{{ $rand }} #button-add-payment').button('reset');
$('.add-payment-{{ $rand }} #loading').remove();
},
success: function(json) {
if (json['error']) {
$('.add-payment-{{ $rand }}#modal-add-payment .modal-message').append('<div class="alert alert-danger">' + json['message'] + '</div>');
$('.add-payment-{{ $rand }} div.alert-danger').delay(3000).fadeOut(350);
}
if (json['success']) {
$('.add-payment-{{ $rand }}#modal-add-payment .modal-message').before('<div class="alert alert-success">' + json['message'] + '</div>');
$('.add-payment-{{ $rand }} div.alert-success').delay(3000).fadeOut(350);
setTimeout(function(){
$(".add-payment-{{ $rand }}#modal-add-payment").modal('hide');
location.reload();
}, 3000);
}
},
error: function(data){
var errors = data.responseJSON;
if (typeof errors !== 'undefined') {
if (errors.paid_at) {
$('.add-payment-{{ $rand }}#modal-add-payment #paid_at').parent().after('<p class="help-block">' + errors.paid_at + '</p>');
}
if (errors.amount) {
$('.add-payment-{{ $rand }}#modal-add-payment #amount').parent().after('<p class="help-block">' + errors.amount + '</p>');
}
if (errors.account_id) {
$('.add-payment-{{ $rand }}#modal-add-payment #account_id').parent().after('<p class="help-block">' + errors.account_id + '</p>');
}
if (errors.currency_code) {
$('.add-payment-{{ $rand }}#modal-add-payment #currency_code').parent().after('<p class="help-block">' + errors.currency_code + '</p>');
}
if (errors.category_id) {
$('.add-payment-{{ $rand }}#modal-add-payment #category_id').parent().after('<p class="help-block">' + errors.category_id + '</p>');
}
if (errors.payment_method) {
$('.add-payment-{{ $rand }}#modal-add-payment #payment_method').parent().after('<p class="help-block">' + errors.payment_method + '</p>');
}
}
}
});
});
</script>

View File

@ -1,4 +1,4 @@
<div class="modal fade create-tax-{{ $rand }}" id="modal-create-tax" style="display: none;">
<div class="modal fade create-tax-{{ $rand }} d-none" id="modal-create-tax">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
@ -7,17 +7,15 @@
<div class="modal-body">
{!! Form::open(['id' => 'form-create-tax', 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, 'normal') }}
{!! Form::hidden('enabled', '1', []) !!}
</div>
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, 'normal') }}
{!! Form::hidden('enabled', '1', []) !!}
</div>
{!! Form::close() !!}
</div>

View File

@ -1,4 +1,4 @@
<div class="modal fade create-vendor-{{ $rand }}" id="modal-create-vendor" style="display: none;">
<div class="modal fade create-vendor-{{ $rand }} d-none" id="modal-create-vendor">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
@ -8,20 +8,19 @@
<div class="modal-body">
{!! Form::open(['id' => 'form-create-vendor', 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('default.currency')) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{!! Form::hidden('enabled', '1', []) !!}
</div>
{{ Form::textareaGroup('address', trans('general.address')) }}
{!! Form::hidden('enabled', '1', []) !!}
</div>
{!! Form::close() !!}
</div>
@ -69,14 +68,14 @@
$('.create-vendor-{{ $rand }}#modal-create-vendor').modal('hide');
$('#vendor_id').append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>');
$('#vendor_id').trigger('change');
$('#vendor_id').select2('refresh');
$('#contact_id').append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>');
$('#contact_id').trigger('change');
$('#contact_id').select2('refresh');
@if ($vendor_selector)
$('{{ $vendor_selector }}').append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>');
$('{{ $vendor_selector }}').trigger('change');
$('{{ $vendor_selector }}').select2('refresh');
@if ($contact_selector)
$('{{ $contact_selector }}').append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>');
$('{{ $contact_selector }}').trigger('change');
$('{{ $contact_selector }}').select2('refresh');
@endif
},
error: function(error, textStatus, errorThrown) {

View File

@ -0,0 +1,48 @@
@extends('layouts.modules')
@section('title', trans('modules.api_key'))
@section('content')
<div class="card">
{!! Form::open([
'route' => 'apps.api-key.store',
'id' => 'app',
'@submit.prevent' => 'onSubmit',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button'
]) !!}
<div class="card-body">
<div class="col-md-12">
<div class="form-group required {{ $errors->has('api_key') ? 'has-error' : ''}}">
{!! Form::label('api_key', trans('modules.api_key'), ['class' => 'form-control-label']) !!}
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fa fa-key"></i>
</span>
</div>
{!! Form::text('api_key', setting('apps.api_key', null), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.enter', ['field' => trans('modules.api_key')])]) !!}
</div>
{!! $errors->first('api_key', '<p class="help-block">:message</p>') !!}
</div>
<p class="mb-0 mt--3">
<small>{!! trans('modules.api_key_link') !!}</small>
</p>
</div>
</div>
<div class="card-footer">
<div class="float-right">
{{ Form::saveButtons('apps/home') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/apps.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,76 +3,61 @@
@section('title', trans_choice('general.modules', 2))
@section('new_button')
<span class="new-button"><a href="{{ url('apps/token/create') }}" class="btn btn-success btn-sm"><span class="fa fa-key"></span> &nbsp;{{ trans('modules.api_token') }}</a></span>
<span class="new-button"><a href="{{ url('apps/my') }}" class="btn btn-default btn-sm"><span class="fa fa-user"></span> &nbsp;{{ trans('modules.my_apps') }}</a></span>
<span class="new-button"><a href="{{ route('apps.api-key.create') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-key"></span> &nbsp;{{ trans('modules.api_key') }}</a></span>
<span class="new-button"><a href="{{ route('apps.my.index') }}" class="btn btn-white btn-sm header-button-bottom"><span class="fa fa-user"></span> &nbsp;{{ trans('modules.my_apps') }}</a></span>
@endsection
@section('content')
@include('partials.modules.bar')
<div class="row">
@if ($pre_sale)
<div class="col-md-12">
<div class="content-header no-padding-left">
<h3>{{ trans('modules.pre_sale') }}</h3>
<h2 class="text-primary">{{ trans('modules.pre_sale') }}</h2>
<div class="row">
@if ($pre_sale->data)
@foreach ($pre_sale->data as $module)
@include('partials.modules.pre_sale')
@endforeach
@else
@include('partials.modules.no_apps')
@endif
</div>
@if ($pre_sale->data)
@foreach ($pre_sale->data as $module)
@include('partials.modules.pre_sale')
@endforeach
@else
@include('partials.modules.no_apps')
@endif
</div>
@endif
@if ($paid)
<div class="col-md-12">
<div class="content-header no-padding-left">
<h3>{{ trans('modules.top_paid') }}</h3>
<h2 class="text-primary">{{ trans('modules.top_paid') }}</h2>
<div class="row">
@if ($paid->data)
@foreach ($paid->data as $module)
@include('partials.modules.item')
@endforeach
@else
@include('partials.modules.no_apps')
@endif
</div>
@if ($paid->data)
@foreach ($paid->data as $module)
@include('partials.modules.item')
@endforeach
@else
@include('partials.modules.no_apps')
@endif
</div>
@endif
@if ($new)
<div class="col-md-12">
<div class="content-header no-padding-left">
<h3>{{ trans('modules.new') }}</h3>
<h2 class="text-primary">{{ trans('modules.new') }}</h2>
<div class="row">
@if ($new->data)
@foreach ($new->data as $module)
@include('partials.modules.item')
@endforeach
@else
@include('partials.modules.no_apps')
@endif
</div>
@if ($new->data)
@foreach ($new->data as $module)
@include('partials.modules.item')
@endforeach
@else
@include('partials.modules.no_apps')
@endif
</div>
@endif
@if ($free)
<div class="col-md-12">
<div class="content-header no-padding-left">
<h3>{{ trans('modules.top_free') }}</h3>
<h2 class="text-primary">{{ trans('modules.top_free') }}</h2>
<div class="row">
@if ($free->data)
@foreach ($free->data as $module)
@include('partials.modules.item')
@endforeach
@else
@include('partials.modules.no_apps')
@endif
</div>
@if ($free->data)
@foreach ($free->data as $module)
@include('partials.modules.item')
@endforeach
@else
@include('partials.modules.no_apps')
@endif
</div>
@endif
</div>
@endsection
@endsection

View File

@ -3,46 +3,33 @@
@section('title', trans_choice('general.modules', 2))
@section('new_button')
<span class="new-button"><a href="{{ url('apps/token/create') }}" class="btn btn-success btn-sm"><span class="fa fa-key"></span> &nbsp;{{ trans('modules.api_token') }}</a></span>
<span class="new-button"><a href="{{ url('apps/my') }}" class="btn btn-default btn-sm"><span class="fa fa-user"></span> &nbsp;{{ trans('modules.my_apps') }}</a></span>
<span class="new-button"><a href="{{ route('apps.api-key.create') }}" class="btn btn-white btn-sm"><span class="fa fa-key"></span> &nbsp;{{ trans('modules.api_key') }}</a></span>
<span class="new-button"><a href="{{ route('apps.my.index') }}" class="btn btn-white btn-sm"><span class="fa fa-user"></span> &nbsp;{{ trans('modules.my_apps') }}</a></span>
@endsection
@section('content')
@include('partials.modules.bar')
<div class="row module">
<div class="row">
<div class="col-md-12">
<div class="col-md-12 no-padding-left">
<div class="box box-success">
<div class="box-body">
<div class="card">
<div class="card-body">
@if ($documentation)
{!! $documentation->body !!}
@else
{{ trans('general.na') }}
@endif
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12">
<div class="text-left">
<a href="{{ url($back) }}" class="btn btn-white btn-md text-left">&laquo; {{ trans('modules.back') }}</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 no-padding-left">
<ul class="pager nomargin">
<li class="previous"><a href="{{ url($back) }}" class="btn btn-default btn-sm">&laquo; {{ trans('modules.back') }}</a></li>
</ul>
</div>
</div>
</div>
@endsection
@push('stylesheet')
<style type="text/css">
.row.module h1 {
margin: 0;
font-size: 24px !important;
}
.row.module img {
width: 100%;
max-width: 900px;
}
</style>
@endpush

View File

@ -3,27 +3,36 @@
@section('title', trans_choice('general.modules', 2))
@section('new_button')
<span class="new-button"><a href="{{ url('apps/token/create') }}" class="btn btn-success btn-sm"><span class="fa fa-key"></span> &nbsp;{{ trans('modules.api_token') }}</a></span>
<span class="new-button"><a href="{{ url('apps/my') }}" class="btn btn-default btn-sm"><span class="fa fa-user"></span> &nbsp;{{ trans('modules.my_apps') }}</a></span>
<span class="new-button">
<a href="{{ route('apps.api-key.create') }}" class="btn btn-white btn-sm header-button-top">
<span class="fa fa-key"></span> &nbsp;{{ trans('modules.api_key') }}
</a>
</span>
<span class="new-button">
<a href="{{ route('apps.my.index') }}" class="btn btn-white btn-sm header-button-bottom">
<span class="fa fa-user"></span> &nbsp;{{ trans('modules.my_apps') }}
</a>
</span>
@endsection
@section('content')
@include('partials.modules.bar')
<div class="row module">
<div class="col-md-12">
<div class="col-md-8 no-padding-left">
<div class="content-header no-padding-left">
<h3>{{ $module->name }}</h3>
</div>
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#description" data-toggle="tab" aria-expanded="true">{{ trans('general.description') }}</a></li>
</ul>
<div class="row">
<div class="col-md-8">
<h3>{{ $module->name }}</h3>
<div class="nav-wrapper">
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
<li class="nav-item">
<a class="nav-link mb-sm-2 mb-md-0 active" href="#description" data-toggle="tab" aria-selected="false">{{ trans('general.description') }}</a>
</li>
</ul>
</div>
<div class="card shadow">
<div class="card-body">
<div class="tab-content">
<div class="tab-pane active" id="description">
<div class="tab-pane fade show active" id="description">
{!! $module->description !!}
@if($module->screenshots || $module->video)
@ -31,24 +40,24 @@
<div class="carousel-inner">
@if($module->video)
@php
if (strpos($module->video->link, '=') !== false) {
$code = explode('=', $module->video->link);
$code[1]= str_replace('&list', '', $code[1]);
if (strpos($module->video->link, '=') !== false) {
$code = explode('=', $module->video->link);
$code[1]= str_replace('&list', '', $code[1]);
if (empty($status)) {
$status = 5;
} else {
$status = 1;
}
if (empty($status)) {
$status = 5;
} else {
$status = 1;
}
@endphp
<div class="item @if($status == 5) {{ 'active' }} @endif">
<iframe width="100%" height="410px" src="https://www.youtube-nocookie.com/embed/{{ $code[1] }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="item @if($status == 5) {{ 'active' }} @endif">
<iframe width="100%" height="410px" src="https://www.youtube-nocookie.com/embed/{{ $code[1] }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="image-description text-center">
{{ $module->name }}
<div class="image-description text-center">
{{ $module->name }}
</div>
</div>
</div>
@php } @endphp
@endif
@ -67,14 +76,14 @@
<div class="carousel-navigation-message">
@if (($module->video && (count($module->screenshots) > 1)) || (!$module->video && (count($module->screenshots) > 1)))
<a href="#carousel-screenshot-generic" class="left carousel-control" role="button" data-slide="prev">
<i class="fa fa-chevron-left"></i>
<span class="sr-only">{{ trans('pagination.previous') }}</span>
</a>
<a href="#carousel-screenshot-generic" class="right carousel-control" role="button" data-slide="next">
<i class="fa fa-chevron-right"></i>
<span class="sr-only">{{ trans('pagination.next') }}</span>
</a>
<a href="#carousel-screenshot-generic" class="left carousel-control" role="button" data-slide="prev">
<i class="fa fa-chevron-left"></i>
<span class="sr-only">{{ trans('pagination.previous') }}</span>
</a>
<a href="#carousel-screenshot-generic" class="right carousel-control" role="button" data-slide="next">
<i class="fa fa-chevron-right"></i>
<span class="sr-only">{{ trans('pagination.next') }}</span>
</a>
@endif()
</div>
</div>
@ -84,18 +93,15 @@
</div>
</div>
</div>
<div class="col-md-4">
<div class="content-header no-padding-left">
<h3>{{ trans_choice('general.actions', 1) }}</h3>
</div>
<div class="box box-success">
<div class="box-body">
<div id="countdown-pre-sale"></div>
<div class="text-center action">
<div style="margin: 10px; font-size: 24px;">
</div>
<div class="col-md-4">
<h3>{{ trans_choice('general.actions', 1) }}</h3>
<div class="card">
<div class="card-body">
<div id="countdown-pre-sale"></div>
<div class="text-center">
<strong>
<div class="text-xl">
@if ($module->price == '0.0000')
{{ trans('modules.free') }}
@else
@ -109,145 +115,92 @@
{!! $module->price_suffix !!}
@endif
</div>
</div>
</strong>
</div>
<!-- /.box-body -->
</div>
<div class="box-footer">
@permission('create-modules-item')
<div class="card-footer">
@permission('create-modules-item')
@if ($module->install)
<a href="#" class="btn btn-warning btn-block" disabled="disabled">
{{ trans('modules.pre_sale') }}
</a>
<a href="#" class="btn btn-warning btn-block" disabled="disabled">
{{ trans('modules.pre_sale') }}
</a>
@else
<a href="{{ $module->action_url }}" class="btn btn-warning btn-block" target="_blank">
{{ trans('modules.pre_sale') }}
</a>
<a href="{{ $module->action_url }}" class="btn btn-warning btn-block" target="_blank">
{{ trans('modules.pre_sale') }}
</a>
@endif
@endpermission
@endpermission
@if ($module->purchase_faq)
</br>
@if ($module->purchase_faq)
<br>
<div class="text-center">
<a href="#" id="button-purchase-faq">{{ trans('modules.tab.faq')}}</a>
<a href="#" @click="onShowFaq" id="button-purchase-faq">{{ trans('modules.tab.faq')}}</a>
</div>
@endif
</div>
</div>
<h3>{{ trans('modules.about') }}</h3>
<div class="card">
<table class="table">
<tbody>
@if ($module->vendor_name)
<tr>
<th>{{ trans_choice('general.developers', 1) }}</th>
<td class="text-right"><a href="{{ url('apps/vendors/' . $module->vendor->slug) }}">{{ $module->vendor_name }}</a></td>
</tr>
@endif
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
<div class="content-header no-padding-left">
<h3>{{ trans('modules.about') }}</h3>
</div>
<div class="box box-success">
<div class="box-body">
<table class="table table-striped">
<tbody>
@if ($module->vendor_name)
<tr>
<th>{{ trans_choice('general.developers', 1) }}</th>
<td class="text-right"><a href="{{ url('apps/vendors/' . $module->vendor->slug) }}">{{ $module->vendor_name }}</a></td>
</tr>
@endif
@if ($module->version)
<tr>
<th>{{ trans('footer.version') }}</th>
<td class="text-right">{{ $module->version }}</td>
</tr>
@endif
@if ($module->created_at)
<tr>
<th>{{ trans('modules.added') }}</th>
<td class="text-right">{{ Date::parse($module->created_at)->format($date_format) }}</td>
</tr>
@endif
@if ($module->updated_at)
<tr>
<th>{{ trans('modules.updated') }}</th>
<td class="text-right">{{ Date::parse($module->updated_at)->diffForHumans() }}</td>
</tr>
@endif
@if ($module->compatibility)
<tr>
<th>{{ trans('modules.compatibility') }}</th>
<td class="text-right">{{ $module->compatibility }}</td>
</tr>
@endif
@if ($module->category)
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
<td class="text-right"><a href="{{ url('apps/categories/' . $module->category->slug) }}">{{ $module->category->name }}</a></td>
</tr>
@endif
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
@if ($module->version)
<tr>
<th>{{ trans('footer.version') }}</th>
<td class="text-right">{{ $module->version }}</td>
</tr>
@endif
@if ($module->created_at)
<tr>
<th>{{ trans('modules.added') }}</th>
<td class="text-right">@date($module->created_at)</td>
</tr>
@endif
@if ($module->updated_at)
<tr>
<th>{{ trans('modules.updated') }}</th>
<td class="text-right">{{ Date::parse($module->updated_at)->diffForHumans() }}</td>
</tr>
@endif
@if ($module->compatibility)
<tr>
<th>{{ trans('modules.compatibility') }}</th>
<td class="text-right">{{ $module->compatibility }}</td>
</tr>
@endif
@if ($module->category)
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
<td class="text-right"><a href="{{ url('apps/categories/' . $module->category->slug) }}">{{ $module->category->name }}</a></td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
@if ($module->purchase_faq)
{!! $module->purchase_faq !!}
<akaunting-modal :show="faq.show">
<template #modal-content>
{!! $module->purchase_faq !!}
</template>
</akaunting-modal>
@endif
@endsection
@push('js')
<script src="{{ asset('public/js/lightbox/ekko-lightbox.js') }}"></script>
<script src="{{ asset('public/js/jquery/countdown/jquery.plugin.js') }}"></script>
<script src="{{ asset('public/js/jquery/countdown/jquery.countdown.js') }}"></script>
@if (language()->getShortCode() != 'en')
<script src="{{ asset('public/js/jquery/countdown/jquery.countdown-' . language()->getShortCode() . '.js') }}"></script>
@endif
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('public/css/ekko-lightbox.css') }}">
<link rel="stylesheet" href="{{ asset('public/css/countdown.css') }}">
@endpush
@push('stylesheet')
<style type="text/css">
.nav-tabs-custom img {
display: block;
max-width: 100%;
height: auto;
}
.text-center.action {
border-top: 1px solid #f4f4f4;
margin-top: 10px;
}
</style>
@endpush
@push('scripts')
@push('scripts_start')
<script type="text/javascript">
$(document).ready(function() {
$('.carousel').carousel({
interval: false,
keyboard: true
});
$('#countdown-pre-sale').countdown({
until: new Date({{ (int) $module->pre_sale_date->year }}, {{ (int) $module->pre_sale_date->month }} - 1, {{ (int) $module->pre_sale_date->day }})
});
});
$(document).on('click', '[data-toggle="lightbox"]', function(e) {
e.preventDefault();
$(this).ekkoLightbox();
});
@if ($module->purchase_faq)
$(document).on('click', '#button-purchase-faq', function (e) {
$('.app-faq-modal').modal('show');
});
@endif
var app_slug = "{{ $module->slug }}";
</script>
<script src="{{ asset('public/js/modules/item.js?v=' . version('short')) }}"></script>
@endpush

Some files were not shown because too many files have changed in this diff Show More