Merge pull request '2332 - Fixed on load error' (#313) from 2332-claim_detail_fix into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-by: Bernat Exposito <bernat@verdnatura.es>
This commit is contained in:
Bernat Exposito 2020-06-16 07:04:59 +00:00
commit ecf1a1159c
2 changed files with 14 additions and 3 deletions

View File

@ -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;
});

View File

@ -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