From af9e988100c863b43fca50db5502a93c2dd23036 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 11 Nov 2014 19:47:15 +0200 Subject: [PATCH] Revert "dashboard page changes" --- app/controllers/DashboardController.php | 61 +-- app/lang/en/texts.php | 9 +- app/views/dashboard.blade.php | 227 ++++++------ app/views/header.blade.php | 5 +- public/css/customCss.css | 61 +-- public/images/blue_bg_img.png | Bin 1216 -> 0 bytes public/images/company_bg_img.png | Bin 2652 -> 0 bytes public/images/gray_bg_img.png | Bin 1101 -> 0 bytes public/images/ring-blue.png | Bin 7281 -> 0 bytes public/images/ring-green.png | Bin 7617 -> 0 bytes public/images/ring-orange.png | Bin 7396 -> 0 bytes public/js/jquery.nicescroll.min.js | 313 ++++++++++++++++ public/js/jquery.slimscroll.js | 470 ------------------------ 13 files changed, 434 insertions(+), 712 deletions(-) delete mode 100644 public/images/blue_bg_img.png delete mode 100644 public/images/company_bg_img.png delete mode 100644 public/images/gray_bg_img.png delete mode 100644 public/images/ring-blue.png delete mode 100644 public/images/ring-green.png delete mode 100644 public/images/ring-orange.png create mode 100644 public/js/jquery.nicescroll.min.js delete mode 100644 public/js/jquery.slimscroll.js diff --git a/app/controllers/DashboardController.php b/app/controllers/DashboardController.php index 4256dd7ead10..72f060ad0870 100644 --- a/app/controllers/DashboardController.php +++ b/app/controllers/DashboardController.php @@ -28,51 +28,7 @@ class DashboardController extends \BaseController { ->where('clients.is_deleted', '=', false) ->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(); @@ -91,14 +47,8 @@ class DashboardController extends \BaseController { ->where('is_quote', '=', false) ->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, @@ -106,14 +56,7 @@ class DashboardController extends \BaseController { 'invoiceAvg' => Utils::formatMoney(($metrics ? $metrics->invoice_avg : 0), Session::get(SESSION_CURRENCY)), 'activities' => $activities, 'pastDue' => $pastDue, - '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)) + 'upcoming' => $upcoming ]; return View::make('dashboard', $data); diff --git a/app/lang/en/texts.php b/app/lang/en/texts.php index 0495e598e015..5835615f32bc 100644 --- a/app/lang/en/texts.php +++ b/app/lang/en/texts.php @@ -120,19 +120,12 @@ return array( 'billed_client' => 'billed client', 'billed_clients' => 'billed clients', 'active_client' => 'active client', - 'total_outstading' => 'Total Outstading', - 'caps_invoice' => 'INVOICE', - 'accounts_aging' => 'ACCOUNTS AGING', - 'account_dashboard' => 'Account Dashboard', 'active_clients' => 'active clients', 'invoices_past_due' => 'PAST DUE INVOICES', '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', diff --git a/app/views/dashboard.blade.php b/app/views/dashboard.blade.php index 15aec5cfc9a9..de05cffef170 100644 --- a/app/views/dashboard.blade.php +++ b/app/views/dashboard.blade.php @@ -1,111 +1,62 @@ @extends('header') - + -
-
-
- - {{ trans('texts.account_dashboard') }} -
-
- -
- {{ HTML::image($account->getLogoPath(), "Logo") }}   -

-
-
-
+ @section('content') -
-
-
-
- -
{{ trans('texts.total_outstading') }}
-
{{ trans('texts.caps_invoice') }}
- -
{{ $totalIncome }}
-
Across all clients
-
-
-
-
-
- {{trans('texts.accounts_aging')}} - -
-
-
-
-
- {{$totalThirtyDayInvoice}} - {{trans('texts.0_30_days_old')}} -
-
-
-
-
-
- {{$totalThirtyToSixtyDay}} - {{trans('texts.31_60_days_old')}} -
-
-
-
-
-
- {{$totalSixtyToNintyDay}} - {{trans('texts.61_90_days_old')}} -
-
-
-
-
-
- {{$totalNintyAndAboveDay}} - {{trans('texts.91_aboue_days_old')}} -
-
-
-
-
+
+
+
+
+ +
+ {{ $totalIncome }} +
+
+ {{ trans('texts.in_total_revenue') }} +
+
+
+
+
+
+
+ +
+ {{ $billedClients }} +
+
+ {{ Utils::pluralize('billed_client', $billedClients) }} +
+
+
+
+
+
+
+ +
+ {{ $invoicesSent }} +
+
+ {{ Utils::pluralize('invoice', $invoicesSent) }} {{ trans('texts.sent') }} +
+
+
+
@@ -170,7 +121,7 @@ -
+
@@ -193,8 +144,9 @@

 

-
-
+
+

 

+
@@ -216,10 +168,64 @@
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @foreach ($pastDue as $invoice) @@ -236,27 +242,24 @@
-
+
-

{{ trans('texts.total_active_client') }}

-
{{ $activeClients }}
+

{{ trans('texts.total_active_client') }}

+
{{ $activeClients }}
+
- +
-

{{ trans('texts.average_invoice') }}

-
{{ $yearValue }}
-
Across all clients
-
- Month - Year - Week -
+

{{ trans('texts.average_invoice') }}

+
{{ $invoiceAvg }}
-
@stop \ No newline at end of file diff --git a/app/views/header.blade.php b/app/views/header.blade.php index 3f93573cae8a..4cf9a3ba22cd 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -3,9 +3,8 @@ @section('head') - - - + +
adssdfdssdfsdfs
adssdfdssdfsdfs
adssdfdssdfsdfs
adssdfdssdfsdfs
adssdfdssdfsdfs
adssdfdssdfsdfs
adssdfdssdfsdfs
adssdfdssdfsdfs
adssdfdssdfsdfs
{{ $invoice->client->getDisplayName() }}