diveren. mail peter 16-02-2020
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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' );
|
||||
|
||||
|
||||
@@ -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' )
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<div class="row">
|
||||
<?php if(in_array(ROLE, [2] )): ?>
|
||||
<div class="db-panel">
|
||||
<div class="conceal-panel db-panel-success" data-bind="click:hideConceals">
|
||||
<h3>Onderhanden werkpositie</h3>
|
||||
</div>
|
||||
<div class="db-panel-holder db-panel-success">
|
||||
<div class="db-panel-heading">
|
||||
<div class="db-panel-heading" data-bind="click:showConceals">
|
||||
<h3 class="db-panel-title">
|
||||
Onderhanden werkpositie
|
||||
</h3>
|
||||
@@ -25,8 +28,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="db-panel">
|
||||
<div class="conceal-panel db-panel-warning" data-bind="click:hideConceals">
|
||||
<h3>Omzet</h3>
|
||||
</div>
|
||||
<div class="db-panel-holder db-panel-warning">
|
||||
<div class="db-panel-heading">
|
||||
<div class="db-panel-heading" data-bind="click:showConceals">
|
||||
<h3 class="db-panel-title">
|
||||
Omzet
|
||||
</h3>
|
||||
@@ -38,11 +44,37 @@
|
||||
<span class="db-panel-data"><strong data-bind="text:revenuesThisYear"></strong></span>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="db-panel-label">Minimum omzet lopend jaar:</span>
|
||||
<span class="db-panel-label">
|
||||
Minimum omzet lopend jaar:
|
||||
</span>
|
||||
<span class="dashboard-info"
|
||||
data-bind="event: {
|
||||
mouseover: enableDetails.bind($data, 'toolTip1'),
|
||||
mouseout: disableDetails.bind($data, 'toolTip1') }">
|
||||
<label>?</label>
|
||||
<div data-bind="if:toolTip1" class="my-tooltip">
|
||||
<h5>Dit is een voorbeeld header</h5>
|
||||
<p>Mollis Egestas Fusce Parturient</p>
|
||||
<p>Ultricies Ligula Risus</p>
|
||||
</div>
|
||||
</span>
|
||||
<span class="db-panel-data"><strong data-bind="text:minimumRevenues"></strong></span>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="db-panel-label">Verwachte omzet komende 12 maanden:</span>
|
||||
<span class="db-panel-label">
|
||||
Verwachte omzet komende 12 maanden:
|
||||
</span>
|
||||
<span class="dashboard-info"
|
||||
data-bind="event: {
|
||||
mouseover: enableDetails.bind($data, 'toolTip3'),
|
||||
mouseout: disableDetails.bind($data, 'toolTip3') }">
|
||||
<label>?</label>
|
||||
<div data-bind="if:toolTip3" class="my-tooltip">
|
||||
<h5>Dit is een voorbeeld header</h5>
|
||||
<p>Mollis Egestas Fusce Parturient</p>
|
||||
<p>Ultricies Ligula Risus</p>
|
||||
</div>
|
||||
</span>
|
||||
<span class="db-panel-data">
|
||||
<strong data-bind="text:revenuesNextyear"></strong>
|
||||
</span>
|
||||
@@ -53,9 +85,12 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="db-panel">
|
||||
<div class="conceal-panel db-panel-info" data-bind="click:hideConceals">
|
||||
<h3>Facturatie</h3>
|
||||
</div>
|
||||
<div class="db-panel-holder db-panel-info">
|
||||
<div class="db-panel-heading">
|
||||
<h3 class="db-panel-title">
|
||||
<h3 class="db-panel-title" data-bind="click:showConceals">
|
||||
Facturatie
|
||||
<span style="margin-left:10px;display:none"
|
||||
class="glyphicon glyphicon-question-sign pointer"
|
||||
@@ -111,15 +146,22 @@
|
||||
</span>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="db-panel-label">Nog te factureren (incl btw):</span>
|
||||
<span class="db-panel-label">Nog te factureren totaal(incl btw):</span>
|
||||
<span class="db-panel-data"><strong data-bind="text:toInvoice"></strong></span>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="db-panel-label">betaalde facturen lopende jaar (incl btw):</span>
|
||||
<span class="db-panel-data"><strong data-bind="text:payments"></strong></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="db-panel">
|
||||
<div class="conceal-panel db-panel-danger" data-bind="click:hideConceals">
|
||||
<h3>Resultaat</h3>
|
||||
</div>
|
||||
<div class="db-panel-holder db-panel-danger">
|
||||
<div class="db-panel-heading">
|
||||
<div class="db-panel-heading" data-bind="click:showConceals">
|
||||
<h3 class="db-panel-title">
|
||||
Resultaat
|
||||
</h3>
|
||||
@@ -131,7 +173,20 @@
|
||||
<span class="db-panel-data"><strong data-bind="text:openCosts"></strong></span>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="db-panel-label">Saldo inkomsten (excl btw):</span>
|
||||
<span class="db-panel-label">
|
||||
Saldo inkomsten totaal(excl btw):
|
||||
</span>
|
||||
<span class="dashboard-info"
|
||||
data-bind="event: {
|
||||
mouseover: enableDetails.bind($data, 'toolTip2'),
|
||||
mouseout: disableDetails.bind($data, 'toolTip2') }">
|
||||
<label>?</label>
|
||||
<div data-bind="if:toolTip2" class="my-tooltip">
|
||||
<h5>Dit is een voorbeeld header</h5>
|
||||
<p>Mollis Egestas Fusce Parturient</p>
|
||||
<p>Ultricies Ligula Risus</p>
|
||||
</div>
|
||||
</span>
|
||||
<span class="db-panel-data"><strong data-bind="text:revenues"></strong></span>
|
||||
</h4>
|
||||
<h4>
|
||||
@@ -155,3 +210,4 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<!-- ko if: hourType() == 'OFFERS' && archive() == 'F' -->
|
||||
<select class="form-control form-control-sm"
|
||||
data-bind="options:$root.offersWithoutProject,
|
||||
optionsText:'offername',
|
||||
optionsText:'fulloffer',
|
||||
optionsValue:'id',
|
||||
value:projectID,
|
||||
optionsCaption:'selecteer...',
|
||||
|
||||
Reference in New Issue
Block a user