From 9537fb3808b7f63e71e892fafabca141b775ea5a Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 24 Aug 2022 09:12:39 +0200 Subject: [PATCH] FIX php 8 error --- htdocs/mrp/ajax/interface.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/ajax/interface.php b/htdocs/mrp/ajax/interface.php index 271b34e5b13..ec626598808 100644 --- a/htdocs/mrp/ajax/interface.php +++ b/htdocs/mrp/ajax/interface.php @@ -48,11 +48,17 @@ if ($action == 'updateselectbatchbywarehouse' && $permissiontoproduce) { if ($resql) { while ($obj = $db->fetch_object($resql)) { - $TRes[$obj->batch] += $obj->qty; + if(empty($TRes[$obj->batch])){ + $TRes[$obj->batch] = $obj->qty; + } else { + $TRes[$obj->batch] += $obj->qty; + } } } - print json_encode($TRes); + echo json_encode($TRes); + exit(); + } elseif ($action == 'updateselectwarehousebybatch' && $permissiontoproduce) { $res = 0; @@ -73,5 +79,7 @@ if ($action == 'updateselectbatchbywarehouse' && $permissiontoproduce) { } } - print json_encode($res); + echo json_encode($res); + exit(); + }