akaunting 3.0 (the last dance)

This commit is contained in:
Burak Civan
2022-06-01 10:15:55 +03:00
parent cead09f6d4
commit d9c0764572
3812 changed files with 126831 additions and 102949 deletions

View File

@@ -1,11 +1,25 @@
@extends('layouts.admin')
@section('title', trans('general.title.new', ['type' => setting('bill.title', trans_choice('general.bills', 1))]))
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => setting('bill.title', trans_choice('general.bills', 1))]) }}
</x-slot>
@section('content')
<x-documents.form.content type="bill" hide-company hide-footer hide-edit-item-columns is-purchase-price />
@endsection
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => setting('bill.title', trans_choice('general.bills', 1))]) }}"
icon="file_open"
route="bills.create"
></x-slot>
<x-slot name="content">
<x-documents.form.content
type="bill"
hide-company
hide-footer
hide-edit-item-columns
hide-send-to
is-purchase-price
/>
</x-slot>
@push('scripts_start')
<x-documents.script type="bill" />
@endpush
</x-layouts.admin>

View File

@@ -1,11 +1,19 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.bills', 1)]) }}
</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.bills', 1)]))
<x-slot name="content">
<x-documents.form.content
type="bill"
:document="$bill"
hide-company
hide-footer
hide-edit-item-columns
hide-send-to
is-purchase-price
/>
</x-slot>
@section('content')
<x-documents.form.content type="bill" :document="$bill" hide-company hide-footer hide-edit-item-columns is-purchase-price />
@endsection
@push('scripts_start')
<x-documents.script type="bill" :items="$bill->items()->get()" />
@endpush
<x-documents.script type="bill" :document="$bill" :items="$bill->items()->get()" />
</x-layouts.admin>

View File

@@ -1,15 +1,25 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.bills', 2) }}
</x-slot>
@section('title', trans_choice('general.bills', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.bills', 2) }}"
icon="file_open"
route="bills.index"
></x-slot>
@section('new_button')
<x-documents.index.top-buttons type="bill" />
@endsection
<x-slot name="buttons">
<x-documents.index.buttons type="bill" hide-accept-payment />
</x-slot>
@section('content')
<x-documents.index.content type="bill" :documents="$bills" />
@endsection
<x-slot name="moreButtons">
<x-documents.index.more-buttons type="bill" />
</x-slot>
<x-slot name="content">
<x-documents.index.content type="bill" :documents="$bills" active-tab="bill" />
</x-slot>
@push('scripts_start')
<x-documents.script type="bill" />
@endpush
</x-layouts.admin>

View File

@@ -1,12 +1,14 @@
@extends('layouts.print')
<x-layouts.print>
<x-slot name="title">
{{ trans_choice('general.bills', 1) . ': ' . $bill->document_number }}
</x-slot>
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->document_number)
@section('content')
<x-documents.template.ddefault
type="bill"
:document="$bill"
hide-discount
hide-footer
/>
@endsection
<x-slot name="content">
<x-documents.template.ddefault
type="bill"
:document="$bill"
hide-discount
hide-footer
/>
</x-slot>
</x-layouts.print>

View File

@@ -1,28 +1,44 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.bills', 1) . ': ' . $bill->document_number }}
</x-slot>
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->document_number)
<x-slot name="status">
<x-show.status status="{{ $bill->status }}" background-color="bg-{{ $bill->status_label }}" text-color="text-text-{{ $bill->status_label }}" />
</x-slot>
@section('new_button')
<x-documents.show.top-buttons
type="bill"
:document="$bill"
hide-button-group-divider2
hide-button-customize
/>
@endsection
<x-slot name="buttons">
<x-documents.show.buttons type="bill" :document="$bill" />
</x-slot>
@section('content')
<x-documents.show.content
type="bill"
:document="$bill"
hide-button-sent
hide-button-email
hide-button-share
/>
@endsection
<x-slot name="moreButtons">
<x-documents.show.more-buttons
type="bill"
:document="$bill"
hide-email
hide-share
hide-divider3
hide-customize
/>
</x-slot>
@push('scripts_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
<x-slot name="content">
<x-documents.show.content
type="bill"
:document="$bill"
hide-send
hide-get-paid
hide-email
hide-share
hide-accept-payment
hide-schedule
hide-children
/>
</x-slot>
@push('stylesheet')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
@endpush
<x-documents.script type="bill" />
@endpush
</x-layouts.admin>

View File

@@ -1,60 +0,0 @@
@extends('layouts.admin')
@section('title', trans('general.title.new', ['type' => trans_choice('general.payments', 1)]))
@section('content')
<div class="card">
{!! Form::open([
'route' => 'payments.store',
'id' => 'transaction',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button needs-validation',
'novalidate' => 'true'
]) !!}
<div class="card-body">
<div class="row">
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], request()->get('paid_at', Date::now()->toDateString())) }}
{!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', '1', ['id' => 'currency_rate']) !!}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency, 'dynamic-currency' => 'currency'], 0.00) }}
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, old('contact.id', old('contact_id', null)), ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.expense_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?search=type:expense enabled:1']) }}
{{ 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::selectGroup('document_id', trans_choice('general.bills', 1), 'file-invoice', [], null, ['disabled' => 'true']) }}
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], null, 'col-md-12') }}
</div>
</div>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('payments.index') }}
</div>
</div>
{{ Form::hidden('type', 'expense') }}
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/banking/transactions.js?v=' . version('short')) }}"></script>
@endpush

