Merge pull request #7565 from tarrsalah/fix_supplier_payment_builddoc
Fix supplier payment builddoc
This commit is contained in:
commit
337d6d9f08
@ -702,7 +702,7 @@ class PaiementFourn extends Paiement
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$modelpath = "core/modules/supplier_payment/pdf/";
|
$modelpath = "core/modules/supplier_payment/doc/";
|
||||||
|
|
||||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -140,30 +140,10 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build document
|
// Build document
|
||||||
if ($action == 'builddoc')
|
$upload_dir = $conf->fournisseur->payment->dir_output;
|
||||||
{
|
// TODO: get the appropriate permisson
|
||||||
// Save modele used
|
$permissioncreate = true;
|
||||||
$object->fetch($id);
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
$object->fetch_thirdparty();
|
|
||||||
|
|
||||||
// Save last template used to generate document
|
|
||||||
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
|
||||||
|
|
||||||
$outputlangs = $langs;
|
|
||||||
$newlang=GETPOST('lang_id','aZ09');
|
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
|
|
||||||
if (! empty($newlang))
|
|
||||||
{
|
|
||||||
$outputlangs = new Translate("",$conf);
|
|
||||||
$outputlangs->setDefaultLang($newlang);
|
|
||||||
}
|
|
||||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
|
||||||
if ($result < 0)
|
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
$action='';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user