fixed client portal

This commit is contained in:
denisdulici 2017-10-21 15:29:54 +03:00
parent 5e7d3392ab
commit 9710f81053
9 changed files with 65 additions and 85 deletions

View File

@ -21,7 +21,7 @@ class Payments extends Controller
*/
public function index()
{
$payments = Payment::with('account', 'category')->where('customer_id', '=', Auth::user()->customer->id)->paginate();
$payments = Payment::with(['account', 'category'])->where('customer_id', '=', Auth::user()->customer->id)->paginate();
$payment_methods = Modules::getPaymentMethods();

View File

@ -18,29 +18,24 @@
</div>
<div class="box-body">
@if ($user->invoices->count())
<table class="table table-bordered">
<table class="table table-striped">
<thead>
<tr>
<th>{{ trans('invoices.invoice_number') }}</th>
<th>{{ trans_choice('general.customers', 1) }}</th>
<th>{{ trans('invoices.total_price') }}</th>
<th>{{ trans_choice('general.statuses', 1) }}</th>
<th>{{ trans('invoices.invoice_date') }}</th>
<th style="width: 18%;">{{ trans('general.actions') }}</th>
<th class="col-md-2">{{ trans('invoices.invoice_number') }}</th>
<th class="col-md-2 text-right">{{ trans('general.amount') }}</th>
<th class="col-md-3 text-right">{{ trans('invoices.invoice_date') }}</th>
<th class="col-md-3 text-right">{{ trans('invoices.due_date') }}</th>
<th class="col-md-2 text-center">{{ trans_choice('general.statuses', 1) }}</th>
</tr>
</thead>
<tbody>
@foreach($user->invoices as $item)
<tr>
<td><a href="{{ url('customer/invoices/' . $item->id . '/edit') }}">{{ $item->invoice_number }}</a></td>
<td>{{ $item->customer_name }}</td>
<td>@money($item->amount, $item->currency_code, true)</td>
<td>{{ $item->status->name }}</td>
<td>{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
<td>
<a href="{{ url('customers/invoices/' . $item->id . '') }}" class="btn btn-info btn-xs"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a>
<a href="{{ url('customers/invoices/' . $item->id . '/edit') }}" class="btn btn-primary btn-xs"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a>
</td>
<td><a href="{{ url('customers/invoices/' . $item->id) }}">{{ $item->invoice_number }}</a></td>
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="text-right">{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
<td class="text-right">{{ Date::parse($item->due_at)->format($date_format) }}</td>
<td class="text-center">{{ $item->status->name }}</td>
</tr>
@endforeach
</tbody>
@ -68,26 +63,22 @@
</div>
<div class="box-body">
@if ($user->revenues->count())
<table class="table table-bordered">
<table class="table table-striped">
<thead>
<tr>
<th>{{ trans('general.date') }}</th>
<th>{{ trans('general.amount') }}</th>
<th>{{ trans_choice('general.categories', 1) }}</th>
<th>{{ trans_choice('general.accounts', 1) }}</th>
<th style="width: 15%;">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($user->revenues as $item)
<tr>
<td><a href="{{ url('customer/payments/' . $item->id . '') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
<td><a href="{{ url('customers/payments/' . $item->id . '') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
<td>@money($item->amount, $item->currency_code, true)</td>
<td>{{ $item->category->name }}</td>
<td>{{ $item->account->name }}</td>
<td>
<a href="{{ url('customers/payments/' . $item->id . '') }}" class="btn btn-info btn-xs"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a>
</td>
</tr>
@endforeach
</tbody>

View File

@ -11,16 +11,16 @@
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header">
<div class="box-header with-border">
{!! Form::open(['url' => 'customers/invoices', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-left">
<span class="title-filter">{{ trans('general.search') }}:</span>
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
{!! Form::text('search', request('search'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('general.search_placeholder')]) !!}
{!! Form::select('status', $status, request('status'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
<span class="title-filter">{{ trans('general.show') }}:</span>
<span class="title-filter hidden-xs">{{ trans('general.show') }}:</span>
{!! Form::select('limit', $limits, request('limit', setting('general.list_limit', '25')), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
</div>
{!! Form::close() !!}
@ -28,30 +28,24 @@
<!-- /.box-header -->
<div class="box-body">
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-invoices">
<table class="table table-striped table-hover" id="tbl-invoices">
<thead>
<tr>
<th>@sortablelink('invoice_number', trans('invoices.invoice_number'))</th>
<th>@sortablelink('customer_name', trans_choice('general.customers', 1))</th>
<th>@sortablelink('amount', trans('invoices.total_price'))</th>
<th>@sortablelink('status.name', trans_choice('general.statuses', 1))</th>
<th>@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
<th>@sortablelink('due_at', trans('invoices.due_date'))</th>
<th style="width: 18%;">{{ trans('general.actions') }}</th>
<th class="col-md-2">@sortablelink('invoice_number', trans('invoices.invoice_number'))</th>
<th class="col-md-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
<th class="col-md-3 text-right">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
<th class="col-md-3 text-right">@sortablelink('due_at', trans('invoices.due_date'))</th>
<th class="col-md-2 text-center">@sortablelink('status.name', trans_choice('general.statuses', 1))</th>
</tr>
</thead>
<tbody>
@foreach($invoices as $item)
<tr>
<td><a href="{{ url('customers/invoices/' . $item->id . '/edit') }}">{{ $item->invoice_number }}</a></td>
<td>{{ $item->customer_name }}</td>
<td>@money($item->amount, $item->currency_code, true)</td>
<td>{{ $item->status->name }}</td>
<td>{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
<td>{{ Date::parse($item->due_at)->format($date_format) }}</td>
<td>
<a href="{{ url('customers/invoices/' . $item->id . '') }}" class="btn btn-info btn-xs"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a>
</td>
<td><a href="{{ url('customers/invoices/' . $item->id) }}">{{ $item->invoice_number }}</a></td>
<td class="text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="text-right">{{ Date::parse($item->invoiced_at)->format($date_format) }}</td>
<td class="text-right">{{ Date::parse($item->due_at)->format($date_format) }}</td>
<td class="text-center">{{ $item->status->name }}</td>
</tr>
@endforeach
</tbody>

View File

@ -11,17 +11,17 @@
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header">
<div class="box-header with-border">
{!! Form::open(['url' => 'customers/payments', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-left">
<span class="title-filter">{{ trans('general.search') }}:</span>
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
{!! Form::text('search', request('search'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('general.search_placeholder')]) !!}
{!! Form::select('category_id', $categories, request('category_id'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::select('payment_method', $payment_methods, request('payment_method'), ['class' => 'form-control input-filter input-sm']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
<span class="title-filter">{{ trans('general.show') }}:</span>
<span class="title-filter hidden-xs">{{ trans('general.show') }}:</span>
{!! Form::select('limit', $limits, request('limit', setting('general.list_limit', '25')), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
</div>
{!! Form::close() !!}
@ -29,26 +29,22 @@
<!-- /.box-header -->
<div class="box-body">
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-revenues">
<table class="table table-striped table-hover" id="tbl-revenues">
<thead>
<tr>
<th>@sortablelink('paid_at', trans('general.date'))</th>
<th>@sortablelink('amount', trans('general.amount'))</th>
<th>@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th>@sortablelink('payment_method', trans_choice('general.payment_methods', 1))</th>
<th style="width: 15%;">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($payments as $item)
<tr>
<td><a href="{{ url('customers/payments/' . $item->id . '') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
<td><a href="{{ url('customers/payments/' . $item->id) }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
<td>@money($item->amount, $item->currency_code, true)</td>
<td>{{ $item->category->name }}</td>
<td>{{ $payment_methods[$item->payment_method] }}</td>
<td>
<a href="{{ url('customers/payments/' . $item->id . '') }}" class="btn btn-info btn-xs"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a>
</td>
</tr>
@endforeach
</tbody>

View File

@ -5,15 +5,15 @@
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header">
<div class="box-header with-border">
{!! Form::open(['url' => 'customers/transactions', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-left">
<span class="title-filter">{{ trans('general.search') }}:</span>
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
{!! Form::text('search', request('search'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('general.search_placeholder')]) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
</div>
<div class="pull-right">
<span class="title-filter">{{ trans('general.show') }}:</span>
<span class="title-filter hidden-xs">{{ trans('general.show') }}:</span>
{!! Form::select('limit', $limits, request('limit', setting('general.list_limit', '25')), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
</div>
{!! Form::close() !!}
@ -21,7 +21,7 @@
<!-- /.box-header -->
<div class="box-body">
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-transactions">
<table class="table table-striped table-hover" id="tbl-transactions">
<thead>
<tr>
<th>@sortablelink('paid_at', trans('general.date'))</th>

View File

@ -173,7 +173,9 @@
<i class="fa fa-4 fa-user-o" style="color: #fff; font-size: 7em;"></i>
@endif
<p>
@if (!empty($user->name))
{{ $user->name }}
@endif
<small>{{ trans('header.last_login', ['time' => $user->last_logged_in_at]) }}</small>
</p>
</li>

View File

@ -2,9 +2,9 @@
<!-- Logo -->
<a href="#" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><img src="{{ asset($company->company_logo) }}" class="logo-image-lg" width="25" alt="{{ $company->company_name }}"></span>
<span class="logo-mini"><img src="{{ !empty($company->company_logo) ? Storage::url($company->company_logo) : asset('public/img/company.png') }}" class="logo-image-mini" width="25" alt="{{ $company->company_name }}"></span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><img src="{{ asset($company->company_logo) }}" class="logo-image-lg" width="25" alt="{{ $company->company_name }}"> <b>{{ $company->company_name }}</b></span>
<span class="logo-lg"><img src="{{ !empty($company->company_logo) ? Storage::url($company->company_logo) : asset('public/img/company.png') }}" width="25" alt="{{ $company->company_name }}"> <b>{{ str_limit($company->company_name, 15) }}</b></span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
@ -53,7 +53,7 @@
<!-- Tasks: style can be found in dropdown.less -->
<li class="dropdown tasks-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
{!! language()->flag() !!}
<i class="fa fa-flag-o"></i>
</a>
<ul class="dropdown-menu">
<li class="header">{{ trans('header.change_language') }}</li>
@ -66,15 +66,27 @@
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="{{ asset($user->picture) }}" class="user-image" alt="User Image">
<span class="hidden-xs">{{ $user->name }}</span>
@if ($user->picture)
<img src="{{ Storage::url($user->picture) }}" class="user-image" alt="User Image">
@else
<i class="fa fa-user-o"></i>
@endif
@if (!empty($user->name))
<span class="hidden-xs">{{ $user->name }}</span>
@endif
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header">
<img src="{{ asset($user->picture) }}" class="img-circle" alt="User Image">
@if ($user->picture)
<img src="{{ Storage::url($user->picture) }}" class="img-circle" alt="User Image">
@else
<i class="fa fa-4 fa-user-o" style="color: #fff; font-size: 7em;"></i>
@endif
<p>
@if (!empty($user->name))
{{ $user->name }}
@endif
<small>{{ trans('header.last_login', ['time' => $user->last_logged_in_at]) }}</small>
</p>
</li>

View File

@ -3,35 +3,15 @@
<section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel">
@if ($customer->picture)
<div class="pull-left image">
<img src="{{ asset($customer->picture) }}" class="img-circle" alt="{{ $customer->name }}">
<img src="{{ Storage::url($customer->picture) }}" class="img-circle" alt="{{ $customer->name }}">
</div>
@endif
<div class="pull-left info">
<p>{{ $customer->name }}</p>
@permission('read-companies-companies')
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="caret"></span> &nbsp;{{ trans('general.change') }}</a>
<ul class="dropdown-menu">
@foreach($companies as $com)
<li><a href="{{ url('companies/companies/'. $com->id .'/set') }}">{{ $com->company_name }}</a></li>
@endforeach
@permission('update-companies-companies')
<li role="separator" class="divider"></li>
<li><a href="{{ url('companies/companies') }}">{{ trans('companies.manage') }}</a></li>
@endpermission
</ul>
@endpermission
</div>
</div>
<!-- search form -->
<form action="#" method="get" id="form-search" class="sidebar-form">
<div id="customer-search" class="input-group">
<input type="text" name="main_search" value="<?php //echo $search; ?>" id="input-main-search" class="form-control" placeholder="Search...">
<span class="input-group-btn">
<button type="submit" name="main_search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
<!-- /.search form -->
<!-- sidebar menu: : style can be found in sidebar.less -->
{!! Menu::get('CustomerMenu') !!}
</section>

View File

@ -111,6 +111,11 @@ Route::group(['middleware' => ['auth', 'language', 'adminmenu', 'permission:read
});
Route::group(['middleware' => ['auth', 'language', 'customermenu', 'permission:read-customer-panel']], function () {
Route::group(['prefix' => 'uploads'], function () {
Route::get('{folder}/{file}', 'Common\Uploads@get');
Route::get('{folder}/{file}/download', 'Common\Uploads@download');
});
Route::group(['prefix' => 'customers'], function () {
Route::get('/', 'Customers\Dashboard@index');