renamed income/expense

This commit is contained in:
denisdulici
2019-12-31 15:49:09 +03:00
parent e2189158b9
commit 2428feb73b
235 changed files with 815 additions and 2147 deletions

View File

@@ -0,0 +1,85 @@
@extends('layouts.admin')
@section('title', trans('general.title.new', ['type' => trans_choice('general.customers', 1)]))
@section('content')
<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="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'user') }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', ['autocomplete' => 'off']) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency')) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe', []) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
@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)'
]) }}
<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>
</div>
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('sales/customers') }}
</div>
</div>
{{ Form::hidden('type', 'customer') }}
{!! Form::close() !!}
</div>
@endsection
@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/sales/customers.js?v=' . version('short')) }}"></script>
@endpush

View File

@@ -0,0 +1,90 @@
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.customers', 1)]))
@section('content')
<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="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'user') }}
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $customer->currency_code) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
{{ Form::textareaGroup('address', trans('general.address')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled'), $customer->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">
@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>
@permission('update-sales-customers')
<div class="card-footer">
<div class="float-right">
{{ Form::saveButtons('sales/customers') }}
</div>
</div>
@endpermission
{{ Form::hidden('type', 'customer') }}
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/sales/customers.js?v=' . version('short')) }}"></script>
@endpush

View File

@@ -0,0 +1,117 @@
@extends('layouts.admin')
@section('title', trans_choice('general.customers', 2))
@section('new_button')
@permission('create-sales-customers')
<span><a href="{{ url('sales/customers/create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
<span><a href="{{ url('common/import/sales/customers') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> &nbsp;{{ trans('import.import') }}</a></span>
@endpermission
<span><a href="{{ route('customers.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> &nbsp;{{ trans('general.export') }}</a></span>
@endsection
@section('content')
@if ($customers->count())
<div class="card">
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
{!! Form::open([
'url' => 'sales/customers',
'role' => 'form',
'method' => 'GET',
'class' => 'mb-0'
]) !!}
<div class="row" v-if="!bulk_action.show">
<div class="col-12 d-flex align-items-center">
<span class="font-weight-400 d-none d-lg-block mr-2">{{ trans('general.search') }}:</span>
<akaunting-search></akaunting-search>
</div>
</div>
{{ Form::bulkActionRowGroup('general.customers', $bulk_actions, 'sales/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 d-none d-sm-block">{{ 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 d-none d-md-block">@sortablelink('email', trans('general.email'))</th>
<th class="col-sm-3 col-md-2 col-lg-2 col-xl-2 d-none d-sm-block">@sortablelink('phone', trans('general.phone'))</th>
<th class="col-lg-2 col-xl-2 text-right d-none d-lg-block">@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 class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">
{{ 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 d-none d-md-block long-texts">
{{ !empty($item->email) ? $item->email : trans('general.na') }}
</td>
<td class="col-sm-3 col-md-2 col-lg-2 col-xl-2 d-none d-sm-block long-texts">
{{ $item->phone }}
</td>
<td class="col-lg-2 col-xl-2 text-right d-none d-lg-block long-texts">
@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-sales-customers'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
@else
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 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-sales-customers')
<a class="dropdown-item" href="{{ route('customers.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
<div class="dropdown-divider"></div>
@endpermission
@permission('delete-sales-customers')
{!! Form::deleteLink($item, 'sales/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])
</div>
</div>
</div>
@else
@include('partials.admin.empty_page', ['page' => 'customers', 'docs_path' => 'sales/customers'])
@endif
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/sales/customers.js?v=' . version('short')) }}"></script>
@endpush

View File

@@ -0,0 +1,180 @@
@extends('layouts.admin')
@section('title', $customer->name)
@section('content')
<div class="row">
<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>
</div>
<div class="card">
<div class="card-header">
<h4 class="mb-0">{{ trans('auth.profile') }}</h4>
</div>
<div class="card-body d-grid">
<a class="text-sm font-weight-600">{{ trans('general.email') }}</a> <a class="text-xs long-texts">{{ $customer->email }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.phone') }}</a> <a class="text-xs long-texts">{{ $customer->phone }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.website') }}</a> <a class="text-xs long-texts">{{ $customer->website }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.tax_number') }}</a> <a class="text-xs long-texts">{{ $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 long-texts">{{ $customer->reference }}</a>
@endif
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="mb-0">{{ trans('general.address') }}</h4>
</div>
<div class="card-body">
<a class="text-xs m-0">
{{ $customer->address }}
</a>
</div>
</div>
<a href="{{ route('customers.edit', $customer->id) }}" class="btn btn-default btn-block edit-sv"><i class="fas fa-edit"></i><b>{{ trans('general.edit') }}</b></a>
</div>
<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>
</div>
</div>
<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>
</div>
</div>
<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>
</div>
</div>
</div>
<div class="row">
<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>
<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 d-none d-sm-block">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-sm-3 d-none d-sm-block">{{ trans_choice('general.accounts', 1) }}</th>
</tr>
</thead>
<tbody>
@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 d-none d-sm-block">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="col-sm-3 d-none d-sm-block">{{ $item->account->name }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<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 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 d-none d-sm-block">{{ trans('invoices.invoice_date') }}</th>
<th class="col-sm-2 d-none d-sm-block">{{ 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 class="row align-items-center border-top-1">
<td class="col-xs-4 col-sm-3"><a href="{{ url('sales/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 d-none d-sm-block">@date($item->invoiced_at)</td>
<td class="col-sm-2 d-none d-sm-block">@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>
<div class="card-footer py-4 table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $invoices, 'type' => 'invoices'])
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/sales/customers.js?v=' . version('short')) }}"></script>
@endpush