FIX [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask

Close #2893
This commit is contained in:
Marcos García de La Fuente 2015-09-01 16:38:53 +02:00
parent 2faa5d725e
commit 50184babb9

View File

@ -2558,15 +2558,16 @@ class Facture extends CommonInvoice
$numref = "";
$numref = $obj->getNextValue($soc,$this,$mode);
if ($numref != "")
{
return $numref;
}
else
{
/**
* $numref can be empty in case we ask for the last value because if there is no invoice created with the
* set up mask.
*/
if ($mode != 'last' && !$numref) {
dol_print_error($db,"Facture::getNextNumRef ".$obj->error);
return "";
}
return $numref;
}
else
{