Removed deprecated usage of facture_pdf_create
This commit is contained in:
parent
610dc8cd0c
commit
4b3191b64e
@ -482,7 +482,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
|||||||
}
|
}
|
||||||
// Generate PDF (whatever is option MAIN_DISABLE_PDF_AUTOUPDATE) so we can include it into email
|
// Generate PDF (whatever is option MAIN_DISABLE_PDF_AUTOUPDATE) so we can include it into email
|
||||||
//if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
//if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
facture_pdf_create($db, $invoice, $invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
|
||||||
|
$invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -190,7 +190,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
|
|||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
$result = facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
if ($result >= 0) {
|
if ($result >= 0) {
|
||||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
|
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
|
||||||
@ -402,7 +402,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
|
|||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (count($object->errors)) setEventMessage($object->errors, 'errors');
|
if (count($object->errors)) setEventMessage($object->errors, 'errors');
|
||||||
@ -477,7 +477,7 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
|
|||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1285,7 +1285,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($_POST ['prod_entry_mode']);
|
unset($_POST ['prod_entry_mode']);
|
||||||
@ -1416,7 +1416,7 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($_POST['qty']);
|
unset($_POST['qty']);
|
||||||
@ -1459,8 +1459,9 @@ else if ($action == 'up' && $user->rights->facture->creer) {
|
|||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
}
|
||||||
|
|
||||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']);
|
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']);
|
||||||
exit();
|
exit();
|
||||||
@ -1481,8 +1482,9 @@ else if ($action == 'down' && $user->rights->facture->creer) {
|
|||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
}
|
||||||
|
|
||||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']);
|
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '#' . $_GET ['rowid']);
|
||||||
exit();
|
exit();
|
||||||
@ -1705,7 +1707,7 @@ else if ($action == 'builddoc') // En get ou en post
|
|||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
$result = facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db, $result);
|
dol_print_error($db, $result);
|
||||||
@ -3707,7 +3709,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
if (! $file || ! is_readable($file)) {
|
if (! $file || ! is_readable($file)) {
|
||||||
$result = facture_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
dol_print_error($db, $result);
|
dol_print_error($db, $result);
|
||||||
exit();
|
exit();
|
||||||
|
|||||||
@ -112,7 +112,9 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $fac, $fac->modelpdf, $outputlangs);
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
|
$fac->generateDocument($fac->modelpdf, $outputlangs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||||
|
|||||||
@ -98,7 +98,9 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $fac, $fac->modelpdf, $outputlangs);
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
|
$fac->generateDocument($fac->modelpdf, $outputlangs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Location: fiche.php?id='.$paiement->id);
|
header('Location: fiche.php?id='.$paiement->id);
|
||||||
|
|||||||
@ -174,7 +174,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
|||||||
if ($regenerate || ! dol_is_file($filename))
|
if ($regenerate || ! dol_is_file($filename))
|
||||||
{
|
{
|
||||||
if ($usestdout) print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n";
|
if ($usestdout) print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n";
|
||||||
$result=facture_pdf_create($db, $fac, $regenerate?$regenerate:$fac->modelpdf, $outputlangs);
|
$result= $fac->generateDocument($regenerate?$regenerate:$fac->modelpdf, $outputlangs);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($usestdout) print "PDF for invoice ".$obj->facnumber." already exists\n";
|
if ($usestdout) print "PDF for invoice ".$obj->facnumber." already exists\n";
|
||||||
|
|||||||
@ -173,7 +173,7 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
// Crabe (english)
|
// Crabe (english)
|
||||||
$localobject->modelpdf='crabe';
|
$localobject->modelpdf='crabe';
|
||||||
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $langs);
|
$result = $localobject->generateDocument($localobject->modelpdf, $langs);
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
$newlangs1=new Translate("",$conf);
|
$newlangs1=new Translate("",$conf);
|
||||||
$newlangs1->setDefaultLang('ja_JP');
|
$newlangs1->setDefaultLang('ja_JP');
|
||||||
$localobject->modelpdf='crabe';
|
$localobject->modelpdf='crabe';
|
||||||
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs1);
|
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs1);
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
$newlangs2a=new Translate("",$conf);
|
$newlangs2a=new Translate("",$conf);
|
||||||
$newlangs2a->setDefaultLang('sa_SA');
|
$newlangs2a->setDefaultLang('sa_SA');
|
||||||
$localobject->modelpdf='crabe';
|
$localobject->modelpdf='crabe';
|
||||||
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs2a);
|
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs2a);
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
$newlangs2b=new Translate("",$conf);
|
$newlangs2b=new Translate("",$conf);
|
||||||
$newlangs2b->setDefaultLang('en_SA');
|
$newlangs2b->setDefaultLang('en_SA');
|
||||||
$localobject->modelpdf='crabe';
|
$localobject->modelpdf='crabe';
|
||||||
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs2b);
|
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs2b);
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
$newlangs3=new Translate("",$conf);
|
$newlangs3=new Translate("",$conf);
|
||||||
$newlangs3->setDefaultLang('el_GR');
|
$newlangs3->setDefaultLang('el_GR');
|
||||||
$localobject->modelpdf='crabe';
|
$localobject->modelpdf='crabe';
|
||||||
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs3);
|
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs3);
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
$newlangs4=new Translate("",$conf);
|
$newlangs4=new Translate("",$conf);
|
||||||
$newlangs4->setDefaultLang('zh_CN');
|
$newlangs4->setDefaultLang('zh_CN');
|
||||||
$localobject->modelpdf='crabe';
|
$localobject->modelpdf='crabe';
|
||||||
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs4);
|
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs4);
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
$newlangs5=new Translate("",$conf);
|
$newlangs5=new Translate("",$conf);
|
||||||
$newlangs5->setDefaultLang('ru_RU');
|
$newlangs5->setDefaultLang('ru_RU');
|
||||||
$localobject->modelpdf='crabe';
|
$localobject->modelpdf='crabe';
|
||||||
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs5);
|
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs5);
|
||||||
$this->assertLessThan($result, 0);
|
$this->assertLessThan($result, 0);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user