Diversen nav mail Peter

This commit is contained in:
2018-08-05 10:48:53 +02:00
parent 16616f13d2
commit b0a866ba11
7 changed files with 129 additions and 6 deletions
@@ -23,6 +23,13 @@ dbo.vatDataService = {
saveVat: function ( vatID, vatrate ) {
$.post( 'index.php/beheer/vatController/saveVat/' + vatID, {vatrate: vatrate} );
},
removeVat: function ( vatID, callback ) {
$.getJSON( 'index.php/beheer/vatController/removeVat/' + vatID )
.done( function (data) {
callback(data);
} );
}
}
+21 -1
View File
@@ -11,6 +11,8 @@ dbo.vatInit = function () {
if ( dbo.vatModel !== undefined ) {
dbo.vatModel.refreshVat();
} else {
dbo.vatModel = {
@@ -37,7 +39,7 @@ dbo.vatInit = function () {
_.each( data, function ( p ) {
vm.vats.push( new vm.Vat( p ) );
} )
} );
} );
},
@@ -65,6 +67,24 @@ dbo.vatInit = function () {
},
removeVat: function () {
dbo.vatDataService.removeVat( this.id, function(data){
if( data.result ){
dbo.vatModel.refreshVat();
var message = 'BTW succesvol verwijderd';
var modalClass = 'modal-success';
}else{
var message ='BTW is in gebruik en kan niet worden verwijderd';
var modalClass= 'modal-danger';
}
tellMe( {
title : 'verwijderen BTW',
message : message,
notify : false,
modalClass: modalClass
});
} );
}
}
@@ -72,7 +72,7 @@ dbo.employeehoursInit = function () {
hourdate : employeeHour ? employeeHour.hourdate() : null,
hourtype_id: employeeHour ? employeeHour.hourtype_id() : 9,
project_id : employeeHour ? employeeHour.projectID() : null,
hours : employeeHour ? employeeHour.hours() : 0,
hours : 0,
inEdit : true
};