generate new pdf when validate billing
This commit is contained in:
parent
04d73668cc
commit
2ecf50a6cc
@ -187,7 +187,21 @@ if (empty($reshook))
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error,$object->errors,'errors');
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user