diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index abd2c7dd502..732be0937d0 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -608,10 +608,14 @@ class ExtraFields if ($unique) { $sql = "ALTER TABLE ".$this->db->prefix().$table." ADD UNIQUE INDEX uk_".$table."_".$attrname." (".$attrname.")"; } else { - $sql = "ALTER TABLE ".$this->db->prefix().$table." DROP INDEX uk_".$table."_".$attrname; + $sql = "ALTER TABLE ".$this->db->prefix().$table." DROP INDEX IF EXISTS uk_".$table."_".$attrname; } dol_syslog(get_class($this).'::update', LOG_DEBUG); $resql = $this->db->query($sql, 1, 'dml'); + /*if ($resql < 0) { + $this->error = $this->db->lasterror(); + return -1; + }*/ return 1; } else { $this->error = $this->db->lasterror(); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index dcf9fafd103..374c4ff4c4c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1066,11 +1066,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } // Capital if (!empty($fromcompany->capital) && $fromcompany->capital) { - $tmpamounttoshow = price2num($fromcompany->capital); // This field is a free string + $tmpamounttoshow = price2num($fromcompany->capital); // This field is a free string or a float if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) { $line3 .= ($line3 ? " - " : "").$outputlangs->transnoentities("CapitalOf", price($tmpamounttoshow, 0, $outputlangs, 0, 0, 0, $conf->currency)); - } else { - $line3 .= ($line3 ? " - " : "").$outputlangs->transnoentities("CapitalOf", $tmpamounttoshow, $outputlangs); + } elseif (!empty($fromcompany->capital)) { + $line3 .= ($line3 ? " - " : "").$outputlangs->transnoentities("CapitalOf", $fromcompany->capital, $outputlangs); } } // Prof Id 1