Create draft show page
This commit is contained in:
parent
7a38e9cc08
commit
986522e813
35
.env.example
35
.env.example
|
|
@ -1,35 +0,0 @@
|
|||
APP_NAME=Akaunting
|
||||
APP_ENV=production
|
||||
APP_LOCALE=en-GB
|
||||
APP_INSTALLED=false
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_SCHEDULE_TIME="09:00"
|
||||
APP_URL=
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=localhost
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=
|
||||
DB_USERNAME=
|
||||
DB_PASSWORD=
|
||||
DB_PREFIX=
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_CONNECTION=sync
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
MAIL_MAILER=mail
|
||||
MAIL_HOST=localhost
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_NAME=null
|
||||
MAIL_FROM_ADDRESS=null
|
||||
|
||||
FIREWALL_ENABLED=false
|
||||
|
||||
MODEL_CACHE_ENABLED=false
|
||||
|
|
@ -8,6 +8,7 @@ use App\Jobs\Banking\CreateAccount;
|
|||
use App\Jobs\Banking\DeleteAccount;
|
||||
use App\Jobs\Banking\UpdateAccount;
|
||||
use App\Models\Banking\Account;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Setting\Currency;
|
||||
|
||||
class Accounts extends Controller
|
||||
|
|
@ -31,9 +32,17 @@ class Accounts extends Controller
|
|||
*/
|
||||
public function show(Account $account)
|
||||
{
|
||||
return view('banking.accounts.show', compact('account'));
|
||||
}
|
||||
$amounts = [
|
||||
'incoming' => 0,
|
||||
'outgoing' => 0,
|
||||
'balance' => 0,
|
||||
];
|
||||
|
||||
$transactions = $account->transactions;
|
||||
|
||||
return view('banking.accounts.show', compact('account', 'amounts', 'transactions'));
|
||||
|
||||
}
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
|
|
@ -91,7 +100,7 @@ class Accounts extends Controller
|
|||
|
||||
flash($message)->success();
|
||||
|
||||
return redirect()->route('account.edit', $clone->id);
|
||||
return redirect()->route('accounts.edit', $clone->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@ namespace App\Models\Banking;
|
|||
use App\Abstracts\Model;
|
||||
use App\Traits\Transactions;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Bkwld\Cloner\Cloneable;
|
||||
|
||||
class Account extends Model
|
||||
{
|
||||
use HasFactory, Transactions;
|
||||
use Cloneable, HasFactory, Transactions;
|
||||
|
||||
protected $table = 'accounts';
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
{"/livewire.js":"/livewire.js?id=936e5d0fb0b76b631ba7"}
|
||||
{"/livewire.js":"/livewire.js?id=d9e06c155e467adb5de2"}
|
||||
|
|
@ -19,7 +19,7 @@ import BulkAction from './../../plugins/bulk-action';
|
|||
Vue.use(DashboardPlugin);
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
el: '#main-body',
|
||||
|
||||
mixins: [
|
||||
Global
|
||||
|
|
@ -28,8 +28,47 @@ const app = new Vue({
|
|||
data: function () {
|
||||
return {
|
||||
form: new Form('account'),
|
||||
bulk_action: new BulkAction('accounts')
|
||||
bulk_action: new BulkAction('accounts'),
|
||||
template: {
|
||||
modal: false,
|
||||
title: '',
|
||||
message: '',
|
||||
html: '',
|
||||
errors: new Error()
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onTemplate() {
|
||||
this.template.modal = true;
|
||||
|
||||
this.transfer_form = new Form('template');
|
||||
|
||||
this.transfer_form.template = this.transfer_form._template;
|
||||
},
|
||||
|
||||
addTemplate() {
|
||||
if (this.transfer_form.template != 1) {
|
||||
|
||||
this.transfer_form.submit();
|
||||
|
||||
this.template.errors = this.transfer_form.errors;
|
||||
}
|
||||
|
||||
this.form.loading = true;
|
||||
|
||||
this.$emit("confirm");
|
||||
},
|
||||
|
||||
closeTemplate() {
|
||||
this.template = {
|
||||
modal: false,
|
||||
title: '',
|
||||
message: '',
|
||||
errors: this.transfer_form.errors
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,275 @@
|
|||
@extends('layouts.admin')
|
||||
|
||||
@section('title', $account->name)
|
||||
|
||||
@section('new_button')
|
||||
<div class="dropup header-drop-top">
|
||||
<button type="button" class="btn btn-white btn-sm" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-chevron-down"></i> {{ trans('general.more_actions') }}
|
||||
</button>
|
||||
|
||||
<div class="dropdown-menu" role="menu">
|
||||
@stack('button_dropdown_start')
|
||||
|
||||
@stack('duplicate_button_start')
|
||||
@can('create-banking-accounts')
|
||||
<a class="dropdown-item" href="{{ route('accounts.duplicate', $account->id) }}">
|
||||
{{ trans('general.duplicate') }}
|
||||
</a>
|
||||
@endcan
|
||||
@stack('duplicate_button_end')
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
@stack('transaction_button_start')
|
||||
@can('create-account-transactions')
|
||||
<a class="dropdown-item" href="{{ route('banking.create-transaction', $account->id) }}">
|
||||
CREATE TRANSACTION
|
||||
</a>
|
||||
@endcan
|
||||
@stack('transaction_button_end')
|
||||
|
||||
@stack('transfer_button_start')
|
||||
@can('show-performance')
|
||||
<a class="dropdown-item" href="{{ route('banking.create-transfer', $account->id) }}">
|
||||
create_transfer
|
||||
</a>
|
||||
@endcan
|
||||
@stack('transfer_button_end')
|
||||
|
||||
@stack('performance_button_start')
|
||||
@can('show-performance')
|
||||
<a class="dropdown-item" href="{{ route('accounts.show-performance', $account->id) }}">
|
||||
performance
|
||||
</a>
|
||||
@endcan
|
||||
@stack('performance_button_end')
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
@stack('delete_button_start')
|
||||
@can('delete-banking-accounts')
|
||||
{!! Form::deleteLink($account, 'accounts.destroy') !!}
|
||||
@endcan
|
||||
@stack('delete_button_end')
|
||||
|
||||
@stack('button_dropdown_end')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stack('account_edit_button_start')
|
||||
@can('update-banking-account')
|
||||
<a href="{{ route('accounts.edit', $account->id) }}" class="btn btn-white btn-sm">
|
||||
{{ trans('general.edit') }}
|
||||
</a>
|
||||
@endcan
|
||||
@stack('account_edit_button_end')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xl-3">
|
||||
<ul class="list-group mb-4">
|
||||
@stack('account_number_start')
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center border-0">
|
||||
{{ trans_choice('general.account_number', 2) }}
|
||||
<span class="badge badge-primary badge-pill">{{ }}</span>
|
||||
</li>
|
||||
@stack('account_number_end')
|
||||
|
||||
@stack('account_currency_start')
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center border-0 border-top-1">
|
||||
{{ trans_choice('general.transactions', 2) }}
|
||||
<span class="badge badge-primary badge-pill">{{ $ }}</span>
|
||||
</li>
|
||||
@stack('account_currency_end')
|
||||
|
||||
@stack('account_starting_balance_start')
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center border-0">
|
||||
{{ trans_choice('banking.starting_balance', 2) }}
|
||||
<span class="badge badge-primary badge-pill">{{ }}</span>
|
||||
</li>
|
||||
@stack('account_starting_balance_end')
|
||||
</ul>
|
||||
|
||||
<ul class="list-group mb-4">
|
||||
@stack('bank_name_start')
|
||||
<li class="list-group-item border-0">
|
||||
<div class="font-weight-600">{{ trans('') }}</div>
|
||||
<div><small class="long-texts" title="{{ $account->name }}">{{ $account->name }}</small></div>
|
||||
</li>
|
||||
@stack('bank_name_end')
|
||||
|
||||
@stack('account_phone_start')
|
||||
<li class="list-group-item border-0 border-top-1">
|
||||
<div class="font-weight-600">{{ trans('general.phone') }}</div>
|
||||
<div><small class="long-texts" title="{{ $account->phone }}">{{ $account->phone }}</small></div>
|
||||
</li>
|
||||
@stack('account_phone_end')
|
||||
|
||||
@stack('account_address_start')
|
||||
<li class="list-group-item border-0 border-top-1">
|
||||
<div class="font-weight-600">{{ trans('general.address') }}</div>
|
||||
<div><small class="long-texts" title="{{ $account->address }}">{{ $account->address }}</small></div>
|
||||
</li>
|
||||
@stack('account_address_end')
|
||||
</ul>
|
||||
|
||||
@stack('account_edit_button_start')
|
||||
@stack('account_edit_button_end')
|
||||
</div>
|
||||
|
||||
<div class="col-xl-9">
|
||||
<div class="row mb--3">
|
||||
@stack('account_incoming_card_start')
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-gradient-success border-0">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('general.incoming') }}</h5>
|
||||
<div class="dropdown-divider"></div>
|
||||
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['incoming'], setting('default.currency'), true)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('account_incoming_card_end')
|
||||
|
||||
@stack('account_outgoing_card_start')
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-gradient-warning border-0">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('widgets.outgoing') }}</h5>
|
||||
<div class="dropdown-divider"></div>
|
||||
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['outgoing'], setting('default.currency'), true)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('account_outgoing_card_end')
|
||||
|
||||
@stack('account_balance_card_start')
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-gradient-danger border-0">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('widgets.balance') }}</h5>
|
||||
<div class="dropdown-divider"></div>
|
||||
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['balance'], setting('default.currency'), true)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('account_balance_card_end')
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="nav-wrapper">
|
||||
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
|
||||
@stack('account_transactions_tab_start')
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0 active" id="invoices-tab" data-toggle="tab" href="#invoices-content" role="tab" aria-controls="invoices-content" aria-selected="true">
|
||||
{{ trans_choice('general.invoices', 2) }}
|
||||
</a>
|
||||
</li>
|
||||
@stack('account_transactions_tab_end')
|
||||
|
||||
@stack('account_transfers_tab_start')
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0" id="transactions-tab" data-toggle="tab" href="#transactions-content" role="tab" aria-controls="transactions-content" aria-selected="false">
|
||||
{{ trans_choice('general.transactions', 2) }}
|
||||
</a>
|
||||
</li>
|
||||
@stack('account_transfers_tab_end')
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="tab-content" id="account-tab-content">
|
||||
@stack('account_transactions_content_start')
|
||||
<div class="tab-pane fade show active" id="transactions-content" role="tabpanel" aria-labelledby="transactions-tab">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover" id="tbl-invoices">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-4 col-sm-1">{{ trans_choice('general.date', 1) }}</th>
|
||||
<th class="col-xs-4 col-sm-3 text-right">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-block text-left">{{ trans('general.type') }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-block text-left">{{ trans('general.category') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($transactions as $item)
|
||||
<tr class="row align-items-center border-top-1 tr-py">
|
||||
<td class="col-xs-4 col-sm-1">@date($item->issued_at)</td>
|
||||
<td class="col-xs-4 col-sm-3 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">{{ $item->type }}</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">$item->category </td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer py-4 table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('account_transactions_content_end')
|
||||
|
||||
@stack('customer_transactions_content_start')
|
||||
<div class="tab-pane fade" id="transactions-content" role="tabpanel" aria-labelledby="transactions-tab">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover" id="tbl-transactions">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-6 col-sm-2">{{ trans('general.date') }}</th>
|
||||
<th class="col-xs-6 col-sm-2 text-right">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-4 d-none d-sm-block">{{ trans_choice('general.categories', 1) }}</th>
|
||||
<th class="col-sm-4 d-none d-sm-block">{{ trans_choice('general.accounts', 1) }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($transactions as $item)
|
||||
<tr class="row align-items-center border-top-1 tr-py">
|
||||
<td class="col-xs-6 col-sm-2"><a href="{{ route('revenues.show', $item->id) }}">@date($item->paid_at)</a></td>
|
||||
<td class="col-xs-6 col-sm-2 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-4 d-none d-sm-block">{{ $item->category->name }}</td>
|
||||
<td class="col-sm-4 d-none d-sm-block">{{ $item->account->name }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer py-4 table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('customer_transactions_content_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/accounts.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
|
|
@ -128,13 +128,18 @@ Route::group(['prefix' => 'purchases'], function () {
|
|||
|
||||
Route::group(['prefix' => 'banking'], function () {
|
||||
Route::get('accounts/currency', 'Banking\Accounts@currency')->name('accounts.currency');
|
||||
Route::get('accounts/{account}/create-transaction', 'Banking\Accounts@createTransaction')->name('accounts.create-transaction');
|
||||
Route::get('accounts/{account}/enable', 'Banking\Accounts@enable')->name('accounts.enable');
|
||||
Route::get('accounts/{account}/disable', 'Banking\Accounts@disable')->name('accounts.disable');
|
||||
Route::get('accounts/{account}/duplicate', 'Banking\Accounts@duplicate')->name('accounts.duplicate');
|
||||
Route::get('accounts/{account}/edit', 'Banking\Accounts@edit')->name('account.edit');
|
||||
Route::resource('accounts', 'Banking\Accounts', ['middleware' => ['date.format', 'money']]);
|
||||
|
||||
Route::post('transactions/import', 'Banking\Transactions@import')->name('transactions.import');
|
||||
Route::get('transactions/export', 'Banking\Transactions@export')->name('transactions.export');
|
||||
|
||||
Route::resource('transactions', 'Banking\Transactions');
|
||||
|
||||
|
||||
Route::get('transfers/{transfer}/print', 'Banking\Transfers@printTransfer')->name('transfers.print');
|
||||
Route::get('transfers/{transfer}/pdf', 'Banking\Transfers@pdfTransfer')->name('transfers.pdf');
|
||||
|
|
|
|||
Loading…
Reference in New Issue