Diverse wijzigingen

This commit is contained in:
2018-05-05 13:22:14 +02:00
parent 860c5db95a
commit b589058437
13 changed files with 105 additions and 41 deletions
+12 -6
View File
@@ -42,16 +42,16 @@ $( function () {
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(),
totalRevenuesIncl : ko.observable(),
outstanding : ko.observable(),
outstandingInvoices: ko.observable(),
payed : ko.observable(),
totalForecast : ko.observable(),
toForecast : ko.observable(),
toInvoice : 0,
@@ -186,6 +186,7 @@ $( function () {
p.inEdit( false );
}
} );
vm.toForecasting();
},
editReservation: function () {
@@ -724,6 +725,8 @@ $( function () {
vm.busy = true;
dbo.projectDataService.getProject( vm.projectID, function ( data ) {
var totalRevenuesIncl = Math.round( (data.invoiceDetails.totalrevenue * (data.vatrate + 100)) / 100 );
vm.id = data.id
vm.projectleaderID( data.projectleader_id );
vm.customerID( data.customer_id );
@@ -732,11 +735,12 @@ $( function () {
vm.projectnumber( data.projectnumber );
vm.projectname( data.projectname );
vm.totalRevenues( dbo.helpers.numberWithPoints( Math.round( Number( data.invoiceDetails.totalrevenue ) ) ) );
vm.totalRevenuesIncl( dbo.helpers.numberWithPoints( totalRevenuesIncl ));
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.outstanding( dbo.helpers.numberWithPoints( Math.round( Number( totalRevenuesIncl ) ) - 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.toInvoice = Math.round( totalRevenuesIncl - Number( data.invoiceDetails.totalinvoiced ) );
vm.projectEmployees.removeAll();
vm.projecthours.removeAll();
@@ -793,13 +797,15 @@ $( function () {
toForecasting: function () {
var vm = dbo.editProjectModal;
console.log( vm.toInvoice );
vm.totalForecast(0);
vm.toForecast( vm.toInvoice );
_.each( vm.forecasts(), function ( p ) {
console.log( p.forecastamount );
vm.totalForecast( vm.totalForecast() + Number( p.forecastamount() ));
vm.toForecast( vm.toForecast() - Number( p.forecastamount() ) );
} );
vm.toForecast( dbo.helpers.numberWithPoints( Number( vm.toForecast() ) ) );
vm.totalForecast( dbo.helpers.numberWithPoints( Number( vm.totalForecast() ) ) );
},
Projectemployee: function ( data ) {