View File

@@ -1,84 +0,0 @@
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]))
@section('content')
@if (($recurring = $payment->recurring) && ($next = $recurring->getNextRecurring()))
<div class="media mb-3">
<div class="media-body">
<div class="media-comment-text">
<div class="d-flex">
<h5 class="mt-0">{{ trans('recurring.recurring') }}</h5>
</div>
<p class="text-sm lh-160 mb-0">{{ trans('recurring.message', [
'type' => mb_strtolower(trans_choice('general.payments', 1)),
'date' => $next->format($date_format)
]) }}
</p>
</div>
</div>
</div>
@endif
<div class="card">
{!! Form::model($payment, [
'method' => 'PATCH',
'files' => true,
'route' => ['payments.update', $payment->id],
'role' => 'form',
'id' => 'transaction',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'class' => 'form-loading-button',
'novalidate' => 'true'
]) !!}
<div class="card-body">
<div class="row">
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($payment->paid_at)->toDateString()) }}
{!! Form::hidden('currency_code', $payment->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency, 'dynamic-currency' => 'currency'], $payment->amount) }}
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $payment->account_id, ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=expense', 'remote_action' => route('categories.index'). '?search=type:expense enabled:1']) }}
{{ Form::recurring('edit', $payment) }}
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $payment->payment_method) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }}
@if ($payment->bill)
{{ Form::textGroup('document', trans_choice('general.bills', 1), 'file-invoice', ['disabled' => 'true'], $payment->bill->document_number) }}
{{ Form::hidden('document_id', $payment->bill->id) }}
@endif
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], $payment->attachment, 'col-md-12') }}
</div>
</div>
@can('update-purchases-payments')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('payments.index') }}
</div>
</div>
@endcan
{{ Form::hidden('type', 'expense') }}
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/banking/transactions.js?v=' . version('short')) }}"></script>
@endpush

View File

