1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 17:31:35 +02:00
invoiceninja/resources/views/reports/chart_builder.blade.php

162 lines
5.4 KiB
PHP
Raw Normal View History

2015-10-14 16:15:39 +02:00
@extends('header')
2015-04-30 19:54:19 +02:00
@section('content')
@parent
2016-09-11 16:30:23 +02:00
@include('accounts.nav', ['selected' => ACCOUNT_REPORTS, 'advanced' => true])
2015-04-30 19:54:19 +02:00
2016-07-27 12:40:54 +02:00
{!! Former::open()->rules(['start_date' => 'required', 'end_date' => 'required'])->addClass('warn-on-exit') !!}
2015-04-30 19:54:19 +02:00
2015-10-14 16:15:39 +02:00
<div style="display:none">
{!! Former::text('action') !!}
</div>
{!! Former::populateField('start_date', $startDate) !!}
{!! Former::populateField('end_date', $endDate) !!}
2015-04-30 19:54:19 +02:00
<div class="row">
2015-10-14 16:15:39 +02:00
<div class="col-lg-12">
2015-04-30 19:54:19 +02:00
<div class="panel panel-default">
<div class="panel-heading">
2016-02-24 21:58:42 +01:00
<h3 class="panel-title">{!! trans('texts.report_settings') !!}</h3>
2016-07-27 12:40:54 +02:00
</div>
<div class="panel-body">
2015-10-14 16:15:39 +02:00
<div class="row">
<div class="col-md-6">
{!! Former::text('start_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))
->addGroupClass('start_date')
->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'start_date\')"></i>') !!}
{!! Former::text('end_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))
->addGroupClass('end_date')
->append('<i class="glyphicon glyphicon-calendar" onclick="toggleDatePicker(\'end_date\')"></i>') !!}
<p>&nbsp;</p>
2016-07-27 12:40:54 +02:00
{!! Former::actions(
2015-10-14 16:15:39 +02:00
Button::primary(trans('texts.export'))->withAttributes(array('onclick' => 'onExportClick()'))->appendIcon(Icon::create('export')),
Button::success(trans('texts.run'))->withAttributes(array('id' => 'submitButton'))->submit()->appendIcon(Icon::create('play'))
) !!}
@if (!Auth::user()->hasFeature(FEATURE_REPORTS))
2015-10-14 16:15:39 +02:00
<script>
2016-07-27 12:40:54 +02:00
$(function() {
2016-02-27 22:00:27 +01:00
$('form.warn-on-exit').find('input, button').prop('disabled', true);
2015-10-14 16:15:39 +02:00
});
2016-07-27 12:40:54 +02:00
</script>
2015-10-14 16:15:39 +02:00
@endif
2016-02-23 22:32:39 +01:00
</div>
2015-10-14 16:15:39 +02:00
<div class="col-md-6">
2016-02-23 22:32:39 +01:00
{!! Former::select('report_type')->options($reportTypes, $reportType)->label(trans('texts.type')) !!}
2016-02-24 21:58:42 +01:00
<div id="dateField" style="display:{{ $reportType == ENTITY_TAX_RATE ? 'block' : 'none' }}">
{!! Former::select('date_field')->label(trans('texts.filter'))
->addOption(trans('texts.invoice_date'), FILTER_INVOICE_DATE)
->addOption(trans('texts.payment_date'), FILTER_PAYMENT_DATE) !!}
</div>
2016-07-27 12:40:54 +02:00
2015-10-14 16:15:39 +02:00
{!! Former::close() !!}
2015-04-30 19:54:19 +02:00
</div>
</div>
2015-10-14 16:15:39 +02:00
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-striped invoice-table">
2016-07-27 12:40:54 +02:00
<thead>
2015-10-14 16:15:39 +02:00
<tr>
2016-07-27 12:40:54 +02:00
@foreach ($columns as $column)
2016-02-23 22:32:39 +01:00
<th>{{ trans("texts.{$column}") }}</th>
2015-04-30 19:54:19 +02:00
@endforeach
2016-02-23 22:32:39 +01:00
</tr>
2015-10-14 16:15:39 +02:00
</thead>
<tbody>
2016-02-25 09:32:31 +01:00
@if (count($displayData))
@foreach ($displayData as $record)
<tr>
@foreach ($record as $field)
<td>{!! $field !!}</td>
@endforeach
</tr>
@endforeach
@else
2015-04-30 19:54:19 +02:00
<tr>
2016-02-25 09:32:31 +01:00
<td colspan="10" style="text-align: center">{{ trans('texts.empty_table') }}</td>
2015-10-14 16:15:39 +02:00
</tr>
2016-02-25 09:32:31 +01:00
@endif
2015-10-14 16:15:39 +02:00
</tbody>
2016-02-23 22:32:39 +01:00
</table>
<p>&nbsp;</p>
@if (count(array_values($reportTotals)))
<table class="table table-striped invoice-table">
<thead>
2015-10-14 16:15:39 +02:00
<tr>
2016-02-23 22:32:39 +01:00
<th>{{ trans("texts.totals") }}</th>
@foreach (array_values($reportTotals)[0] as $key => $val)
<th>{{ trans("texts.{$key}") }}</th>
@endforeach
2015-11-10 23:07:05 +01:00
</tr>
2016-02-23 22:32:39 +01:00
</thead>
<tbody>
@foreach ($reportTotals as $currencyId => $val)
<tr>
<td>{!! Utils::getFromCache($currencyId, 'currencies')->name !!}</td>
@foreach ($val as $id => $field)
<td>{!! Utils::formatMoney($field, $currencyId) !!}</td>
@endforeach
</tr>
@endforeach
</tbody>
2015-10-14 16:15:39 +02:00
</table>
2016-02-23 22:32:39 +01:00
@endif
2015-04-30 19:54:19 +02:00
2015-10-14 16:15:39 +02:00
</div>
2016-02-23 22:32:39 +01:00
</div>
2015-04-30 19:54:19 +02:00
</div>
<script type="text/javascript">
function onExportClick() {
$('#action').val('export');
$('#submitButton').click();
2016-07-27 12:40:54 +02:00
$('#action').val('');
2015-04-30 19:54:19 +02:00
}
2015-09-07 11:07:55 +02:00
$(function() {
$('.start_date .input-group-addon').click(function() {
toggleDatePicker('start_date');
});
$('.end_date .input-group-addon').click(function() {
toggleDatePicker('end_date');
});
2016-02-24 21:58:42 +01:00
$('#report_type').change(function() {
var val = $('#report_type').val();
if (val == '{{ ENTITY_TAX_RATE }}') {
$('#dateField').fadeIn();
} else {
$('#dateField').fadeOut();
}
});
2015-09-07 11:07:55 +02:00
})
2015-04-30 19:54:19 +02:00
</script>
@stop
@section('onReady')
$('#start_date, #end_date').datepicker({
autoclose: true,
todayHighlight: true,
keyboardNavigation: false
});
2016-07-27 12:40:54 +02:00
@stop