Diversen nav opmerkingen
This commit is contained in:
@@ -25,13 +25,17 @@ dbo.outgoinginvoicesInit = function () {
|
||||
totalToInvoiceFuture: ko.observable(),
|
||||
initialize : null,
|
||||
validYear : ko.observable(),
|
||||
totalToInvoice : ko.observable(),
|
||||
totalCurrentforecast: ko.observable(),
|
||||
totalOtherforecast : ko.observable(),
|
||||
totalMissingForecast: ko.observable(),
|
||||
|
||||
init: function () {
|
||||
var vm = dbo.outgoinginvoicesModel;
|
||||
|
||||
vm.selectedYear( (new Date()).getFullYear() );
|
||||
vm.selectedMonthID( 0 );
|
||||
vm.validYear(true);
|
||||
vm.validYear( true );
|
||||
|
||||
vm.initModule();
|
||||
},
|
||||
@@ -72,6 +76,9 @@ dbo.outgoinginvoicesInit = function () {
|
||||
} );
|
||||
vm.totalToInvoice( dbo.helpers.numberWithPoints( Math.round( vm.totalToInvoice() ) ) );
|
||||
vm.totalToInvoiceFuture( dbo.helpers.numberWithPoints( Math.round( vm.totalToInvoiceFuture() ) ) );
|
||||
vm.totalCurrentforecast( dbo.helpers.numberWithPoints( Math.round( vm.totalCurrentforecast() ) ) );
|
||||
vm.totalOtherforecast( dbo.helpers.numberWithPoints( Math.round( vm.totalOtherforecast() ) ) );
|
||||
vm.totalMissingForecast( dbo.helpers.numberWithPoints( Math.round( vm.totalMissingForecast() ) ) );
|
||||
} );
|
||||
},
|
||||
|
||||
@@ -79,6 +86,9 @@ dbo.outgoinginvoicesInit = function () {
|
||||
var vm = dbo.outgoinginvoicesModel;
|
||||
vm.totalToInvoice( 0 );
|
||||
vm.totalToInvoiceFuture( 0 );
|
||||
vm.totalCurrentforecast( 0 );
|
||||
vm.totalOtherforecast( 0 );
|
||||
vm.totalMissingForecast( 0 );
|
||||
},
|
||||
|
||||
Project: function ( data ) {
|
||||
@@ -109,8 +119,9 @@ dbo.outgoinginvoicesInit = function () {
|
||||
self.toInvoiceFuture = dbo.helpers.numberWithPoints( Math.round( totalInvoice - totalInvoiced - Number( data.currentforecast ) ) );
|
||||
self.currentforecast = dbo.helpers.numberWithPoints( Math.round( data.currentforecast ) );
|
||||
self.otherforecast = dbo.helpers.numberWithPoints( Math.round( data.otherforecast ) );
|
||||
self.missingForecast =
|
||||
dbo.helpers.numberWithPoints( totalInvoice - totalInvoiced - data.otherforecast );
|
||||
var missingForcast = Math.round( totalInvoice - totalInvoiced - data.otherforecast - data.currentforecast );
|
||||
console.log( missingForcast );
|
||||
self.missingForecast = dbo.helpers.numberWithPoints( missingForcast );
|
||||
|
||||
self.months = ko.observableArray( [] );
|
||||
_.each( data.months, function ( p ) {
|
||||
@@ -123,8 +134,12 @@ dbo.outgoinginvoicesInit = function () {
|
||||
vm['payment' + p.month]( Number( vm['payment' + p.month]() ) + Number( p.paymentamount ) );
|
||||
} );
|
||||
|
||||
|
||||
vm.totalToInvoice( vm.totalToInvoice() + (totalInvoice - totalInvoiced) );
|
||||
vm.totalToInvoiceFuture( vm.totalToInvoiceFuture() + (totalInvoice - totalInvoiced - Number( data.currentforecast )) );
|
||||
vm.totalCurrentforecast( Number( vm.totalCurrentforecast() ) + Number( data.currentforecast ) );
|
||||
vm.totalOtherforecast( Number( vm.totalOtherforecast() ) + Number( data.otherforecast ) );
|
||||
vm.totalMissingForecast( Number( vm.totalMissingForecast() ) + Number( missingForcast ) );
|
||||
},
|
||||
|
||||
Month: function ( data ) {
|
||||
|
||||
Reference in New Issue
Block a user