2015-03-16 22:45:25 +01:00
|
|
|
@extends('header')
|
|
|
|
|
2016-09-11 16:30:23 +02:00
|
|
|
@section('head')
|
|
|
|
@parent
|
|
|
|
|
|
|
|
@include('money_script')
|
|
|
|
|
|
|
|
<script src="{!! asset('js/Chart.min.js') !!}" type="text/javascript"></script>
|
|
|
|
<script src="{{ asset('js/daterangepicker.min.js') }}" type="text/javascript"></script>
|
|
|
|
<link href="{{ asset('css/daterangepicker.css') }}" rel="stylesheet" type="text/css"/>
|
|
|
|
|
|
|
|
@stop
|
2015-10-29 22:56:45 +01:00
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
@section('content')
|
|
|
|
|
2016-09-11 16:30:23 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
@if (Auth::user()->hasPermission('view_all'))
|
|
|
|
function loadChart(data) {
|
|
|
|
var ctx = document.getElementById('chart-canvas').getContext('2d');
|
|
|
|
if (window.myChart) {
|
|
|
|
window.myChart.config.data = data;
|
2017-03-23 14:09:51 +01:00
|
|
|
window.myChart.config.options.scales.xAxes[0].time.unit = chartGroupBy.toLowerCase();
|
|
|
|
window.myChart.config.options.scales.xAxes[0].time.round = chartGroupBy.toLowerCase();
|
2016-09-11 16:30:23 +02:00
|
|
|
window.myChart.update();
|
|
|
|
} else {
|
|
|
|
$('#progress-div').hide();
|
|
|
|
$('#chart-canvas').fadeIn();
|
|
|
|
window.myChart = new Chart(ctx, {
|
|
|
|
type: 'line',
|
|
|
|
data: data,
|
|
|
|
options: {
|
|
|
|
tooltips: {
|
|
|
|
mode: 'x-axis',
|
|
|
|
titleFontSize: 15,
|
|
|
|
titleMarginBottom: 12,
|
|
|
|
bodyFontSize: 15,
|
|
|
|
bodySpacing: 10,
|
|
|
|
callbacks: {
|
|
|
|
title: function(item) {
|
|
|
|
return moment(item[0].xLabel).format("{{ $account->getMomentDateFormat() }}");
|
|
|
|
},
|
|
|
|
label: function(item, data) {
|
|
|
|
if (item.datasetIndex == 0) {
|
|
|
|
var label = " {{ trans('texts.invoices') }}: ";
|
|
|
|
} else if (item.datasetIndex == 1) {
|
|
|
|
var label = " {{ trans('texts.payments') }}: ";
|
|
|
|
} else if (item.datasetIndex == 2) {
|
|
|
|
var label = " {{ trans('texts.expenses') }}: ";
|
|
|
|
}
|
|
|
|
|
|
|
|
return label + formatMoney(item.yLabel, chartCurrencyId, account.country_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
display: false,
|
|
|
|
fontSize: 18,
|
|
|
|
text: '{{ trans('texts.total_revenue') }}'
|
|
|
|
},
|
|
|
|
scales: {
|
|
|
|
xAxes: [{
|
|
|
|
type: 'time',
|
|
|
|
time: {
|
2017-03-23 14:09:51 +01:00
|
|
|
unit: chartGroupBy,
|
|
|
|
round: chartGroupBy,
|
2016-09-11 16:30:23 +02:00
|
|
|
},
|
|
|
|
gridLines: {
|
|
|
|
display: false,
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
yAxes: [{
|
|
|
|
ticks: {
|
|
|
|
beginAtZero: true,
|
|
|
|
callback: function(label, index, labels) {
|
|
|
|
return formatMoney(label, chartCurrencyId, account.country_id);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var account = {!! $account !!};
|
2017-03-23 14:09:51 +01:00
|
|
|
var chartGroupBy = 'day';
|
2016-09-11 16:30:23 +02:00
|
|
|
var chartCurrencyId = {{ $account->getCurrencyId() }};
|
2017-03-23 14:09:51 +01:00
|
|
|
var dateRanges = {!! $account->present()->dateRangeOptions !!};
|
|
|
|
var chartStartDate;
|
|
|
|
var chartEndDate;
|
2016-09-11 16:30:23 +02:00
|
|
|
|
|
|
|
$(function() {
|
|
|
|
|
|
|
|
// Initialize date range selector
|
2017-03-23 14:09:51 +01:00
|
|
|
chartStartDate = moment().subtract(29, 'days');
|
|
|
|
chartEndDate = moment();
|
|
|
|
|
|
|
|
if (isStorageSupported()) {
|
|
|
|
var lastRange = localStorage.getItem('last:dashboard_range');
|
|
|
|
lastRange = dateRanges[lastRange];
|
|
|
|
if (lastRange) {
|
|
|
|
chartStartDate = lastRange[0];
|
|
|
|
chartEndDate = lastRange[1];
|
|
|
|
}
|
|
|
|
|
2017-03-23 14:13:04 +01:00
|
|
|
@if (count($currencies) > 1)
|
|
|
|
var currencyId = localStorage.getItem('last:dashboard_currency_id');
|
|
|
|
if (currencyId) {
|
|
|
|
chartCurrencyId = currencyId;
|
|
|
|
$("#currency-btn-group [data-button=\"" + chartCurrencyId + "\"]").addClass("active").siblings().removeClass("active");
|
|
|
|
}
|
|
|
|
@endif
|
2017-03-23 14:09:51 +01:00
|
|
|
|
|
|
|
var groupBy = localStorage.getItem('last:dashboard_group_by');
|
|
|
|
if (groupBy) {
|
|
|
|
chartGroupBy = groupBy;
|
|
|
|
$("#group-btn-group [data-button=\"" + groupBy + "\"]").addClass("active").siblings().removeClass("active");
|
|
|
|
}
|
|
|
|
}
|
2016-09-11 16:30:23 +02:00
|
|
|
|
2016-12-25 19:22:56 +01:00
|
|
|
function cb(start, end, label) {
|
2016-09-11 16:30:23 +02:00
|
|
|
$('#reportrange span').html(start.format('{{ $account->getMomentDateFormat() }}') + ' - ' + end.format('{{ $account->getMomentDateFormat() }}'));
|
|
|
|
chartStartDate = start;
|
|
|
|
chartEndDate = end;
|
2016-12-25 19:22:56 +01:00
|
|
|
$('.range-label-div').text(label);
|
2016-09-11 16:30:23 +02:00
|
|
|
loadData();
|
2017-03-23 14:09:51 +01:00
|
|
|
|
|
|
|
if (isStorageSupported() && label && label != "{{ trans('texts.custom_range') }}") {
|
|
|
|
localStorage.setItem('last:dashboard_range', label);
|
|
|
|
}
|
2016-09-11 16:30:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$('#reportrange').daterangepicker({
|
|
|
|
locale: {
|
2016-12-25 19:22:56 +01:00
|
|
|
format: "{{ $account->getMomentDateFormat() }}",
|
|
|
|
customRangeLabel: "{{ trans('texts.custom_range') }}",
|
2016-09-11 16:30:23 +02:00
|
|
|
},
|
2016-12-25 19:22:56 +01:00
|
|
|
startDate: chartStartDate,
|
2016-09-11 16:30:23 +02:00
|
|
|
endDate: chartEndDate,
|
|
|
|
linkedCalendars: false,
|
2017-03-23 14:09:51 +01:00
|
|
|
ranges: dateRanges,
|
2016-09-11 16:30:23 +02:00
|
|
|
}, cb);
|
|
|
|
|
|
|
|
cb(chartStartDate, chartEndDate);
|
|
|
|
|
|
|
|
$("#currency-btn-group > .btn").click(function(){
|
|
|
|
$(this).addClass("active").siblings().removeClass("active");
|
|
|
|
chartCurrencyId = currencyMap[$(this).text()].id;
|
|
|
|
loadData();
|
2017-03-23 14:09:51 +01:00
|
|
|
if (isStorageSupported()) {
|
|
|
|
localStorage.setItem('last:dashboard_currency_id', $(this).attr('data-button'));
|
|
|
|
}
|
2016-09-11 16:30:23 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
$("#group-btn-group > .btn").click(function(){
|
|
|
|
$(this).addClass("active").siblings().removeClass("active");
|
2017-03-23 14:09:51 +01:00
|
|
|
chartGroupBy = $(this).attr('data-button');
|
2016-09-11 16:30:23 +02:00
|
|
|
loadData();
|
2017-03-23 14:09:51 +01:00
|
|
|
if (isStorageSupported()) {
|
|
|
|
localStorage.setItem('last:dashboard_group_by', chartGroupBy);
|
|
|
|
}
|
2016-09-11 16:30:23 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
function loadData() {
|
|
|
|
var includeExpenses = "{{ count($expenses) ? 'true' : 'false' }}";
|
2017-03-23 14:09:51 +01:00
|
|
|
var url = "{!! url('/dashboard_chart_data') !!}/" + chartGroupBy + '/' + chartStartDate.format('YYYY-MM-DD') + '/' + chartEndDate.format('YYYY-MM-DD') + '/' + chartCurrencyId + '/' + includeExpenses;
|
2016-09-11 16:30:23 +02:00
|
|
|
$.get(url, function(response) {
|
|
|
|
response = JSON.parse(response);
|
|
|
|
loadChart(response.data);
|
|
|
|
|
|
|
|
var totals = response.totals;
|
|
|
|
$('.revenue-div').text(formatMoney(totals.revenue, chartCurrencyId, account.country_id));
|
|
|
|
$('.outstanding-div').text(formatMoney(totals.balance, chartCurrencyId, account.country_id));
|
|
|
|
$('.expenses-div').text(formatMoney(totals.expenses, chartCurrencyId, account.country_id));
|
|
|
|
$('.average-div').text(formatMoney(totals.average, chartCurrencyId, account.country_id));
|
|
|
|
|
|
|
|
$('.currency').hide();
|
|
|
|
$('.currency_' + chartCurrencyId).show();
|
2017-02-08 21:54:41 +01:00
|
|
|
|
|
|
|
// add blank values to fix layout
|
|
|
|
var divs = ['revenue', 'expenses', 'outstanding']
|
|
|
|
for (var i=0; i<divs.length; i++) {
|
|
|
|
var type = divs[i];
|
|
|
|
if (!$('.' + type + '-panel .currency_' + chartCurrencyId).length) {
|
|
|
|
$('.' + type + '-panel .currency_blank').text(formatMoney(0, chartCurrencyId)).show();
|
|
|
|
}
|
|
|
|
}
|
2016-09-11 16:30:23 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
@else
|
|
|
|
$(function() {
|
|
|
|
$('.currency').show();
|
|
|
|
})
|
|
|
|
@endif
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-2">
|
|
|
|
<ol class="breadcrumb"><li class='active'>{{ trans('texts.dashboard') }}</li></ol>
|
|
|
|
</div>
|
|
|
|
@if (count($tasks))
|
|
|
|
<div class="col-md-2" style="padding-top:6px">
|
|
|
|
@foreach ($tasks as $task)
|
|
|
|
{!! Button::primary($task->present()->titledName)->small()->asLinkTo($task->present()->url) !!}
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
<div class="col-md-8">
|
|
|
|
@else
|
|
|
|
<div class="col-md-10">
|
|
|
|
@endif
|
|
|
|
@if (Auth::user()->hasPermission('view_all'))
|
|
|
|
<div class="pull-right">
|
|
|
|
@if (count($currencies) > 1)
|
|
|
|
<div id="currency-btn-group" class="btn-group" role="group" style="border: 1px solid #ccc;">
|
|
|
|
@foreach ($currencies as $key => $val)
|
|
|
|
<button type="button" class="btn btn-normal {{ array_values($currencies)[0] == $val ? 'active' : '' }}"
|
2017-03-23 14:09:51 +01:00
|
|
|
data-button="{{ $key }}" style="font-weight:normal !important;background-color:white">{{ $val }}</button>
|
2016-09-11 16:30:23 +02:00
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
<div id="group-btn-group" class="btn-group" role="group" style="border: 1px solid #ccc; margin-left:18px">
|
2016-09-22 21:38:53 +02:00
|
|
|
<button type="button" class="btn btn-normal active" data-button="day" style="font-weight:normal !important;background-color:white">{{ trans('texts.day') }}</button>
|
|
|
|
<button type="button" class="btn btn-normal" data-button="week" style="font-weight:normal !important;background-color:white">{{ trans('texts.week') }}</button>
|
|
|
|
<button type="button" class="btn btn-normal" data-button="month" style="font-weight:normal !important;background-color:white">{{ trans('texts.month') }}</button>
|
2016-09-11 16:30:23 +02:00
|
|
|
</div>
|
|
|
|
<div id="reportrange" class="pull-right" style="background: #fff; cursor: pointer; padding: 9px 14px; border: 1px solid #ccc; margin-top: 0px; margin-left:18px">
|
|
|
|
<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
|
|
|
|
<span></span> <b class="caret"></b>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-12-14 15:19:16 +01:00
|
|
|
|
|
|
|
@if ($account->company->hasEarnedPromo())
|
|
|
|
@include('partials/discount_promo')
|
|
|
|
@elseif ($showBlueVinePromo)
|
2016-11-14 19:42:59 +01:00
|
|
|
@include('partials/bluevine_promo')
|
|
|
|
@endif
|
2016-12-14 15:19:16 +01:00
|
|
|
|
2016-12-28 15:39:29 +01:00
|
|
|
@if ($showWhiteLabelExpired)
|
|
|
|
@include('partials/white_label_expired')
|
|
|
|
@endif
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
<div class="row">
|
2016-07-30 21:10:00 +02:00
|
|
|
<div class="col-md-4">
|
2015-03-16 22:45:25 +01:00
|
|
|
<div class="panel panel-default">
|
2017-02-08 21:54:41 +01:00
|
|
|
<div class="panel-body revenue-panel">
|
2016-02-03 21:33:29 +01:00
|
|
|
<div style="overflow:hidden">
|
|
|
|
<div class="in-thin">
|
|
|
|
{{ trans('texts.total_revenue') }}
|
|
|
|
</div>
|
2016-09-11 16:30:23 +02:00
|
|
|
<div class="revenue-div in-bold pull-right" style="color:#337ab7">
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
<div class="in-bold">
|
|
|
|
@if (count($paidToDate))
|
|
|
|
@foreach ($paidToDate as $item)
|
2016-09-11 16:30:23 +02:00
|
|
|
<div class="currency currency_{{ $item->currency_id ?: $account->getCurrencyId() }}" style="display:none">
|
|
|
|
{{ Utils::formatMoney($item->value, $item->currency_id) }}
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
@endforeach
|
|
|
|
@else
|
2016-09-12 08:37:49 +02:00
|
|
|
<div class="currency currency_{{ $account->getCurrencyId() }}" style="display:none">
|
|
|
|
{{ Utils::formatMoney(0) }}
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
@endif
|
2017-02-08 21:54:41 +01:00
|
|
|
<div class="currency currency_blank" style="display:none">
|
|
|
|
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
</div>
|
2016-12-25 19:31:56 +01:00
|
|
|
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;">
|
|
|
|
{{ trans('texts.last_30_days') }}
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<div class="panel panel-default">
|
2017-02-08 21:54:41 +01:00
|
|
|
<div class="panel-body expenses-panel">
|
2016-02-03 21:33:29 +01:00
|
|
|
<div style="overflow:hidden">
|
2016-09-11 16:30:23 +02:00
|
|
|
@if (count($expenses))
|
|
|
|
<div class="in-thin">
|
|
|
|
{{ trans('texts.total_expenses') }}
|
|
|
|
</div>
|
|
|
|
<div class="expenses-div in-bold pull-right" style="color:#337ab7">
|
|
|
|
</div>
|
|
|
|
<div class="in-bold">
|
|
|
|
@foreach ($expenses as $item)
|
|
|
|
<div class="currency currency_{{ $item->currency_id ?: $account->getCurrencyId() }}" style="display:none">
|
|
|
|
{{ Utils::formatMoney($item->value, $item->currency_id) }}<br/>
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
@endforeach
|
2017-02-08 21:54:41 +01:00
|
|
|
<div class="currency currency_blank" style="display:none">
|
|
|
|
|
|
|
|
</div>
|
2016-09-11 16:30:23 +02:00
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<div class="in-thin">
|
|
|
|
{{ trans('texts.average_invoice') }}
|
|
|
|
</div>
|
|
|
|
<div class="average-div in-bold pull-right" style="color:#337ab7">
|
|
|
|
</div>
|
|
|
|
<div class="in-bold">
|
|
|
|
@if (count($averageInvoice))
|
|
|
|
@foreach ($averageInvoice as $item)
|
|
|
|
<div class="currency currency_{{ $item->currency_id ?: $account->getCurrencyId() }}" style="display:none">
|
|
|
|
{{ Utils::formatMoney($item->invoice_avg, $item->currency_id) }}<br/>
|
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
@else
|
2016-09-12 08:37:49 +02:00
|
|
|
<div class="currency currency_{{ $account->getCurrencyId() }}" style="display:none">
|
|
|
|
{{ Utils::formatMoney(0) }}
|
|
|
|
</div>
|
2016-09-11 16:30:23 +02:00
|
|
|
@endif
|
2017-02-08 21:54:41 +01:00
|
|
|
<div class="currency currency_blank" style="display:none">
|
|
|
|
|
|
|
|
</div>
|
2016-09-11 16:30:23 +02:00
|
|
|
</div>
|
|
|
|
@endif
|
2016-12-25 19:31:56 +01:00
|
|
|
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;">
|
|
|
|
{{ trans('texts.last_30_days') }}
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<div class="panel panel-default">
|
2017-02-08 21:54:41 +01:00
|
|
|
<div class="panel-body outstanding-panel">
|
2016-02-03 21:33:29 +01:00
|
|
|
<div style="overflow:hidden">
|
|
|
|
<div class="in-thin">
|
|
|
|
{{ trans('texts.outstanding') }}
|
|
|
|
</div>
|
2016-09-11 16:30:23 +02:00
|
|
|
<div class="outstanding-div in-bold pull-right" style="color:#337ab7">
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
<div class="in-bold">
|
|
|
|
@if (count($balances))
|
|
|
|
@foreach ($balances as $item)
|
2016-09-11 16:30:23 +02:00
|
|
|
<div class="currency currency_{{ $item->currency_id ?: $account->getCurrencyId() }}" style="display:none">
|
|
|
|
{{ Utils::formatMoney($item->value, $item->currency_id) }}<br/>
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
@endforeach
|
|
|
|
@else
|
2016-09-12 08:37:49 +02:00
|
|
|
<div class="currency currency_{{ $account->getCurrencyId() }}" style="display:none">
|
|
|
|
{{ Utils::formatMoney(0) }}
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
@endif
|
2017-02-08 21:54:41 +01:00
|
|
|
<div class="currency currency_blank" style="display:none">
|
|
|
|
|
|
|
|
</div>
|
2016-02-03 21:33:29 +01:00
|
|
|
</div>
|
2016-12-25 19:31:56 +01:00
|
|
|
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;">
|
|
|
|
{{ trans('texts.last_30_days') }}
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-09-11 16:30:23 +02:00
|
|
|
@if (Auth::user()->hasPermission('view_all'))
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div id="progress-div" class="progress">
|
|
|
|
<div class="progress-bar progress-bar-striped active" role="progressbar"
|
|
|
|
aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>
|
|
|
|
</div>
|
|
|
|
<canvas id="chart-canvas" height="70px" style="background-color:white;padding:20px;display:none"></canvas>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
<p> </p>
|
2016-09-11 16:30:23 +02:00
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
<div class="row">
|
2015-10-06 19:55:55 +02:00
|
|
|
<div class="col-md-6">
|
2015-07-29 21:55:12 +02:00
|
|
|
<div class="panel panel-default dashboard" style="height:320px">
|
2016-09-11 16:30:23 +02:00
|
|
|
<div class="panel-heading" style="background-color:#286090 !important">
|
2015-03-16 22:45:25 +01:00
|
|
|
<h3 class="panel-title in-bold-white">
|
2015-12-21 20:57:55 +01:00
|
|
|
<i class="glyphicon glyphicon-exclamation-sign"></i> {{ trans('texts.activity') }}
|
2016-08-02 09:41:04 +02:00
|
|
|
@if ($invoicesSent)
|
|
|
|
<div class="pull-right" style="font-size:14px;padding-top:4px">
|
2017-03-27 20:51:48 +02:00
|
|
|
@if ($invoicesSent == 1)
|
|
|
|
{{ trans('texts.invoice_sent', ['count' => $invoicesSent]) }}
|
2017-03-12 11:39:37 +01:00
|
|
|
@else
|
2017-03-27 20:51:48 +02:00
|
|
|
{{ trans('texts.invoices_sent', ['count' => $invoicesSent]) }}
|
2017-03-12 11:39:37 +01:00
|
|
|
@endif
|
2016-08-02 09:41:04 +02:00
|
|
|
</div>
|
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
</h3>
|
|
|
|
</div>
|
2015-07-29 21:55:12 +02:00
|
|
|
<ul class="panel-body list-group" style="height:276px;overflow-y:auto;">
|
2015-03-16 22:45:25 +01:00
|
|
|
@foreach ($activities as $activity)
|
|
|
|
<li class="list-group-item">
|
|
|
|
<span style="color:#888;font-style:italic">{{ Utils::timestampToDateString(strtotime($activity->created_at)) }}:</span>
|
2015-10-28 20:22:07 +01:00
|
|
|
{!! $activity->getMessage() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
</li>
|
|
|
|
@endforeach
|
|
|
|
</ul>
|
2016-07-30 21:10:00 +02:00
|
|
|
</div>
|
2015-10-06 19:55:55 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
2015-07-29 21:55:12 +02:00
|
|
|
<div class="panel panel-default dashboard" style="height:320px;">
|
|
|
|
<div class="panel-heading" style="margin:0; background-color: #f5f5f5 !important;">
|
|
|
|
<h3 class="panel-title" style="color: black !important">
|
2016-09-11 16:30:23 +02:00
|
|
|
@if (count($expenses) && count($averageInvoice))
|
|
|
|
<div class="pull-right" style="font-size:14px;padding-top:4px;font-weight:bold">
|
|
|
|
@foreach ($averageInvoice as $item)
|
|
|
|
<span class="currency currency_{{ $item->currency_id ?: $account->getCurrencyId() }}" style="display:none">
|
|
|
|
{{ trans('texts.average_invoice') }}
|
|
|
|
{{ Utils::formatMoney($item->invoice_avg, $item->currency_id) }} |
|
|
|
|
</span>
|
|
|
|
@endforeach
|
|
|
|
<span class="average-div" style="color:#337ab7"/>
|
|
|
|
</div>
|
|
|
|
@endif
|
2015-07-29 21:55:12 +02:00
|
|
|
<i class="glyphicon glyphicon-ok-sign"></i> {{ trans('texts.recent_payments') }}
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body" style="height:274px;overflow-y:auto;">
|
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<th>{{ trans('texts.invoice_number_short') }}</th>
|
|
|
|
<th>{{ trans('texts.client') }}</th>
|
|
|
|
<th>{{ trans('texts.payment_date') }}</th>
|
|
|
|
<th>{{ trans('texts.amount') }}</th>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach ($payments as $payment)
|
|
|
|
<tr>
|
|
|
|
<td>{!! \App\Models\Invoice::calcLink($payment) !!}</td>
|
2016-04-26 03:53:39 +02:00
|
|
|
@can('viewByOwner', [ENTITY_CLIENT, $payment->client_user_id])
|
2016-03-16 03:29:30 +01:00
|
|
|
<td>{!! link_to('/clients/'.$payment->client_public_id, trim($payment->client_name) ?: (trim($payment->first_name . ' ' . $payment->last_name) ?: $payment->email)) !!}</td>
|
|
|
|
@else
|
|
|
|
<td>{{ trim($payment->client_name) ?: (trim($payment->first_name . ' ' . $payment->last_name) ?: $payment->email) }}</td>
|
2016-04-26 03:53:39 +02:00
|
|
|
@endcan
|
2015-07-29 21:55:12 +02:00
|
|
|
<td>{{ Utils::fromSqlDate($payment->payment_date) }}</td>
|
|
|
|
<td>{{ Utils::formatMoney($payment->amount, $payment->currency_id ?: ($account->currency_id ?: DEFAULT_CURRENCY)) }}</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
2015-10-06 19:55:55 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
2016-07-30 21:10:00 +02:00
|
|
|
<div class="col-md-6">
|
2015-10-06 19:55:55 +02:00
|
|
|
<div class="panel panel-default dashboard" style="height:320px;">
|
|
|
|
<div class="panel-heading" style="margin:0; background-color: #f5f5f5 !important;">
|
|
|
|
<h3 class="panel-title" style="color: black !important">
|
|
|
|
<i class="glyphicon glyphicon-time"></i> {{ trans('texts.upcoming_invoices') }}
|
2015-03-16 22:45:25 +01:00
|
|
|
</h3>
|
|
|
|
</div>
|
2015-07-29 21:55:12 +02:00
|
|
|
<div class="panel-body" style="height:274px;overflow-y:auto;">
|
2015-03-16 22:45:25 +01:00
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<th>{{ trans('texts.invoice_number_short') }}</th>
|
|
|
|
<th>{{ trans('texts.client') }}</th>
|
|
|
|
<th>{{ trans('texts.due_date') }}</th>
|
|
|
|
<th>{{ trans('texts.balance_due') }}</th>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2015-10-06 19:55:55 +02:00
|
|
|
@foreach ($upcoming as $invoice)
|
2016-05-26 16:56:54 +02:00
|
|
|
@if ($invoice->invoice_type_id == INVOICE_TYPE_STANDARD)
|
2015-10-06 19:55:55 +02:00
|
|
|
<tr>
|
|
|
|
<td>{!! \App\Models\Invoice::calcLink($invoice) !!}</td>
|
2016-04-26 03:53:39 +02:00
|
|
|
@can('viewByOwner', [ENTITY_CLIENT, $invoice->client_user_id])
|
2016-03-20 02:57:20 +01:00
|
|
|
<td>{!! link_to('/clients/'.$invoice->client_public_id, trim($invoice->client_name) ?: (trim($invoice->first_name . ' ' . $invoice->last_name) ?: $invoice->email)) !!}</td>
|
2016-03-16 03:29:30 +01:00
|
|
|
@else
|
2016-03-20 02:57:20 +01:00
|
|
|
<td>{{ trim($invoice->client_name) ?: (trim($invoice->first_name . ' ' . $invoice->last_name) ?: $invoice->email) }}</td>
|
2016-04-26 03:53:39 +02:00
|
|
|
@endcan
|
2015-10-06 19:55:55 +02:00
|
|
|
<td>{{ Utils::fromSqlDate($invoice->due_date) }}</td>
|
|
|
|
<td>{{ Utils::formatMoney($invoice->balance, $invoice->currency_id ?: ($account->currency_id ?: DEFAULT_CURRENCY)) }}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2015-10-06 19:55:55 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-16 03:29:30 +01:00
|
|
|
<div class="col-md-6">
|
2015-10-06 19:55:55 +02:00
|
|
|
<div class="panel panel-default dashboard" style="height:320px">
|
2016-09-11 16:30:23 +02:00
|
|
|
<div class="panel-heading" style="background-color:#777 !important">
|
2015-10-06 19:55:55 +02:00
|
|
|
<h3 class="panel-title in-bold-white">
|
|
|
|
<i class="glyphicon glyphicon-time"></i> {{ trans('texts.invoices_past_due') }}
|
2015-03-16 22:45:25 +01:00
|
|
|
</h3>
|
|
|
|
</div>
|
2015-07-29 21:55:12 +02:00
|
|
|
<div class="panel-body" style="height:274px;overflow-y:auto;">
|
2015-03-16 22:45:25 +01:00
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<th>{{ trans('texts.invoice_number_short') }}</th>
|
|
|
|
<th>{{ trans('texts.client') }}</th>
|
|
|
|
<th>{{ trans('texts.due_date') }}</th>
|
|
|
|
<th>{{ trans('texts.balance_due') }}</th>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2015-10-06 19:55:55 +02:00
|
|
|
@foreach ($pastDue as $invoice)
|
2016-05-26 16:56:54 +02:00
|
|
|
@if ($invoice->invoice_type_id == INVOICE_TYPE_STANDARD)
|
2015-10-06 19:55:55 +02:00
|
|
|
<tr>
|
|
|
|
<td>{!! \App\Models\Invoice::calcLink($invoice) !!}</td>
|
2016-04-26 03:53:39 +02:00
|
|
|
@can('viewByOwner', [ENTITY_CLIENT, $invoice->client_user_id])
|
2016-03-20 02:57:20 +01:00
|
|
|
<td>{!! link_to('/clients/'.$invoice->client_public_id, trim($invoice->client_name) ?: (trim($invoice->first_name . ' ' . $invoice->last_name) ?: $invoice->email)) !!}</td>
|
2016-03-16 03:29:30 +01:00
|
|
|
@else
|
2016-03-20 02:57:20 +01:00
|
|
|
<td>{{ trim($invoice->client_name) ?: (trim($invoice->first_name . ' ' . $invoice->last_name) ?: $invoice->email) }}</td>
|
2016-04-26 03:53:39 +02:00
|
|
|
@endcan
|
2015-10-06 19:55:55 +02:00
|
|
|
<td>{{ Utils::fromSqlDate($invoice->due_date) }}</td>
|
|
|
|
<td>{{ Utils::formatMoney($invoice->balance, $invoice->currency_id ?: ($account->currency_id ?: DEFAULT_CURRENCY)) }}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2016-07-30 21:10:00 +02:00
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
2015-05-08 10:21:29 +02:00
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2015-10-06 19:55:55 +02:00
|
|
|
@if ($hasQuotes)
|
|
|
|
<div class="row">
|
2016-07-30 21:10:00 +02:00
|
|
|
<div class="col-md-6">
|
2015-10-06 19:55:55 +02:00
|
|
|
<div class="panel panel-default dashboard" style="height:320px;">
|
|
|
|
<div class="panel-heading" style="margin:0; background-color: #f5f5f5 !important;">
|
|
|
|
<h3 class="panel-title" style="color: black !important">
|
|
|
|
<i class="glyphicon glyphicon-time"></i> {{ trans('texts.upcoming_quotes') }}
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body" style="height:274px;overflow-y:auto;">
|
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<th>{{ trans('texts.quote_number_short') }}</th>
|
|
|
|
<th>{{ trans('texts.client') }}</th>
|
2015-11-04 14:57:59 +01:00
|
|
|
<th>{{ trans('texts.valid_until') }}</th>
|
|
|
|
<th>{{ trans('texts.amount') }}</th>
|
2015-10-06 19:55:55 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach ($upcoming as $invoice)
|
2016-07-30 21:10:00 +02:00
|
|
|
@if ($invoice->invoice_type_id == INVOICE_TYPE_QUOTE)
|
2015-10-06 19:55:55 +02:00
|
|
|
<tr>
|
|
|
|
<td>{!! \App\Models\Invoice::calcLink($invoice) !!}</td>
|
|
|
|
<td>{!! link_to('/clients/'.$invoice->client_public_id, trim($invoice->client_name) ?: (trim($invoice->first_name . ' ' . $invoice->last_name) ?: $invoice->email)) !!}</td>
|
|
|
|
<td>{{ Utils::fromSqlDate($invoice->due_date) }}</td>
|
|
|
|
<td>{{ Utils::formatMoney($invoice->balance, $invoice->currency_id ?: ($account->currency_id ?: DEFAULT_CURRENCY)) }}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-07-30 21:10:00 +02:00
|
|
|
<div class="col-md-6">
|
2015-10-06 19:55:55 +02:00
|
|
|
<div class="panel panel-default dashboard" style="height:320px">
|
2016-09-11 16:30:23 +02:00
|
|
|
<div class="panel-heading" style="background-color:#777 !important">
|
2015-10-06 19:55:55 +02:00
|
|
|
<h3 class="panel-title in-bold-white">
|
|
|
|
<i class="glyphicon glyphicon-time"></i> {{ trans('texts.expired_quotes') }}
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body" style="height:274px;overflow-y:auto;">
|
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<th>{{ trans('texts.quote_number_short') }}</th>
|
|
|
|
<th>{{ trans('texts.client') }}</th>
|
2015-11-04 14:57:59 +01:00
|
|
|
<th>{{ trans('texts.valid_until') }}</th>
|
|
|
|
<th>{{ trans('texts.amount') }}</th>
|
2015-10-06 19:55:55 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach ($pastDue as $invoice)
|
2016-07-30 21:10:00 +02:00
|
|
|
@if ($invoice->invoice_type_id == INVOICE_TYPE_QUOTE)
|
2015-10-06 19:55:55 +02:00
|
|
|
<tr>
|
|
|
|
<td>{!! \App\Models\Invoice::calcLink($invoice) !!}</td>
|
|
|
|
<td>{!! link_to('/clients/'.$invoice->client_public_id, trim($invoice->client_name) ?: (trim($invoice->first_name . ' ' . $invoice->last_name) ?: $invoice->email)) !!}</td>
|
|
|
|
<td>{{ Utils::fromSqlDate($invoice->due_date) }}</td>
|
|
|
|
<td>{{ Utils::formatMoney($invoice->balance, $invoice->currency_id ?: ($account->currency_id ?: DEFAULT_CURRENCY)) }}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2016-07-30 21:10:00 +02:00
|
|
|
</div>
|
2015-10-06 19:55:55 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2015-10-18 09:30:28 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
$('.normalDropDown:not(.dropdown-toggle)').click(function() {
|
|
|
|
window.location = '{{ URL::to('invoices/create') }}';
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2016-07-30 21:10:00 +02:00
|
|
|
@stop
|