From 71c18da3711fa49ca86bff7a57264450fe35ffe6 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 23 Apr 2024 09:32:41 +0200 Subject: [PATCH] wip #6875 --- .../fluidbook/cart/fluidbook.cart.bastide-resah.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js b/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js index cf6c3838..c73624b2 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah.js @@ -180,9 +180,9 @@ FluidbookCartBastideResah.prototype = { return `
${this.fluidbook.l10n.__('your cart is empty')}
`; } - let total_ht=0; - let tva=0; - let eco_taxe=0; + let total_ht = 0; + let tva = 0; + let eco_taxe = 0; let total_ttc = 0; let $this = this; @@ -204,13 +204,14 @@ FluidbookCartBastideResah.prototype = { content += ''; + let q = parseInt(item.quantity); let et = $this.parseFloat($this.data[item.reference]['ECOTAXE']); - let ht = $this.parseFloat($this.data[item.reference]['PV RESAH HT']) + et; - let tht = parseInt(item.quantity) * ht; + let pvht = $this.parseFloat($this.data[item.reference]['PV RESAH HT']); + let tht = q * (pvht + et); total_ht += tht; eco_taxe += item.quantity * et; - tva += $this.parseFloat($this.data[item.reference]['TVA']) * tht * 0.01; + tva += $this.parseFloat($this.data[item.reference]['TVA']) * pvht * q * 0.01; $.each(columns, function (key, title) { let data = $this.data[item.reference]; -- 2.39.5