Skip to content

Commit

Permalink
link to reports
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Nov 28, 2018
1 parent 291cf95 commit 1cf927a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 4 deletions.
13 changes: 10 additions & 3 deletions app/Http/ViewComposers/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ class All
public function compose(View $view)
{
// Make sure it's installed
if (env('APP_INSTALLED')) {
// Share date format
$view->with(['date_format' => $this->getCompanyDateFormat()]);
if (!env('APP_INSTALLED')) {
return;
}

// Share user logged in
$auth_user = auth()->user();

// Share date format
$date_format = $this->getCompanyDateFormat();

$view->with(['auth_user' => $auth_user, 'date_format' => $date_format]);
}
}
4 changes: 4 additions & 0 deletions resources/views/banking/accounts/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
<tbody>
@foreach($accounts as $item)
<tr>
@if ($auth_user->can('read-reports-income-expense-summary'))
<td><a href="{{ url('reports/income-expense-summary?accounts[]=' . $item->id) }}">{{ $item->name }}</a></td>
@else
<td><a href="{{ route('accounts.edit', $item->id) }}">{{ $item->name }}</a></td>
@endif
<td class="hidden-xs">{{ $item->number }}</td>
<td class="text-right amount-space">@money($item->balance, $item->currency_code, true)</td>
<td class="hidden-xs">
Expand Down
12 changes: 12 additions & 0 deletions resources/views/common/dashboard/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<!---Income-->
<div class="col-md-4">
<div class="info-box">
@if ($auth_user->can('read-reports-income-summary'))
<a href="{{ url('reports/income-summary') }}"><span class="info-box-icon bg-aqua"><i class="fa fa-money"></i></span></a>
@else
<span class="info-box-icon bg-aqua"><i class="fa fa-money"></i></span>
@endif

<div class="info-box-content">
<span class="info-box-text">{{ trans('dashboard.total_incomes') }}</span>
Expand All @@ -26,7 +30,11 @@
<!---Expense-->
<div class="col-md-4">
<div class="info-box">
@if ($auth_user->can('read-reports-expense-summary'))
<a href="{{ url('reports/expense-summary') }}"><span class="info-box-icon bg-red"><i class="fa fa-shopping-cart"></i></span></a>
@else
<span class="info-box-icon bg-red"><i class="fa fa-shopping-cart"></i></span>
@endif

<div class="info-box-content">
<span class="info-box-text">{{ trans('dashboard.total_expenses') }}</span>
Expand All @@ -46,7 +54,11 @@
<!---Profit-->
<div class="col-md-4">
<div class="info-box">
@if ($auth_user->can('read-reports-income-expense-summary'))
<a href="{{ url('reports/income-expense-summary') }}"><span class="info-box-icon bg-green"><i class="fa fa-heart"></i></span></a>
@else
<span class="info-box-icon bg-green"><i class="fa fa-heart"></i></span>
@endif

<div class="info-box-content">
<span class="info-box-text">{{ trans('dashboard.total_profit') }}</span>
Expand Down
3 changes: 3 additions & 0 deletions resources/views/expenses/vendors/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="{{ url('expenses/vendors/' . $item->id) }}">{{ trans('general.show') }}</a></li>
@permission('read-reports-expense-summary')
<li><a href="{{ url('reports/expense-summary?vendors[]=' . $item->id) }}">{{ trans_choice('general.reports', 1) }}</a></li>
@endpermission
<li><a href="{{ url('expenses/vendors/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>@if ($item->enabled)
<li><a href="{{ route('vendors.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
@else
Expand Down
3 changes: 3 additions & 0 deletions resources/views/incomes/customers/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="{{ url('incomes/customers/' . $item->id) }}">{{ trans('general.show') }}</a></li>
@permission('read-reports-income-summary')
<li><a href="{{ url('reports/income-summary?customers[]=' . $item->id) }}">{{ trans_choice('general.reports', 1) }}</a></li>
@endpermission
<li><a href="{{ url('incomes/customers/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@if ($item->enabled)
<li><a href="{{ route('customers.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
Expand Down
12 changes: 11 additions & 1 deletion resources/views/settings/categories/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@
<tbody>
@foreach($categories as $item)
<tr>
<td><a href="{{ url('settings/categories/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
<td>
@if (($item->type == 'income') && $auth_user->can('read-reports-income-summary'))
<a href="{{ url('reports/income-summary?categories[]=' . $item->id) }}">{{ $item->name }}</a>
@elseif (($item->type == 'expense') && $auth_user->can('read-reports-expense-summary'))
<a href="{{ url('reports/expense-summary?categories[]=' . $item->id) }}">{{ $item->name }}</a>
@elseif (($item->type == 'item') && $auth_user->can('read-common-items'))
<a href="{{ url('common/items?categories[]=' . $item->id) }}">{{ $item->name }}</a>
@else
<a href="{{ url('settings/categories/' . $item->id . '/edit') }}">{{ $item->name }}</a>
@endif
</td>
<td>{{ $types[$item->type] }}</td>
<td class="hidden-xs"><i class="fa fa-2x fa-circle" style="color:{{ $item->color }};"></i></td>
<td class="hidden-xs">
Expand Down

0 comments on commit 1cf927a

Please sign in to comment.