fix php8 warnings

This commit is contained in:
Frédéric France 2022-08-31 21:37:10 +02:00
parent 57bcc2177a
commit 194c76727e
3 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php';
if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
if (!empty($conf->commande->enabled)) {
if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
}
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionlinebatch.class.php';
@ -625,7 +625,7 @@ class Expedition extends CommonObject
$this->fetch_optionals();
// Fix Get multicurrency param for transmited
if (!empty($conf->multicurrency->enabled)) {
if (isModEnabled('multicurrency')) {
if (!empty($this->multicurrency_code)) {
$this->multicurrency_code = $this->thirdparty->multicurrency_code;
}
@ -1291,7 +1291,7 @@ class Expedition extends CommonObject
}
// delete batch expedition line
if (!$error && $conf->productbatch->enabled) {
if (!$error && isModEnabled('productbatch')) {
$shipmentlinebatch = new ExpeditionLineBatch($this->db);
if ($shipmentlinebatch->deleteFromShipment($this->id) < 0) {
$error++; $this->errors[] = "Error ".$this->db->lasterror();
@ -2901,7 +2901,7 @@ class ExpeditionLigne extends CommonObjectLine
// update lot
if (!empty($batch) && $conf->productbatch->enabled) {
if (!empty($batch) && isModEnabled('productbatch')) {
dol_syslog(get_class($this)."::update expedition batch id=$expedition_batch_id, batch_id=$batch_id, batch=$batch");
if (empty($batch_id) || empty($this->fk_product)) {

View File

@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o
$upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref);
$projectRequired = $conf->project->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED);
$projectRequired = isModEnabled('project') && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED);
$fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED);
if ($object->id > 0) {

View File

@ -161,7 +161,7 @@ if (empty($reshook)) {
// Get the real quantity in stock now, but before the stock move for inventory.
$realqtynow = $product_static->stock_warehouse[$line->fk_warehouse]->real;
if ($conf->productbatch->enabled && $product_static->hasbatch()) {
if (isModEnabled('productbatch') && $product_static->hasbatch()) {
$realqtynow = $product_static->stock_warehouse[$line->fk_warehouse]->detail_batch[$line->batch]->qty;
}