print reports

This commit is contained in:
denisdulici
2018-04-07 12:00:39 +03:00
parent fcc6107871
commit 7ecf6914a8
15 changed files with 319 additions and 187 deletions

View File

@@ -0,0 +1,48 @@
<div class="box-body">
{!! $chart->render() !!}
<hr>
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-report-expenses">
<thead>
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
@foreach($dates as $date)
<th class="text-right">{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@if ($expenses)
@foreach($expenses as $category_id => $category)
<tr>
<td>{{ $categories[$category_id] }}</td>
@foreach($category as $item)
<td class="text-right">@money($item['amount'], $item['currency_code'], true)</td>
@endforeach
</tr>
@endforeach
@else
<tr>
<td colspan="4">
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
</td>
</tr>
@endif
</tbody>
<tfoot>
<tr>
<th>{{ trans_choice('general.totals', 1) }}</th>
@foreach($totals as $total)
<th class="text-right">@money($total['amount'], $total['currency_code'], true)</th>
@endforeach
</tr>
</tfoot>
</table>
</div>
</div>
@push('js')
{!! Charts::assets() !!}
@endpush

View File

@@ -2,6 +2,10 @@
@section('title', trans('reports.summary.expense'))
@section('new_button')
<span class="new-button"><a href="{{ url('reports/expense-summary') }}?print=1&status={{ request('status') }}&year={{ request('year', $this_year) }}" target="_blank" class="btn btn-success btn-sm"><span class="fa fa-print"></span> &nbsp;{{ trans('general.print') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
<div class="box box-success">
@@ -17,55 +21,8 @@
</div>
{!! Form::close() !!}
</div>
<div class="box-body">
{!! $chart->render() !!}
<hr>
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-report-expenses">
<thead>
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
@foreach($dates as $date)
<th class="text-right">{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@if ($expenses)
@foreach($expenses as $category_id => $category)
<tr>
<td>{{ $categories[$category_id] }}</td>
@foreach($category as $item)
<td class="text-right">@money($item['amount'], $item['currency_code'], true)</td>
@endforeach
</tr>
@endforeach
@else
<tr>
<td colspan="4">
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
</td>
</tr>
@endif
</tbody>
<tfoot>
<tr>
<th>{{ trans_choice('general.totals', 1) }}</th>
@foreach($totals as $total)
<th class="text-right">@money($total['amount'], $total['currency_code'], true)</th>
@endforeach
</tr>
</tfoot>
</table>
</div>
</div>
<!-- /.box-body -->
@include('reports.expense_summary.body')
</div>
<!-- /.box -->
@endsection
@push('js')
{!! Charts::assets() !!}
@endpush

View File

@@ -0,0 +1,7 @@
@extends('layouts.print')
@section('title', trans('reports.summary.expense'))
@section('content')
@include('reports.expense_summary.body')
@endsection

View File

@@ -0,0 +1,66 @@
<div class="box-body">
{!! $chart->render() !!}
<hr>
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-payments">
<thead>
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
@foreach($dates as $date)
<th class="text-right">{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@if ($compares)
@foreach($compares as $type => $categories)
@foreach($categories as $category_id => $category)
<tr>
@if($type == 'income')
<td>{{ $income_categories[$category_id] }}</td>
@else
<td>{{ $expense_categories[$category_id] }}</td>
@endif
@foreach($category as $item)
@if($type == 'income')
<td class="text-right">@money($item['amount'], $item['currency_code'], true)</td>
@else
<td class="text-right">@money(-$item['amount'], $item['currency_code'], true)</td>
@endif
@endforeach
</tr>
@endforeach
@endforeach
@else
<tr>
<td colspan="13">
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
</td>
</tr>
@endif
</tbody>
<tfoot>
<tr>
<th>{{ trans_choice('general.totals', 1) }}</th>
@foreach($totals as $total)
<th class="text-right">
@if($total['amount'] == 0)
<span>@money($total['amount'], $total['currency_code'], true)</span>
@elseif($total['amount'] > 0)
<span class="text-green">@money($total['amount'], $total['currency_code'], true)</span>
@else
<span class="text-red">@money($total['amount'], $total['currency_code'], true)</span>
@endif
</th>
@endforeach
</tr>
</tfoot>
</table>
</div>
</div>
@push('js')
{!! Charts::assets() !!}
@endpush

View File

@@ -1,6 +1,10 @@
@extends('layouts.admin')
@section('title', trans_choice('reports.summary.income_expense', 1))
@section('title', trans('reports.summary.income_expense'))
@section('new_button')
<span class="new-button"><a href="{{ url('reports/income-expense-summary') }}?print=1&status={{ request('status') }}&year={{ request('year', $this_year) }}" target="_blank" class="btn btn-success btn-sm"><span class="fa fa-print"></span> &nbsp;{{ trans('general.print') }}</a></span>
@endsection
@section('content')
<!-- Default box -->
@@ -17,73 +21,8 @@
</div>
{!! Form::close() !!}
</div>
<div class="box-body">
{!! $chart->render() !!}
<hr>
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-payments">
<thead>
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
@foreach($dates as $date)
<th class="text-right">{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@if ($compares)
@foreach($compares as $type => $categories)
@foreach($categories as $category_id => $category)
<tr>
@if($type == 'income')
<td>{{ $income_categories[$category_id] }}</td>
@else
<td>{{ $expense_categories[$category_id] }}</td>
@endif
@foreach($category as $item)
@if($type == 'income')
<td class="text-right">@money($item['amount'], $item['currency_code'], true)</td>
@else
<td class="text-right">@money(-$item['amount'], $item['currency_code'], true)</td>
@endif
@endforeach
</tr>
@endforeach
@endforeach
@else
<tr>
<td colspan="13">
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
</td>
</tr>
@endif
</tbody>
<tfoot>
<tr>
<th>{{ trans_choice('general.totals', 1) }}</th>
@foreach($totals as $total)
<th class="text-right">
@if($total['amount'] == 0)
<span>@money($total['amount'], $total['currency_code'], true)</span>
@elseif($total['amount'] > 0)
<span class="text-green">@money($total['amount'], $total['currency_code'], true)</span>
@else
<span class="text-red">@money($total['amount'], $total['currency_code'], true)</span>
@endif
</th>
@endforeach
</tr>
</tfoot>
</table>
</div>
</div>
<!-- /.box-body -->
@include('reports.income_expense_summary.body')
</div>
<!-- /.box -->
@endsection
@push('js')
{!! Charts::assets() !!}
@endpush

View File

@@ -0,0 +1,7 @@
@extends('layouts.print')
@section('title', trans('reports.summary.income_expense'))
@section('content')
@include('reports.income_expense_summary.body')
@endsection

View File

@@ -0,0 +1,48 @@
<div class="box-body">
{!! $chart->render() !!}
<hr>
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-report-incomes">
<thead>
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
@foreach($dates as $date)
<th class="text-right">{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@if ($incomes)
@foreach($incomes as $category_id => $category)
<tr>
<td>{{ $categories[$category_id] }}</td>
@foreach($category as $item)
<td class="text-right">@money($item['amount'], $item['currency_code'], true)</td>
@endforeach
</tr>
@endforeach
@else
<tr>
<td colspan="4">
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
</td>
</tr>
@endif
</tbody>
<tfoot>
<tr>
<th>{{ trans_choice('general.totals', 1) }}</th>
@foreach($totals as $total)
<th class="text-right">@money($total['amount'], $total['currency_code'], true)</th>
@endforeach
</tr>
</tfoot>
</table>
</div>
</div>
@push('js')
{!! Charts::assets() !!}
@endpush

View File

@@ -1,71 +1,28 @@
@extends('layouts.admin')
@section('title', trans_choice('reports.summary.income', 1))
@section('title', trans('reports.summary.income'))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header">
<div class="pull-left" style="margin-left: 23px">
<a href="{{ url('reports/income-summary') }}?year={{ request('year', $this_year) }}"><span class="badge @if (request('status') == '') bg-green @else bg-default @endif">{{ trans('general.all') }}</span></a>
<a href="{{ url('reports/income-summary') }}?status=paid&year={{ request('year', $this_year) }}"><span class="badge @if (request('status') == 'paid') bg-green @else bg-default @endif">{{ trans('invoices.paid') }}</span></a>
<a href="{{ url('reports/income-summary') }}?status=upcoming&year={{ request('year', $this_year) }}"><span class="badge @if (request('status') == 'upcoming') bg-green @else bg-default @endif">{{ trans('dashboard.receivables') }}</span></a>
</div>
{!! Form::open(['url' => 'reports/income-summary', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-right">
{!! Form::select('year', $years, request('year', $this_year), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
</div>
{!! Form::close() !!}
</div>
<div class="box-body">
{!! $chart->render() !!}
<hr>
<div class="table table-responsive">
<table class="table table-bordered table-striped table-hover" id="tbl-report-incomes">
<thead>
<tr>
<th>{{ trans_choice('general.categories', 1) }}</th>
@foreach($dates as $date)
<th class="text-right">{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@if ($incomes)
@foreach($incomes as $category_id => $category)
<tr>
<td>{{ $categories[$category_id] }}</td>
@foreach($category as $item)
<td class="text-right">@money($item['amount'], $item['currency_code'], true)</td>
@endforeach
</tr>
@endforeach
@else
<tr>
<td colspan="4">
<h5 class="text-center">{{ trans('general.no_records') }}</h5>
</td>
</tr>
@endif
</tbody>
<tfoot>
<tr>
<th>{{ trans_choice('general.totals', 1) }}</th>
@foreach($totals as $total)
<th class="text-right">@money($total['amount'], $total['currency_code'], true)</th>
@endforeach
</tr>
</tfoot>
</table>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
@section('new_button')
<span class="new-button"><a href="{{ url('reports/income-summary') }}?print=1&status={{ request('status') }}&year={{ request('year', $this_year) }}" target="_blank" class="btn btn-success btn-sm"><span class="fa fa-print"></span> &nbsp;{{ trans('general.print') }}</a></span>
@endsection
@push('js')
{!! Charts::assets() !!}
@endpush
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="box-header">
<div class="pull-left" style="margin-left: 23px">
<a href="{{ url('reports/income-summary') }}?year={{ request('year', $this_year) }}"><span class="badge @if (request('status') == '') bg-green @else bg-default @endif">{{ trans('general.all') }}</span></a>
<a href="{{ url('reports/income-summary') }}?status=paid&year={{ request('year', $this_year) }}"><span class="badge @if (request('status') == 'paid') bg-green @else bg-default @endif">{{ trans('invoices.paid') }}</span></a>
<a href="{{ url('reports/income-summary') }}?status=upcoming&year={{ request('year', $this_year) }}"><span class="badge @if (request('status') == 'upcoming') bg-green @else bg-default @endif">{{ trans('dashboard.receivables') }}</span></a>
</div>
{!! Form::open(['url' => 'reports/income-summary', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-right">
{!! Form::select('year', $years, request('year', $this_year), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
</div>
{!! Form::close() !!}
</div>
@include('reports.income_summary.body')
</div>
<!-- /.box -->
@endsection

View File

@@ -0,0 +1,7 @@
@extends('layouts.print')
@section('title', trans('reports.summary.income'))
@section('content')
@include('reports.income_summary.body')
@endsection