diversen nav opmerkingen

This commit is contained in:
2018-03-21 17:23:58 +01:00
parent 3241cc0c67
commit e89dc41e18
23 changed files with 404 additions and 154 deletions
@@ -24,9 +24,11 @@ dbo.monthlyemployeehoursInit = function () {
recap : ko.observableArray( [] ),
totalPerEmployee : ko.observableArray( [] ),
totalEmployeeRevenues : ko.observable(),
totalAvailableRevenues : ko.observable(),
totalEmployeeHours : ko.observable(),
totalEmployeeAvailableHours: ko.observable(),
totalBudget : ko.observable(),
totalOwnRevenue : ko.observable(),
totalCosts : ko.observable(),
totalAvailableBudget : ko.observable(),
totalSaldo : ko.observable(),
@@ -37,12 +39,8 @@ dbo.monthlyemployeehoursInit = function () {
var vm = dbo.monthlyEmployeeHoursModel;
dbo.reportsDataService.getUsedYears( function ( data ) {
vm.years.removeAll();
$.each( data, function ( i, p ) {
vm.years.push( {id: p.year, year: p.year} );
} );
vm.selectedYear( (new Date()).getFullYear() );
vm.years( dbo.years )
vm.selectedYear( dbo.currentYear );
} );
vm.initModule();
@@ -51,11 +49,13 @@ dbo.monthlyemployeehoursInit = function () {
initModule: function () {
var vm = dbo.monthlyEmployeeHoursModel;
vm.totalBudget( 0 );
vm.totalOwnRevenue( 0 );
vm.totalCosts( 0 );
vm.totalAvailableBudget( 0 );
vm.totalSaldo( 0 );
vm.totalWorkInProgress( 0 );
vm.totalEmployeeRevenues( 0 );
vm.totalAvailableRevenues(0)
vm.totalEmployeeHours( 0 );
vm.totalEmployeeAvailableHours( 0 );
vm.totalPerEmployee.removeAll();
@@ -78,11 +78,13 @@ dbo.monthlyemployeehoursInit = function () {
vm.recap.push( new vm.Project( p ) )
} );
vm.totalBudget( dbo.helpers.thousandSeparator( vm.totalBudget() ) );
vm.totalOwnRevenue( dbo.helpers.thousandSeparator( vm.totalOwnRevenue() ) );
vm.totalCosts( dbo.helpers.thousandSeparator( vm.totalCosts() ) );
vm.totalAvailableBudget( dbo.helpers.thousandSeparator( vm.totalAvailableBudget() ) );
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.totalEmployeeHours( dbo.helpers.thousandSeparator( vm.totalEmployeeHours() ) );
_.each( vm.totalPerEmployee(), function ( p ) {
p.totalRevenue( dbo.helpers.thousandSeparator( p.totalRevenue() ) );
@@ -286,8 +288,10 @@ dbo.monthlyemployeehoursInit = function () {
self.revenues = dbo.helpers.thousandSeparator( data.budget );
self.hours = data.hours;
self.totalEmpoloyeeRevenues = 0;
self.availableRevenue = data.own_revenue - data.projectEuros;
self.externCosts = dbo.helpers.thousandSeparator( data.projectcosts );
self.budget = dbo.helpers.thousandSeparator( data.budget );
self.ownRevenue = dbo.helpers.thousandSeparator( data.own_revenue );
self.budgetAvailable = dbo.helpers.thousandSeparator( data.budgetAvailable );
self.saldo = dbo.helpers.thousandSeparator( data.saldo );
@@ -300,10 +304,12 @@ dbo.monthlyemployeehoursInit = function () {
self.totalEmployeeRevenues = data.projectEuros;
self.totalEmployeeHours = data.projectHours;
self.hoursAvailable = data.hoursAvailable;
vm.totalAvailableRevenues( vm.totalAvailableRevenues() + self.availableRevenue );
vm.totalEmployeeRevenues( vm.totalEmployeeRevenues() + Number( self.totalEmployeeRevenues ) );
vm.totalEmployeeHours( vm.totalEmployeeHours() + Number( self.totalEmployeeHours ) );
vm.totalEmployeeAvailableHours( vm.totalEmployeeAvailableHours() + Number( self.hoursAvailable ) );
self.totalEmployeeRevenues = dbo.helpers.thousandSeparator( self.totalEmployeeRevenues );
self.availableRevenue = dbo.helpers.thousandSeparator( self.availableRevenue );
self.workInProgress = dbo.helpers.thousandSeparator( data.workInProgress );
self.hoursAvailable = data.hoursAvailable;
@@ -319,8 +325,9 @@ dbo.monthlyemployeehoursInit = function () {
var vm = dbo.monthlyEmployeeHoursModel;
vm.totalBudget( vm.totalBudget() + Number( data.budget ) );
vm.totalOwnRevenue( vm.totalOwnRevenue() + Number( data.own_revenue ) );
vm.totalCosts( vm.totalCosts() + Number( data.projectcosts ) );
vm.totalAvailableBudget( vm.totalAvailableBudget() + Number( data.budgetAvailable ) );
vm.totalAvailableBudget( vm.totalAvailableBudget() + Number( data.ownRevenueAvailable ) );
vm.totalSaldo( vm.totalSaldo() + Number( data.saldo ) );
vm.totalWorkInProgress( vm.totalWorkInProgress() + Number( data.workInProgress ) );