akaunting 3.0 (the last dance)
This commit is contained in:
110
resources/views/banking/recurring_transactions/create.blade.php
Normal file
110
resources/views/banking/recurring_transactions/create.blade.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">
|
||||
{{ trans('general.title.new', ['type' => trans_choice('general.recurring_' . Str::plural($real_type), 1)]) }}
|
||||
</x-slot>
|
||||
|
||||
@php $fav_icon = ($real_type == 'income') ? 'request_quote' : 'paid'; @endphp
|
||||
<x-slot name="favorite"
|
||||
title="{{ trans('general.title.new', ['type' => trans_choice('general.recurring_' . Str::plural($real_type), 1)]) }}"
|
||||
icon="{{ $fav_icon }}"
|
||||
url="{{ route('recurring-transactions.create', ['type' => $type]) }}"
|
||||
></x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="transaction" route="recurring-transactions.store">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transactions.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<div class="form-group form-group relative sm:col-span-3">
|
||||
<label class="form-control-label">
|
||||
{{ trans('general.date') }}
|
||||
</label>
|
||||
|
||||
<x-tooltip id="tooltip-paid" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_date', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}">
|
||||
<div class="relative focused has-label">
|
||||
<x-form.input.text name="disabled_transaction_paid" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
|
||||
</div>
|
||||
</x-tooltip>
|
||||
|
||||
<x-form.input.hidden name="paid_at" :value="Date::now()" />
|
||||
</div>
|
||||
|
||||
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" value="0" autofocus="autofocus" :currency="$currency" dynamicCurrency="currency" />
|
||||
|
||||
<x-form.group.account />
|
||||
|
||||
<x-form.group.payment-method />
|
||||
|
||||
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
|
||||
|
||||
<x-form.input.hidden name="currency_code" :value="$account_currency_code" />
|
||||
<x-form.input.hidden name="currency_rate" value="1" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.assign') }}" description="{{ trans('transactions.form_description.assign_' . $real_type) }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<x-form.group.category type="{{ $real_type }}" :selected="setting('default.' . $real_type . '_category')" />
|
||||
|
||||
<x-form.group.contact type="{{ config('type.transaction.' . $real_type . '.contact_type') }}" not-required />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans_choice('general.schedules', 1) }}" description="{{ trans('recurring.form_description.schedule', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<x-form.group.recurring type="transaction" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transactions.form_description.other') }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<div class="form-group form-group relative sm:col-span-3">
|
||||
<label class="form-control-label">
|
||||
{{ trans_choice('general.numbers', 1) }}
|
||||
</label>
|
||||
|
||||
<x-tooltip id="tooltip-number" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_number', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}">
|
||||
<div class="relative focused has-label">
|
||||
<x-form.input.text name="disabled_transaction_number" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
|
||||
</div>
|
||||
</x-tooltip>
|
||||
|
||||
<x-form.input.hidden name="number" value="{{ $number }}" />
|
||||
</div>
|
||||
|
||||
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
|
||||
|
||||
<x-form.group.attachment />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="recurring-transactions.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.input.hidden name="type" :value="$type" />
|
||||
<x-form.input.hidden name="real_type" :value="$real_type" />
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="banking" file="transactions" />
|
||||
</x-layouts.admin>
|
||||
113
resources/views/banking/recurring_transactions/edit.blade.php
Normal file
113
resources/views/banking/recurring_transactions/edit.blade.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">
|
||||
{{ trans('general.title.edit', ['type' => trans_choice('general.recurring_' . Str::plural($real_type), 1)]) }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="transaction" method="PATCH" :route="['recurring-transactions.update', $recurring_transaction->id]" :model="$recurring_transaction">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('transactions.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<div class="form-group form-group relative sm:col-span-3">
|
||||
<label class="form-control-label">
|
||||
{{ trans('general.date') }}
|
||||
</label>
|
||||
|
||||
<x-tooltip id="tooltip-paid" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_date', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}">
|
||||
<div class="relative focused has-label">
|
||||
<x-form.input.text name="disabled_transaction_paid" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
|
||||
</div>
|
||||
</x-tooltip>
|
||||
|
||||
<x-form.input.hidden name="paid_at" :value="$recurring_transaction->paid_at" />
|
||||
</div>
|
||||
|
||||
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" :value="$recurring_transaction->amount" autofocus="autofocus" :currency="$currency" dynamicCurrency="currency" />
|
||||
|
||||
<x-form.group.account />
|
||||
|
||||
<x-form.group.payment-method />
|
||||
|
||||
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" not-required />
|
||||
|
||||
<x-form.input.hidden name="currency_code" :value="$recurring_transaction->currency_code" />
|
||||
<x-form.input.hidden name="currency_rate" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.assign') }}" description="{{ trans('transactions.form_description.assign_' . $real_type) }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<x-form.group.category type="{{ $real_type }}" />
|
||||
|
||||
<x-form.group.contact type="{{ config('type.transaction.' . $real_type . '.contact_type') }}" not-required />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('recurring.recurring') }}" description="{{ trans('recurring.form_description.schedule', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<x-form.group.recurring
|
||||
type="transaction"
|
||||
:frequency="$recurring_transaction ? $recurring_transaction->recurring->frequency : null"
|
||||
:custom-frequency="$recurring_transaction ? $recurring_transaction->recurring->custom_frequency : null"
|
||||
:limit="$recurring_transaction ? $recurring_transaction->recurring->limit_by : null"
|
||||
:started-value="$recurring_transaction ? $recurring_transaction->recurring->started_at : null"
|
||||
:limit-count="$recurring_transaction ? $recurring_transaction->recurring->limit_count : null"
|
||||
:limit-date-value="$recurring_transaction ? $recurring_transaction->recurring->limit_date : null"
|
||||
/>
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans_choice('general.others', 1) }}" description="{{ trans('transactions.form_description.other') }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="body">
|
||||
<div class="form-group form-group relative sm:col-span-3">
|
||||
<label class="form-control-label">
|
||||
{{ trans_choice('general.numbers', 1) }}
|
||||
</label>
|
||||
|
||||
<x-tooltip id="tooltip-number" placement="bottom" message="{{ trans('documents.recurring.tooltip.document_number', ['type' => Str::lower(trans_choice('general.transactions', 1))]) }}">
|
||||
<div class="relative focused has-label">
|
||||
<x-form.input.text name="disabled_transaction_number" value="{{ trans('documents.recurring.auto_generated') }}" class="form-element" disabled />
|
||||
</div>
|
||||
</x-tooltip>
|
||||
|
||||
<x-form.input.hidden name="number" value="{{ $number }}" />
|
||||
</div>
|
||||
|
||||
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" not-required />
|
||||
|
||||
<x-form.group.attachment />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
@can('update-banking-transactions')
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="recurring-transactions.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
@endcan
|
||||
|
||||
<x-form.input.hidden name="type" :value="$recurring_transaction->type" />
|
||||
<x-form.input.hidden name="real_type" :value="$real_type" />
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="banking" file="transactions" />
|
||||
</x-layouts.admin>
|
||||
172
resources/views/banking/recurring_transactions/index.blade.php
Normal file
172
resources/views/banking/recurring_transactions/index.blade.php
Normal file
@@ -0,0 +1,172 @@
|
||||
<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-transactions.index"
|
||||
></x-slot>
|
||||
|
||||
<x-slot name="buttons">
|
||||
@can('create-banking-transactions')
|
||||
<x-link href="{{ route('recurring-transactions.create', ['type' => 'income-recurring']) }}" kind="primary">
|
||||
{{ trans('general.title.new', ['type' => trans_choice('general.recurring_incomes', 1)]) }}
|
||||
</x-link>
|
||||
|
||||
<x-link href="{{ route('recurring-transactions.create', ['type' => 'expense-recurring']) }}" kind="primary">
|
||||
{{ trans('general.title.new', ['type' => trans_choice('general.recurring_expenses', 1)]) }}
|
||||
</x-link>
|
||||
@endcan
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
@if ($transactions->count() || request()->get('search', false))
|
||||
<x-index.container>
|
||||
<x-tabs active="recurring-templates">
|
||||
<x-slot name="navs">
|
||||
<x-tabs.nav-link id="transactions" name="{{ trans_choice('general.transactions', 2) }}" href="{{ route('transactions.index') }}" />
|
||||
<x-tabs.nav id="recurring-templates" name="{{ trans_choice('general.recurring_templates', 2) }}" active />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<x-index.search
|
||||
search-string="App\Models\Banking\Transaction"
|
||||
/>
|
||||
|
||||
<x-tabs.tab id="recurring-templates">
|
||||
<x-table>
|
||||
<x-table.thead>
|
||||
<x-table.tr class="flex items-center px-1">
|
||||
|
||||
<x-table.th class="w-4/12 sm:w-3/12">
|
||||
<x-slot name="first">
|
||||
<x-sortablelink column="recurring.started_at" title="{{ trans('general.start_date') }}" />
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
{{ trans('recurring.last_issued') }}
|
||||
</x-slot>
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-2/12 hidden sm:table-cell">
|
||||
<x-slot name="first">
|
||||
<x-sortablelink column="type" title="{{ trans_choice('general.types', 1) }}" />
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
<x-sortablelink column="category.name" title="{{ trans_choice('general.categories', 1) }}" />
|
||||
</x-slot>
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-4/12 sm:w-3/12">
|
||||
<x-sortablelink column="recurring.status" title="{{ trans_choice('general.statuses', 1) }}" />
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-2/12 hidden sm:table-cell">
|
||||
<x-slot name="first">
|
||||
{{ trans('recurring.frequency') }}
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
{{ trans('recurring.duration') }}
|
||||
</x-slot>
|
||||
</x-table.th>
|
||||
|
||||
<x-table.th class="w-4/12 sm:w-2/12" kind="amount">
|
||||
<x-sortablelink column="amount" title="{{ trans('general.amount') }}" />
|
||||
</x-table.th>
|
||||
</x-table.tr>
|
||||
</x-table.thead>
|
||||
|
||||
<x-table.tbody>
|
||||
@foreach($transactions as $item)
|
||||
<x-table.tr href="{{ route('recurring-transactions.show', $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->contact->name }}" />
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-4/12 sm:w-3/12">
|
||||
<x-slot name="first">
|
||||
<x-date date="{{ $item->recurring->started_at }}" />
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
@if ($last = $item->recurring->getLastRecurring())
|
||||
{{ $last->format(company_date_format()) }}
|
||||
@endif
|
||||
</x-slot>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-2/12 hidden sm:table-cell">
|
||||
<x-slot name="first">
|
||||
{{ $item->type_title }}
|
||||
</x-slot>
|
||||
<x-slot name="second" class="flex items-center">
|
||||
<x-index.category :model="$item->category" />
|
||||
</x-slot>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-4/12 sm:w-3/12">
|
||||
<x-index.status status="{{ $item->recurring->status }}" background-color="bg-{{ $item->recurring_status_label }}" text-color="text-text-{{ $item->recurring_status_label }}" />
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-2/12 hidden sm:table-cell">
|
||||
<x-slot name="first">
|
||||
{{ trans('recurring.' . $item->recurring->frequency) }}
|
||||
</x-slot>
|
||||
<x-slot name="second">
|
||||
@if ($item->recurring->limit_by == 'count')
|
||||
@if ($item->recurring->limit_count == 0)
|
||||
{{ trans('recurring.ends_never') }}
|
||||
@else
|
||||
{{ trans('recurring.ends_after', ['times' => $item->recurring->limit_count]) }}
|
||||
@endif
|
||||
@else
|
||||
{{ trans('recurring.ends_date', ['date' => company_date($item->recurring->limit_date)]) }}
|
||||
@endif
|
||||
</x-slot>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-4/12 sm:w-2/12" kind="amount">
|
||||
<x-money :amount="$item->amount" :currency="$item->currency_code" convert />
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td kind="action">
|
||||
<x-table.actions :model="$item" />
|
||||
</x-table.td>
|
||||
</x-table.tr>
|
||||
@endforeach
|
||||
</x-table.tbody>
|
||||
</x-table>
|
||||
|
||||
<x-pagination :items="$transactions" />
|
||||
</x-tabs.tab>
|
||||
</x-slot>
|
||||
</x-tabs>
|
||||
</x-index.container>
|
||||
@else
|
||||
<x-empty-page
|
||||
group="banking"
|
||||
page="recurring_templates"
|
||||
hide-button-import
|
||||
permission-create="create-banking-transactions"
|
||||
:buttons="[
|
||||
[
|
||||
'url' => route('recurring-transactions.create', ['type' => 'income-recurring']),
|
||||
'permission' => 'create-banking-transactions',
|
||||
'text' => trans('general.title.new', ['type' => trans_choice('general.recurring_incomes', 1)]),
|
||||
'description' => '',
|
||||
'active_badge' => true,
|
||||
],
|
||||
[
|
||||
'url' => route('recurring-transactions.create', ['type' => 'expense-recurring']),
|
||||
'permission' => 'create-banking-transactions',
|
||||
'text' => trans('general.title.new', ['type' => trans_choice('general.recurring_expenses', 1)]),
|
||||
'description' => '',
|
||||
'active_badge' => true,
|
||||
],
|
||||
]"
|
||||
/>
|
||||
@endif
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="banking" file="transactions" />
|
||||
</x-layouts.admin>
|
||||
@@ -0,0 +1,38 @@
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">
|
||||
{{ $title }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="status">
|
||||
<x-show.status status="{{ $recurring_transaction->recurring->status }}" background-color="bg-{{ $recurring_transaction->recurring_status_label }}" text-color="text-text-{{ $recurring_transaction->recurring_status_label }}" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="buttons">
|
||||
<x-transactions.show.buttons type="{{ $recurring_transaction->type }}" :transaction="$recurring_transaction" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="moreButtons">
|
||||
<x-transactions.show.more-buttons
|
||||
type="{{ $recurring_transaction->type }}"
|
||||
:transaction="$recurring_transaction"
|
||||
hide-button-print
|
||||
hide-button-pdf
|
||||
hide-divider-1
|
||||
hide-button-share
|
||||
hide-button-email
|
||||
hide-divider-2
|
||||
hide-button-delete
|
||||
hide-divider-4
|
||||
/>
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<x-transactions.show.content type="{{ $recurring_transaction->type }}" :transaction="$recurring_transaction" hide-number />
|
||||
</x-slot>
|
||||
|
||||
@push('stylesheet')
|
||||
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
|
||||
@endpush
|
||||
|
||||
<x-transactions.script type="{{ $recurring_transaction->type }}" folder="banking" file="transactions" />
|
||||
</x-layouts.admin>
|
||||
Reference in New Issue
Block a user