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')
|
||||
->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)
|
||||
->orderBy('created_at', 'desc')->take(6)->get();
|
||||
|
||||
@ -48,7 +92,13 @@ class DashboardController extends \BaseController {
|
||||
->where('is_deleted', '=', false)
|
||||
->orderBy('due_date', 'asc')->take(6)->get();
|
||||
|
||||
//To do
|
||||
$monthValue = '12345.67';
|
||||
$yearValue = '987654.32';
|
||||
$weekValue ='57684.73';
|
||||
|
||||
$data = [
|
||||
'account' => Account::with('users')->findOrFail(Auth::user()->account_id),
|
||||
'totalIncome' => Utils::formatMoney($totalIncome ? $totalIncome->value : 0, Session::get(SESSION_CURRENCY)),
|
||||
'billedClients' => $metrics ? $metrics->billed_clients : 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)),
|
||||
'activities' => $activities,
|
||||
'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);
|
||||
|
@ -129,7 +129,10 @@ return array(
|
||||
'upcoming_invoices' => 'UPCOMING INVOICES',
|
||||
'average_invoice' => 'Invoice Average',
|
||||
'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
|
||||
'archive' => 'Archive',
|
||||
|
@ -1,45 +1,52 @@
|
||||
@extends('header')
|
||||
|
||||
<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 type="text/javascript">
|
||||
|
||||
$(document).ready(
|
||||
function() {
|
||||
$("#informationBox").niceScroll();
|
||||
//$("#upComingDataScrolls").niceScroll();
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#monthButton").onclick(function(){
|
||||
$("#monthButton").removeClass('greyButton').addClass('blueButton');
|
||||
$("#informationBox").niceScroll();
|
||||
$(".upComingDataScrolls").niceScroll();
|
||||
|
||||
$( "#monthButton" ).click(function() {
|
||||
$("#invoiceAvgValue").text('{{$monthValue}}');
|
||||
$("#monthButton").removeClass('greyButton').addClass('blueButton');
|
||||
$("#yearButton").removeClass('blueButton').addClass('greyButton');
|
||||
$("#weekButton").removeClass('blueButton').addClass('greyButton');
|
||||
});
|
||||
|
||||
$("#yearButton").onclick(function(){
|
||||
$("#monthButton").removeClass('blueButton').addClass('greyButton');
|
||||
});
|
||||
|
||||
$( "#yearButton" ).click(function() {
|
||||
$("#invoiceAvgValue").text('{{$yearValue}}');
|
||||
$("#monthButton").removeClass('blueButton').addClass('greyButton');
|
||||
$("#yearButton").removeClass('greyButton').addClass('blueButton');
|
||||
$("#weekButton").removeClass('blueButton').addClass('greyButton');
|
||||
});
|
||||
});
|
||||
|
||||
$("#weekButton").onclick(function(){
|
||||
$("#monthButton").removeClass('blueButton').addClass('greyButton');
|
||||
$( "#weekButton" ).click(function() {
|
||||
$("#invoiceAvgValue").text('{{$weekValue}}');
|
||||
$("#monthButton").removeClass('blueButton').addClass('greyButton');
|
||||
$("#yearButton").removeClass('blueButton').addClass('greyButton');
|
||||
$("#weekButton").removeClass('greyButton').addClass('blueButton');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</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="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 style="font-weight: bolder;font-size: 20px;"> {{ trans('texts.account_dashboard') }} </span>
|
||||
</div>
|
||||
<div class="col-md-6" style="">
|
||||
<span class="img-wrap" ><img style="height: 80px;width: auto;float: right;" src="{{ asset('images/ring-orange.png') }}"></span>
|
||||
<div class="col-md-6">
|
||||
<span class="img-wrap" >
|
||||
<center style="float: right;">
|
||||
{{ HTML::image($account->getLogoPath(), "Logo") }}
|
||||
</center><br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -65,24 +72,35 @@
|
||||
|
||||
</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-body">
|
||||
<img src="{{ asset('images/ring-orange.png') }}" class="in-image"/>
|
||||
<div class="panel-body orangeRing">
|
||||
<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 class="col-md-4">
|
||||
<div class="col-md-3">
|
||||
<div class="panel-default" style="border: 0px solid transparent">
|
||||
<div class="panel-body">
|
||||
<img src="{{ asset('images/ring-blue.png') }}" class="in-image"/>
|
||||
<div class="panel-body blueRing">
|
||||
<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 class="col-md-4">
|
||||
<div class="col-md-3">
|
||||
<div class="panel-default" style="border: 0px solid transparent">
|
||||
<div class="panel-body">
|
||||
<img src="{{ asset('images/ring-green.png') }}" class="in-image"/>
|
||||
<div class="panel-body greenRing">
|
||||
<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>
|
||||
@ -152,7 +170,7 @@
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div id="upComingDataScrolls">
|
||||
<div class="upComingDataScrolls">
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
@ -175,9 +193,8 @@
|
||||
|
||||
<p> </p>
|
||||
|
||||
<div class="row" style="background-color: white;">
|
||||
<p> </p>
|
||||
|
||||
<div class="row" style="background-color: white;border: 1px solid rgb(223, 221, 221);">
|
||||
<div >
|
||||
<div class="col-md-6">
|
||||
<div class="panel-default dashboard postDueInvBox">
|
||||
<div class="panel-heading" style="background-color:#FFFFFF;padding-bottom: 0px;border-bottom: 0px solid transparent;">
|
||||
@ -199,7 +216,7 @@
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div id="upComingDataScrolls">
|
||||
<div class="upComingDataScrolls">
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
@ -219,7 +236,7 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
@ -230,7 +247,7 @@
|
||||
<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>
|
||||
<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 style="margin-top: 25%;">
|
||||
<span id="monthButton" class="greyButton">Month </span>
|
||||
@ -239,6 +256,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
@ -4,6 +4,7 @@
|
||||
@section('head')
|
||||
|
||||
<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>
|
||||
<style type="text/css">
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
|
||||
#upComingDataScrolls{
|
||||
.upComingDataScrolls{
|
||||
height: 250px;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
color: #000000;
|
||||
@ -137,3 +137,41 @@
|
||||
padding: 2%;
|
||||
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