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