From 7deed5741005caa279a37d79553269393405c3e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Sep 2021 01:32:20 +0200 Subject: [PATCH] Fix scrutinizer errors --- htdocs/mrp/class/api_mos.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index a59a7247338..8fbd25090c7 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -476,13 +476,13 @@ class Mos extends DolibarrApi if (isset($line->fk_warehouse)) { // If there is a warehouse to set if (!($line->fk_warehouse > 0)) { // If there is no warehouse set. $langs->load("errors"); - throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref)); $error++; + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref)); } if ($tmpproduct->status_batch) { $langs->load("errors"); - throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref)); $error++; + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref)); } } $idstockmove = 0; @@ -535,13 +535,13 @@ class Mos extends DolibarrApi if (isset($line->fk_warehouse)) { // If there is a warehouse to set if (!($line->fk_warehouse > 0)) { // If there is no warehouse set. $langs->load("errors"); - throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref)); $error++; + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref)); } if ($tmpproduct->status_batch) { $langs->load("errors"); - throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref)); $error++; + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref)); } } $idstockmove = 0; @@ -716,7 +716,7 @@ class Mos extends DolibarrApi if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); } - $myobject[$field] = $data[$field]; + $myobject[$field] = $data[$field]; } return $myobject; }