2
0
forked from Wavyzz/dolibarr

Fix scrutinizer bug reports

This commit is contained in:
Laurent Destailleur
2017-10-06 00:26:24 +02:00
parent 86e751bd45
commit 801a5180d6
12 changed files with 32 additions and 39 deletions

View File

@@ -104,7 +104,7 @@ class Documents extends DolibarrApi
{
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$this->invoice = new Facture($this->db);
$result = $this->invoice->fetch(0, $ref);
$result = $this->invoice->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
if( ! $result ) {
throw new RestException(404, 'Invoice not found');
}