Diverse aanpassing nav mail Peter

This commit is contained in:
2019-02-22 14:19:03 +01:00
parent d71692f320
commit 695f6c6960
23 changed files with 295 additions and 79 deletions
+46 -27
View File
@@ -28,34 +28,38 @@ $( function () {
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 ),
vat_id : ko.observable(),
projectname : ko.observable(),
busy : false,
ownRevenue : ko.observable(),
otherRevenue : ko.observable(),
costs : ko.observable(),
projectname : ko.observable(),
years : ko.observableArray( dbo.years ),
months : ko.observableArray( dbo.monthArray ),
outstanding : ko.observable(),
documents : ko.observableArray( [] ),
comments : ko.observableArray( [] ),
activeTab : ko.observable(),
totalRevenues : ko.observable(),
totalInvoiced : ko.observable(),
totalRevenuesIncl: ko.observable(),
customerID : ko.observable( null ),
projectnumber : ko.observable(),
projectleaderID : ko.observable(),
archive : ko.observable( false ),
startdate : ko.observable( null ),
enddate : ko.observable( null ),
vat_id : ko.observable(),
projectname : ko.observable(),
busy : false,
ownRevenue : ko.observable(),
otherRevenue : ko.observable(),
costs : ko.observable(),
projectname : ko.observable(),
years : ko.observableArray( dbo.years ),
months : ko.observableArray( dbo.monthArray ),
outstanding : 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,
hourTotals : ko.observableArray( [] ),
totalNonDeclarable : ko.observable( 0 ),
totalDeclarable : ko.observable( 0 ),
totalRevenueHours : ko.observable( 0 ),
init: function () {
var vm = dbo.editProjectModal;
@@ -113,7 +117,7 @@ $( function () {
self.fromReservation( !self.fromReservation() );
vm.saveProjectCost(self);
vm.saveProjectCost( self );
},
editProjectemployee: function () {
@@ -800,7 +804,7 @@ $( function () {
dbo.projectDataService.getAvailableEmployees( vm.projectID, function ( data ) {
vm.availableEmployees( data );
if ( typeof(callback) == 'function' ) callback();
if ( typeof (callback) == 'function' ) callback();
} );
},
@@ -809,7 +813,7 @@ $( function () {
vm.busy = true;
dbo.projectDataService.getProject( vm.projectID, function ( data ) {
var revenues = Number(data.offer.own_revenue) + Number(data.offer.other_revenue) + Number(data.offer.costs);
var revenues = Number( data.offer.own_revenue ) + Number( data.offer.other_revenue ) + Number( data.offer.costs );
var totalRevenuesIncl = Math.round( (revenues * (Number( data.vat.vatrate ) + 100)) / 100 );
vm.id = data.id
@@ -832,9 +836,25 @@ $( function () {
vm.ownRevenue( dbo.helpers.numberWithPoints( Math.round( Number( data.offer.own_revenue ) ) ) );
vm.otherRevenue( dbo.helpers.numberWithPoints( Math.round( Number( data.offer.other_revenue ) ) ) );
vm.costs(dbo.helpers.numberWithPoints( Math.round( Number( data.offer.costs ) ) ) );
vm.costs( dbo.helpers.numberWithPoints( Math.round( Number( data.offer.costs ) ) ) );
vm.totalRevenues( dbo.helpers.numberWithPoints( Math.round( revenues ) ) );
vm.hourTotals.removeAll();
vm.totalNonDeclarable( 0 );
vm.totalDeclarable( 0 );
vm.totalRevenueHours( 0 );
_.each( data.hourTotals, function ( p ) {
vm.hourTotals.push( {
fullname : p.fullname,
nondeclarable: p.nondeclarable,
declarable : p.declarable,
revenues : dbo.helpers.numberWithPoints( Math.round( Number( p.revenues ) ) )
} );
vm.totalNonDeclarable( Number( vm.totalNonDeclarable() ) + Number( p.nondeclarable ) );
vm.totalDeclarable( Number( vm.totalDeclarable() ) + Number( p.declarable ) );
vm.totalRevenueHours( Number( vm.totalRevenueHours() ) + Number( p.revenues ) );
} );
vm.totalRevenueHours( dbo.helpers.numberWithPoints( Math.round( vm.totalRevenueHours() ) ) );
_.each( data.projectemployees, function ( p ) {
vm.projectEmployees.push( new vm.Projectemployee( p ) );
@@ -1012,7 +1032,6 @@ $( function () {
},
Reservation: function ( data ) {
console.log( data );
this.id = data.id;
this.project_id = data.project_id;
this.reservationamount = ko.observable( data.reservationamount );