diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index bbf2435436e..a4aa1afbd8c 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $langs->load('admin'); +$langs->load("products"); if (!$user->admin) accessforbidden(); diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 2ef3191154d..4e9e0063dc3 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -202,18 +202,26 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave','alpha')) $srcpath = $upload_dir.'/'.$filenamefrom; $destpath = $upload_dir.'/'.$filenameto; - $result = dol_move($srcpath, $destpath); - if ($result) + if (!file_exists($destpath)) { - if ($object->id) + $result = dol_move($srcpath, $destpath); + if ($result) { - $object->addThumbs($destpath); + if ($object->id) + { + $object->addThumbs($destpath); + } + + // TODO Add revert function of addThumbs to remove for old name + //$object->delThumbs($srcpath); + + setEventMessages($langs->trans("FileRenamed"), null); + } + else + { + $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. + setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); } - - // TODO Add revert function of addThumbs to remove for old name - //$object->delThumbs($srcpath); - - setEventMessages($langs->trans("FileRenamed"), null); } else { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 85408c7e14a..b403f0f87dd 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -398,7 +398,7 @@ class Expedition extends CommonObject if (($lineId = $expeditionline->insert()) < 0) { - $this->error[]=$expeditionline->error; + $this->errors[]=$expeditionline->error; } return $lineId; } @@ -2386,9 +2386,9 @@ class ExpeditionLigne extends CommonObjectLine $error=0; // Check parameters - if (empty($this->fk_expedition) || empty($this->fk_origin_line) || empty($this->qty)) + if (empty($this->fk_expedition) || empty($this->fk_origin_line) || ! is_numeric($this->qty)) { - $this->errors[] = 'ErrorMandatoryParametersNotProvided'; + $this->error = 'ErrorMandatoryParametersNotProvided'; return -1; } // Clean parameters @@ -2428,7 +2428,6 @@ class ExpeditionLigne extends CommonObjectLine $result=$this->call_trigger('LINESHIPPING_INSERT',$user); if ($result < 0) { - $this->errors[]=$this->error; $error++; } // End call triggers @@ -2444,6 +2443,7 @@ class ExpeditionLigne extends CommonObjectLine dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); $this->error.=($this->error?', '.$errmsg:$errmsg); } + $this->db->rollback(); return -1*$error; } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 621a229121c..dc00360acfd 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -384,6 +384,7 @@ class SupplierProposal extends CommonObject if (empty($info_bits)) $info_bits=0; if (empty($rang)) $rang=0; if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; + if (empty($pu_ht)) $pu_ht=0; $remise_percent=price2num($remise_percent); $qty=price2num($qty);