@@ -1,136 +0,0 @@
@extends('layouts.admin')
@section('title', trans_choice('general.payments', 2))
@section('new_button')
@can('create-purchases-payments')
<a href="{{ route('payments.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
<a href="{{ route('import.create', ['group' => 'purchases', 'type' => 'payments']) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
@endcan
<a href="{{ route('payments.export', request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
@endsection
@section('content')
@if ($payments->count() || request()->get('search', false))
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'payments.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Purchase\Payment" />
</div>
{{ Form::bulkActionRowGroup('general.payments', $bulk_actions, ['group' => 'purchases', 'type' => 'payments']) }}
{!! Form::close() !!}
</div>
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1">@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-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-2 col-lg-3 col-xl-3 d-none d-md-block text-left">@sortablelink('contact.name', trans_choice('general.vendors', 1))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
</tr>
</thead>
<tbody>
@foreach($payments as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->contact->name) }}</td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1">
@if ($item->reconciled)
<a class="col-aka" href="#">@date($item->paid_at)</a>
@else
<a class="col-aka" href="{{ route('payments.show', $item->id) }}">@date($item->paid_at)</a>
@endif
@if ($item->recurring)
<i class="fas fa-redo-alt fa-xs" title="{{ trans('recurring.recurring') }}"></i>
@endif
</td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-3 col-xl-3 d-none d-md-block text-left">
{{ $item->contact->name }}
@if($item->bill)
@if ($item->bill->status == 'paid')
<el-tooltip content="{{ $item->bill->document_number }} / {{ trans('documents.statuses.paid') }}"
effect="success"
:open-delay="100"
placement="top">
<span class="badge badge-dot pl-2 h-0">
<i class="bg-success"></i>
</span>
</el-tooltip>
@elseif ($item->bill->status == 'partial')
<el-tooltip content="{{ $item->bill->document_number }} / {{ trans('documents.statuses.partial') }}"
effect="info"
:open-delay="100"
placement="top">
<span class="badge badge-dot pl-2 h-0">
<i class="bg-info"></i>
</span>
</el-tooltip>
@endif
@endif
</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left long-texts">{{ $item->category->name }}</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left long-texts">{{ $item->account->name }}</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('payments.show', $item->id) }}">{{ trans('general.show') }}</a>
@if (!$item->reconciled)
@can('update-purchases-payments')
<a class="dropdown-item" href="{{ route('payments.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@endcan
@endif
@if (empty($item->document_id))
@can('create-purchases-payments')
<a class="dropdown-item" href="{{ route('payments.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
<div class="dropdown-divider"></div>
@endcan
@endif
@if (!$item->reconciled)
@can('delete-purchases-payments')
{!! Form::deleteLink($item, 'payments.destroy') !!}
@endcan
@endif
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $payments])
</div>
</div>
</div>
@else
<x-empty-page group="purchases" page="payments" />
@endif
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/banking/transactions.js?v=' . version('short')) }}"></script>
@endpush

View File

@@ -1,10 +0,0 @@
@extends('layouts.print')
@section('title', trans_choice('general.payments', 1) . ': ' . $payment->id)
@section('content')
<x-transactions.template.ddefault
type="expense"
:transaction="$payment"
/>
@endsection

View File

