@section('header')
	@include('common.header')
@stop

@section('content')

	<div class="row" ng-controller="AccountsCtrl" ng-init="pieChartData = {{ json_encode($overview['piechart']) }}">
		<div class="col-sm-3">
			<div class="widget">
				<div class="widget-content text-center">
					<h5>Money Owed per Department</h5>
					<canvas class="chart chart-doughnut" chart-data="piechart.data" chart-labels="piechart.labels"></canvas>
				</div>
			</div>
		</div>
		<div class="col-sm-6">
			<div class="widget">
				<div class="widget-content text-center" ng-init="lineChartData = {{ json_encode($overview['linechart']) }}">
					<h5>Amount owed per month</h5>
					<canvas class="chart chart-line" chart-data="linechart.data" chart-labels="linechart.labels" chart-series="linechart.series"></canvas>
				</div>
			</div>
		</div>
		<div class="col-sm-3">
			<div class="widget">
				<div class="widget-content text-center">
					<h3>&pound;{!! number_format($overview['owed']['labour'] + $overview['owed']['parts'], 2) !!}</h3>
					<h4><small>&pound;{!! number_format($overview['owed']['labour'], 2) !!} Labour + &pound;{!! number_format($overview['owed']['parts'], 2) !!} Parts</small></h4>
					<h5><span class="label label-warning">Money owed to us</span></h5>
					<hr>
					<h3>&pound;{!! number_format($overview['overdue']['labour'] + $overview['overdue']['parts'], 2) !!}</h3>
					<h4><small>&pound;{!! number_format($overview['overdue']['labour'], 2) !!} Labour + &pound;{!! number_format($overview['overdue']['parts'], 2) !!} Parts</small></h4>
					<h5><span class="label label-danger">Overdue invoices</span></h5>
				</div>
			</div>
		</div>

	</div>


	<uib-tabset>
		<uib-tab heading="Queue">
			<div class="repair-tab bookings-content">
				<div accounts-queue></div>
			</div>
		</uib-tab>
		<uib-tab heading="Projects">
			<div class="repair-tab bookings-content">
				<div accounts-projects></div>
			</div>
		</uib-tab>
	</uib-tabset>

	<script type="text/ng-template" id="accounts/queue.html">
		@include('accounts::templates.queue')
	</script>

	<script type="text/ng-template" id="accounts/projects.html">
		@include('accounts::templates.projects')
	</script>

@stop