PR#28448 broke qty float on xpedition same correction as #31794 (#32055)

This commit is contained in:
daGrumpf 2024-11-22 13:07:23 +01:00 committed by GitHub
parent 3085b48dc9
commit ef41ebb864
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -357,7 +357,7 @@ if (empty($reshook)) {
}
} else {
//shipment line for product with no batch management and no multiple stock location
if (GETPOSTINT($qty) > 0) {
if (GETPOSTFLOAT($qty) > 0) {
$totalqty += price2num(GETPOST($qty, 'alpha'), 'MS');
$subtotalqty = price2num(GETPOST($qty, 'alpha'), 'MS');
}
@ -401,7 +401,7 @@ if (empty($reshook)) {
}
}
} else {
if (GETPOSTINT($qty) > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) {
if (GETPOSTFLOAT($qty) > 0 || getDolGlobalString('SHIPMENT_GETS_ALL_ORDER_PRODUCTS')) {
$ent = "entl".$i;
$idl = "idl".$i;
$entrepot_id = is_numeric(GETPOSTINT($ent)) ? GETPOSTINT($ent) : GETPOSTINT('entrepot_id');
@ -412,7 +412,7 @@ if (empty($reshook)) {
$entrepot_id = 0;
}
$ret = $object->addline($entrepot_id, GETPOSTINT($idl), price2num(GETPOSTINT($qty), 'MS'), $array_options[$i]);
$ret = $object->addline($entrepot_id, GETPOSTINT($idl), price2num(GETPOSTFLOAT($qty), 'MS'), $array_options[$i]);
if ($ret < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
@ -671,7 +671,7 @@ if (empty($reshook)) {
$batch = "batchl".$detail_batch->fk_expeditiondet."_".$detail_batch->fk_origin_stock;
$qty = "qtyl".$detail_batch->fk_expeditiondet.'_'.$detail_batch->id;
$batch_id = GETPOSTINT($batch);
$batch_qty = GETPOSTINT($qty);
$batch_qty = GETPOSTFLOAT($qty);
if (!empty($batch_id)) {
if ($lotStock->fetch($batch_id) > 0 && $line->fetch($detail_batch->fk_expeditiondet) > 0) { // $line is ExpeditionLine
if ($lines[$i]->entrepot_id != 0) {
@ -708,7 +708,7 @@ if (empty($reshook)) {
$batch = "batchl".$line_id."_0";
$qty = "qtyl".$line_id."_0";
$batch_id = GETPOSTINT($batch);
$batch_qty = GETPOSTINT($qty);
$batch_qty = GETPOSTFLOAT($qty);
$lineIdToAddLot = 0;
if ($batch_qty > 0 && !empty($batch_id)) {
if ($lotStock->fetch($batch_id) > 0) {