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,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 );
} );
},