Fix scrutinizer errors
This commit is contained in:
parent
6fd191b01a
commit
7deed57410
@ -476,13 +476,13 @@ class Mos extends DolibarrApi
|
|||||||
if (isset($line->fk_warehouse)) { // If there is a warehouse to set
|
if (isset($line->fk_warehouse)) { // If there is a warehouse to set
|
||||||
if (!($line->fk_warehouse > 0)) { // If there is no warehouse set.
|
if (!($line->fk_warehouse > 0)) { // If there is no warehouse set.
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref));
|
|
||||||
$error++;
|
$error++;
|
||||||
|
throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref));
|
||||||
}
|
}
|
||||||
if ($tmpproduct->status_batch) {
|
if ($tmpproduct->status_batch) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref));
|
|
||||||
$error++;
|
$error++;
|
||||||
|
throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$idstockmove = 0;
|
$idstockmove = 0;
|
||||||
@ -535,13 +535,13 @@ class Mos extends DolibarrApi
|
|||||||
if (isset($line->fk_warehouse)) { // If there is a warehouse to set
|
if (isset($line->fk_warehouse)) { // If there is a warehouse to set
|
||||||
if (!($line->fk_warehouse > 0)) { // If there is no warehouse set.
|
if (!($line->fk_warehouse > 0)) { // If there is no warehouse set.
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref));
|
|
||||||
$error++;
|
$error++;
|
||||||
|
throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref));
|
||||||
}
|
}
|
||||||
if ($tmpproduct->status_batch) {
|
if ($tmpproduct->status_batch) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref));
|
|
||||||
$error++;
|
$error++;
|
||||||
|
throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$idstockmove = 0;
|
$idstockmove = 0;
|
||||||
@ -716,7 +716,7 @@ class Mos extends DolibarrApi
|
|||||||
if (!isset($data[$field])) {
|
if (!isset($data[$field])) {
|
||||||
throw new RestException(400, "$field field missing");
|
throw new RestException(400, "$field field missing");
|
||||||
}
|
}
|
||||||
$myobject[$field] = $data[$field];
|
$myobject[$field] = $data[$field];
|
||||||
}
|
}
|
||||||
return $myobject;
|
return $myobject;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user