getVAT now doesn't make a call when it can't

This commit is contained in:
gerard 2018-08-02 15:39:32 +02:00
parent 19e72c86cf
commit 2fa91ef59d
1 changed files with 6 additions and 4 deletions

View File

@ -64,10 +64,12 @@ class Controller {
}
getVAT() {
this.$http.get(`/ticket/api/Tickets/${this.ticket.id}/getVAT`).then(res => {
this.VAT = res.data || 0;
this.total = this.subTotal + this.VAT;
});
if (this.ticket || this.ticket.id) {
this.$http.get(`/ticket/api/Tickets/${this.ticket.id}/getVAT`).then(res => {
this.VAT = res.data || 0;
this.total = this.subTotal + this.VAT;
});
}
}
get isEditable() {