Skip to content

Commit

Permalink
removed transactions from portal
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Nov 29, 2019
1 parent 3d48bf4 commit 7b13b79
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 165 deletions.
12 changes: 2 additions & 10 deletions app/Http/Controllers/Portal/Payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'));
}

/**
Expand Down
23 changes: 0 additions & 23 deletions app/Http/Controllers/Portal/Transactions.php

This file was deleted.

7 changes: 2 additions & 5 deletions app/Listeners/Menu/AddPortalItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ public function handle(Event $event)
{
$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']);
}
}
3 changes: 2 additions & 1 deletion app/Listeners/Update/V20/Version200.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ public function updatePermissions()
'client-portal' => 'r',
'portal-invoices' => 'r,u',
'portal-payments' => 'r,u',
'portal-transactions' => 'r',
'portal-profile' => 'r,u',
],
]);
Expand Down Expand Up @@ -837,6 +836,8 @@ public function deleteOldFiles()
'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',
Expand Down
1 change: 0 additions & 1 deletion database/seeds/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ private function roles()
'client-portal' => 'r',
'portal-invoices' => 'r,u',
'portal-payments' => 'r,u',
'portal-transactions' => 'r',
'portal-profile' => 'r,u',
],
];
Expand Down
28 changes: 0 additions & 28 deletions resources/assets/js/views/portal/transactions.js

This file was deleted.

6 changes: 3 additions & 3 deletions resources/views/portal/payments/index.blade.php
Original file line number Diff line number Diff line change
@@ -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">
Expand Down Expand Up @@ -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>

Expand All @@ -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>
Expand Down
47 changes: 14 additions & 33 deletions resources/views/portal/payments/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,70 +1,53 @@
@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>
</div>

<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>
</div>

<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>
Expand All @@ -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>
Expand Down
59 changes: 0 additions & 59 deletions resources/views/portal/transactions/index.blade.php

This file was deleted.

2 changes: 0 additions & 2 deletions routes/portal.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

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');

Expand Down

0 comments on commit 7b13b79

Please sign in to comment.