@@ -1,17 +0,0 @@
@extends('layouts.admin')
@section('title', trans('payments.payment_made'))
@section('new_button')
<x-transactions.show.top-buttons type="expense" :transaction="$payment" hide-button-share hide-button-email />
@endsection
@section('content')
<x-transactions.show.content type="expense" :transaction="$payment" />
@endsection
@push('scripts_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
<x-transactions.script type="expense" />
@endpush

View File

@@ -0,0 +1,25 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.recurring_bills', 1)]) }}
</x-slot>
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.recurring_bills', 1)]) }}"
icon="request_quote"
url="{{ route('recurring-bills.create') }}"
></x-slot>
<x-slot name="content">
<x-documents.form.content
type="bill-recurring"
show-recurring
hide-company
hide-footer
hide-edit-item-columns
hide-send-to
is-purchase-price
/>
</x-slot>
<x-documents.script type="bill-recurring" />
</x-layouts.admin>

View File

@@ -0,0 +1,20 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.recurring_bills', 1)]) }}
</x-slot>
<x-slot name="content">
<x-documents.form.content
type="bill-recurring"
:document="$recurring_bill"
show-recurring
hide-company
hide-footer
hide-edit-item-columns
hide-send-to
is-purchase-price
/>
</x-slot>
<x-documents.script type="bill-recurring" :document="$recurring_bill" :items="$recurring_bill->items()->get()" />
</x-layouts.admin>

View File

@@ -0,0 +1,31 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.recurring_templates', 2) }}
</x-slot>
<x-slot name="favorite"
title="{{ trans_choice('general.recurring_templates', 2) }}"
icon="receipt_long"
route="recurring-bills.index"
></x-slot>
<x-slot name="buttons">
<x-documents.index.buttons type="bill-recurring" />
</x-slot>
<x-slot name="moreButtons">
<x-documents.index.more-buttons type="bill-recurring" hide-export hide-cancelled />
</x-slot>
<x-slot name="content">
<x-documents.index.content type="bill-recurring"
page="recurring_templates"
:documents="$bills"
tab-active="recurring-templates"
hide-summary
hide-bulk-action
/>
</x-slot>
<x-documents.script type="bill-recurring" />
</x-layouts.admin>

View File

@@ -0,0 +1,40 @@
<x-layouts.admin>
<x-slot name="title">
{{ trans_choice('general.recurring_bills', 1) . ': ' . $recurring_bill->document_number }}
</x-slot>
<x-slot name="status">
<x-show.status status="{{ ! empty($recurring_bill->recurring) ? $recurring_bill->recurring->status : 'ended' }}" background-color="bg-{{ $recurring_bill->recurring_status_label }}" text-color="text-text-{{ $recurring_bill->recurring_status_label }}" />
</x-slot>
<x-slot name="buttons">
<x-documents.show.buttons type="bill-recurring" :document="$recurring_bill" />
</x-slot>
<x-slot name="moreButtons">
<x-documents.show.more-buttons
type="bill-recurring"
:document="$recurring_bill"
hide-divider1
hide-divider2
hide-divider3
hide-divider4
hide-email
hide-share
hide-customize
hide-print
hide-pdf
hide-cancel
/>
</x-slot>
<x-slot name="content">
<x-documents.show.content type="bill-recurring" :document="$recurring_bill" hide-status-message hide-send hide-get-paid hide-receive hide-make-payment />
</x-slot>
@push('stylesheet')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
@endpush
<x-documents.script type="bill-recurring" />
</x-layouts.admin>

View File

@@ -1,63 +1,17 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.new', ['type' => trans_choice('general.vendors', 1)]) }}
</x-slot>
@section('title', trans('general.title.new', ['type' => trans_choice('general.vendors', 1)]))
<x-slot name="favorite"
title="{{ trans('general.title.new', ['type' => trans_choice('general.vendors', 1)]) }}"
icon="engineering"
route="vendors.create"
></x-slot>
@section('content')
<div class="card">
{!! Form::open([
'route' => 'vendors.store',
'id' => 'vendor',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button needs-validation',
'novalidate' => 'true'
]) !!}
<x-slot name="content">
<x-contacts.form.content type="vendor" hide-can-login />
</x-slot>
<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::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name']]) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe', []) }}
{{ Form::textareaGroup('address', trans('general.address'), '', '', ['rows' => '2', 'v-model' => 'form.address']) }}
{{ Form::textGroup('city', trans_choice('general.cities', 1), 'city', []) }}
{{ Form::textGroup('zip_code', trans('general.zip_code'), 'mail-bulk', []) }}
{{ Form::textGroup('state', trans('general.state'), 'city', []) }}
{{ Form::selectGroup('country', trans_choice('general.countries', 1), 'globe-americas', trans('countries'), setting('company.country'), ['model' => 'form.country']) }}
{{ Form::fileGroup('logo', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file']) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
</div>
</div>
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('vendors.index') }}
</div>
</div>
{{ Form::hidden('type', 'vendor') }}
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/purchases/vendors.js?v=' . version('short')) }}"></script>
@endpush
<x-contacts.script type="vendor" />
</x-layouts.admin>

View File

@@ -1,66 +1,11 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ trans('general.title.edit', ['type' => trans_choice('general.vendors', 1)]) }}
</x-slot>
@section('title', trans('general.title.edit', ['type' => trans_choice('general.vendors', 1)]))
<x-slot name="content">
<x-contacts.form.content type="vendor" :model="$vendor" hide-can-login />
</x-slot>
@section('content')
<div class="card">
{!! Form::model($vendor, [
'id' => 'vendor',
'method' => 'PATCH',
'route' => ['vendors.update', $vendor->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'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::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $vendor->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name']]) }}
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
{{ Form::textareaGroup('address', trans('general.address'), '', $vendor->address, ['rows' => '2', 'v-model' => 'form.address']) }}
{{ Form::textGroup('city', trans_choice('general.cities', 1), 'city', []) }}
{{ Form::textGroup('zip_code', trans('general.zip_code'), 'mail-bulk', []) }}
{{ Form::textGroup('state', trans('general.state'), 'city', []) }}
{{ Form::selectGroup('country', trans_choice('general.countries', 1), 'globe-americas', trans('countries'), $vendor->country, ['model' => 'form.country']) }}
{{ Form::fileGroup('logo', trans_choice('general.logos', 1), '', ['dropzone-class' => 'form-file']) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
{{ Form::radioGroup('enabled', trans('general.enabled'), $vendor->enabled) }}
</div>
</div>
@can('update-purchases-vendors')
<div class="card-footer">
<div class="row save-buttons">
{{ Form::saveButtons('vendors.index') }}
</div>
</div>
@endcan
{{ Form::hidden('type', 'vendor') }}
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/purchases/vendors.js?v=' . version('short')) }}"></script>
@endpush
<x-contacts.script type="vendor" :model="$vendor" />
</x-layouts.admin>

View File

@@ -1,117 +1,23 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">{{ trans_choice('general.vendors', 2) }}</x-slot>
@section('title', trans_choice('general.vendors', 2))
<x-slot name="favorite"
title="{{ trans_choice('general.vendors', 2) }}"
icon="engineering"
route="vendors.index"
></x-slot>
@section('new_button')
@can('create-purchases-vendors')
<a href="{{ route('vendors.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
<a href="{{ route('import.create', ['group' => 'purchases', 'type' => 'vendors']) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
@endcan
<a href="{{ route('vendors.export', request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
@endsection
<x-slot name="buttons">
<x-contacts.index.buttons type="vendor" />
</x-slot>
@section('content')
@if ($vendors->count() || request()->get('search', false))
<div class="card">
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
{!! Form::open([
'method' => 'GET',
'route' => 'vendors.index',
'role' => 'form',
'class' => 'mb-0'
]) !!}
<div class="align-items-center" v-if="!bulk_action.show">
<x-search-string model="App\Models\Common\Contact" />
</div>
<x-slot name="moreButtons">
<x-contacts.index.more-buttons type="vendor" />
</x-slot>
{{ Form::bulkActionRowGroup('general.vendors', $bulk_actions, ['group' => 'purchases', 'type' => 'vendors']) }}
{!! Form::close() !!}
</div>
<x-slot name="content">
<x-contacts.index.content type="vendor" :contacts="$vendors" show-picture />
</x-slot>
<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-4 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-md-3 col-lg-3 col-xl-3 d-none d-md-block">@sortablelink('email', trans('general.email'))</th>
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-right">@sortablelink('unpaid', trans('general.unpaid'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-2 text-center">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($vendors as $item)
<tr 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-4 col-lg-3 col-xl-3">
<a class="col-aka long-texts d-block" href="{{ route('vendors.show', $item->id) }}">{{ $item->name }}</a>
</td>
<td class="col-md-3 col-lg-3 col-xl-3 d-none d-md-block long-texts">
<el-tooltip content="{{ !empty($item->phone) ? $item->phone : trans('general.na') }}"
effect="dark"
placement="top">
<span>{{ !empty($item->email) ? $item->email : trans('general.na') }}</span>
</el-tooltip>
</td>
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-right long-texts">
@money($item->unpaid, setting('default.currency'), true)
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-2 col-xl-2 text-center">
@if (user()->can('update-purchases-vendors'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success" class="mw-60 d-inline-block">{{ trans('general.yes') }}</badge>
@else
<badge rounded type="danger" class="mw-60 d-inline-block">{{ trans('general.no') }}</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('vendors.show', $item->id) }}">{{ trans('general.show') }}</a>
@can('update-purchases-vendors')
<a class="dropdown-item" href="{{ route('vendors.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@endcan
@can('create-purchases-vendors')
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ route('vendors.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
@endcan
@can('delete-purchases-vendors')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'vendors.destroy') !!}
@endcan
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $vendors])
</div>
</div>
</div>
@else
<x-empty-page group="purchases" page="vendors" />
@endif
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/purchases/vendors.js?v=' . version('short')) }}"></script>
@endpush
<x-contacts.script type="vendor" />
</x-layouts.admin>

