Browse Source

[Backend] Documents : correctif problème génération pdf (nom fichier brouillon)

refactoring
Guillaume Bourgeois 2 years ago
parent
commit
b79c8ca379
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      common/models/Document.php

+ 12
- 1
common/models/Document.php View File

@@ -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()

Loading…
Cancel
Save