akaunting 3.0 (the last dance)
This commit is contained in:
@ -1,59 +1,69 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.companies', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.companies', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="company" route="companies.store">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('companies.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'id' => 'company',
|
||||
'route' => 'companies.store',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<div class="sm:col-span-3 grid gap-x-8 gap-y-6 grid-rows-3">
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
<x-form.group.email name="email" label="{{ trans('general.email') }}" />
|
||||
|
||||
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
|
||||
<x-form.group.text name="phone" label="{{ trans('settings.company.phone') }}" value="{{ setting('company.phone') }}" not-required />
|
||||
</div>
|
||||
|
||||
{{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies) }}
|
||||
<div class="sm:col-span-3">
|
||||
<x-form.group.file name="logo" label="{{ trans('companies.logo') }}" not-required />
|
||||
</div>
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), setting('default.locale', config('app.locale', 'en-GB')), []) }}
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('items.billing') }}" description="{{ trans('companies.form_description.billing') }}" />
|
||||
</x-slot>
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', [], setting('company.tax_number')) }}
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" not-required />
|
||||
|
||||
{{ Form::textGroup('phone', trans('settings.company.phone'), 'phone', [], setting('company.phone')) }}
|
||||
<x-form.group.currency name="currency" />
|
||||
|
||||
{{ Form::textareaGroup('address', trans('general.address'), '', '', ['rows' => '2', 'v-model' => 'form.address']) }}
|
||||
<x-form.group.locale not-required />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{{ Form::textGroup('city', trans_choice('general.cities', 1), 'city', [], setting('company.city')) }}
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.address') }}" description="{{ trans('companies.form_description.address') }}" />
|
||||
</x-slot>
|
||||
|
||||
{{ Form::textGroup('zip_code', trans('general.zip_code'), 'mail-bulk', [], setting('company.zip_code')) }}
|
||||
<x-slot name="body">
|
||||
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" v-model="form.address" />
|
||||
|
||||
{{ Form::textGroup('state', trans('general.state'), 'city', [], setting('company.state')) }}
|
||||
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ setting('company.city') }}" not-required />
|
||||
|
||||
{{ Form::selectGroup('country', trans_choice('general.countries', 1), 'globe-americas', trans('countries'), setting('company.country'), ['model' => 'form.country']) }}
|
||||
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" value="{{ setting('company.zip_code') }}" not-required />
|
||||
|
||||
{{ Form::fileGroup('logo', trans('companies.logo'), '', ['dropzone-class' => 'form-file']) }}
|
||||
<x-form.group.text name="state" label="{{ trans('general.state') }}" value="{{ setting('company.state') }}" not-required />
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
|
||||
</div>
|
||||
</div>
|
||||
<x-form.group.country />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('companies.index') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="companies.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="companies" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,62 +1,73 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.companies', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.companies', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="company" method="PATCH" :route="['companies.update', $company->id]" :model="$company">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('companies.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($company, [
|
||||
'id' => 'company',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['companies.update', $company->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<div class="sm:col-span-3 grid gap-x-8 gap-y-6 grid-rows-3">
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
<x-form.group.email name="email" label="{{ trans('general.email') }}" />
|
||||
|
||||
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
|
||||
<x-form.group.text name="phone" label="{{ trans('settings.company.phone') }}" not-required />
|
||||
</div>
|
||||
|
||||
{{ Form::selectGroup('currency', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $company->currency ?? 'USD') }}
|
||||
<div class="sm:col-span-3">
|
||||
<x-form.group.file name="logo" label="{{ trans('companies.logo') }}" :value="$company->company_logo" not-required />
|
||||
</div>
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed(), $company->locale ?? config('app.locale', 'en-GB'), []) }}
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('items.billing') }}" description="{{ trans('companies.form_description.billing') }}" />
|
||||
</x-slot>
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', [], $company->tax_number) }}
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" not-required />
|
||||
|
||||
{{ Form::textGroup('phone', trans('settings.company.phone'), 'phone', [], $company->phone) }}
|
||||
<x-form.group.currency name="currency" selected="{{ ! empty($company->currency) ? $company->currency : config('setting.fallback.default.currency') }}" />
|
||||
|
||||
{{ Form::textareaGroup('address', trans('general.address'), '', $company->address, ['rows' => '2', 'v-model' => 'form.address']) }}
|
||||
<x-form.group.locale not-required />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{{ Form::textGroup('city', trans_choice('general.cities', 1), 'city', []) }}
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.address') }}" description="{{ trans('companies.form_description.address') }}" />
|
||||
</x-slot>
|
||||
|
||||
{{ Form::textGroup('zip_code', trans('general.zip_code'), 'mail-bulk', []) }}
|
||||
<x-slot name="body">
|
||||
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" not-required v-model="form.address" />
|
||||
|
||||
{{ Form::textGroup('state', trans('general.state'), 'city', []) }}
|
||||
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" not-required />
|
||||
|
||||
{{ Form::selectGroup('country', trans_choice('general.countries', 1), 'globe-americas', trans('countries'), $company->country, ['model' => 'form.country']) }}
|
||||
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" not-required />
|
||||
|
||||
{{ Form::fileGroup('logo', trans('companies.logo'), '', ['dropzone-class' => 'form-file'], $company->company_logo) }}
|
||||
<x-form.group.text name="state" label="{{ trans('general.state') }}" not-required />
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), $company->enabled) }}
|
||||
</div>
|
||||
</div>
|
||||
<x-form.group.country />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
@can('update-common-companies')
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('companies.index') }}
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
@can('update-common-companies')
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="companies.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
@endcan
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="common" file="companies" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,101 +1,148 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">
|
||||
{{ trans_choice('general.companies', 2) }}
|
||||
</x-slot>
|
||||
|
||||
@section('title', trans_choice('general.companies', 2))
|
||||
<x-slot name="favorite"
|
||||
title="{{ trans_choice('general.companies', 2) }}"
|
||||
icon="business"
|
||||
route="companies.index"
|
||||
></x-slot>
|
||||
|
||||
@can('create-common-companies')
|
||||
@section('new_button')
|
||||
<a href="{{ route('companies.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
|
||||
@endsection
|
||||
@endcan
|
||||
<x-slot name="buttons">
|
||||
@can('create-common-companies')
|
||||
<x-link href="{{ route('companies.create') }}" kind="primary">
|
||||
{{ trans('general.title.new', ['type' => trans_choice('general.companies', 1)]) }}
|
||||
</x-link>
|
||||
@endcan
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
|
||||
{!! Form::open([
|
||||
'method' => 'GET',
|
||||
'route' => 'companies.index',
|
||||
'role' => 'form',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="align-items-center" v-if="!bulk_action.show">
|
||||
<x-search-string model="App\Models\Common\Company" />
|
||||
</div>
|
||||
<x-slot name="content">
|
||||
<x-index.container>
|
||||
<x-index.search
|
||||
search-string="App\Models\Common\Company"
|
||||
bulk-action="App\BulkActions\Common\Companies"
|
||||
/>
|
||||
|
||||
{{ Form::bulkActionRowGroup('general.companies', $bulk_actions, ['group' => 'common', 'type' => 'companies']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<x-table>
|
||||
<x-table.thead>
|
||||
<x-table.tr class="flex items-center px-1">
|
||||
<x-table.th class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
|
||||
<x-index.bulkaction.all />
|
||||
</x-table.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 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">@sortablelink('id', trans('general.id'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-3 col-xl-3 long-texts">@sortablelink('name', trans('general.name'))</th>
|
||||
<th class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block long-texts">@sortablelink('email', trans('general.email'))</th>
|
||||
<th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('created_at', trans('general.created'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">@sortablelink('enabled', trans('general.enabled'))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<x-table.th class="w-2/12 sm:w-1/12">
|
||||
<x-sortablelink column="id" title="{{ trans('general.id') }}" />
|
||||
</x-table.th>
|
||||
|
||||
<tbody>
|
||||
<x-table.th class="w-8/12 sm:w-4/12">
|
||||
<x-slot name="first" class="flex items-center">
|
||||
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
<x-sortablelink column="tax_number" title="{{ trans('general.tax_number') }}" />
|
||||
</x-slot>
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-4/12 hidden sm:table-cell">
|
||||
<x-slot name="first">
|
||||
<x-sortablelink column="email" title="{{ trans('general.email') }}" />
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
<x-sortablelink column="phone" title="{{ trans('general.phone') }}" />
|
||||
</x-slot>
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-3/12" kind="right">
|
||||
<x-slot name="first">
|
||||
<x-sortablelink column="country" title="{{ trans_choice('general.countries', 1) }}" />
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
<x-sortablelink column="currency" title="{{ trans_choice('general.currencies', 1) }}" />
|
||||
</x-slot>
|
||||
</x-table.th>
|
||||
</x-table.tr>
|
||||
</x-table.thead>
|
||||
|
||||
<x-table.tbody>
|
||||
@foreach($companies as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">
|
||||
<x-table.tr href="{{ route('companies.edit', $item->id) }}">
|
||||
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
|
||||
@if ((company_id() != $item->id))
|
||||
{{ Form::bulkActionGroup($item->id, $item->name) }}
|
||||
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
|
||||
@else
|
||||
{{ Form::bulkActionGroup($item->id, $item->name, ['disabled' => 'true']) }}
|
||||
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" disabled="true" />
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block"><a class="col-aka">{{ $item->id }}</a></td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-3 col-xl-3 long-texts"><a href="{{ route('companies.edit', $item->id) }}">{{ $item->name }}</a></td>
|
||||
<td class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block long-texts">{{ $item->email }}</td>
|
||||
<td class="col-lg-2 col-xl-2 d-none d-lg-block">@date($item->created_at)</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">
|
||||
@if ((company_id() != $item->id) && user()->can('update-common-companies'))
|
||||
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
|
||||
@else
|
||||
<badge rounded type="danger" class="mw-60">{{ 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">
|
||||
@if ($item->enabled)
|
||||
<a class="dropdown-item" href="{{ route('companies.switch', $item->id) }}">{{ trans('general.switch') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
<a class="dropdown-item" href="{{ route('companies.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@can('delete-common-companies')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'companies.destroy') !!}
|
||||
@endcan
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-2/12 sm:w-1/12 font-bold truncate">
|
||||
{{ $item->id }}
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-8/12 sm:w-4/12 truncate">
|
||||
<x-slot name="first" class="flex" override="class">
|
||||
<div class="font-medium truncate">
|
||||
{{ $item->name }}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if (! $item->enabled)
|
||||
<x-index.disable text="{{ trans_choice('general.companies', 1) }}" />
|
||||
@endif
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
@if ($item->tax_number)
|
||||
{{ $item->tax_number }}
|
||||
@else
|
||||
<x-empty-data />
|
||||
@endif
|
||||
</x-slot>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-4/12 hidden sm:table-cell truncate">
|
||||
<x-slot name="first">
|
||||
@if ($item->email)
|
||||
{{ $item->email }}
|
||||
@else
|
||||
<x-empty-data />
|
||||
@endif
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
@if ($item->phone)
|
||||
{{ $item->phone }}
|
||||
@else
|
||||
<x-empty-data />
|
||||
@endif
|
||||
</x-slot>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-3/12" kind="amount">
|
||||
<x-slot name="first">
|
||||
@if ($item->country)
|
||||
<x-index.country code="{{ $item->country }}" />
|
||||
@else
|
||||
<x-empty-data />
|
||||
@endif
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
@if ($item->currency)
|
||||
<x-index.currency code="{{ $item->currency }}" />
|
||||
@else
|
||||
<x-empty-data />
|
||||
@endif
|
||||
</x-slot>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td kind="action">
|
||||
<x-table.actions :model="$item" />
|
||||
</x-table.td>
|
||||
</x-table.tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</x-table.tbody>
|
||||
</x-table>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $companies])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
<x-pagination :items="$companies" />
|
||||
</x-index.container>
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/companies.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="companies" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,41 +1,31 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="dashboard" route="dashboards.store">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('dashboards.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'id' => 'dashboard',
|
||||
'route' => 'dashboards.store',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
@can('read-auth-users')
|
||||
<x-form.group.checkbox name="users" label="{{ trans_choice('general.users', 2) }}" :options="$users" :checked="[]" />
|
||||
@endcan
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
@can('read-auth-users')
|
||||
{{ Form::checkboxGroup('users', trans_choice('general.users', 2), $users, 'name') }}
|
||||
@endcan
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="dashboards.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('dashboards.index') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="dashboards" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,44 +1,35 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.dashboards', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.dashboards', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="dashboard" method="PATCH" :route="['dashboards.update', $dashboard->id]" :model="$dashboard">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('dashboards.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($dashboard, [
|
||||
'id' => 'dashboard',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['dashboards.update', $dashboard->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
@can('read-auth-users')
|
||||
<x-form.group.checkbox name="users" label="{{ trans_choice('general.users', 2) }}" :options="$users" :checked="$dashboard->users()->pluck('id')->toArray()" />
|
||||
@endcan
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
@can('read-auth-users')
|
||||
{{ Form::checkboxGroup('users', trans_choice('general.users', 2), $users, 'name') }}
|
||||
@endcan
|
||||
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), $dashboard->enabled) }}
|
||||
</div>
|
||||
</div>
|
||||
@can('update-common-dashboards')
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="dashboards.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
@endcan
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
@can('update-common-dashboards')
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('dashboards.index') }}
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="dashboards" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,91 +1,74 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans_choice('general.dashboards', 2) }}</x-slot>
|
||||
|
||||
@section('title', trans_choice('general.dashboards', 2))
|
||||
<x-slot name="buttons">
|
||||
@can('create-common-dashboards')
|
||||
<x-link href="{{ route('dashboards.create') }}" kind="primary">
|
||||
{{ trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]) }}
|
||||
</x-link>
|
||||
@endcan
|
||||
</x-slot>
|
||||
|
||||
@can('create-common-dashboards')
|
||||
@section('new_button')
|
||||
<a href="{{ route('dashboards.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
|
||||
@endsection
|
||||
@endcan
|
||||
<x-slot name="content">
|
||||
<x-index.container>
|
||||
<x-index.search
|
||||
search-string="App\Models\Common\Dashboard"
|
||||
bulk-action="App\BulkActions\Common\Dashboards"
|
||||
/>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
|
||||
{!! Form::open([
|
||||
'method' => 'GET',
|
||||
'route' => 'dashboards.index',
|
||||
'role' => 'form',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="align-items-center" v-if="!bulk_action.show">
|
||||
<x-search-string model="App\Models\Common\Dashboard" />
|
||||
</div>
|
||||
<x-table>
|
||||
<x-table.thead>
|
||||
<x-table.tr class="flex items-center px-1">
|
||||
<x-table.th class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
|
||||
<x-index.bulkaction.all />
|
||||
</x-table.th>
|
||||
|
||||
{{ Form::bulkActionRowGroup('general.dashboards', $bulk_actions, ['group' => 'common', 'type' => 'dashboards']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<x-table.th class="w-8/12 sm:w-5/12">
|
||||
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
|
||||
</x-table.th>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-3 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-6 col-lg-7 col-xl-7 long-texts">@sortablelink('name', trans('general.name'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">@sortablelink('enabled', trans('general.enabled'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<x-table.th class="w-7/12 hidden sm:table-cell" kind="right">
|
||||
{{ trans_choice('general.users', 1) }}
|
||||
</x-table.th>
|
||||
</x-table.tr>
|
||||
</x-table.thead>
|
||||
|
||||
<tbody>
|
||||
<x-table.tbody>
|
||||
@foreach($dashboards as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-3 col-md-2 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-6 col-lg-7 col-xl-7 long-texts"><a href="{{ route('dashboards.edit', $item->id) }}">{{ $item->name }}</a></td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">
|
||||
@if (user()->can('update-common-dashboards'))
|
||||
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
|
||||
@else
|
||||
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
|
||||
@endif
|
||||
<x-table.tr href="{{ route('dashboards.edit', $item->id) }}">
|
||||
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
|
||||
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-5/12 p-0 whitespace-nowrap text-sm font-medium text-black">
|
||||
{{ $item->name }}
|
||||
|
||||
@if (! $item->enabled)
|
||||
<x-index.disable text="{{ trans_choice('general.dashboards', 1) }}" />
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2 text-center">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h text-muted"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
@if ($item->enabled)
|
||||
<a class="dropdown-item" href="{{ route('dashboards.switch', $item->id) }}">{{ trans('general.switch') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
<a class="dropdown-item" href="{{ route('dashboards.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@can('delete-common-dashboards')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'dashboards.destroy') !!}
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-7/12" kind="right">
|
||||
@if ($item->users)
|
||||
@foreach($item->users as $user)
|
||||
<span class="bg-lilac-900 px-3 py-1 text-sm rounded-lg text-black ltr:ml-3 rtl:mr-3">
|
||||
{{ !empty($user->name) ? $user->name : trans('general.na') }}
|
||||
</span>
|
||||
@endforeach
|
||||
@endif
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td kind="action">
|
||||
<x-table.actions :model="$item" />
|
||||
</x-table.td>
|
||||
</x-table.tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</x-table.tbody>
|
||||
</x-table>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $dashboards])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
<x-pagination :items="$dashboards" />
|
||||
</x-index.container>
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="dashboards" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,148 +1,186 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="metaTitle">
|
||||
{{ $dashboard->name }}
|
||||
</x-slot>
|
||||
|
||||
@section('title', $dashboard->name)
|
||||
<x-slot name="title">
|
||||
@if ($user_dashboards->count() > 1)
|
||||
<div class="flex items-center relative cursor-pointer">
|
||||
<x-dropdown id="dashboard-list">
|
||||
<x-slot name="trigger" class="flex items-center" override="class">
|
||||
<span class="text-2xl xl:text-5xl text-black font-light truncate border-b border-transparent transition-all hover:text-black-700 hover:border-black">
|
||||
{{ $dashboard->name }}
|
||||
</span>
|
||||
|
||||
@section('dashboard_action')
|
||||
@canany(['create-common-widgets', 'read-common-dashboards'])
|
||||
<span class="dashboard-action">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-sm items-align-center py-2 mt--1" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-v"></i>
|
||||
</a>
|
||||
<svg class="w-5 h-5 mt-1 text-gray-400" x-description="Heroicon name: solid/selector" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd"></path>
|
||||
</svg>
|
||||
</x-slot>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-sm-right dropdown-menu-xs-right dropdown-menu-arrow">
|
||||
@can('create-common-widgets')
|
||||
{!! Form::button(trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]), [
|
||||
'type' => 'button',
|
||||
'class' => 'dropdown-item',
|
||||
'title' => trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]),
|
||||
'@click' => 'onCreateWidget()',
|
||||
]) !!}
|
||||
@endcan
|
||||
@can('update-common-dashboards')
|
||||
<div class="dropdown-divider"></div>
|
||||
@can('create-common-dashboards')
|
||||
<a class="dropdown-item" href="{{ route('dashboards.create') }}">{{ trans('general.title.create', ['type' => trans_choice('general.dashboards', 1)]) }}</a>
|
||||
@endcan
|
||||
<a class="dropdown-item" href="{{ route('dashboards.index') }}">{{ trans('general.title.manage', ['type' => trans_choice('general.dashboards', 2)]) }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
@foreach ($user_dashboards as $user_dashboard)
|
||||
<x-dropdown.link href="{{ route('dashboards.switch', $user_dashboard->id) }}">
|
||||
{{ $user_dashboard->name }}
|
||||
</x-dropdown.link>
|
||||
@endforeach
|
||||
</x-dropdown>
|
||||
</div>
|
||||
</span>
|
||||
@endcanany
|
||||
@else
|
||||
{{ $dashboard->name }}
|
||||
@endif
|
||||
</x-slot>
|
||||
|
||||
@php
|
||||
$text = json_encode([
|
||||
'name' => trans('general.name'),
|
||||
'type' => trans_choice('general.types', 1),
|
||||
'width' => trans('general.width'),
|
||||
'sort' => trans('general.sort'),
|
||||
'enabled' => trans('general.enabled'),
|
||||
'yes' => trans('general.yes'),
|
||||
'no' => trans('general.no'),
|
||||
'save' => trans('general.save'),
|
||||
'cancel' => trans('general.cancel')
|
||||
]);
|
||||
<x-slot name="buttons">
|
||||
<!--Dashboard General Filter-->
|
||||
<el-date-picker
|
||||
v-model="filter_date"
|
||||
type="daterange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
@change="onChangeFilterDate"
|
||||
range-separator="-"
|
||||
start-placeholder="{{ $date_picker_shortcuts[trans('reports.this_year')]['start'] }}"
|
||||
end-placeholder="{{ $date_picker_shortcuts[trans('reports.this_year')]['end'] }}"
|
||||
popper-class="dashboard-picker"
|
||||
:picker-options="{
|
||||
shortcuts: [
|
||||
{
|
||||
text: '{{ trans("reports.this_year") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}');
|
||||
|
||||
$placeholder = json_encode([
|
||||
'name' => trans('general.form.enter', ['field' => trans('general.name')]),
|
||||
'type' => trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]),
|
||||
'width' => trans('general.form.select.field', ['field' => trans('general.width')]),
|
||||
'sort' => trans('general.form.enter', ['field' => trans('general.sprt')])
|
||||
]);
|
||||
@endphp
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.previous_year") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["end"] }}');
|
||||
|
||||
<akaunting-widget
|
||||
v-if="widget_modal"
|
||||
:title="'{{ trans_choice('general.widgets', 1) }}'"
|
||||
:show="widget_modal"
|
||||
:widget_id="widget.id"
|
||||
:name="widget.name"
|
||||
:width="widget.width"
|
||||
:action="widget.action"
|
||||
:type="widget.class"
|
||||
:types="widgets"
|
||||
:sort="widget.sort"
|
||||
:dashboard_id="{{ $dashboard->id }}"
|
||||
:text="{{ $text }}"
|
||||
:placeholder="{{ $placeholder }}"
|
||||
@cancel="onCancel">
|
||||
</akaunting-widget>
|
||||
@endsection
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.this_quarter") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["end"] }}');
|
||||
|
||||
@section('new_button')
|
||||
<!--Dashboard General Filter-->
|
||||
<el-date-picker
|
||||
v-model="filter_date"
|
||||
type="daterange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
:format="'yyyy-MM-dd'"
|
||||
value-format="yyyy-MM-dd"
|
||||
@change="onChangeFilterDate"
|
||||
range-separator=">>"
|
||||
start-placeholder="{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}"
|
||||
end-placeholder="{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}"
|
||||
:picker-options="{
|
||||
shortcuts: [
|
||||
{
|
||||
text: '{{ trans("reports.this_year") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}');
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.previous_quarter") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["end"] }}');
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.last_12_months") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["end"] }}');
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.previous_year") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["end"] }}');
|
||||
]
|
||||
}">
|
||||
</el-date-picker>
|
||||
</x-slot>
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.this_quarter") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["end"] }}');
|
||||
@section('dashboard_action')
|
||||
@canany(['create-common-widgets', 'read-common-dashboards'])
|
||||
<div class="dashboard-action">
|
||||
<x-dropdown id="dropdown-dashboard-company">
|
||||
<x-slot name="trigger" class="flex" override="class">
|
||||
<span id="dashboard-more-actions" class="material-icons-outlined text-4xl text-purple cursor-pointer hover:bg-gray-100 hover:rounded-lg hover:shadow-md">more_vert</span>
|
||||
</x-slot>
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.previous_quarter") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["end"] }}');
|
||||
@can('create-common-widgets')
|
||||
<x-button
|
||||
type="button"
|
||||
id="dashboard-add-widget"
|
||||
class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap"
|
||||
override="class"
|
||||
title="{{ trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]) }}"
|
||||
@click="onCreateWidget()"
|
||||
>
|
||||
<span class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100">
|
||||
{{ trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]) }}
|
||||
</span>
|
||||
</x-button>
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.last_12_months") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["end"] }}');
|
||||
<x-dropdown.divider />
|
||||
@endcan
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}
|
||||
]
|
||||
}">
|
||||
</el-date-picker>
|
||||
@endsection
|
||||
@can('update-common-dashboards')
|
||||
@can('create-common-dashboards')
|
||||
<x-dropdown.link href="{{ route('dashboards.create') }}">
|
||||
{{ trans('general.title.create', ['type' => trans_choice('general.dashboards', 1)]) }}
|
||||
</x-dropdown.link>
|
||||
@endcan
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
@foreach($widgets as $widget)
|
||||
@widget($widget)
|
||||
@endforeach
|
||||
</div>
|
||||
@endsection
|
||||
<x-dropdown.link href="{{ route('dashboards.index') }}">
|
||||
{{ trans('general.title.manage', ['type' => trans_choice('general.dashboards', 2)]) }}
|
||||
</x-dropdown.link>
|
||||
@endcan
|
||||
</x-dropdown>
|
||||
</div>
|
||||
@endcanany
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
@php
|
||||
$text = json_encode([
|
||||
'name' => trans('general.name'),
|
||||
'type' => trans_choice('general.types', 1),
|
||||
'width' => trans('general.width'),
|
||||
'sort' => trans('general.sort'),
|
||||
'enabled' => trans('general.enabled'),
|
||||
'yes' => trans('general.yes'),
|
||||
'no' => trans('general.no'),
|
||||
'save' => trans('general.save'),
|
||||
'cancel' => trans('general.cancel')
|
||||
]);
|
||||
|
||||
$placeholder = json_encode([
|
||||
'name' => trans('general.form.enter', ['field' => trans('general.name')]),
|
||||
'type' => trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]),
|
||||
'width' => trans('general.form.select.field', ['field' => trans('general.width')]),
|
||||
'sort' => trans('general.form.enter', ['field' => trans('general.sprt')])
|
||||
]);
|
||||
@endphp
|
||||
|
||||
<akaunting-widget
|
||||
v-if="widget_modal"
|
||||
:title="'{{ trans_choice('general.widgets', 1) }}'"
|
||||
:show="widget_modal"
|
||||
:widget_id="widget.id"
|
||||
:name="widget.name"
|
||||
:width="widget.width"
|
||||
:action="widget.action"
|
||||
:type="widget.class"
|
||||
:types="widgets"
|
||||
:sort="widget.sort"
|
||||
:dashboard_id="{{ $dashboard->id }}"
|
||||
:text="{{ $text }}"
|
||||
:placeholder="{{ $placeholder }}"
|
||||
@cancel="onCancel">
|
||||
</akaunting-widget>
|
||||
@endsection
|
||||
|
||||
<x-slot name="content">
|
||||
<div class="dashboard flex flex-wrap -mx-12">
|
||||
@foreach($widgets as $widget)
|
||||
@widget($widget)
|
||||
@endforeach
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="common" file="dashboards" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,52 +1,62 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">
|
||||
{{ trans('import.title', ['type' => $title_type]) }}
|
||||
</x-slot>
|
||||
|
||||
@section('title', trans('import.title', ['type' => $title_type]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open($form_params) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-warning alert-important">
|
||||
{!! trans('import.limitations', ['extensions' => strtoupper(config('excel.imports.extensions')), 'row_limit' => config('excel.imports.row_limit')]) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info alert-important">
|
||||
{!! trans('import.sample_file', ['download_link' => $sample_file]) !!}
|
||||
<x-slot name="content">
|
||||
<div class="card">
|
||||
<x-form id="import" :route="$form_params['route']" :url="$form_params['url']">
|
||||
<div class="card-body mt-8">
|
||||
<div class="border-t-4 border-orange-300 rounded-b-lg text-orange-700 px-4 py-3 shadow-md" role="alert">
|
||||
<div class="flex">
|
||||
<div>
|
||||
{!! trans('import.limitations', ['extensions' => strtoupper(config('excel.imports.extensions')),
|
||||
'row_limit' => config('excel.imports.row_limit')
|
||||
])
|
||||
!!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::fileGroup('import', '', 'plus', ['dropzone-class' => 'form-file', 'options' => ['acceptedFiles' => '.xls,.xlsx']], null, 'col-md-12') }}
|
||||
<div class="border-t-4 mt-8 border-blue-300 rounded-b-lg text-blue-700 px-4 py-3 shadow-md" role="alert">
|
||||
<div class="flex">
|
||||
<div>
|
||||
{!! trans('import.sample_file', ['download_link' => $sample_file]) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-form.group.file name="import" dropzone-class="form-file" singleWidthClasses :options="['acceptedFiles' => '.xls,.xlsx']" form-group-class="mt-8" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
@if (!empty($route))
|
||||
<a href="{{ route(\Str::replaceFirst('.import', '.index', $route)) }}" class="btn btn-outline-secondary">
|
||||
<div class="relative__footer mt-8">
|
||||
<div class="sm:col-span-6 flex items-center justify-end">
|
||||
@if (! empty($route))
|
||||
<a href="{{ route(\Str::replaceFirst('.import', '.index', $route)) }}" class="px-6 py-1.5 mr-2 hover:bg-gray-200 rounded-lg">
|
||||
{{ trans('general.cancel') }}
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ url($path) }}" class="btn btn-outline-secondary">
|
||||
<a href="{{ url($path) }}" class="px-6 py-1.5 hover:bg-gray-200 rounded-lg ltr:ml-2 rtl:mr-2">
|
||||
{{ trans('general.cancel') }}
|
||||
</a>
|
||||
@endif
|
||||
|
||||
{!! Form::button(
|
||||
'<span v-if="form.loading" class="btn-inner--icon"><i class="aka-loader"></i></span> <span :class="[{\'ml-0\': form.loading}]" class="btn-inner--text">' . trans('import.import') . '</span>',
|
||||
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-icon btn-success']) !!}
|
||||
<x-button
|
||||
type="submit"
|
||||
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100"
|
||||
::disabled="form.loading"
|
||||
override="class"
|
||||
>
|
||||
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
|
||||
<span :class="[{'opacity-0': form.loading}]">
|
||||
{{ trans('import.import') }}
|
||||
</span>
|
||||
</x-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-form>
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/imports.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="imports" />
|
||||
</x-layouts.admin>
|
@ -1,49 +1,66 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.items', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.items', 1)]))
|
||||
<x-slot name="favorite"
|
||||
title="{{ trans('general.title.new', ['type' => trans_choice('general.items', 1)]) }}"
|
||||
icon="inventory_2"
|
||||
route="items.create"
|
||||
></x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'route' => 'items.store',
|
||||
'id' => 'item',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="item" route="items.store">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('items.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'tag') }}
|
||||
<x-slot name="body">
|
||||
<x-form.group.radio
|
||||
name="type"
|
||||
label="{{ trans_choice('general.types', 1) }}"
|
||||
:options="[
|
||||
'product' => trans_choice('general.products', 1),
|
||||
'service' => trans_choice('general.services', 1)
|
||||
]"
|
||||
checked="product"
|
||||
@input="onType($event)"
|
||||
/>
|
||||
|
||||
{{ Form::multiSelectAddNewGroup('tax_ids', trans_choice('general.taxes', 1), 'percentage', $taxes, (setting('default.tax')) ? [setting('default.tax')] : null, ['path' => route('modals.taxes.create'), 'field' => ['key' => 'id', 'value' => 'title']], 'col-md-6 el-select-tags-pl-38') }}
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
<x-form.group.category type="item" not-required />
|
||||
|
||||
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money-bill-wave') }}
|
||||
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('items.billing') }}" description="{{ trans('items.form_description.billing') }}" />
|
||||
</x-slot>
|
||||
|
||||
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item enabled:1']) }}
|
||||
<x-slot name="body">
|
||||
<x-form.group.checkbox name="sale_information" id="item-sale-information" :options="['sale' => trans('items.sale_information')]" @input="onInformation($event, 'sale')" form-group-class="sm:col-span-3" checkbox-class="sm:col-span-6" />
|
||||
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), 'plus', ['dropzone-class' => 'form-file']) }}
|
||||
<x-form.group.checkbox name="purchase_information" id="item-purchase-information" :options="['sale' => trans('items.purchase_information')]" @input="onInformation($event, 'purchase')" form-group-class="sm:col-span-3" checkbox-class="sm:col-span-6" />
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
|
||||
</div>
|
||||
</div>
|
||||
<x-form.group.text name="sale_price" label="{{ trans('items.sale_price') }}" v-bind:disabled="sale_information" />
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('items.index') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
<x-form.group.text name="purchase_price" label="{{ trans('items.purchase_price') }}" v-bind:disabled="purchase_information" />
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-form.group.select multiple add-new name="tax_ids" label="{{ trans_choice('general.taxes', 1) }}" :options="$taxes" :selected="(setting('default.tax')) ? [setting('default.tax')] : null" not-required :path="route('modals.taxes.create')" :field="['key' => 'id', 'value' => 'title']" form-group-class="sm:col-span-3 el-select-tags-pl-38" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="items.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="common" file="items" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,53 +1,64 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.items', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.items', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="item" method="PATCH" :route="['items.update', $item->id]" :model="$item">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('items.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($item, [
|
||||
'id' => 'item',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['items.update', $item->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<x-form.group.radio
|
||||
name="type"
|
||||
label="{{ trans_choice('general.types', 1) }}"
|
||||
:options="[
|
||||
'product' => trans_choice('general.products', 1),
|
||||
'service' => trans_choice('general.services', 1)
|
||||
]"
|
||||
checked="{{ $item->type }}"
|
||||
@input="onType($event)"
|
||||
/>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'tag') }}
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
{{ Form::multiSelectAddNewGroup('tax_ids', trans_choice('general.taxes', 1), 'percentage', $taxes, $item->tax_ids, ['path' => route('modals.taxes.create'), 'field' => ['key' => 'id', 'value' => 'title']], 'col-md-6 el-select-tags-pl-38') }}
|
||||
<x-form.group.category type="item" not-required />
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money-bill-wave') }}
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('items.billing') }}" description="{{ trans('items.form_description.billing') }}" />
|
||||
</x-slot>
|
||||
|
||||
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }}
|
||||
<x-slot name="body">
|
||||
<x-form.group.checkbox name="sale_information" id="item-sale-information" :options="['sale' => trans('items.sale_information')]" @input="onInformation($event, 'sale')" form-group-class="sm:col-span-3" checkbox-class="sm:col-span-6" />
|
||||
|
||||
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $item->category_id, ['path' => route('modals.categories.create') . '?type=item', 'remote_action' => route('categories.index'). '?search=type:item enabled:1']) }}
|
||||
<x-form.group.checkbox name="purchase_information" id="item-purchase-information" :options="['sale' => trans('items.purchase_information')]" @input="onInformation($event, 'purchase')" form-group-class="sm:col-span-3" checkbox-class="sm:col-span-6" />
|
||||
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1), '', ['dropzone-class' => 'form-file'], $item->picture) }}
|
||||
<x-form.group.text name="sale_price" label="{{ trans('items.sale_price') }}" v-bind:disabled="sale_information" />
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), $item->enabled) }}
|
||||
</div>
|
||||
</div>
|
||||
<x-form.group.text name="purchase_price" label="{{ trans('items.purchase_price') }}" v-bind:disabled="purchase_information" />
|
||||
|
||||
@can('update-common-items')
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('items.index') }}
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
<x-form.group.select multiple add-new name="tax_ids" label="{{ trans_choice('general.taxes', 1) }}" :options="$taxes" :selected="$item->tax_ids" not-required :path="route('modals.taxes.create')" :field="['key' => 'id', 'value' => 'title']" form-group-class="sm:col-span-3 el-select-tags-pl-38" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
@can('update-common-items')
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="items.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
@endcan
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="common" file="items" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,112 +1,152 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans_choice('general.items', 2) }}</x-slot>
|
||||
|
||||
@section('title', trans_choice('general.items', 2))
|
||||
<x-slot name="favorite"
|
||||
title="{{ trans_choice('general.items', 2) }}"
|
||||
icon="inventory_2"
|
||||
route="items.index"
|
||||
></x-slot>
|
||||
|
||||
@section('new_button')
|
||||
@can('create-common-items')
|
||||
<a href="{{ route('items.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
|
||||
<a href="{{ route('import.create', ['common', 'items']) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
|
||||
@endcan
|
||||
<a href="{{ route('items.export', request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
|
||||
@endsection
|
||||
<x-slot name="buttons">
|
||||
@can('create-common-items')
|
||||
<x-link href="{{ route('items.create') }}" kind="primary">
|
||||
{{ trans('general.title.new', ['type' => trans_choice('general.items', 1)]) }}
|
||||
</x-link>
|
||||
@endcan
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
@if ($items->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' => 'items.index',
|
||||
'role' => 'form',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="align-items-center" v-if="!bulk_action.show">
|
||||
<x-search-string model="App\Models\Common\Item" />
|
||||
</div>
|
||||
<x-slot name="moreButtons">
|
||||
<x-dropdown id="dropdown-more-actions">
|
||||
<x-slot name="trigger">
|
||||
<span class="material-icons">more_horiz</span>
|
||||
</x-slot>
|
||||
|
||||
{{ Form::bulkActionRowGroup('general.items', $bulk_actions, ['group' => 'common', 'type' => 'items']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@can('create-common-items')
|
||||
<x-dropdown.link href="{{ route('import.create', ['common', 'items']) }}">
|
||||
{{ trans('import.import') }}
|
||||
</x-dropdown.link>
|
||||
@endcan
|
||||
|
||||
<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-4 col-md-4 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-lg-1 col-xl-2 d-none d-lg-block">@sortablelink('category', trans_choice('general.categories', 1))</th>
|
||||
<th class="col-md-3 col-lg-3 col-xl-2 text-right d-none d-md-block">@sortablelink('sale_price', trans('items.sales_price'))</th>
|
||||
<th class="col-lg-2 col-xl-2 text-right d-none d-lg-block">@sortablelink('purchase_price', trans('items.purchase_price'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center">@sortablelink('enabled', trans('general.enabled'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<x-dropdown.link href="{{ route('items.export', request()->input()) }}">
|
||||
{{ trans('general.export') }}
|
||||
</x-dropdown.link>
|
||||
</x-dropdown>
|
||||
</x-slot>
|
||||
|
||||
<tbody>
|
||||
<x-slot name="content">
|
||||
@if ($items->count() || request()->get('search', false))
|
||||
<x-index.container>
|
||||
<x-index.search
|
||||
search-string="App\Models\Common\Item"
|
||||
bulk-action="App\BulkActions\Common\Items"
|
||||
/>
|
||||
|
||||
<x-table>
|
||||
<x-table.thead>
|
||||
<x-table.tr class="flex items-center px-1">
|
||||
<x-table.th class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
|
||||
<x-index.bulkaction.all />
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-6/12 sm:w-4/12">
|
||||
<x-slot name="first">
|
||||
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
<x-sortablelink column="description" title="{{ trans('general.description') }}" />
|
||||
</x-slot>
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-3/12 hidden sm:table-cell">
|
||||
<x-sortablelink column="category.name" title="{{ trans_choice('general.categories', 1) }}" />
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-2/12 hidden sm:table-cell">
|
||||
{{ trans_choice('general.taxes', 2) }}
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-6/12 sm:w-3/12" kind="amount">
|
||||
<x-slot name="first">
|
||||
<x-sortablelink column="sale_price" title="{{ trans('items.sale_price') }}" />
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
<x-sortablelink column="purchase_price" title="{{ trans('items.purchase_price') }}" />
|
||||
</x-slot>
|
||||
</x-table.th>
|
||||
</x-table.tr>
|
||||
</x-table.thead>
|
||||
|
||||
<x-table.tbody>
|
||||
@foreach($items as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">
|
||||
{{ Form::bulkActionGroup($item->id, $item->name) }}
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-3 col-xl-3 py-2">
|
||||
<img src="{{ $item->picture ? Storage::url($item->picture->id) : asset('public/img/akaunting-logo-green.svg') }}" class="avatar image-style p-1 mr-3 item-img col-aka d-none d-md-inline" alt="{{ $item->name }}">
|
||||
<a href="{{ route('items.edit', $item->id) }}">{{ $item->name }}</a>
|
||||
</td>
|
||||
<td class="col-lg-1 col-xl-2 d-none d-lg-block long-texts">
|
||||
{{ $item->category->name }}
|
||||
</td>
|
||||
<td class="col-md-3 col-lg-3 col-xl-2 text-right d-none d-md-block">
|
||||
{{ money($item->sale_price, setting('default.currency'), true) }}
|
||||
</td>
|
||||
<td class="col-lg-2 col-xl-2 text-right d-none d-lg-block">
|
||||
{{ money($item->purchase_price, setting('default.currency'), true) }}
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center">
|
||||
@if (user()->can('update-common-items'))
|
||||
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
|
||||
@else
|
||||
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-1 col-xl-1 text-center">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-neutral btn-sm text-light items-align-center p-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h text-muted"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
<a class="dropdown-item" href="{{ route('items.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@can('create-common-items')
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="{{ route('items.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
@endcan
|
||||
@can('delete-common-items')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'items.destroy') !!}
|
||||
@endcan
|
||||
<x-table.tr href="{{ route('items.edit', $item->id) }}">
|
||||
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
|
||||
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-6/12 sm:w-4/12 truncate">
|
||||
<x-slot name="first" class="flex items-center font-bold" override="class">
|
||||
<div class="truncate">
|
||||
{{ $item->name }}
|
||||
</div>
|
||||
|
||||
@if (! $item->enabled)
|
||||
<x-index.disable text="{{ trans_choice('general.items', 1) }}" />
|
||||
@endif
|
||||
</x-slot>
|
||||
<x-slot name="second" class="font-normal truncate" override="class">
|
||||
{{ $item->description }}
|
||||
</x-slot>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-3/12 truncate hidden sm:table-cell">
|
||||
<div class="flex items-center">
|
||||
<x-index.category :model="$item->category" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-2/12 hidden sm:table-cell">
|
||||
@if ($item->taxes->count())
|
||||
@foreach($item->taxes as $tax)
|
||||
<span class="bg-lilac-900 px-3 py-1 text-sm rounded-lg text-black ltr:mr-3 rtl:ml-3">
|
||||
{{ $tax->tax->name }}
|
||||
</span>
|
||||
@endforeach
|
||||
@else
|
||||
<x-empty-data />
|
||||
@endif
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="relative w-6/12 sm:w-3/12" kind="amount">
|
||||
<x-slot name="first">
|
||||
@if ($item->sale_price)
|
||||
<x-money :amount="$item->sale_price" :currency="setting('default.currency')" convert />
|
||||
@else
|
||||
<x-empty-data />
|
||||
@endif
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
@if ($item->purchase_price)
|
||||
<x-money :amount="$item->purchase_price" :currency="setting('default.currency')" convert />
|
||||
@else
|
||||
<x-empty-data />
|
||||
@endif
|
||||
</x-slot>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td kind="action">
|
||||
<x-table.actions :model="$item" />
|
||||
</x-table.td>
|
||||
</x-table.tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</x-table.tbody>
|
||||
</x-table>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row align-items-center">
|
||||
@include('partials.admin.pagination', ['items' => $items])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<x-empty-page page="items" />
|
||||
@endif
|
||||
@endsection
|
||||
<x-pagination :items="$items" />
|
||||
</x-index.container>
|
||||
@else
|
||||
<x-empty-page group="common" page="items" />
|
||||
@endif
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/items.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="items" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,60 +0,0 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.notifications', 2))
|
||||
|
||||
@section('new_button')
|
||||
<a href="{{ route('notifications.read-all') }}" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm" data-toggle="tooltip" data-placement="right" title="{{ trans('notifications.mark_read_all') }}">
|
||||
<span class="btn-inner--icon"><i class="fas fa-check-double pt-2"></i></span>
|
||||
</a>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@stack('new_apps')
|
||||
|
||||
<livewire:common.notifications.new-apps />
|
||||
|
||||
@stack('exports')
|
||||
|
||||
<livewire:common.notifications.exports />
|
||||
|
||||
@stack('imports')
|
||||
|
||||
<livewire:common.notifications.imports />
|
||||
|
||||
@stack('invoices_recurring')
|
||||
|
||||
<livewire:common.notifications.recurring type="invoice" text-title="notifications.recurring_invoices" />
|
||||
|
||||
@stack('invoices_reminder')
|
||||
|
||||
<livewire:common.notifications.reminder type="invoice" text-title="widgets.overdue_invoices" />
|
||||
|
||||
@stack('bills_recurring')
|
||||
|
||||
<livewire:common.notifications.recurring type="bill" text-title="notifications.recurring_bills" />
|
||||
|
||||
@stack('bills_reminder')
|
||||
|
||||
<livewire:common.notifications.reminder type="bill" text-title="notifications.upcoming_bills" />
|
||||
|
||||
@stack('end')
|
||||
@endsection
|
||||
|
||||
@push('body_js')
|
||||
<script type="text/javascript">
|
||||
var hash_split = location.hash.split('#');
|
||||
|
||||
if (hash_split[1] != undefined && document.getElementById(hash_split[1]) != null) {
|
||||
document.getElementById(hash_split[1]).scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
|
||||
document.getElementById('collapse-' + hash_split[1]).classList.add('show');
|
||||
document.getElementById('heading-' + hash_split[1]).ariaExpanded = 'true';
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/vendor/bootstrap-notify/bootstrap-notify.min.js') }}"></script>
|
||||
@endpush
|
@ -1,42 +1,43 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.reports', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.reports', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="report" route="reports.store">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'id' => 'report',
|
||||
'route' => 'reports.store',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
<x-form.group.select name="class" label="{{ trans_choice('general.types', 1) }}" :options="$classes" change="onChangeClass" />
|
||||
|
||||
{{ Form::selectGroup('class', trans_choice('general.types', 1), 'bars', $classes, null, ['required' => 'required', 'change' => 'onChangeClass']) }}
|
||||
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
|
||||
<x-form.section v-if="showPreferences">
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans_choice('reports.preferences', 2) }}" description="" />
|
||||
</x-slot>
|
||||
|
||||
{{ Form::hidden('report', 'invalid', ['data-field' => 'settings']) }}
|
||||
<x-slot name="body">
|
||||
<component v-bind:is="report_fields" @change="onChangeReportFields"></component>
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<component v-bind:is="report_fields" @change="onChangeReportFields"></component>
|
||||
</div>
|
||||
</div>
|
||||
<x-form.input.hidden name="report" value="invalid" data-field="settings" />
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('reports.index') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="reports.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="reports" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,85 +1,148 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.reports', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.reports', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="report" method="PATCH" :route="['reports.update', $report->id]" :model="$report">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($report, [
|
||||
'id' => 'report',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['reports.update', $report->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
<x-form.group.text name="class_disabled" label="{{ trans_choice('general.types', 1) }}" value="{{ $classes[$report->class] }}" disabled />
|
||||
|
||||
{{ Form::textGroup('class_disabled', trans_choice('general.types', 1), 'bars', ['required' => 'required', 'disabled' => 'true'], $classes[$report->class]) }}
|
||||
{{ Form::hidden('class', $report->class) }}
|
||||
<x-form.input.hidden name="class" :value="$report->class" />
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
|
||||
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
{{ Form::hidden('report', 'invalid', ['data-field' => 'settings']) }}
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans_choice('reports.preferences', 2) }}" description="" />
|
||||
</x-slot>
|
||||
|
||||
@foreach($class->getFields() as $field)
|
||||
@php $type = $field['type']; @endphp
|
||||
<x-slot name="body">
|
||||
<x-form.input.hidden name="report" value="invalid" data-field="settings" />
|
||||
|
||||
@if (($type == 'textGroup') || ($type == 'emailGroup') || ($type == 'passwordGroup'))
|
||||
{{ Form::$type($field['name'], $field['title'], $field['icon'], array_merge([
|
||||
'data-field' => 'settings'
|
||||
],
|
||||
$field['attributes'])
|
||||
) }}
|
||||
@elseif ($type == 'textareaGroup')
|
||||
{{ Form::$type($field['name'], $field['title']) }}
|
||||
@elseif ($type == 'dateGroup')
|
||||
{{ Form::$type($field['name'], $field['title'], $field['icon'], array_merge([
|
||||
'data-field' => 'settings',
|
||||
'show-date-format' => company_date_format(),
|
||||
],
|
||||
$field['attributes']),
|
||||
isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']}: null
|
||||
) }}
|
||||
@elseif ($type == 'selectGroup')
|
||||
{{ Form::$type($field['name'], $field['title'], $field['icon'], $field['values'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : $field['selected'], array_merge([
|
||||
'data-field' => 'settings'
|
||||
],
|
||||
$field['attributes'])
|
||||
) }}
|
||||
@elseif ($type == 'radioGroup')
|
||||
{{ Form::$type($field['name'], $field['title'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : true, $field['enable'], $field['disable'], array_merge([
|
||||
'data-field' => 'settings'
|
||||
],
|
||||
$field['attributes'])
|
||||
) }}
|
||||
@elseif ($type == 'checkboxGroup')
|
||||
{{ Form::$type($field['name'], $field['title'], $field['items'], $report->settings->{$field['name']}, $field['id'], $report->settings->{$field['name']}, array_merge([
|
||||
'data-field' => 'settings'
|
||||
],
|
||||
$field['attributes'])
|
||||
) }}
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@foreach($class->getFields() as $field)
|
||||
@php $type = $field['type']; @endphp
|
||||
|
||||
@can('update-common-reports')
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('reports.index') }}
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
@switch($type)
|
||||
@case('text')
|
||||
@case('textGroup')
|
||||
<x-form.group.text
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
data-field="settings"
|
||||
:attributes="$field['attributes']"
|
||||
/>
|
||||
@break
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
@case('email')
|
||||
@case('emailGroup')
|
||||
<x-form.group.email
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
data-field="settings"
|
||||
:attributes="$field['attributes']"
|
||||
/>
|
||||
@break
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
@case('password')
|
||||
@case('passwordGroup')
|
||||
<x-form.group.email
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
data-field="settings"
|
||||
:attributes="$field['attributes']"
|
||||
/>
|
||||
@break
|
||||
|
||||
@case('textarea')
|
||||
@case('textareaGroup')
|
||||
<x-form.group.textarea
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
data-field="settings"
|
||||
:attributes="$field['attributes']"
|
||||
/>
|
||||
@break
|
||||
|
||||
@case('date')
|
||||
@case('dateGroup')
|
||||
<x-form.group.date
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
:value="isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']}: null"
|
||||
data-field="settings"
|
||||
:attributes="array_merge([
|
||||
'model' => 'form.settings'.'.'.$field['name'],
|
||||
'show-date-format' => company_date_format(),
|
||||
], $field['attributes'])"
|
||||
/>
|
||||
@break
|
||||
|
||||
@case('select')
|
||||
@case('selectGroup')
|
||||
<x-form.group.select
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
:options="$field['values']"
|
||||
:selected="$field['selected']"
|
||||
data-field="settings"
|
||||
:attributes="$field['attributes']"
|
||||
/>
|
||||
@break
|
||||
|
||||
@case('radio')
|
||||
@case('radioGroup')
|
||||
<x-form.group.radio
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
:attributes="array_merge([
|
||||
'data-field' => 'settings'
|
||||
], $field['attributes'])"
|
||||
/>
|
||||
@break
|
||||
|
||||
@case('checkbox')
|
||||
@case('checkboxGroup')
|
||||
<x-form.group.checkbox
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
:attributes="array_merge([
|
||||
'data-field' => 'settings'
|
||||
], $field['attributes'])"
|
||||
/>
|
||||
@break
|
||||
|
||||
@default
|
||||
<x-form.group.text
|
||||
name="{{ $field['name'] }}"
|
||||
label="{{ $field['title'] }}"
|
||||
:attributes="array_merge([
|
||||
'data-field' => 'settings'
|
||||
], $field['attributes'])"
|
||||
/>
|
||||
@endswitch
|
||||
@endforeach
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
@can('update-common-reports')
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="reports.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
@endcan
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="common" file="reports" />
|
||||
</x-layouts.admin>
|
||||
|
@ -1,91 +1,90 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans_choice('general.reports', 2) }}</x-slot>
|
||||
|
||||
@section('title', trans_choice('general.reports', 2))
|
||||
<x-slot name="favorite"
|
||||
title="{{ trans_choice('general.reports', 2) }}"
|
||||
icon="donut_small"
|
||||
route="reports.index"
|
||||
></x-slot>
|
||||
|
||||
@section('new_button')
|
||||
@can('create-common-reports')
|
||||
<a href="{{ route('reports.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
|
||||
@endcan
|
||||
@endsection
|
||||
<x-slot name="buttons">
|
||||
@can('create-common-reports')
|
||||
<x-link href="{{ route('reports.create') }}" kind="primary">
|
||||
{{ trans('general.title.new', ['type' => trans_choice('general.reports', 1)]) }}
|
||||
</x-link>
|
||||
@endcan
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="row mb-4">
|
||||
@foreach($categories as $name => $reports)
|
||||
<div class="col-md-12">
|
||||
<h3>{{ $name }}</h3>
|
||||
</div>
|
||||
<x-slot name="content">
|
||||
<livewire:report.pins :categories="$categories" />
|
||||
|
||||
@foreach($reports as $report)
|
||||
<div class="col-md-4">
|
||||
<div class="card card-stats">
|
||||
@canany(['create-common-reports', 'update-common-reports', 'delete-common-reports'])
|
||||
<a class="btn btn-sm items-align-center py-2 mr-0 card-action-button shadow-none--hover" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-v text-primary"></i>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
@can('update-common-reports')
|
||||
<a class="dropdown-item" href="{{ route('reports.edit', $report->id) }}">{{ trans('general.edit') }}</a>
|
||||
@endcan
|
||||
|
||||
@can('create-common-reports')
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="{{ route('reports.duplicate', $report->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
@endcan
|
||||
|
||||
@can('delete-common-reports')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($report, 'reports.destroy') !!}
|
||||
@endcan
|
||||
</div>
|
||||
@endcanany
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<h5 class="card-title text-uppercase text-muted mb-0">{{ $report->name }}</h5>
|
||||
</a>
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<h2 class="font-weight-bold mb-0" v-if="reports_total[{{ $report->id }}]" v-html="reports_total[{{ $report->id }}]"></h2>
|
||||
<h2 class="font-weight-bold mb-0" v-else>{{ $totals[$report->id] }}</h2>
|
||||
</a>
|
||||
|
||||
<button type="button" @click="onRefreshTotal('{{ $report->id }}')" class="btn btn-otline-primary btn-sm ml-2">
|
||||
<i class="fas fa-redo"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<a href="{{ route('reports.show', $report->id) }}">
|
||||
<div class="icon icon-shape bg-orange text-white rounded-circle shadow">
|
||||
<i class="{{ $icons[$report->id] }}"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="mt-3 mb-0 text-sm">
|
||||
<a class="text-default" href="{{ route('reports.show', $report->id) }}">
|
||||
<span class="pre">{{ $report->description }}</span>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@foreach ($categories as $category)
|
||||
@php $category_id = $loop->index; @endphp
|
||||
<div
|
||||
@class([
|
||||
'mb-14',
|
||||
'mt-4' => (! $loop->first) ? false : true,
|
||||
'mt-12' => ($loop->first) ? false : true,
|
||||
])
|
||||
>
|
||||
<div class="px-2">
|
||||
<x-form.section.head title="{!! $category['name'] !!}" description="{{ $category['description'] }}" />
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<div class="grid sm:grid-cols-6 gap-12 my-3.5">
|
||||
@foreach($category['reports'] as $report)
|
||||
<div class="flex justify-between sm:col-span-3 p-1 group">
|
||||
<div class="lg:w-80">
|
||||
<a href="{{ route('reports.show', $report->id) }}" class="flex">
|
||||
<span class="material-icons-outlined text-5xl transform transition-all hover:scale-125">
|
||||
{{ $icons[$report->id] }}
|
||||
</span>
|
||||
|
||||
<div class="ltr:ml-2 rtl:mr-2">
|
||||
<h2 class="mb-1">
|
||||
<span class="border-b border-transparent transition-all group-hover:border-black">
|
||||
{{ $report->name }}
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
<span class="text-black-400 text-sm">{{ $report->description }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="flex items-start">
|
||||
<livewire:report.pin :categories="$categories" :report-id="$report->id" />
|
||||
|
||||
@canany(['create-common-reports', 'update-common-reports', 'delete-common-reports'])
|
||||
<x-dropdown id="widget-{{ $category_id }}-{{ $report->id }}">
|
||||
<x-slot name="trigger" class="flex" override="class">
|
||||
<span class="material-icons-outlined text-purple text-lg px-1 py-0.5 cursor-pointer hover:bg-gray-100 hover:rounded-lg hover:shadow-md">more_vert</span>
|
||||
</x-slot>
|
||||
|
||||
@can('update-common-reports')
|
||||
<x-dropdown.link href="{{ route('reports.edit', $report->id) }}">
|
||||
{{ trans('general.edit') }}
|
||||
</x-dropdown.link>
|
||||
@endcan
|
||||
|
||||
@can('create-common-reports')
|
||||
<x-dropdown.link href="{{ route('reports.duplicate', $report->id) }}">
|
||||
{{ trans('general.duplicate') }}
|
||||
</x-dropdown.link>
|
||||
@endcan
|
||||
|
||||
@can('delete-common-reports')
|
||||
<x-delete-link :model="$report" route="reports.destroy" />
|
||||
@endcan
|
||||
</x-dropdown>
|
||||
@endcanany
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endsection
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_start')
|
||||
<script type="text/javascript">
|
||||
var reports_total = {!! json_encode($totals) !!};
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="reports" />
|
||||
</x-layouts.admin>
|
||||
|
Reference in New Issue
Block a user