Diversen nav opmerkingen

This commit is contained in:
2018-05-06 20:39:59 +02:00
parent a3d200c38b
commit c7846f9a80
16 changed files with 126 additions and 82 deletions
+19 -8
View File
@@ -34,6 +34,7 @@ $( function () {
archive : ko.observable( false ),
startdate : ko.observable( null ),
enddate : ko.observable( null ),
vat_id : ko.observable(),
projectname : ko.observable(),
busy : false,
ownRevenue : ko.observable(),
@@ -58,6 +59,10 @@ $( function () {
init: function () {
var vm = dbo.editProjectModal;
vm.busy = true;
$( "#project-scroller" ).height( $( window ).height() - 100 );
dbo.customerDataService.getAllCustomers( 'F', function ( data ) {
vm.customers( data );
dbo.userDataService.getAllUsers( 'F', function ( data ) {
@@ -71,6 +76,8 @@ $( function () {
vm.refreshProject();
vm.activeTab( 'DASHBOARD' );
vm.busy = false;
} );
} );
} );
@@ -287,6 +294,7 @@ $( function () {
vm.callback = callback;
dbo.projectDataService.addProject( function ( data ) {
console.log( data );
vm.projectID = data;
vm.showProject( true );
@@ -365,11 +373,13 @@ $( function () {
projectleader_id: vm.projectleaderID(),
projectname : vm.projectname(),
startdate : vm.startdate(),
enddate : vm.enddate()
enddate : vm.enddate(),
vat_id : vm.vat_id()
}
dbo.projectDataService.saveProject( vm.projectID, submitDATA, function ( data ) {
vm.projectID = data;
vm.refreshProject();
// vm.projectID = data.projectID;
} );
},
@@ -725,7 +735,7 @@ $( function () {
vm.busy = true;
dbo.projectDataService.getProject( vm.projectID, function ( data ) {
var totalRevenuesIncl = Math.round( (data.invoiceDetails.totalrevenue * (data.vatrate + 100)) / 100 );
var totalRevenuesIncl = Math.round( (data.invoiceDetails.totalrevenue * (Number( data.vat.vatrate ) + 100)) / 100 );
vm.id = data.id
vm.projectleaderID( data.projectleader_id );
@@ -734,13 +744,14 @@ $( function () {
vm.enddate( dbo.helpers.mysql2date( data.enddate ) );
vm.projectnumber( data.projectnumber );
vm.projectname( data.projectname );
vm.vat_id( data.vat_id );
vm.totalRevenues( dbo.helpers.numberWithPoints( Math.round( Number( data.invoiceDetails.totalrevenue ) ) ) );
vm.totalRevenuesIncl( dbo.helpers.numberWithPoints( totalRevenuesIncl ));
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( 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( totalRevenuesIncl - Number( data.invoiceDetails.totalinvoiced ) );
vm.toInvoice = Math.round( totalRevenuesIncl - Number( data.invoiceDetails.totalinvoiced ) );
vm.projectEmployees.removeAll();
vm.projecthours.removeAll();
@@ -798,10 +809,10 @@ $( function () {
toForecasting: function () {
var vm = dbo.editProjectModal;
vm.totalForecast(0);
vm.totalForecast( 0 );
vm.toForecast( vm.toInvoice );
_.each( vm.forecasts(), function ( p ) {
vm.totalForecast( vm.totalForecast() + Number( p.forecastamount() ));
vm.totalForecast( vm.totalForecast() + Number( p.forecastamount() ) );
vm.toForecast( vm.toForecast() - Number( p.forecastamount() ) );
} );
vm.toForecast( dbo.helpers.numberWithPoints( Number( vm.toForecast() ) ) );
@@ -978,7 +989,7 @@ $( function () {
refreshDocuments: function () {
var vm = dbo.editProjectModal;
console.log( vm.projectID );
dbo.documentsDataService.getdocuments( vm.projectID, function ( data ) {
vm.documents.removeAll();