Merge pull request #961 from denisdulici/master

Removed transactions from portal
This commit is contained in:
Denis Duliçi 2019-11-30 02:10:59 +03:00 committed by GitHub
commit 69921574d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 23 additions and 165 deletions

View File

@ -3,9 +3,7 @@
namespace App\Http\Controllers\portal;
use App\Abstracts\Http\Controller;
use App\Models\Banking\Account;
use App\Models\Banking\Transaction;
use App\Models\Setting\Category;
use App\Utilities\Modules;
class Payments extends Controller
@ -18,17 +16,11 @@ class Payments extends Controller
*/
public function index()
{
$payments = Transaction::type('income')->with(['account', 'category'])->where('contact_id', '=', user()->contact->id)->paginate();
$payments = Transaction::type('income')->where('contact_id', '=', user()->contact->id)->paginate();
$payment_methods = Modules::getPaymentMethods('all');
$categories = collect(Category::type('income')->enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');
$accounts = collect(Account::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
return view('portal.payments.index', compact('payments', 'payment_methods', 'categories', 'accounts'));
return view('portal.payments.index', compact('payments', 'payment_methods'));
}
/**

View File

@ -1,23 +0,0 @@
<?php
namespace App\Http\Controllers\Portal;
use App\Abstracts\Http\Controller;
use App\Models\Banking\Transaction;
use Auth;
class Transactions extends Controller
{
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$transactions = Transaction::type('income')->where('contact_id', user()->contact->id)->get();
return view('portal.transactions.index', compact('transactions'));
}
}

View File

@ -16,13 +16,10 @@ class AddPortalItems
{
$menu = $event->menu;
// Dashboard
$menu->route('portal.dashboard', trans_choice('general.dashboards', 1), [], 1, ['icon' => 'fa fa-tachometer-alt']);
// Invoices
$menu->route('portal.invoices.index', trans_choice('general.invoices', 2), [], 2, ['icon' => 'fa fa-money-bill']);
$menu->route('portal.invoices.index', trans_choice('general.invoices', 2), [], 2, ['icon' => 'fa fa-file-signature']);
// Payments
$menu->route('portal.payments.index', trans_choice('general.payments', 2), [], 3, ['icon' => 'fa fa-shopping-cart']);
$menu->route('portal.payments.index', trans_choice('general.payments', 2), [], 3, ['icon' => 'fa fa-money-bill']);
}
}

View File

@ -649,7 +649,6 @@ class Version200 extends Listener
'client-portal' => 'r',
'portal-invoices' => 'r,u',
'portal-payments' => 'r,u',
'portal-transactions' => 'r',
'portal-profile' => 'r,u',
],
]);
@ -837,6 +836,8 @@ class Version200 extends Listener
'resources/assets/js/components/Example.vue',
'resources/assets/sass/_variables.scss',
'resources/assets/sass/app.scss',
'resources/views/expenses/bills/bill.blade.php',
'resources/views/incomes/invoices/invoice.blade.php',
'resources/views/layouts/customer.blade.php',
'resources/views/layouts/link.blade.php',
'resources/views/modules/token/create.blade.php',

View File

@ -124,7 +124,6 @@ class Roles extends Seeder
'client-portal' => 'r',
'portal-invoices' => 'r,u',
'portal-payments' => 'r,u',
'portal-transactions' => 'r',
'portal-profile' => 'r,u',
],
];

View File

@ -1,28 +0,0 @@
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./../../bootstrap');
import Vue from 'vue';
import Global from './../../mixins/global';
import Form from './../../plugins/form';
import BulkAction from './../../plugins/bulk-action';
const app = new Vue({
el: '#app',
mixins: [
Global
],
data: function () {
return {
}
}
});

View File

@ -1,6 +1,6 @@
@extends('layouts.portal')
@section('title', trans_choice('general.payments', 1))
@section('title', trans_choice('general.payments', 2))
@section('content')
<div class="card">
@ -28,8 +28,8 @@
<tr class="row table-head-line">
<th class="col-xs-3 col-sm-3">@sortablelink('paid_at', trans('general.date'))</th>
<th class="col-xs-3 col-sm-3">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-sm-3 hidden-sm">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-xs-6 col-sm-3">@sortablelink('payment_method', trans_choice('general.payment_methods', 1))</th>
<th class="col-sm-3 hidden-sm">@sortablelink('description', trans('general.description'))</th>
</tr>
</thead>
@ -38,8 +38,8 @@
<tr class="row align-items-center border-top-1">
<td class="col-xs-3 col-sm-3"><a class="text-success" href="{{ route('portal.payments.show', $item->id) }}">@date($item->paid_at)</a></td>
<td class="col-xs-3 col-sm-3">@money($item->amount, $item->currency_code, true)</td>
<td class="col-sm-3 hidden-sm">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td class="col-xs-6 col-sm-3">{{ $payment_methods[$item->payment_method] }}</td>
<td class="col-sm-3 hidden-sm">{{ $item->description }}</td>
</tr>
@endforeach
</tbody>

View File

@ -1,25 +1,16 @@
@extends('layouts.portal')
@section('title', trans_choice('general.invoices', 1))
@section('title', trans_choice('general.payments', 1))
@section('content')
<div class="card">
<div class="card-header">
<h3 class="m-0 float-right">{{ $payment->category->name }}</h3>
<h3 class="m-0 float-right">@date($payment->paid_at)</h3>
</div>
<div class="card-body">
<div class="row mb-4">
<div class="col-md-7">
<h2>{{ $payment->contact->name }}</h2>
</div>
<div class="col-md-5">
<h2 class="float-right">{{ trans('general.date') }}: @date($payment->paid_at)</h2>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<a class="text-sm font-weight-600">{{ trans('general.from') }}:</a> <a class="text-xs long-texts"> {{ setting('company.name') }}</a>
@ -27,20 +18,20 @@
<div class="card-body d-grid">
<a class="text-sm font-weight-600">{{ trans('general.address') }}:</a>
<a class="text-xs long-texts"> {{ setting('company.address') }}</a>
<a class="text-xs long-texts">{{ setting('company.address') }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.phone') }}:</a>
<a class="text-xs long-texts"> {{ setting('company.phone') }}</a>
<a class="text-xs long-texts">{{ setting('company.phone') }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.email') }}:</a>
<a class="text-xs long-texts"> {{ setting('company.email') }}</a>
<a class="text-xs long-texts">{{ setting('company.email') }}</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<a class="text-sm font-weight-600">{{ trans('general.to') }}:</a> <a class="text-xs long-texts"> {{ $payment->contact->name }}</a>
@ -48,23 +39,15 @@
<div class="card-body d-grid">
<a class="text-sm font-weight-600">{{ trans('general.address') }}:</a>
<a class="text-xs long-texts"> {{ $payment->contact->address }}</a>
<a class="text-xs long-texts">{{ $payment->contact->address }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.phone') }}:</a>
<a class="text-xs long-texts"> {{ $payment->contact->phone }}</a>
<a class="text-xs long-texts">{{ $payment->contact->phone }}</a>
<div class="dropdown-divider"></div>
<a class="text-sm font-weight-600">{{ trans('general.email') }}:</a>
<a class="text-xs long-texts"> {{ $payment->contact->email }}</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header">
<a class="text-sm font-weight-600">{{ trans('invoices.payment_due') }}:</a> <a class="text-xs long-texts"> @date($payment->paid_at)</a>
<a class="text-xs long-texts">{{ $payment->contact->email }}</a>
</div>
</div>
</div>
@ -85,18 +68,16 @@
<table class="table align-items-center table-flush">
<thead class="thead-light">
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
<th>{{ trans_choice('general.payment_methods', 1) }}</th>
<th>{{ trans('general.reference') }}</th>
<th>{{ trans('general.amount') }}</th>
<th>{{ trans_choice('general.payment_methods', 1) }}</th>
<th>{{ trans('general.description') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ $payment->category->name }}</td>
<td>{{ $payment_methods[$payment->payment_method] }}</td>
<td>{{ $payment->reference }}</td>
<td>@money($payment->amount, $payment->currency_code, true)</td>
<td>{{ $payment_methods[$payment->payment_method] }}</td>
<td>{{ $payment->description }}</td>
</tr>
</tbody>
</table>

View File

@ -1,59 +0,0 @@
@extends('layouts.portal')
@section('title', trans_choice('general.transactions', 2))
@section('content')
<div class="card">
<div class="card-header border-bottom-0">
{!! Form::open([
'route' => 'portal.transactions.index',
'role' => 'form',
'method' => 'GET',
'class' => 'mb-0'
]) !!}
<div class="row">
<div class="col-12 card-header-search card-header-space">
<span class="table-text hidden-lg card-header-search-text">{{ trans('general.search') }}:</span>
<akaunting-search></akaunting-search>
</div>
</div>
{!! Form::close() !!}
</div>
<div class="table-responsive">
<table class="table table-flush">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-md-2 hidden-md">@sortablelink('paid_at', trans('general.date'))</th>
<th class="col-xs-5 col-sm-3 col-md-2">@sortablelink('account.name', trans('accounts.account_name'))</th>
<th class="col-xs-3 col-sm-3 col-md-2">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-sm-3 col-md-2 hidden-sm">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-md-2 hidden-md">@sortablelink('description', trans('general.description'))</th>
<th class="col-xs-4 col-sm-3 col-md-2">@sortablelink('amount', trans('general.amount'))</th>
</tr>
</thead>
<tbody>
@foreach($transactions as $item)
<tr class="row align-items-center border-top-1">
<td class="col-md-2 hidden-md">@date($item->date)</td>
<td class="col-xs-5 col-sm-3 col-md-2">{{ $item->account->name }}</td>
<td class="col-xs-3 col-sm-3 col-md-2">{{ trans_choice('general.payments', 1) }}</td>
<td class="col-sm-3 col-md-2 hidden-sm">{{ $item->category->name }}</td>
<td class="col-md-2 hidden-md">{{ $item->description }}</td>
<td class="col-xs-4 col-sm-3 col-md-2">@money($item->amount, $item->currency_code, true)</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer table-action"></div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/customers/transactions.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -9,8 +9,6 @@ Route::group(['as' => 'portal.'], function () {
Route::resource('payments', 'Portal\Payments');
Route::resource('transactions', 'Portal\Transactions');
Route::get('profile/read-invoices', 'Portal\Profile@readOverdueInvoices')->name('invoices.read');
Route::resource('profile', 'Portal\Profile');