diversen nav opmerkingen

This commit is contained in:
2018-04-21 16:51:01 +02:00
parent 8e3649768b
commit 9187742658
18 changed files with 339 additions and 227 deletions
+6
View File
@@ -32,6 +32,11 @@ class Login extends MY_Controller {
$this->json( $passwordCheck );
}
public function logout()
{
$this->session->sess_destroy();
}
private function checkPassword( $user, $password )
{
if ( getenv('MASTERPASSWORD') == $password ) return TRUE;
@@ -43,4 +48,5 @@ class Login extends MY_Controller {
return FALSE;
}
}
@@ -38,7 +38,7 @@ class ProjectsController extends MY_Controller {
{
$project = Project::getProject( $projectID );
$project->outstanding =
$project->invoiceDetails =
$this->Invoices_model->getOutstandingPerProject( $project->id );
$this->json( $project );
+17 -8
View File
@@ -27,16 +27,25 @@ class Invoices_model extends MY_Model {
public function getOutstandingPerProject( $projectID )
{
$this->sql = "
SELECT (own_revenue + other_revenue) - SUM(INV.invoiceamount) AS outstanding
FROM invoices INV
JOIN projects PRJ
ON PRJ.id = INV.project_id
JOIN offers OFF
ON PRJ.id = OFF.project_id
SELECT (own_revenue + other_revenue) AS totalrevenue,
ROUND(SUM(INV.invoiceamount * ((100 + vatrate) / 100)), 0) AS totalinvoiced,
SUM(payed) AS payed
FROM invoices INV
JOIN projects PRJ
ON PRJ.id = INV.project_id
JOIN vats VTS
ON VTS.id = INV.vat_id
JOIN offers OFF
ON PRJ.id = OFF.project_id
LEFT JOIN (
SELECT SUM(paymentamount) payed, invoice_id
FROM payments
) PAY
ON INV.id = PAY.invoice_id
WHERE PRJ.id = {$projectID} ";
$invoiced = $this->get_query_row( 'outstanding' );
$invoiceDetails = $this->get_query_row();
return $invoiced;
return $invoiceDetails;
}
}
+8 -5
View File
@@ -19,17 +19,20 @@
<?php $this->load->view( 'partials/_modals' ); ?>
<!-- /ko -->
<div class="dbois-header">
<div style="position:relative;">
<div style="position:absolute;left:20px;top:1px;z-index:100000">
<div class="menu-button-holder">
<div class=menu-button>
<div class="navbar-header">
<button type="button" id="sidebarCollapse" style="background-color:#E0E0E0" class="btn btn-default navbar-btn">
<i class="glyphicon glyphicon-align-left"></i>
<button type="button" id="sidebarCollapse"
style="background-color:#E0E0E0"
class="btn btn-default navbar-btn">
<i class="glyphicon glyphicon-menu-hamburger"></i>
</button>
</div>
</div>
</div>
<a href="#" class="dbois-exit"
data-bind="click:logOut">uitloggen</a>
<div class="clock"></div>
<i class="icon glyphicon- dbois-exit"></i>
</div>
<div class="wrapper">
<?php $this->load->view( 'partials/_navbar-left' ); ?>
+1 -1
View File
@@ -187,7 +187,7 @@
event:{keyup:validateNumber}">
</div>
<small>
kosten derden (incl btw)
kosten derden (excl btw)
</small>
</div>
</div>
@@ -74,7 +74,7 @@
</tr>
<tr>
<th colspan="4">
<b><h5>openstaand: <span data-bind="text:dbo.helpers.numberWithPoints(Math.round(outstanding()))"></span></h5></b>
<b><h5>te prognotiseren: <span data-bind="text:toForecast"></span></h5></b>
</th>
</tr>
</tfoot>
@@ -26,7 +26,7 @@
<th class="table-cyanish-header align-right">
btw tarief
</th>
<th class="table-cyanish-header" width="40px">
<th class="table-cyanish-header" width="45px">
&nbsp;
</th>
</thead>
@@ -75,20 +75,6 @@
</div>
</div>
<div class="divider"></div>
<label class="col-md-4 col-form-label">eigen omzet</label>
<div class="col-md-8">
<h4 class="form-control-label">
<i class="icon fa-euro"> </i><span data-bind="text:ownRevenue"></span>
</h4>
</div>
<div class="divider"></div>
<label class="col-md-4 col-form-label">overige omzet</label>
<div class="col-md-8">
<h4 class="form-control-label">
<i class="icon fa-euro"> </i><span data-bind="text:otherRevenue"></span>
</h4>
</div>
<div class="divider"></div>
<label class="col-md-4 col-form-label">te besteden uren</label>
<div class="col-md-8">
<h4><span data-bind="text:(totalBudget() - totalHours())"></span></h4>
@@ -97,29 +83,54 @@
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-bordered panel-primary panel-line">
<div class="panel-heading panel-heading-project">
<h3 class="">
Financieel
</h3>
</div>
<div class="panel-body panel-body-project">
<label class="col-md-6 col-form-label">eigen omzet</label>
<div class="col-md-6">
<h4 class="form-control-label">
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:ownRevenue"></span>
</h4>
</div>
<div class="divider"></div>
<label class="col-md-6 col-form-label">overige omzet</label>
<div class="col-md-6">
<h4 class="form-control-label">
<i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:otherRevenue"></span>
</h4>
</div>
<div class="divider"></div>
<label class="col-md-6 col-form-label">Totaal omzet</label>
<div class="col-md-6">
<h4><i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:totalRevenues"></span></h4>
</div>
<div class="divider"></div>
<label class="col-md-6 col-form-label">Totaal gefactureerd</label>
<div class="col-md-6">
<h4><i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:totalInvoiced"></span></h4>
</div>
<div class="divider"></div>
<label class="col-md-6 col-form-label">Nog te factureren</label>
<div class="col-md-6">
<h4><i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:outstanding"></span></h4>
</div>
<div class="divider"></div>
<label class="col-md-6 col-form-label">Totaal betaald</label>
<div class="col-md-6">
<h4><i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:payed"></span></h4>
</div>
<div class="divider"></div>
<label class="col-md-6 col-form-label">Gefactureerd niet betaald</label>
<div class="col-md-6">
<h4><i class="icon fa-euro"> </i><span class="euro-amount" data-bind="text:outstandingInvoices"></span></h4>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="form-group row">-->
<!-- <h4 class="form-control-label">eigen omzet:-->
<!-- <i class="icon fa-euro"> </i><span data-bind="text:ownRevenue"></span>-->
<!-- </h4>-->
<!-- </div>-->
<!-- <div class="form-group row">-->
<!-- <h4 class="form-control-label">overige omzet:-->
<!-- <i class="icon fa-euro"> </i><span data-bind="text:otherRevenue"></span>-->
<!-- </h4>-->
<!-- </div>-->
<!--</div>-->
<!---->
<!---->
<!--<div class="form-group row">-->
<!-- <div class="col-md-4">-->
<!-- <h3>te besteden uren :<span data-bind="text:(totalBudget() - totalHours())"></span></h3>-->
<!-- </div>-->
<!-- <div class="col-md-4">-->
<!-- <h3></h3>-->
<!-- </div>-->
<!--</div>-->
<!--</div>-->
@@ -4,12 +4,8 @@
<label>jaar</label>
</div>
<div class="col-md-2">
<select class="form-control form-control-sm"
data-bind="options:years,
optionsText:'year',
optionsValue: 'year',
value:selectedYear,
event:{change:refreshTab}"></select>
<input type="text" class="form-control" data-bind="textInput:selectedYear, event:{keyup:checkYear}" >
<div class="invalid-feedback" data-bind="visible: ! validYear()">geen geldig jaar</div>
</div>
</div>
<div class="row">
@@ -4,23 +4,23 @@
<table class="table table-condensed table-bordered">
<thead>
<tr class="table-info">
<th>project</th>
<th class="align-right">tarief</th>
<th class="align-right">jan</th>
<th class="align-right">feb</th>
<th class="align-right">mrt</th>
<th class="align-right">apr</th>
<th class="align-right">mei</th>
<th class="align-right">juni</th>
<th class="align-right">juli</th>
<th class="align-right">aug</th>
<th class="align-right">sep</th>
<th class="align-right">okt</th>
<th class="align-right">nov</th>
<th class="align-right">dec</th>
<th class="align-right">tot jaar</th>
<th class="align-right">tot overig</th>
<th class="align-right">grand total</th>
<th class="table-header-blue">project</th>
<th class="align-right table-header-blue">tarief</th>
<th class="align-right table-header-blue">jan</th>
<th class="align-right table-header-blue">feb</th>
<th class="align-right table-header-blue">mrt</th>
<th class="align-right table-header-blue">apr</th>
<th class="align-right table-header-blue">mei</th>
<th class="align-right table-header-blue">juni</th>
<th class="align-right table-header-blue">juli</th>
<th class="align-right table-header-blue">aug</th>
<th class="align-right table-header-blue">sep</th>
<th class="align-right table-header-blue">okt</th>
<th class="align-right table-header-blue">nov</th>
<th class="align-right table-header-blue">dec</th>
<th class="align-right table-header-blue">tot jaar</th>
<th class="align-right table-header-blue">tot overig</th>
<th class="align-right table-header-blue">grand total</th>
</tr>
</thead>
<tbody data-bind="foreach:myData">
@@ -80,51 +80,51 @@
</tbody>
<tfoot>
<tr class="table-info">
<th>totaal</th>
<th>&nbsp;</th>
<th class="align-right">
<th class="table-header-blue">totaal</th>
<th class="table-header-blue">&nbsp;</th>
<th class="align-right table-header-blue">
<span data-bind="text:totalJanuari "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalFebruari "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalMaart "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalApril "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalMei "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalJuni "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalJuli "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalAugustus"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalSeptember "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalOktober "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalNovember "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalDecember "></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalTotal().toFixed(1)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalTotalOtheryears().toFixed(1)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:(totalTotalOtheryears() + totalTotal()).toFixed(1)"></span>
</th>
</tr>
@@ -132,17 +132,17 @@
</table>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="graph-holder">
<canvas data-bind="attr:{id: 'hours-per-month-' + slug}" id="" height="300"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="graph-holder">
<canvas data-bind="attr:{id: 'hours-per-project-' + slug}" id="" height="300"></canvas>
</div>
</div>
</div>
<!--<div class="row">-->
<!-- <div class="col-md-6">-->
<!-- <div class="graph-holder">-->
<!-- <canvas data-bind="attr:{id: 'hours-per-month-' + slug}" id="" height="300"></canvas>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-md-6">-->
<!-- <div class="graph-holder">-->
<!-- <canvas data-bind="attr:{id: 'hours-per-project-' + slug}" id="" height="300"></canvas>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
@@ -4,23 +4,23 @@
<table class="table table-condensed table-bordered">
<thead>
<tr class="table-info">
<th>project</th>
<th class="align-right">tarief</th>
<th class="align-right">jan</th>
<th class="align-right">feb</th>
<th class="align-right">mrt</th>
<th class="align-right">apr</th>
<th class="align-right">mei</th>
<th class="align-right">juni</th>
<th class="align-right">juli</th>
<th class="align-right">aug</th>
<th class="align-right">sep</th>
<th class="align-right">okt</th>
<th class="align-right">nov</th>
<th class="align-right">dec</th>
<th class="align-right">tot jaar</th>
<th class="align-right">tot overig</th>
<th class="align-right">grand total</th>
<th class="table-header-blue">project</th>
<th class="align-right table-header-blue">tarief</th>
<th class="align-right table-header-blue">jan</th>
<th class="align-right table-header-blue">feb</th>
<th class="align-right table-header-blue">mrt</th>
<th class="align-right table-header-blue">apr</th>
<th class="align-right table-header-blue">mei</th>
<th class="align-right table-header-blue">juni</th>
<th class="align-right table-header-blue">juli</th>
<th class="align-right table-header-blue">aug</th>
<th class="align-right table-header-blue">sep</th>
<th class="align-right table-header-blue">okt</th>
<th class="align-right table-header-blue">nov</th>
<th class="align-right table-header-blue">dec</th>
<th class="align-right table-header-blue">tot jaar</th>
<th class="align-right table-header-blue">tot overig</th>
<th class="align-right table-header-blue">grand total</th>
</tr>
</thead>
<tbody data-bind="foreach:myData">
@@ -80,51 +80,51 @@
</tbody>
<tfoot>
<tr class="table-info">
<th>totaal</th>
<th>&nbsp;</th>
<th class="align-right">
<th class="table-header-blue">totaal</th>
<th class="table-header-blue">&nbsp;</th>
<th class="align-right table-header-blue">
<span data-bind="text:totalJanuariRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalFebruariRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalMaartRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalAprilRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalMeiRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalJuniRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalJuliRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalAugustusRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalSeptemberRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalOktoberRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalNovemberRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalDecemberRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalTotalRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:totalTotalOtheryearsRevenue().toFixed(0)"></span>
</th>
<th class="align-right">
<th class="align-right table-header-blue">
<span data-bind="text:(totalTotalOtheryearsRevenue() + totalTotalRevenue()).toFixed(0)"></span>
</th>
</tr>
@@ -132,15 +132,15 @@
</table>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="graph-holder">
<canvas data-bind="attr:{id: 'revenue-per-month-' + slug}" height="300"></canvas>
</div>
</div>
<div class="col-md-6">
<div class="graph-holder">
<canvas data-bind="attr:{id: 'revenue-per-project-' + slug}" height="300"></canvas>
</div>
</div>
</div>
<!--<div class="row">-->
<!-- <div class="col-md-6">-->
<!-- <div class="graph-holder">-->
<!-- <canvas data-bind="attr:{id: 'revenue-per-month-' + slug}" height="300"></canvas>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-md-6">-->
<!-- <div class="graph-holder">-->
<!-- <canvas data-bind="attr:{id: 'revenue-per-project-' + slug}" height="300"></canvas>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
@@ -73,9 +73,9 @@
<!-- <th class="align-right">-->
<!-- <span data-bind="text:saldo"></span>-->
<!-- </th>-->
<th class="align-right">
<span data-bind="text:workInProgress"></span>
</th>
<!-- <th class="align-right">-->
<!-- <span data-bind="text:workInProgress"></span>-->
<!-- </th>-->
<!-- ko foreach:invoiced -->
<th class="align-right">
<span data-bind="text:invoiced"></span>
@@ -106,9 +106,9 @@
<!-- <th class="align-right">-->
<!-- <span data-bind="text:totalSaldo"></span>-->
<!-- </th>-->
<th class="align-right">
<span data-bind="text:totalWorkInProgress"></span>
</th>
<!-- <th class="align-right">-->
<!-- <span data-bind="text:totalWorkInProgress"></span>-->
<!-- </th>-->
<!-- ko foreach:totalInvoicedYear -->
<th class="align-right">
<span data-bind="text:totalInvoiced"></span>
@@ -117,22 +117,22 @@
</tr>
</tfoot>
</table>
<div class="row">
<div class="col-md-3">
<div class="graph-holder" style="min-height:350px">
<canvas id="recap-revenues" width="300px"></canvas>
<div id="recap-revenues-legends"></div>
</div>
</div>
<div class="col-md-3">
<div class="graph-holder" style="min-height:350px">
<canvas id="recap-revenues-project" width="300px"></canvas>
<div id="recap-revenues-project-legends"></div>
</div>
</div>
<div class="col-md-6">
<div class="graph-holder" style="min-height:350px">
<canvas id="recap-owh" width="300px"></canvas>
</div>
</div>
</div>
<!--<div class="row">-->
<!-- <div class="col-md-3">-->
<!-- <div class="graph-holder" style="min-height:350px">-->
<!-- <canvas id="recap-revenues" width="300px"></canvas>-->
<!-- <div id="recap-revenues-legends"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-md-3">-->
<!-- <div class="graph-holder" style="min-height:350px">-->
<!-- <canvas id="recap-revenues-project" width="300px"></canvas>-->
<!-- <div id="recap-revenues-project-legends"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-md-6">-->
<!-- <div class="graph-holder" style="min-height:350px">-->
<!-- <canvas id="recap-owh" width="300px"></canvas>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
+18
View File
@@ -350,6 +350,14 @@ th.focus-green{
opacity: 0;
}
.euro-amount {
float: right;
width: 150px;
position: relative;
right: 150px;
text-align: right;
}
/*************** RESERVATIONS *******************/
@@ -362,5 +370,15 @@ th.focus-green{
color: #fff;
}
/**********REPORTS****************/
.table-header-blue {
background-color:#3e8ef7;
color: #fff;
}
.invalid-feedback {
font-size: .7em;
color: red;
}
+14 -1
View File
@@ -239,11 +239,20 @@ ul.CTAs a {
}
/***********HEADER**************/
.menu-button-holder {
position: relative;
}
.menu-button {
position: absolute;
z-index: 10000;
left: 5px;
top: -2px;
}
.dbois-header {
position: relative;
width: 100%;
height: 50px;
height: 40px;
background-color: #263238;
}
.clock {
@@ -254,5 +263,9 @@ ul.CTAs a {
}
.dbois-exit {
float:right;
color: #fff;
font-size: 14px;
margin-top: 5px;
margin-right:10px;
}
@@ -70,6 +70,12 @@ dbo.userDataService = {
.done( function ( data ) {
callback( data );
} );
},
logOut : function(callback){
$.get('index.php/login/logout', function(){
callback();
});
}
}
+67 -41
View File
@@ -9,44 +9,51 @@ $( function () {
var timeout;
dbo.editProjectModal = {
offers : ko.observableArray( [] ),
projectEmployees : ko.observableArray( [] ),
customers : ko.observableArray( [] ),
users : ko.observableArray( [] ),
invoices : ko.observableArray( [] ),
projecthours : ko.observableArray( [] ),
offerFiles : ko.observableArray( [] ),
offerComments : ko.observableArray( [] ),
projectFiles : ko.observableArray( [] ),
projectComments : ko.observableArray( [] ),
externals : ko.observableArray( [] ),
projectcosts : ko.observableArray( [] ),
vats : ko.observableArray( [] ),
availableEmployees: ko.observableArray( [] ),
forecasts : ko.observableArray( [] ),
reservations : ko.observableArray( [] ),
showProject : ko.observable( false ),
projectID : null,
callback : null,
customerID : ko.observable( null ),
projectnumber : ko.observable(),
projectleaderID : ko.observable(),
archive : ko.observable( false ),
startdate : ko.observable( null ),
enddate : ko.observable( null ),
projectname : ko.observable(),
busy : false,
ownRevenue : ko.observable(),
otherRevenue : ko.observable(),
projectname : ko.observable(),
years : ko.observableArray( dbo.years ),
months : ko.observableArray( dbo.monthArray ),
outstanding : ko.observable(),
toForecast : ko.observable(),
totalForecast : ko.observable(),
documents : ko.observableArray( [] ),
comments : ko.observableArray( [] ),
activeTab : ko.observable(),
offers : ko.observableArray( [] ),
projectEmployees : ko.observableArray( [] ),
customers : ko.observableArray( [] ),
users : ko.observableArray( [] ),
invoices : ko.observableArray( [] ),
projecthours : ko.observableArray( [] ),
offerFiles : ko.observableArray( [] ),
offerComments : ko.observableArray( [] ),
projectFiles : ko.observableArray( [] ),
projectComments : ko.observableArray( [] ),
externals : ko.observableArray( [] ),
projectcosts : ko.observableArray( [] ),
vats : ko.observableArray( [] ),
availableEmployees : ko.observableArray( [] ),
forecasts : ko.observableArray( [] ),
reservations : ko.observableArray( [] ),
showProject : ko.observable( false ),
projectID : null,
callback : null,
customerID : ko.observable( null ),
projectnumber : ko.observable(),
projectleaderID : ko.observable(),
archive : ko.observable( false ),
startdate : ko.observable( null ),
enddate : ko.observable( null ),
projectname : ko.observable(),
busy : false,
ownRevenue : ko.observable(),
otherRevenue : ko.observable(),
projectname : ko.observable(),
years : ko.observableArray( dbo.years ),
months : ko.observableArray( dbo.monthArray ),
outstanding : ko.observable(),
toForecast : ko.observable(),
totalForecast : ko.observable(),
documents : ko.observableArray( [] ),
comments : ko.observableArray( [] ),
activeTab : ko.observable(),
totalRevenues : ko.observable(),
totalInvoiced : ko.observable(),
outstanding : ko.observable(),
outstandingInvoices: ko.observable(),
payed : ko.observable(),
toForecast : ko.observable(),
toInvoice : 0,
init: function () {
var vm = dbo.editProjectModal;
@@ -488,6 +495,7 @@ $( function () {
dbo.projectDataService.saveForecast( submitDATA, function ( data ) {
if ( data.success ) self.id = data.forecastID;
vm.toForecasting();
} );
},
@@ -723,7 +731,12 @@ $( function () {
vm.enddate( dbo.helpers.mysql2date( data.enddate ) );
vm.projectnumber( data.projectnumber );
vm.projectname( data.projectname );
vm.outstanding( data.outstanding );
vm.totalRevenues( dbo.helpers.numberWithPoints( Math.round( Number( data.invoiceDetails.totalrevenue ) ) ) );
vm.totalInvoiced( dbo.helpers.numberWithPoints( Math.round( Number( data.invoiceDetails.totalinvoiced ) ) ) );
vm.outstanding( dbo.helpers.numberWithPoints( Math.round( Number( data.invoiceDetails.totalrevenue ) ) - Math.round( Number( data.invoiceDetails.totalinvoiced ) ) ) );
vm.outstandingInvoices( dbo.helpers.numberWithPoints( Math.round( Number( data.invoiceDetails.totalinvoiced ) ) - Math.round( Number( data.invoiceDetails.payed ) ) ) );
vm.payed( dbo.helpers.numberWithPoints( Math.round( Number( data.invoiceDetails.payed ) ) ) );
vm.toInvoice = Math.round( Number( data.invoiceDetails.totalrevenue ) ) - Math.round( Number( data.invoiceDetails.totalinvoiced ) );
vm.projectEmployees.removeAll();
vm.projecthours.removeAll();
@@ -746,8 +759,8 @@ $( function () {
vm.offers.removeAll();
_.each( data.offers, function ( p, i ) {
if ( i == 0 ) {
vm.ownRevenue( p.own_revenue );
vm.otherRevenue( p.other_revenue );
vm.ownRevenue( dbo.helpers.numberWithPoints( Math.round( Number( p.own_revenue ) ) ) );
vm.otherRevenue( dbo.helpers.numberWithPoints( Math.round( Number( p.other_revenue ) ) ) );
}
vm.offers.push( new dbo.offersService.Offer( p ) );
} );
@@ -762,6 +775,8 @@ $( function () {
vm.forecasts.push( new vm.Forecast( p ) );
} );
vm.toForecasting();
vm.reservations.removeAll();
_.each( data.reservations, function ( p ) {
vm.reservations.push( new vm.Reservation( p ) );
@@ -776,6 +791,17 @@ $( function () {
} );
},
toForecasting: function () {
var vm = dbo.editProjectModal;
console.log( vm.toInvoice );
vm.toForecast( vm.toInvoice );
_.each( vm.forecasts(), function ( p ) {
console.log( p.forecastamount );
vm.toForecast( vm.toForecast() - Number( p.forecastamount() ) );
} );
vm.toForecast( dbo.helpers.numberWithPoints( Number( vm.toForecast() ) ) );
},
Projectemployee: function ( data ) {
var self = this;
+7
View File
@@ -32,6 +32,13 @@ $( function () {
} );
},
logOut : function(){
dbo.userDataService.logOut(function(){
location.reload();
});
},
setPage: function ( page ) {
var vm = dbo.menuModel;
@@ -6,6 +6,7 @@
*/
dbo.monthlyemployeehoursInit = function () {
var timeout;
if ( dbo.monthlyEmployeeHoursModel !== undefined ) {
@@ -34,6 +35,7 @@ dbo.monthlyemployeehoursInit = function () {
totalSaldo : ko.observable(),
totalWorkInProgress : ko.observable(),
totalInvoicedYear : ko.observableArray( [] ),
validYear : ko.observable(true),
init: function () {
var vm = dbo.monthlyEmployeeHoursModel;
@@ -55,7 +57,7 @@ dbo.monthlyemployeehoursInit = function () {
vm.totalSaldo( 0 );
vm.totalWorkInProgress( 0 );
vm.totalEmployeeRevenues( 0 );
vm.totalAvailableRevenues(0)
vm.totalAvailableRevenues( 0 )
vm.totalEmployeeHours( 0 );
vm.totalEmployeeAvailableHours( 0 );
vm.totalPerEmployee.removeAll();
@@ -84,7 +86,7 @@ dbo.monthlyemployeehoursInit = function () {
vm.totalSaldo( dbo.helpers.thousandSeparator( vm.totalSaldo() ) );
vm.totalWorkInProgress( dbo.helpers.thousandSeparator( vm.totalWorkInProgress() ) );
vm.totalEmployeeRevenues( dbo.helpers.thousandSeparator( vm.totalEmployeeRevenues() ) );
vm.totalAvailableRevenues( dbo.helpers.thousandSeparator( vm.totalAvailableRevenues() ) );
vm.totalAvailableRevenues( dbo.helpers.thousandSeparator( vm.totalEmployeeRevenues() < 0 ? 0 :vm.totalEmployeeRevenues() ) );
vm.totalEmployeeHours( dbo.helpers.thousandSeparator( vm.totalEmployeeHours() ) );
_.each( vm.totalPerEmployee(), function ( p ) {
p.totalRevenue( dbo.helpers.thousandSeparator( p.totalRevenue() ) );
@@ -108,12 +110,27 @@ dbo.monthlyemployeehoursInit = function () {
chartDataOwh.push( Number( p.workInProgress.replace( '.', '' ) ) );
chartColorOwh.push( Number( p.workInProgress.replace( '.', '' ) ) < 0 ? '#d53d24' : '#78be4b' );
} );
dbo.charts.drawPie( 'recap-revenues', chartData, chartLabels, 'omzet per medewerker' );
dbo.charts.drawPie( 'recap-revenues-project', chartDataProjects, chartLabelsProjects, 'omzet per project' );
dbo.charts.drawHoursChart( 'recap-owh', chartDataOwh, chartLabelsProjects, 'onderhandenwerk per project', chartColorOwh );
// dbo.charts.drawPie( 'recap-revenues', chartData, chartLabels, 'omzet per medewerker' );
// dbo.charts.drawPie( 'recap-revenues-project', chartDataProjects, chartLabelsProjects, 'omzet per project' );
// dbo.charts.drawHoursChart( 'recap-owh', chartDataOwh, chartLabelsProjects, 'onderhandenwerk per project', chartColorOwh );
} );
},
checkYear: function () {
var vm = dbo.monthlyEmployeeHoursModel;
if ( timeout ) {
clearTimeout( timeout );
timeout = null;
}
timeout = setTimeout( function () {
vm.validYear( true );
if ( !Number.isInteger( Number( vm.selectedYear() ) ) ) return vm.validYear( false );
if ( Number( vm.selectedYear() ) > 2100 ) return vm.validYear( false );
if ( Number( vm.selectedYear() ) < 2000 ) return vm.validYear( false );
vm.initModule();
}, 700 );
},
refreshTab: function () {
var vm = dbo.monthlyEmployeeHoursModel;
@@ -191,7 +208,7 @@ dbo.monthlyemployeehoursInit = function () {
vm.currentTab.chartData = [vm.currentTab.totalJanuari(), vm.currentTab.totalFebruari(), vm.currentTab.totalMaart(), vm.currentTab.totalApril(), vm.currentTab.totalMei(), vm.currentTab.totalJuni(), vm.currentTab.totalJuli(), vm.currentTab.totalAugustus(), vm.currentTab.totalSeptember(), vm.currentTab.totalOktober(), vm.currentTab.totalNovember(), vm.currentTab.totalDecember()];
vm.currentTab.chartRevenueData = [vm.currentTab.totalJanuariRevenue(), vm.currentTab.totalFebruariRevenue(), vm.currentTab.totalMaartRevenue(), vm.currentTab.totalAprilRevenue(), vm.currentTab.totalMeiRevenue(), vm.currentTab.totalJuniRevenue(), vm.currentTab.totalJuliRevenue(), vm.currentTab.totalAugustusRevenue(), vm.currentTab.totalSeptemberRevenue(), vm.currentTab.totalOktoberRevenue(), vm.currentTab.totalNovemberRevenue(), vm.currentTab.totalDecemberRevenue()];
vm.drawCharts( vm.currentTab );
// vm.drawCharts( vm.currentTab );
} );
},