generate new pdf when validate billing

This commit is contained in:
De Coninck Laurent
2017-02-21 19:33:32 +01:00
parent 04d73668cc
commit 2ecf50a6cc

View File

@@ -187,7 +187,21 @@ if (empty($reshook))
if ($result < 0)
{
setEventMessages($object->error,$object->errors,'errors');
}
}else{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result);
}
}
}