Diversen nav opmerkingen
This commit is contained in:
@@ -51,19 +51,14 @@ dbo.employeehoursreportInit = function () {
|
||||
var vm = dbo.employeeHoursreportModel;
|
||||
|
||||
vm.initialize = true;
|
||||
dbo.reportsDataService.getUsedYears( function ( data ) {
|
||||
vm.years.removeAll();
|
||||
_.each( data, function ( p ) {
|
||||
vm.years.push( {id: p.year, year: p.year} );
|
||||
} );
|
||||
|
||||
vm.selectedYear( (new Date()).getFullYear() );
|
||||
vm.selectedMonthID( 0 );
|
||||
vm.selectedYear( (new Date()).getFullYear() );
|
||||
vm.selectedMonthID( 0 );
|
||||
vm.validYear( true );
|
||||
|
||||
vm.initialize = false;
|
||||
vm.initialize = false;
|
||||
|
||||
vm.initModule();
|
||||
} );
|
||||
vm.initModule();
|
||||
},
|
||||
|
||||
initModule: function () {
|
||||
@@ -73,18 +68,13 @@ dbo.employeehoursreportInit = function () {
|
||||
},
|
||||
|
||||
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 );
|
||||
var vm = dbo.employeeHoursreportModel;
|
||||
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.validYear( true );
|
||||
|
||||
vm.initModule();
|
||||
},
|
||||
|
||||
setActivetab: function ( tab ) {
|
||||
@@ -125,7 +115,7 @@ dbo.employeehoursreportInit = function () {
|
||||
vm.nonprofitablehoursTotaal( Math.round( vm.nonprofitablehoursTotaal() + Number( p.nonprofitablehours ) ) );
|
||||
vm.nonprojecthoursTotaal( Math.round( vm.nonprojecthoursTotaal() + Number( p.nonprojecthours ) ) );
|
||||
vm.totalhoursTotaal( Math.round( vm.totalhoursTotaal() + Number( p.totalhours ) ) );
|
||||
vm.targetTotaal( Math.round( vm.targetTotaal() + Number( p.targethours / 12 ) ) );
|
||||
vm.targetTotaal( Math.round( vm.targetTotaal() + Number( p.targethours ) ) );
|
||||
vm.revenuesTotaal( Number( vm.revenuesTotaal() ) + Number( p.revenues ) );
|
||||
|
||||
chartData.labels.push( p.fullname );
|
||||
@@ -135,7 +125,7 @@ dbo.employeehoursreportInit = function () {
|
||||
} );
|
||||
vm.occupancyRateTotalTotaal( Math.round( (vm.totalhoursTotaal() / vm.targetTotaal()) * 100 ) );
|
||||
vm.occupancyRateHoursTotaal( Math.round( (vm.profitablehoursTotaal() / vm.totalhoursTotaal()) * 100 ) );
|
||||
vm.occupancyRateInvoiceTotaal(Math.round( (vm.profitablehoursTotaal() / vm.targetTotaal()) * 100 ));
|
||||
vm.occupancyRateInvoiceTotaal( Math.round( (vm.profitablehoursTotaal() / vm.targetTotaal()) * 100 ) );
|
||||
vm.averageDayRateTotaal( Math.round( Number( vm.revenuesTotaal() ) / Number( vm.profitablehoursTotaal() ) ) * 8 );
|
||||
vm.revenuesTotaal( dbo.helpers.thousandSeparator( vm.revenuesTotaal() ) );
|
||||
|
||||
@@ -160,10 +150,10 @@ dbo.employeehoursreportInit = function () {
|
||||
this.nonprofitablehours = data.nonprofitablehours;
|
||||
this.nonprojecthours = data.nonprojecthours;
|
||||
this.totalhours = Math.round( data.totalhours );
|
||||
this.target = Math.round( data.targethours / 12 );
|
||||
this.occupancyRateTotal = Math.round( (data.totalhours / (data.targethours / 12)) * 100 );
|
||||
this.target = dbo.helpers.numberWithPoints( Math.round( data.targethours ) );
|
||||
this.occupancyRateTotal = Math.round( (data.totalhours / data.targethours) * 100 );
|
||||
this.occupancyRateHours = Math.round( (data.profitablehours / data.totalhours) * 100 );
|
||||
this.occupancyRateInvoice = Math.round( (data.profitablehours / (data.targethours / 12)) * 100 );
|
||||
this.occupancyRateInvoice = Math.round( (data.profitablehours / data.targethours) * 100 );
|
||||
this.revenues = dbo.helpers.thousandSeparator( data.revenues );
|
||||
this.averageDayRate = Math.round( (data.revenues / data.profitablehours) * 8 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user