From 4bdf52a34aa6e52df15f995d3541a05b0c413c12 Mon Sep 17 00:00:00 2001 From: Theo Weijmer Date: Fri, 21 Feb 2020 11:52:59 +0100 Subject: [PATCH] diveren. mail peter 16-02-2020 --- .../dashboard/DashboardController.php | 26 +++- application/core/MY_Controller.php | 2 +- application/models/eloquent/Offer.php | 3 +- application/views/pages/dashboard_view.php | 72 ++++++++- .../views/pages/employeehours_view.php | 2 +- public/css/dashboard.css | 63 +++++++- .../lib/modules/dashboard/dashboardModule.js | 137 ++++++++++-------- 7 files changed, 229 insertions(+), 76 deletions(-) diff --git a/application/controllers/dashboard/DashboardController.php b/application/controllers/dashboard/DashboardController.php index df734f2..fd70734 100644 --- a/application/controllers/dashboard/DashboardController.php +++ b/application/controllers/dashboard/DashboardController.php @@ -8,6 +8,8 @@ class DashboardController extends MY_Controller { + private $invoiceOverviews = []; + public function __construct() { parent::__construct(); @@ -44,6 +46,8 @@ class DashboardController extends MY_Controller { $outstandings = $this->Invoices_model->getTotalsOutstandingPerProject( FALSE ); + $this->setInvoiceOverview(); + $this->json( [ 'totalOwp' => round( $totalOwp, 0 ), 'revenuesThisYear' => $this->getRevenuesThisYear(), @@ -51,10 +55,11 @@ class DashboardController extends MY_Controller { 'owpNextyear' => round( $totalOwp - $currentFinancialYear ), 'revenuesNextyear' => round( $currentFinancialYear / 0.4 ), 'totalRevenues' => round( $totalRevenues ), - 'outstandings' => $this->getInvoiceOverview(), + 'outstandings' => $this->invoiceOverviews, 'costsToPay' => $this->reservations(), 'invoiced' => $this->getInvoiced(), - 'totalChance' => $this->getChanceRevenues() + 'totalChance' => $this->getChanceRevenues(), + 'totalPayment' => $this->getTotalpayment() ] ); } @@ -76,7 +81,7 @@ class DashboardController extends MY_Controller { return $totalRevenue; } - private function getInvoiceOverview() + private function setInvoiceOverview() { $projects = Project::whereArchive( 'F' )->get(); @@ -84,10 +89,8 @@ class DashboardController extends MY_Controller { { $invoiceOverview = new InvoiceOverview( $project, date( 'Y' ) ); - $invoiceOverviews[] = $invoiceOverview->getProjectDetails(); + $this->invoiceOverviews[] = $invoiceOverview->getProjectDetails(); } - - return $invoiceOverviews; } private function reservations() @@ -137,4 +140,15 @@ class DashboardController extends MY_Controller { return $totalChance; } + private function getTotalPayment() + { + $totalPayment = 0; + foreach($this->invoiceOverviews as $invoiceOverview) + { + $totalPayment += str_replace( '.', '', $invoiceOverview['projectPayment']); + } + + return $totalPayment; + } + } diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php index 2aba7bb..ae0d771 100644 --- a/application/core/MY_Controller.php +++ b/application/core/MY_Controller.php @@ -16,7 +16,7 @@ class MY_Controller extends CI_Controller { { parent::__construct(); - $this->version = '1.00.40'; + $this->version = '1.00.50'; $this->load->library( 'beheer/session/RetrieveUserSession' ); diff --git a/application/models/eloquent/Offer.php b/application/models/eloquent/Offer.php index 87545f3..7f155d9 100644 --- a/application/models/eloquent/Offer.php +++ b/application/models/eloquent/Offer.php @@ -46,7 +46,8 @@ class Offer extends BaseModel { public static function getOffersWithoutProject() { - $offersWithoutProject = Offer::orderBy( 'startdate' ) + $offersWithoutProject = Offer::selectRAW('offers.*, CONCAT(offernumber, " ", offername) AS fulloffer') + ->orderBy( 'startdate' ) // ->whereNull('rejectdate') // ->whereNull('project_id') ->whereArchive( 'F' ) diff --git a/application/views/pages/dashboard_view.php b/application/views/pages/dashboard_view.php index 4c3095d..e0e5e47 100644 --- a/application/views/pages/dashboard_view.php +++ b/application/views/pages/dashboard_view.php @@ -1,8 +1,11 @@
+
+

Onderhanden werkpositie

+
-
+

Onderhanden werkpositie

@@ -25,8 +28,11 @@
+
+

Omzet

+
-
+

Omzet

@@ -38,11 +44,37 @@

- Minimum omzet lopend jaar: + + Minimum omzet lopend jaar: + + + +
+
Dit is een voorbeeld header
+

Mollis Egestas Fusce Parturient

+

Ultricies Ligula Risus

+
+

- Verwachte omzet komende 12 maanden: + + Verwachte omzet komende 12 maanden: + + + +
+
Dit is een voorbeeld header
+

Mollis Egestas Fusce Parturient

+

Ultricies Ligula Risus

+
+
@@ -53,9 +85,12 @@

+
+

Facturatie

+
-

+

Facturatie

- Nog te factureren (incl btw): + Nog te factureren totaal(incl btw):

+

+ betaalde facturen lopende jaar (incl btw): + +

+
+

Resultaat

+
-
+

Resultaat

@@ -131,7 +173,20 @@

- Saldo inkomsten (excl btw): + + Saldo inkomsten totaal(excl btw): + + + +
+
Dit is een voorbeeld header
+

Mollis Egestas Fusce Parturient

+

Ultricies Ligula Risus

+
+

@@ -155,3 +210,4 @@

+ diff --git a/application/views/pages/employeehours_view.php b/application/views/pages/employeehours_view.php index 5cb7230..af54ed6 100644 --- a/application/views/pages/employeehours_view.php +++ b/application/views/pages/employeehours_view.php @@ -70,7 +70,7 @@