#797 ticket.sale boton mas bajo derecha

This commit is contained in:
Gerard 2018-11-14 14:31:56 +01:00
parent 221d0456b7
commit e3a2b2af0b
2 changed files with 17 additions and 2 deletions

View File

@ -274,4 +274,12 @@
question="You are going to delete lines of the ticket"
message="Continue anyway?"
on-response="$ctrl.onRemoveLinesClick(response)">
</vn-confirm>
</vn-confirm>
<vn-float-button
ng-show="$ctrl.isEditable"
ng-click="$ctrl.newOrderFromTicket()"
icon="add"
vn-tooltip="New item"
vn-bind="+"
fixed-bottom-right>
</vn-float-button>

View File

@ -68,7 +68,7 @@ class Controller {
get isEditable() {
try {
return !this.ticket.tracking.state.alertLevel;
return !this.ticket.state.state.alertLevel;
} catch (e) {}
return true;
@ -324,6 +324,13 @@ class Controller {
this.$scope.model.refresh();
});
}
newOrderFromTicket() {
this.$http.post(`/api/Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(res => {
this.$state.go('order.card.catalog', {id: res.data});
this.vnApp.showSuccess(this.$translate.instant('Order created'));
});
}
}
Controller.$inject = ['$scope', '$state', '$http', 'vnApp', '$translate'];