diuversen opmerkingen 19062018

This commit is contained in:
2018-07-14 16:56:42 +02:00
parent 124be78a85
commit cecbfd83fb
20 changed files with 266 additions and 67 deletions
+7
View File
@@ -1,3 +1,6 @@
/* @override
http://dbois.local/css/correction.css?* */
body{
padding-top:0;
/*font-size:12px;*/
@@ -58,3 +61,7 @@ body{
color: #000;
}
.form-control-xsm {
padding: 0px 3px;
}
+4
View File
@@ -111,6 +111,10 @@ th.focus-green{
border-bottom: 1px solid red !important;
}
.red-border{
border: 2px solid red !important;
}
/*********SWITCH************/
.onoffswitch {
position: relative;
@@ -0,0 +1,20 @@
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 20/06/2018
* Time: 14:15
*/
dbo.authorisationDataService = {
getRoleAuthorisations: function ( callback ) {
$.getJSON( 'index.php/beheer/AuthorisationController/getRoleAuthorisations' )
.done( function ( data ) {
callback( data );
} );
}
}
@@ -8,14 +8,14 @@
dbo.employeeTargetDataService = {
getEmployeeTargets: function ( employeeID, callback ) {
$.getJSON( 'index.php/beheer/employeetargetController/getEmployeeTargets/' + employeeID )
$.getJSON( 'index.php/beheer/employeeTargetController/getEmployeeTargets/' + employeeID )
.done( function ( data ) {
callback( data );
} );
},
saveEmployeeTarget: function ( submitDATA, callback ) {
$.post( 'index.php/beheer/employeetargetController/saveEmployeeTarget', submitDATA, function () {
$.post( 'index.php/beheer/employeeTargetController/saveEmployeeTarget', submitDATA, function () {
}, 'json' )
.done( function ( data ) {
callback( data );
@@ -27,6 +27,13 @@ dbo.reportsDataService = {
.done( function ( data ) {
callback( data );
} );
},
saveCurrentFinnacialYear: function(projectID, amount, callback){
$.post( 'index.php/reports/reportsController/saveCurrentFinnacialYear/' + projectID, {amount:amount} )
.done( function ( data ) {
callback( data );
}, 'json' );
}
}
@@ -0,0 +1,37 @@
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 20/06/2018
* Time: 14:11
*/
dbo.authorisationInit = function () {
if ( dbo.authorisationModel !== undefined ) {
} else {
dbo.authorisationModel = {
roles : ko.observableArray([]) ,
init: function () {
var self = dbo.authorisationModel;
self.refreshPageAuthorisations();
},
refreshPageAuthorisations: function () {
dbo.authorisationDataService.getRoleAuthorisations( function ( data ) {
console.log( data );
} );
}
};
dbo.authorisationModel.init();
ko.applyBindings( dbo.authorisationModel, document.getElementById( 'AUTHORISATION' ) );
}
};
@@ -35,6 +35,8 @@ dbo.monthlyemployeehoursInit = function () {
totalSaldo : ko.observable(),
totalOwp : ko.observable(),
totalWorkInProgress : ko.observable(),
totalCurrentFinancialYear : ko.observable(),
totalNextFinancialYear : ko.observable(),
totalInvoicedYear : ko.observableArray( [] ),
validYear : ko.observable( true ),
@@ -62,6 +64,8 @@ dbo.monthlyemployeehoursInit = function () {
vm.totalEmployeeHours( 0 );
vm.totalEmployeeAvailableHours( 0 );
vm.totalOwp( 0 );
vm.totalCurrentFinancialYear( 0 );
vm.totalNextFinancialYear( 0 );
vm.totalPerEmployee.removeAll();
vm.totalInvoicedYear.removeAll();
dbo.userDataService.getUniqueProjectEmployees( function ( data ) {
@@ -300,6 +304,7 @@ dbo.monthlyemployeehoursInit = function () {
var vm = dbo.monthlyEmployeeHoursModel;
var self = this;
self.projectID = data.id
self.projectnumber = data.projectnumber;
self.instroom = data.instroom;
self.uitstroom = data.uitstroom;
@@ -309,7 +314,14 @@ dbo.monthlyemployeehoursInit = function () {
self.hours = data.hours;
self.totalEmpoloyeeRevenues = 0;
self.availableRevenue = data.own_revenue - data.projectEuros;
self.owp = self.availableRevenue < 0 ? 0 : self.availableRevenue;
self.owpNumber = self.availableRevenue < 0 ? 0 : self.availableRevenue;
self.owp = self.owpNumber;
self.currentFinancialYear = ko.observable( data.current_financial_year );
self.pristine = ko.observable( true );
self.nextFinancialYears = ko.pureComputed( function () {
return dbo.helpers.thousandSeparator( Number( self.owpNumber ) - Number( self.currentFinancialYear() ) );
} );
self.externCosts = dbo.helpers.thousandSeparator( data.projectcosts );
self.budget = dbo.helpers.thousandSeparator( data.budget );
self.ownRevenue = dbo.helpers.thousandSeparator( data.own_revenue );
@@ -393,11 +405,53 @@ dbo.monthlyemployeehoursInit = function () {
this.hours = data.hours;
this.budget = data.budget;
this.availableHours = data.availableHours;
},
saveCurrentFinancialYear: function () {
var self = this;
self.pristine( false );
self.currentFinancialYear( dbo.helpers.validateNumber( self.currentFinancialYear() ) );
if ( timeout ) {
clearTimeout( timeout );
timeout = null;
}
timeout = setTimeout( function () {
if ( self.currentFinancialYear().length == 0 ) self.currentFinancialYear( 0 );
dbo.reportsDataService.saveCurrentFinnacialYear(
self.projectID, self.currentFinancialYear(), function () {
self.pristine( true );
} );
}, 400 );
}
};
dbo.monthlyEmployeeHoursModel.init();
dbo.monthlyEmployeeHoursModel.totalCurrentFinancialYear = ko.pureComputed( function () {
var totalCurrentFinancialYear = 0
var vm = dbo.monthlyEmployeeHoursModel;
_.each( vm.recap(), function ( p ) {
totalCurrentFinancialYear += Number( p.currentFinancialYear() );
} );
return dbo.helpers.thousandSeparator( totalCurrentFinancialYear );
} );
dbo.monthlyEmployeeHoursModel.totalNextFinancialYear = ko.pureComputed( function () {
var totalNextFinancialYear = 0
var vm = dbo.monthlyEmployeeHoursModel;
_.each( vm.recap(), function ( p ) {
totalNextFinancialYear += Number( p.owpNumber ) - Number( p.currentFinancialYear() );
} );
return dbo.helpers.thousandSeparator( totalNextFinancialYear );
} );
ko.applyBindings( dbo.monthlyEmployeeHoursModel, document.getElementById( "MONTHLYEMPLOYEEHOURS" ) );
}