From 7fd77bdaef1ed8d091e504fe7bf9762eadfced43 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 16 Jun 2020 08:50:59 +0200 Subject: [PATCH] 2332 - Fixed on load error --- modules/claim/front/detail/index.js | 14 ++++++++++++-- modules/claim/front/locale/es.yml | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/claim/front/detail/index.js b/modules/claim/front/detail/index.js index f73cfd996..591072e6e 100644 --- a/modules/claim/front/detail/index.js +++ b/modules/claim/front/detail/index.js @@ -99,13 +99,21 @@ class Controller extends Section { this._salesClaimed.forEach(sale => { let orgSale = sale.sale; this.paidTotal += this.getSaleTotal(orgSale); - this.claimedTotal += sale.quantity * orgSale.price - ((orgSale.discount * (sale.quantity * orgSale.price)) / 100); + + const price = sale.quantity * orgSale.price; + const discount = ((orgSale.discount * price) / 100); + + this.claimedTotal += price - discount; }); } getSaleTotal(sale) { let total = 0.0; - total += sale.quantity * sale.price - ((sale.discount * (sale.quantity * sale.price)) / 100); + + const price = sale.quantity * sale.price; + const discount = ((sale.discount * price) / 100); + + total += price - discount; return total; } @@ -127,6 +135,8 @@ class Controller extends Section { } isClaimEditable() { + if (!this.claim) return; + this.$http.get(`Tickets/${this.claim.ticketFk}/isEditable`).then(res => { this.isEditable = res.data; }); diff --git a/modules/claim/front/locale/es.yml b/modules/claim/front/locale/es.yml index b65593bbd..338342eb5 100644 --- a/modules/claim/front/locale/es.yml +++ b/modules/claim/front/locale/es.yml @@ -14,5 +14,6 @@ Send Pickup order: Enviar orden de recogida Show Pickup order: Ver orden de recogida Search claim by id or client name: Buscar reclamaciones por identificador o nombre de cliente Claim deleted!: Reclamación eliminada! -claim: reclamacióm +claim: reclamación +Photos: Fotos