v2 first commit
This commit is contained in:
@ -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> {{ 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
|
||||
|
@ -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> {{ Form::checkbox('create_user', '1', 1, ['id' => 'create_user', 'disabled' => 'disabled']) }}
|
||||
@else
|
||||
<strong>{{ trans('customers.allow_login') }}</strong> {{ 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
|
||||
|
@ -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> {{ 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> {{ 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> {{ 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> {{ 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> {{ 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> {{ 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> ' . 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
|
||||
|
@ -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
|
||||
|
@ -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> ' . 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> ' . 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> {{ 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¤cy_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
|
||||
|
@ -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> ' . 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> ' . 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> {{ 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¤cy_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
|
||||
|
@ -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> {{ 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> {{ 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> {{ 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> {{ 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> {{ 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> {{ 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> ' . 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
|
||||
|
||||
|
@ -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
|
@ -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
@ -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
|
||||
|
@ -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
|
||||
|
@ -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> {{ 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> {{ 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> {{ 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> {{ 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> {{ 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> {{ 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> ' . 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
|
||||
|
||||
|
Reference in New Issue
Block a user