@@ -480,7 +480,18 @@ class Document extends ActiveRecordCommon | |||
public function getFilename() | |||
{ | |||
return $this->getType() . '-' . $this->reference . '.pdf'; | |||
$filename = $this->getType() . '-'; | |||
if($this->isStatusValid()) { | |||
$filename .= $this->reference; | |||
} | |||
elseif($this->isStatusDraft()) { | |||
$filename .= 'Brouillon-'.$this->id; | |||
} | |||
$filename .= '.pdf'; | |||
return $filename; | |||
} | |||
public function getFilenameComplete() |