From 46df3d9f110928cbcba4c708331f22e5f397fc97 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 5 Jan 2023 14:32:35 +0100 Subject: [PATCH] Fix: regression sur les ventes --- module/actor/base-actor.js | 2 +- module/actor/commerce.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/actor/base-actor.js b/module/actor/base-actor.js index b62ac03d..5740b70f 100644 --- a/module/actor/base-actor.js +++ b/module/actor/base-actor.js @@ -310,7 +310,7 @@ export class RdDBaseActor extends Actor { async decrementerQuantiteItem(item, quantite, options = { supprimerSiZero: true }) { - if (itemVendu.isService()) { + if (item.isService()) { return; } let resteQuantite = (item.system.quantite ?? 1) - quantite; diff --git a/module/actor/commerce.js b/module/actor/commerce.js index 0288dd99..fffc6535 100644 --- a/module/actor/commerce.js +++ b/module/actor/commerce.js @@ -39,11 +39,11 @@ export class RdDCommerce extends RdDBaseActor { // ne pas consommer pour un commerce } - async decrementerQuantiteItem(itemVendu, quantite) { + async decrementerQuantiteItem(item, quantite) { if (this.system.illimite) { return; } - await super.decrementerQuantiteItem(itemVendu, quantite, { supprimerSiZero: false }); + await super.decrementerQuantiteItem(item, quantite, { supprimerSiZero: false }); } calculerPrix(item) {