Update product.class.php

This commit is contained in:
Laurent Destailleur 2021-10-05 18:43:35 +02:00 committed by GitHub
parent e44c3a46e1
commit e85a0c54cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5111,7 +5111,7 @@ class Product extends CommonObject
*
* @param User $user user asking change
* @param int $id_entrepot id of warehouse
* @param double $nbpiece nb of units
* @param double $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove)
* @param int $movement 0 = add, 1 = remove
* @param string $label Label of stock movement
* @param double $price Unit price HT of product, used to calculate average weighted price (PMP in french). If 0, average weighted price is not changed.
@ -5133,7 +5133,7 @@ class Product extends CommonObject
if (!$movement) {
$movement = 1;
}
$nbpiece *= -1;
$nbpiece = abs($nbpiece);
}
$op[0] = "+".trim($nbpiece);
@ -5162,7 +5162,7 @@ class Product extends CommonObject
*
* @param User $user user asking change
* @param int $id_entrepot id of warehouse
* @param double $nbpiece nb of units
* @param double $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove)
* @param int $movement 0 = add, 1 = remove
* @param string $label Label of stock movement
* @param double $price Price to use for stock eval
@ -5187,7 +5187,7 @@ class Product extends CommonObject
if (!$movement) {
$movement = 1;
}
$nbpiece *= -1;
$nbpiece = abs($nbpiece);
}
$op[0] = "+".trim($nbpiece);