Add generateDocument function to entrepot class

This commit is contained in:
wdammak 2018-05-18 14:59:42 +01:00 committed by GitHub
parent e01d9a62bc
commit 5fef8c2dc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -707,5 +707,37 @@ class Entrepot extends CommonObject
return $TChildWarehouses;
}
/**
* Create object on disk
*
* @param string $modele force le modele a utiliser ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs='',$hidedetails=0,$hidedesc=0,$hideref=0)
{
global $conf,$user,$langs;
$langs->load("stocks");
if (! dol_strlen($modele)) {
$modele = 'standard';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->STOCK_ADDON_PDF)) {
$modele = $conf->global->STOCK_ADDON_PDF;
}
}
$modelpath = "core/modules/stock/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}