View File

@@ -1,275 +1,31 @@
@extends('layouts.admin')
<x-layouts.admin>
<x-slot name="title">
{{ $vendor->name }}
</x-slot>
@section('title', $vendor->name)
<x-slot name="status">
@if (! $vendor->enabled)
<x-index.disable text="{{ trans_choice('general.vendors', 1) }}" />
@endif
</x-slot>
@section('new_button')
<div class="dropup header-drop-top">
<button type="button" id="more_actions_vnd_show" class="btn btn-white btn-sm" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-chevron-down"></i>&nbsp; {{ trans('general.more_actions') }}
</button>
<x-slot name="favorite"
title="{{ $vendor->name }}"
icon="engineering"
:route="['vendors.show', $vendor->id]"
></x-slot>
<div class="dropdown-menu" role="menu">
@stack('button_dropdown_start')
<x-slot name="buttons">
<x-contacts.show.buttons type="vendor" :model="$vendor" />
</x-slot>
@stack('duplicate_button_start')
@can('create-purchases-vendors')
<a class="dropdown-item" href="{{ route('vendors.duplicate', $vendor->id) }}">
{{ trans('general.duplicate') }}
</a>
@endcan
@stack('duplicate_button_end')
<x-slot name="moreButtons">
<x-contacts.show.more-buttons type="vendor" :model="$vendor" />
</x-slot>
<div class="dropdown-divider"></div>
<x-slot name="content">
<x-contacts.show.content type="vendor" :model="$vendor" />
</x-slot>
@stack('bill_button_start')
@can('create-purchases-bills')
<a class="dropdown-item" id="create_bill" href="{{ route('vendors.create-bill', $vendor->id) }}">
{{ trans('bills.create_bill') }}
</a>
@endcan
@stack('bill_button_end')
@stack('payment_button_start')
@can('create-purchases-payments')
<a class="dropdown-item" id="create_payment" href="{{ route('vendors.create-payment', $vendor->id) }}">
{{ trans('payments.create_payment') }}
</a>
@endcan
@stack('payment_button_end')
<div class="dropdown-divider"></div>
@stack('delete_button_start')
@can('delete-purchases-vendors')
{!! Form::deleteLink($vendor, 'vendors.destroy') !!}
@endcan
@stack('delete_button_end')
@stack('button_dropdown_end')
</div>
</div>
@stack('edit_button_start')
@can('update-purchases-vendors')
<a href="{{ route('vendors.edit', $vendor->id) }}" class="btn btn-white btn-sm">
{{ trans('general.edit') }}
</a>
@endcan
@stack('edit_button_end')
@endsection
@section('content')
<div class="row">
<div class="col-xl-3">
<ul class="list-group mb-4">
@stack('vendor_bills_count_start')
<li class="list-group-item d-flex justify-content-between align-items-center border-0">
{{ trans_choice('general.bills', 2) }}
<span class="badge badge-primary badge-pill">{{ $counts['bills'] }}</span>
</li>
@stack('vendor_bills_count_end')
@stack('vendor_transactions_count_start')
<li class="list-group-item d-flex justify-content-between align-items-center border-0 border-top-1">
{{ trans_choice('general.transactions', 2) }}
<span class="badge badge-primary badge-pill">{{ $counts['transactions'] }}</span>
</li>
@stack('vendor_transactions_count_end')
</ul>
<ul class="list-group mb-4">
@stack('vendor_email_start')
<li class="list-group-item border-0">
<div class="font-weight-600">{{ trans('general.email') }}</div>
<div><small class="long-texts" title="{{ $vendor->email }}">{{ $vendor->email }}</small></div>
</li>
@stack('vendor_email_end')
@stack('vendor_phone_start')
<li class="list-group-item border-0 border-top-1">
<div class="font-weight-600">{{ trans('general.phone') }}</div>
<div><small class="long-texts" title="{{ $vendor->phone }}">{{ $vendor->phone }}</small></div>
</li>
@stack('vendor_phone_end')
@stack('vendor_website_start')
<li class="list-group-item border-0 border-top-1">
<div class="font-weight-600">{{ trans('general.website') }}</div>
<div><small class="long-texts" title="{{ $vendor->website }}">{{ $vendor->website }}</small></div>
</li>
@stack('vendor_website_end')
@stack('vendor_tax_number_start')
<li class="list-group-item border-0 border-top-1">
<div class="font-weight-600">{{ trans('general.tax_number') }}</div>
<div><small class="long-texts" title="{{ $vendor->tax_number }}">{{ $vendor->tax_number }}</small></div>
</li>
@stack('vendor_tax_number_end')
@stack('vendor_address_start')
<li class="list-group-item border-0 border-top-1">
<div class="font-weight-600">{{ trans('general.address') }}</div>
<div><small>{{ $vendor->address }}</small></div>
<div><small>{{ $vendor->location }}</small></div>
</li>
@stack('vendor_address_end')
@if ($vendor->reference)
@stack('vendor_reference_start')
<li class="list-group-item border-0 border-top-1">
<div class="font-weight-600">{{ trans('general.reference') }}</div>
<div><small class="long-texts" title="{{ $vendor->reference }}">{{ $vendor->reference }}</small></div>
</li>
@stack('vendor_reference_end')
@endif
</ul>
@stack('vendor_edit_button_start')
@stack('vendor_edit_button_end')
</div>
<div class="col-xl-9">
<div class="row mb--3">
@stack('vendor_paid_card_start')
<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>
@stack('vendor_paid_card_end')
@stack('vendor_open_card_start')
<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('widgets.open_bills') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['open'], setting('default.currency'), true)</span>
</div>
</div>
</div>
</div>
</div>
@stack('vendor_open_card_end')
@stack('vendor_overdue_card_start')
<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('widgets.overdue_bills') }}</h5>
<div class="dropdown-divider"></div>
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['overdue'], setting('default.currency'), true)</span>
</div>
</div>
</div>
</div>
</div>
@stack('vendor_overdue_card_end')
</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">
@stack('vendor_bills_tab_start')
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 active" id="bills-tab" data-toggle="tab" href="#bills-content" role="tab" aria-controls="bills-content" aria-selected="false">{{ trans_choice('general.bills', 2) }}</a>
</li>
@stack('vendor_bills_tab_end')
@stack('vendor_transactions_tab_start')
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0" id="transactions-tab" data-toggle="tab" href="#transactions-content" role="tab" aria-controls="transactions-content" aria-selected="true">{{ trans_choice('general.transactions', 2) }}</a>
</li>
@stack('vendor_transactions_tab_end')
</ul>
</div>
<div class="card">
<div class="tab-content" id="myTabContent">
@stack('vendor_bills_content_start')
<div class="tab-pane fade show active" id="bills-content" role="tabpanel" aria-labelledby="transactions-tab">
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-bills">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-1">{{ trans_choice('general.numbers', 1) }}</th>
<th class="col-xs-4 col-sm-3 text-right">{{ trans('general.amount') }}</th>
<th class="col-sm-3 d-none d-sm-block text-left">{{ trans('invoices.invoice_date') }}</th>
<th class="col-sm-3 d-none d-sm-block text-left">{{ trans('invoices.due_date') }}</th>
<th class="col-xs-4 col-sm-2">{{ trans_choice('general.statuses', 1) }}</th>
</tr>
</thead>
<tbody>
@foreach($bills as $item)
<tr class="row align-items-center border-top-1 tr-py">
<td class="col-xs-4 col-sm-1"><a href="{{ route('bills.show', $item->id) }}">{{ $item->document_number }}</a></td>
<td class="col-xs-4 col-sm-3 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->issued_at)</td>
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->due_at)</td>
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status_label }} my--2">{{ trans('documents.statuses.' . $item->status) }}</span></td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer py-4 table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $bills, 'type' => 'bills'])
</div>
</div>
</div>
@stack('vendor_bills_content_end')
@stack('vendor_transactions_content_start')
<div class="tab-pane fade" id="transactions-content" role="tabpanel" aria-labelledby="bills-tab">
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-transactions">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-6 col-sm-2">{{ trans('general.date') }}</th>
<th class="col-xs-6 col-sm-2 text-right">{{ trans('general.amount') }}</th>
<th class="col-sm-4 d-none d-sm-block">{{ trans_choice('general.categories', 1) }}</th>
<th class="col-sm-4 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 tr-py">
<td class="col-xs-6 col-sm-2"><a href="{{ route('payments.show', $item->id) }}">@date($item->paid_at)</a></td>
<td class="col-xs-6 col-sm-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-4 d-none d-sm-block">{{ $item->category->name }}</td>
<td class="col-sm-4 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>
@stack('vendor_transactions_content_end')
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/purchases/vendors.js?v=' . version('short')) }}"></script>
@endpush
<x-contacts.script type="vendor" />
</x-layouts.admin>