From b53c7b5eb52dcda3930a907325cd024c2b89e8b1 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Mon, 29 Jan 2024 17:43:40 +0100 Subject: [PATCH] qual: phpstan for htdocs/expedition/dispatch.php htdocs/expedition/dispatch.php 216 Property ExpeditionLigne::$qty (float) does not accept string. htdocs/expedition/dispatch.php 217 Property ExpeditionLigne::$entrepot_id (int) does not accept array|string. htdocs/expedition/dispatch.php 274 Property ExpeditionLigne::$entrepot_id (int) does not accept array|string. htdocs/expedition/dispatch.php 275 Property ExpeditionLigne::$fk_origin_line (int) does not accept array|string. htdocs/expedition/dispatch.php 276 Property ExpeditionLigne::$qty (float) does not accept string. --- htdocs/expedition/dispatch.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index 8ba6e6d7768..cc3a31140ee 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -160,7 +160,7 @@ if ($action == 'updatelines' && $usercancreate) { $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc_'.$reg[1].'_'.$reg[2].'month', 'int'), GETPOST('dlc_'.$reg[1].'_'.$reg[2].'day', 'int'), GETPOST('dlc_'.$reg[1].'_'.$reg[2].'year', 'int')); } - $newqty = price2num(GETPOST($qty, 'alpha'), 'MS'); + $newqty = GETPOSTFLOAT($qty, 'MS'); //var_dump("modebatch=".$modebatch." newqty=".$newqty." ent=".$ent." idline=".$idline); // We ask to move a qty @@ -214,7 +214,7 @@ if ($action == 'updatelines' && $usercancreate) { } else { $qtystart = $expeditiondispatch->qty; $expeditiondispatch->qty = $newqty; - $expeditiondispatch->entrepot_id = GETPOST($ent, 'int'); + $expeditiondispatch->entrepot_id = GETPOSTINT($ent); if ($newqty > 0) { $result = $expeditiondispatch->update($user); @@ -271,8 +271,8 @@ if ($action == 'updatelines' && $usercancreate) { } } else { $expeditiondispatch->fk_expedition = $object->id; - $expeditiondispatch->entrepot_id = GETPOST($ent, 'int'); - $expeditiondispatch->fk_origin_line = GETPOST($fk_commandedet, 'int'); + $expeditiondispatch->entrepot_id = GETPOSTINT($ent); + $expeditiondispatch->fk_origin_line = GETPOSTINT($fk_commandedet); $expeditiondispatch->qty = $newqty; if ($newqty > 0) {