diff --git a/application/controllers/dashboard/DashboardController.php b/application/controllers/dashboard/DashboardController.php index fd70734..23dc0fa 100644 --- a/application/controllers/dashboard/DashboardController.php +++ b/application/controllers/dashboard/DashboardController.php @@ -59,7 +59,7 @@ class DashboardController extends MY_Controller { 'costsToPay' => $this->reservations(), 'invoiced' => $this->getInvoiced(), 'totalChance' => $this->getChanceRevenues(), - 'totalPayment' => $this->getTotalpayment() + 'totalPayment' => Payment::getPaymentInYear( date( 'Y' )) ] ); } @@ -140,15 +140,4 @@ 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 ae0d771..83a5103 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.50'; + $this->version = '1.00.52'; $this->load->library( 'beheer/session/RetrieveUserSession' ); diff --git a/application/models/eloquent/Payment.php b/application/models/eloquent/Payment.php index fa6ac0b..5afbb1a 100644 --- a/application/models/eloquent/Payment.php +++ b/application/models/eloquent/Payment.php @@ -39,6 +39,15 @@ class Payment extends BaseModel { return $projects->toArray(); } + public static function getPaymentInYear( $year ) + { + $payments = self::selectRAW('SUM(paymentamount) AS totalpayment') + ->whereRaw("DATE_FORMAT(paymentdate, '%Y') = '{$year}'") + ->first(); + + return $payments->totalpayment; + } + public static function savePayment( $paymentID, $payment ) { $payment = (array) $payment; diff --git a/application/views/pages/dashboard_view.php b/application/views/pages/dashboard_view.php index a3309c5..c1be180 100644 --- a/application/views/pages/dashboard_view.php +++ b/application/views/pages/dashboard_view.php @@ -55,9 +55,7 @@ mouseout: disableDetails.bind($data, 'toolTip1') }">
Mollis Egestas Fusce Parturient
-Ultricies Ligula Risus
+Omzet totaal gerealiseerd lopend jaar + Onderhanden werkpositie lopend jaar.
Mollis Egestas Fusce Parturient
-Ultricies Ligula Risus
+Onderhanden werkpositie totaal/40%.
Mollis Egestas Fusce Parturient
-Ultricies Ligula Risus
+Openstaande facturen + nog te factureren totaal + kosten derden + reserveringen derden.