Diverse wijzigingen
This commit is contained in:
@@ -92,6 +92,7 @@ $( function () {
|
||||
dbo.employeeTargetDataService.getEmployeeTargets( vm.employeeID, function ( data ) {
|
||||
vm.employeeTargets.removeAll();
|
||||
|
||||
vm.newTarget( true );
|
||||
vm.targetLength = data.length
|
||||
var i = 0;
|
||||
_.each( data, function ( p ) {
|
||||
@@ -132,8 +133,8 @@ $( function () {
|
||||
return false;
|
||||
} );
|
||||
|
||||
if ( ! self.endmonth() ) vm.newTarget( false );
|
||||
if ( ! self.endyear() ) vm.newTarget( false );
|
||||
if ( !self.endmonth() ) vm.newTarget( false );
|
||||
if ( !self.endyear() ) vm.newTarget( false );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user