diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 95c6af527b6..85da9cd5c37 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -502,8 +502,7 @@ class Invoices extends DolibarrApi } $result = $this->invoice->delete_contact($rowid); - - if (!$result) { + if ($result < 0) { throw new RestException(500, 'Error when deleted the contact'); } @@ -600,7 +599,7 @@ class Invoices extends DolibarrApi /** * Delete invoice * - * @param int $id Invoice ID + * @param int $id Invoice ID * @return array */ public function delete($id) @@ -617,7 +616,8 @@ class Invoices extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - if ($this->invoice->delete($id) < 0) + $result = $this->invoice->delete(DolibarrApiAccess::$user); + if ($result < 0) { throw new RestException(500); } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index f5119791432..cf6bc12b9a1 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -746,7 +746,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetXY($posx, $posy); $pdf->SetFont('', 'B', $default_font_size + 2); $pdf->SetTextColor(111, 81, 124); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 3, $object->getLibStatut(0), '', 'R'); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 3, $outputlangs->transnoentities($object->statuts_short[$object->status]), '', 'R'); if ($showaddress) { // Sender properties