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
+17 -3
View File
@@ -7,6 +7,7 @@
dbo.vatInit = function () {
var timeout;
if ( dbo.vatModel !== undefined ) {
@@ -35,7 +36,7 @@ dbo.vatInit = function () {
vm.vats.removeAll();
_.each( data, function ( p ) {
vm.vats( new vm.Vat( p ) );
vm.vats.push( new vm.Vat( p ) );
} )
} );
},
@@ -44,13 +45,26 @@ dbo.vatInit = function () {
this.inEdit( !this.inEdit() );
},
validateNumber: function ( field ) {
var self = this;
self[field]( dbo.helpers.validateNumber( self[field](), true ) );
if ( timeout ) {
clearTimeout( timeout );
timeout = null;
}
timeout = setTimeout( function () {
dbo.vatDataService.saveVat( self.id, self.vatrate() );
}, 700 );
},
Vat: function ( data, inEdit = false ) {
this.id = data.id;
this.vatrate = ko.observable( data.vatrate );
this.vatrate = ko.observable( data.vatrate || 0 );
this.inEdit = ko.observable( inEdit );
},
removeVat : function(){
removeVat: function () {
}
}
@@ -96,17 +96,14 @@ dbo.reservationsInit = function () {
self.payed = dbo.helpers.numberWithPoints( data.payed );
self.saldo = dbo.helpers.numberWithPoints( data.saldo );
self.saldoToPay = dbo.helpers.numberWithPoints( data.saldoToPay );
}
}
dbo.reservationsModel.init();
ko.applyBindings( dbo.reservationsModel, document.getElementById( "RESERVATIONS" ) );
}
dbo.reservationsModel.init();
ko.applyBindings(
dbo.reservationsModel, document.getElementById( "RESERVATIONS" ) );
}