Skip to content

Commit

Permalink
Removed deprecated usage of supplier_order_pdf_create and supplier_in…
Browse files Browse the repository at this point in the history
…voice_pdf_create
  • Loading branch information
marcosgdf committed Sep 16, 2014
1 parent 3561c8e commit 9ae7486
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
24 changes: 14 additions & 10 deletions htdocs/fourn/commande/fiche.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
$outputlangs->setDefaultLang($newlang);
}

supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}

unset($_POST ['prod_entry_mode']);
Expand Down Expand Up @@ -448,7 +448,7 @@
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($object->id); // Reload to get new records
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
else
Expand All @@ -473,7 +473,7 @@
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($object->id); // Reload to get new records
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
else
Expand Down Expand Up @@ -504,7 +504,7 @@
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($object->id); // Reload to get new records
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}
else
Expand Down Expand Up @@ -550,7 +550,7 @@
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;
Expand Down Expand Up @@ -582,7 +582,7 @@
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;
Expand Down Expand Up @@ -689,7 +689,9 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
exit;
}
Expand All @@ -703,7 +705,9 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
exit;
}
Expand All @@ -721,7 +725,7 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang(GETPOST('lang_id'));
}
$result=supplier_order_pdf_create($db, $object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref);
$result= $object->generateDocument($object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
dol_print_error($db,$result);
Expand Down Expand Up @@ -2033,7 +2037,7 @@
// Build document if it not exists
if (! $file || ! is_readable($file))
{
$result=supplier_order_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)
{
dol_print_error($db,$result);
Expand Down
10 changes: 5 additions & 5 deletions htdocs/fourn/facture/fiche.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@

if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
dol_print_error($db,$result);
Expand Down Expand Up @@ -699,7 +699,7 @@
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
dol_print_error($db,$result);
Expand Down Expand Up @@ -776,7 +776,7 @@
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
dol_print_error($db,$result);
Expand Down Expand Up @@ -1016,7 +1016,7 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
dol_print_error($db,$result);
Expand Down Expand Up @@ -2348,7 +2348,7 @@
// Build document if it not exists
if (! $file || ! is_readable($file))
{
$result=supplier_invoice_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)
{
dol_print_error($db,$result);
Expand Down
4 changes: 2 additions & 2 deletions test/phpunit/BuildDocTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function testFactureFournisseurBuild()

// Canelle
$localobject->modelpdf='canelle';
$result=supplier_invoice_pdf_create($db, $localobject, $localobject->modelpdf, $langs);
$result = $localobject->generateDocument($localobject->modelpdf, $langs);

$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
Expand Down Expand Up @@ -302,7 +302,7 @@ public function testCommandeFournisseurBuild()

// Muscadet
$localobject->modelpdf='muscadet';
$result=supplier_order_pdf_create($db, $localobject, $localobject->modelpdf, $langs);
$result= $localobject->generateDocument($localobject->modelpdf, $langs);

$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
Expand Down

0 comments on commit 9ae7486

Please sign in to comment.