Update card.php

This commit is contained in:
Anthony Berton 2022-06-27 11:18:38 +02:00 committed by GitHub
parent 3a8f479db7
commit bcdbcf5070
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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