From bcdbcf5070d80b0925b72c41a4f686044b5d865e Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 27 Jun 2022 11:18:38 +0200 Subject: [PATCH] Update card.php --- htdocs/expedition/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f79e4becd9d..ef1405e54b6 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1188,8 +1188,10 @@ if ($action == 'create') { if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $quantityToBeDelivered = 0; } else { - if (isset($quantityAsked) and isset($quantityDelivered)) { - $quantityToBeDelivered = is_float($quantityAsked) - is_float($quantityDelivered); + if (is_numeric($quantityDelivered)) { + $quantityToBeDelivered = $quantityAsked - $quantityDelivered; + } else { + $quantityToBeDelivered = $quantityAsked; } }