FIX: Allow decimal qty reception (#34328)

* Use fmod instead of % with line->packaging, to avoid fatal error if packaging decimal

Ensure packaging is numeric, positive, then use fmod instead of %, to prevent error with decimal packaging values (resulting in division by zero), for ajusting  quantity

* Update edit rules

* Update edit rules

* After saving, it's better

* ```
No code changes made
```

* Just modify reception/card.php
This commit is contained in:
dum77
2025-06-04 11:12:45 +02:00
committed by GitHub
parent 6b75c869fb
commit d4fe691f54

View File

@@ -700,7 +700,7 @@ if (empty($reshook)) {
$line->id = $line_id; $line->id = $line_id;
$line->fk_entrepot = GETPOSTINT($stockLocation); $line->fk_entrepot = GETPOSTINT($stockLocation);
$line->qty = GETPOSTINT($qty); $line->qty = GETPOSTFLOAT($qty, 'MS');
$line->comment = GETPOST($comment, 'alpha'); $line->comment = GETPOST($comment, 'alpha');
if (isModEnabled('productbatch')) { if (isModEnabled('productbatch')) {
@@ -725,7 +725,7 @@ if (empty($reshook)) {
} else { // Product no predefined } else { // Product no predefined
$qty = "qtyl".$line_id; $qty = "qtyl".$line_id;
$line->id = $line_id; $line->id = $line_id;
$line->qty = GETPOSTINT($qty); $line->qty = GETPOSTFLOAT($qty, 'MS');
$line->fk_entrepot = 0; $line->fk_entrepot = 0;
if ($line->update($user) < 0) { if ($line->update($user) < 0) {
setEventMessages($line->error, $line->errors, 'errors'); setEventMessages($line->error, $line->errors, 'errors');