prepend the author firstname and lastname for ER ref

Instead of using the validator of the ER use the author firstname and last name.
This is not always the case as soon ass someone can create ER for someone else
This commit is contained in:
De Coninck Laurent 2017-02-24 13:49:34 +01:00
parent e981e719a1
commit 7e80505104

View File

@ -958,7 +958,7 @@ class ExpenseReport extends CommonObject
{
$prefix="ER";
if (! empty($conf->global->EXPENSE_REPORT_PREFIX)) $prefix=$conf->global->EXPENSE_REPORT_PREFIX;
$this->ref = strtoupper($fuser->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d');
$this->ref = str_replace(' ','_', $this->user_author_infos).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d');
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// We rename directory in order to avoid losing the attachments