diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index f27dfa4a70e..35b22cd8759 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1039,4 +1039,36 @@ class MouvementStock extends CommonObject return $langs->trans('StatusNotApplicable').' '.img_picto($langs->trans('StatusNotApplicable'),'statut9'); } } + + /** + * 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 = 'stdmovement'; + + if ($this->modelpdf) { + $modele = $this->modelpdf; + } elseif (! empty($conf->global->MOUVEMENT_ADDON_PDF)) { + $modele = $conf->global->MOUVEMENT_ADDON_PDF; + } + } + + $modelpath = "core/modules/stock/doc/"; + + return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); + } }