Debug 6 /reservation

This commit is contained in:
2018-07-31 13:47:47 +02:00
parent 2da7fdd9cc
commit c520c3386a
6 changed files with 52 additions and 25 deletions
+24 -8
View File
@@ -107,6 +107,15 @@ $( function () {
sessionStorage.setItem( "showPayment", showPayments );
},
toggleFromReservation: function () {
var vm = dbo.editProjectModal;
var self = this;
self.fromReservation( !self.fromReservation() );
vm.saveProjectCost(self);
},
editProjectemployee: function () {
var self = this;
var vm = dbo.editProjectModal;
@@ -476,16 +485,22 @@ $( function () {
saveProjectcosts: function () {
var vm = dbo.editProjectModal;
var self = this;
vm.saveProjectCost( this );
},
saveProjectCost: function ( self ) {
var vm = dbo.editProjectModal;
var submitDATA = {
id : self.id,
project_id : vm.projectID,
external_id: self.external_id(),
description: self.description(),
date : self.date(),
costs : self.costs(),
payed : self.payed()
id : self.id,
project_id : vm.projectID,
external_id : self.external_id(),
description : self.description(),
date : self.date(),
costs : self.costs(),
payed : self.payed(),
from_reservation: self.fromReservation() ? 'T' : 'F'
};
dbo.projectDataService.saveProjectcost( submitDATA, function ( data ) {
@@ -925,6 +940,7 @@ $( function () {
self.costs = ko.observable( data.costs );
self.payed = ko.observable( data.payed );
self.inEdit = ko.observable( data.inEdit || false );
self.fromReservation = ko.observable( data.from_reservation == 'T' ? true : false );
this.toPay = ko.pureComputed( function () {
if ( isNaN( self.costs() ) ) return 0;