From: Vincent Vanwaelscappel Date: Tue, 23 Apr 2024 07:32:41 +0000 (+0200) Subject: wip #6875 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=71c18da3711fa49ca86bff7a57264450fe35ffe6;p=fluidbook-html5.git wip #6875 --- 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];