mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
dashborad page
This commit is contained in:
parent
ab19abac45
commit
110dcaf062
@ -29,6 +29,50 @@ class DashboardController extends \BaseController {
|
|||||||
->groupBy('accounts.id')
|
->groupBy('accounts.id')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
// for 0- 30 day Invoice Price
|
||||||
|
$thirtyDayInvoice = Invoice::scope()
|
||||||
|
->where('invoice_date', '<', date('Y-m-d'))
|
||||||
|
->where('balance', '>', 0)
|
||||||
|
->where('is_recurring', '=', false)
|
||||||
|
->where('is_quote', '=', false)
|
||||||
|
->where('is_deleted', '=', false)
|
||||||
|
->orderBy('invoice_date', 'dsc')->take(30)->get();
|
||||||
|
|
||||||
|
$totalThirtyDay = Utils::getTotalValue($thirtyDayInvoice);
|
||||||
|
|
||||||
|
// for 31- 60 day Invoice Price
|
||||||
|
$thirtyToSixtyDay = Invoice::scope()
|
||||||
|
->where('invoice_date', '<', date('Y-m-d'))
|
||||||
|
->where('balance', '>', 0)
|
||||||
|
->where('is_recurring', '=', false)
|
||||||
|
->where('is_quote', '=', false)
|
||||||
|
->where('is_deleted', '=', false)
|
||||||
|
->orderBy('invoice_date', 'dsc')->skip(30)->take(30)->get();
|
||||||
|
|
||||||
|
$totalThirtyToSixtyDay = Utils::getTotalValue($thirtyToSixtyDay);
|
||||||
|
|
||||||
|
// for 61- 90 day Invoice Price
|
||||||
|
$sixtyToNintyDay = Invoice::scope()
|
||||||
|
->where('invoice_date', '<', date('Y-m-d'))
|
||||||
|
->where('balance', '>', 0)
|
||||||
|
->where('is_recurring', '=', false)
|
||||||
|
->where('is_quote', '=', false)
|
||||||
|
->where('is_deleted', '=', false)
|
||||||
|
->orderBy('invoice_date', 'dsc')->skip(60)->take(30)->get();
|
||||||
|
|
||||||
|
$totalSixtyToNintyDay = Utils::getTotalValue($sixtyToNintyDay);
|
||||||
|
|
||||||
|
// for 90- above day Invoice Price
|
||||||
|
$nintyAndAboveDay = Invoice::scope()
|
||||||
|
->where('invoice_date', '<', date('Y-m-d'))
|
||||||
|
->where('balance', '>', 0)
|
||||||
|
->where('is_recurring', '=', false)
|
||||||
|
->where('is_quote', '=', false)
|
||||||
|
->where('is_deleted', '=', false)
|
||||||
|
->orderBy('invoice_date', 'dsc')->skip(90)->take(100000)->get();
|
||||||
|
|
||||||
|
$totalNintyAndAboveDay = Utils::getTotalValue($nintyAndAboveDay);
|
||||||
|
|
||||||
$activities = Activity::where('activities.account_id', '=', Auth::user()->account_id)
|
$activities = Activity::where('activities.account_id', '=', Auth::user()->account_id)
|
||||||
->orderBy('created_at', 'desc')->take(6)->get();
|
->orderBy('created_at', 'desc')->take(6)->get();
|
||||||
|
|
||||||
@ -48,7 +92,13 @@ class DashboardController extends \BaseController {
|
|||||||
->where('is_deleted', '=', false)
|
->where('is_deleted', '=', false)
|
||||||
->orderBy('due_date', 'asc')->take(6)->get();
|
->orderBy('due_date', 'asc')->take(6)->get();
|
||||||
|
|
||||||
|
//To do
|
||||||
|
$monthValue = '12345.67';
|
||||||
|
$yearValue = '987654.32';
|
||||||
|
$weekValue ='57684.73';
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
'account' => Account::with('users')->findOrFail(Auth::user()->account_id),
|
||||||
'totalIncome' => Utils::formatMoney($totalIncome ? $totalIncome->value : 0, Session::get(SESSION_CURRENCY)),
|
'totalIncome' => Utils::formatMoney($totalIncome ? $totalIncome->value : 0, Session::get(SESSION_CURRENCY)),
|
||||||
'billedClients' => $metrics ? $metrics->billed_clients : 0,
|
'billedClients' => $metrics ? $metrics->billed_clients : 0,
|
||||||
'invoicesSent' => $metrics ? $metrics->invoices_sent : 0,
|
'invoicesSent' => $metrics ? $metrics->invoices_sent : 0,
|
||||||
@ -56,7 +106,14 @@ class DashboardController extends \BaseController {
|
|||||||
'invoiceAvg' => Utils::formatMoney(($metrics ? $metrics->invoice_avg : 0), Session::get(SESSION_CURRENCY)),
|
'invoiceAvg' => Utils::formatMoney(($metrics ? $metrics->invoice_avg : 0), Session::get(SESSION_CURRENCY)),
|
||||||
'activities' => $activities,
|
'activities' => $activities,
|
||||||
'pastDue' => $pastDue,
|
'pastDue' => $pastDue,
|
||||||
'upcoming' => $upcoming
|
'upcoming' => $upcoming,
|
||||||
|
'monthValue' => Utils::formatMoney(($monthValue ), Session::get(SESSION_CURRENCY)),
|
||||||
|
'yearValue' => Utils::formatMoney(($yearValue ), Session::get(SESSION_CURRENCY)),
|
||||||
|
'weekValue' => Utils::formatMoney(($weekValue ), Session::get(SESSION_CURRENCY)),
|
||||||
|
'totalThirtyDayInvoice' => Utils::formatMoney(($totalThirtyDay), Session::get(SESSION_CURRENCY)),
|
||||||
|
'totalThirtyToSixtyDay' => Utils::formatMoney(($totalThirtyToSixtyDay), Session::get(SESSION_CURRENCY)),
|
||||||
|
'totalSixtyToNintyDay' => Utils::formatMoney(($totalSixtyToNintyDay), Session::get(SESSION_CURRENCY)),
|
||||||
|
'totalNintyAndAboveDay' =>Utils::formatMoney(($totalNintyAndAboveDay), Session::get(SESSION_CURRENCY))
|
||||||
];
|
];
|
||||||
|
|
||||||
return View::make('dashboard', $data);
|
return View::make('dashboard', $data);
|
||||||
|
@ -129,7 +129,10 @@ return array(
|
|||||||
'upcoming_invoices' => 'UPCOMING INVOICES',
|
'upcoming_invoices' => 'UPCOMING INVOICES',
|
||||||
'average_invoice' => 'Invoice Average',
|
'average_invoice' => 'Invoice Average',
|
||||||
'total_active_client'=> 'Total Active Clients',
|
'total_active_client'=> 'Total Active Clients',
|
||||||
|
'0_30_days_old'=> '0-30 DAYS OLD',
|
||||||
|
'31_60_days_old' => '31-60 DAYS OLD',
|
||||||
|
'61_90_days_old'=> '61-90 DAYS OLD',
|
||||||
|
'91_aboue_days_old' => '91-ABOVE DAYS OLD',
|
||||||
|
|
||||||
// list pages
|
// list pages
|
||||||
'archive' => 'Archive',
|
'archive' => 'Archive',
|
||||||
|
@ -1,29 +1,33 @@
|
|||||||
@extends('header')
|
@extends('header')
|
||||||
|
|
||||||
<link href="{{ asset('css/customCss.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
|
<link href="{{ asset('css/customCss.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
|
||||||
|
|
||||||
<script src="{{ asset('js/jquery.min.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('js/jquery.min.js') }}" type="text/javascript"></script>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).ready(
|
$(document).ready(function() {
|
||||||
function() {
|
|
||||||
$("#informationBox").niceScroll();
|
|
||||||
//$("#upComingDataScrolls").niceScroll();
|
|
||||||
|
|
||||||
$("#monthButton").onclick(function(){
|
$("#informationBox").niceScroll();
|
||||||
|
$(".upComingDataScrolls").niceScroll();
|
||||||
|
|
||||||
|
$( "#monthButton" ).click(function() {
|
||||||
|
$("#invoiceAvgValue").text('{{$monthValue}}');
|
||||||
$("#monthButton").removeClass('greyButton').addClass('blueButton');
|
$("#monthButton").removeClass('greyButton').addClass('blueButton');
|
||||||
$("#yearButton").removeClass('blueButton').addClass('greyButton');
|
$("#yearButton").removeClass('blueButton').addClass('greyButton');
|
||||||
$("#weekButton").removeClass('blueButton').addClass('greyButton');
|
$("#weekButton").removeClass('blueButton').addClass('greyButton');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#yearButton").onclick(function(){
|
$( "#yearButton" ).click(function() {
|
||||||
|
$("#invoiceAvgValue").text('{{$yearValue}}');
|
||||||
$("#monthButton").removeClass('blueButton').addClass('greyButton');
|
$("#monthButton").removeClass('blueButton').addClass('greyButton');
|
||||||
$("#yearButton").removeClass('greyButton').addClass('blueButton');
|
$("#yearButton").removeClass('greyButton').addClass('blueButton');
|
||||||
$("#weekButton").removeClass('blueButton').addClass('greyButton');
|
$("#weekButton").removeClass('blueButton').addClass('greyButton');
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#weekButton").onclick(function(){
|
$( "#weekButton" ).click(function() {
|
||||||
|
$("#invoiceAvgValue").text('{{$weekValue}}');
|
||||||
$("#monthButton").removeClass('blueButton').addClass('greyButton');
|
$("#monthButton").removeClass('blueButton').addClass('greyButton');
|
||||||
$("#yearButton").removeClass('blueButton').addClass('greyButton');
|
$("#yearButton").removeClass('blueButton').addClass('greyButton');
|
||||||
$("#weekButton").removeClass('greyButton').addClass('blueButton');
|
$("#weekButton").removeClass('greyButton').addClass('blueButton');
|
||||||
@ -32,14 +36,17 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="row" style="background-image: url('../images/company_bg_img.png');height: 150px;background-position: center center;background-repeat: no-repeat;">
|
<div class="row headerBar">
|
||||||
<div class="container" style="padding: 3%;">
|
<div class="container" style="padding: 3%;">
|
||||||
<div class="col-md-6" style="margin-top: 2%;">
|
<div class="col-md-6" style="margin-top: 2%;">
|
||||||
<span class="img-wrap" style="float: left;margin-top: 1%;" ><img src="{{ asset('images/account_dashboard_icon.png') }}"></span>
|
<span class="img-wrap" style="float: left;margin-top: 1%;" ><img src="{{ asset('images/account_dashboard_icon.png') }}"></span>
|
||||||
<span style="font-weight: bolder;font-size: 20px;"> {{ trans('texts.account_dashboard') }} </span>
|
<span style="font-weight: bolder;font-size: 20px;"> {{ trans('texts.account_dashboard') }} </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6" style="">
|
<div class="col-md-6">
|
||||||
<span class="img-wrap" ><img style="height: 80px;width: auto;float: right;" src="{{ asset('images/ring-orange.png') }}"></span>
|
<span class="img-wrap" >
|
||||||
|
<center style="float: right;">
|
||||||
|
{{ HTML::image($account->getLogoPath(), "Logo") }}
|
||||||
|
</center><br/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -65,24 +72,35 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="col-md-4" style="border-left: 1px solid rgb(223, 221, 221);padding-bottom: 1%;">
|
<div class="col-md-3" style="border-left: 1px solid rgb(223, 221, 221);padding-bottom: 1%;">
|
||||||
<div class="panel-default" style="border: 0px solid transparent">
|
<div class="panel-default" style="border: 0px solid transparent">
|
||||||
<div class="panel-body">
|
<div class="panel-body orangeRing">
|
||||||
<img src="{{ asset('images/ring-orange.png') }}" class="in-image"/>
|
<span class="ringText orange" style="margin-top: 50px;font-size: 25px;"> {{$totalThirtyDayInvoice}}</span>
|
||||||
|
<span class="ringText"> {{trans('texts.0_30_days_old')}} </span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-3">
|
||||||
<div class="panel-default" style="border: 0px solid transparent">
|
<div class="panel-default" style="border: 0px solid transparent">
|
||||||
<div class="panel-body">
|
<div class="panel-body blueRing">
|
||||||
<img src="{{ asset('images/ring-blue.png') }}" class="in-image"/>
|
<span class="ringText blue" style="margin-top: 50px;font-size: 25px;"> {{$totalThirtyToSixtyDay}}</span>
|
||||||
|
<span class="ringText"> {{trans('texts.31_60_days_old')}} </span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-3">
|
||||||
<div class="panel-default" style="border: 0px solid transparent">
|
<div class="panel-default" style="border: 0px solid transparent">
|
||||||
<div class="panel-body">
|
<div class="panel-body greenRing">
|
||||||
<img src="{{ asset('images/ring-green.png') }}" class="in-image"/>
|
<span class="ringText green" style="margin-top: 50px;font-size: 25px;"> {{$totalSixtyToNintyDay}}</span>
|
||||||
|
<span class="ringText"> {{trans('texts.61_90_days_old')}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="panel-default" style="border: 0px solid transparent">
|
||||||
|
<div class="panel-body orangeRing">
|
||||||
|
<span class="ringText orange" style="margin-top: 50px;font-size: 25px;"> {{$totalNintyAndAboveDay}}</span>
|
||||||
|
<span class="ringText"> {{trans('texts.91_aboue_days_old')}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -152,7 +170,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div id="upComingDataScrolls">
|
<div class="upComingDataScrolls">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -175,9 +193,8 @@
|
|||||||
|
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
|
||||||
<div class="row" style="background-color: white;">
|
<div class="row" style="background-color: white;border: 1px solid rgb(223, 221, 221);">
|
||||||
<p> </p>
|
<div >
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="panel-default dashboard postDueInvBox">
|
<div class="panel-default dashboard postDueInvBox">
|
||||||
<div class="panel-heading" style="background-color:#FFFFFF;padding-bottom: 0px;border-bottom: 0px solid transparent;">
|
<div class="panel-heading" style="background-color:#FFFFFF;padding-bottom: 0px;border-bottom: 0px solid transparent;">
|
||||||
@ -199,7 +216,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div id="upComingDataScrolls">
|
<div class="upComingDataScrolls">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -219,7 +236,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="average-invoice" style="background-color: #FFFFFF;">
|
<div class="average-invoice activeClient">
|
||||||
<span class="img-wrap col-md-offset-0"><img src="{{ asset('images/total_client_icon.png') }}"></span>
|
<span class="img-wrap col-md-offset-0"><img src="{{ asset('images/total_client_icon.png') }}"></span>
|
||||||
<div class="black" style="font-size:16px;"><p style="margin-top: 10px;">{{ trans('texts.total_active_client') }}</p></div>
|
<div class="black" style="font-size:16px;"><p style="margin-top: 10px;">{{ trans('texts.total_active_client') }}</p></div>
|
||||||
<div class="green" style="font-size:50px;">{{ $activeClients }}</div>
|
<div class="green" style="font-size:50px;">{{ $activeClients }}</div>
|
||||||
@ -230,7 +247,7 @@
|
|||||||
<div class="average-invoice" style="background-color: #FFFFFF;">
|
<div class="average-invoice" style="background-color: #FFFFFF;">
|
||||||
<span class="img-wrap col-md-offset-0"><img src="{{ asset('images/avgl_invoice_icon.png') }}"></span>
|
<span class="img-wrap col-md-offset-0"><img src="{{ asset('images/avgl_invoice_icon.png') }}"></span>
|
||||||
<div class="black" style="font-size:16px;"><p style="margin-top: 10px;">{{ trans('texts.average_invoice') }}</p></div>
|
<div class="black" style="font-size:16px;"><p style="margin-top: 10px;">{{ trans('texts.average_invoice') }}</p></div>
|
||||||
<div class="green" style="font-size:42px">{{ $invoiceAvg }}</div>
|
<div class="green" id="invoiceAvgValue" style="font-size:42px">{{ $yearValue }}</div>
|
||||||
<div class="col-md-offset-0" style="color: #909090;">Across all clients</div>
|
<div class="col-md-offset-0" style="color: #909090;">Across all clients</div>
|
||||||
<div style="margin-top: 25%;">
|
<div style="margin-top: 25%;">
|
||||||
<span id="monthButton" class="greyButton">Month </span>
|
<span id="monthButton" class="greyButton">Month </span>
|
||||||
@ -240,5 +257,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@stop
|
@stop
|
@ -4,6 +4,7 @@
|
|||||||
@section('head')
|
@section('head')
|
||||||
|
|
||||||
<link href="{{ asset('built.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
|
<link href="{{ asset('built.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
|
||||||
|
|
||||||
<script src="{{ asset('js/jquery.nicescroll.min.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('js/jquery.nicescroll.min.js') }}" type="text/javascript"></script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#upComingDataScrolls{
|
.upComingDataScrolls{
|
||||||
height: 250px;
|
height: 250px;
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family: 'Roboto', sans-serif;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
@ -137,3 +137,41 @@
|
|||||||
padding: 2%;
|
padding: 2%;
|
||||||
margin-top: 1%;
|
margin-top: 1%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.activeClient{
|
||||||
|
background-color: #FFFFFF !important;
|
||||||
|
border: 1px solid rgb(223, 221, 221);
|
||||||
|
height: 321px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.orangeRing{
|
||||||
|
background-image: url('../images/ring-orange.png');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
height: 200px;
|
||||||
|
background-position: center center;
|
||||||
|
}
|
||||||
|
.blueRing{
|
||||||
|
background-image: url('../images/ring-blue.png');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
height: 200px;
|
||||||
|
background-position: center center;
|
||||||
|
}
|
||||||
|
.greenRing{
|
||||||
|
background-image: url('../images/ring-green.png');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
height: 200px;
|
||||||
|
background-position: center center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerBar{
|
||||||
|
background-image: url('../images/company_bg_img.png');
|
||||||
|
height: 150px;
|
||||||
|
background-position: center center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ringText{
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user