From 9ec6387a63df1e8dfe504272b7dc5288530f131a Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Mon, 28 May 2018 05:21:53 +0100 Subject: [PATCH 1/2] Add movement generateDocument function (mode dev) --- .../stock/class/mouvementstock.class.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) 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); + } } From 16503fee5813a1a14282b7f15b447c20e8b63cd6 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 28 May 2018 10:46:47 +0200 Subject: [PATCH 2/2] fix commend list --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 8ff8a32a9ff..da4734a3f80 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -420,7 +420,7 @@ if ($resql) if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref); if ($search_town != '') $param.='&search_town='.urlencode($search_town); if ($search_zip != '') $param.='&search_zip='.urlencode($search_zip); - if ($search_state != '') $param.='&search_state='.urlencode$search_state); + if ($search_state != '') $param.='&search_state='.urlencode($search_state); if ($search_country != '') $param.='&search_country='.urlencode($search_country); if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.urlencode($search_type_thirdparty); if ($search_product_category != '') $param.='&search_product_category='.urlencode($search_product_category);