diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php index 4c5f7941248..bfe4c4d1f43 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/fournisseur.php @@ -88,6 +88,41 @@ if ($_GET["action"] == 'specimen') } } +if ($_GET["action"] == 'specimenfacture') +{ + $modele=$_GET["module"]; + + $facture = new FactureFournisseur($db); + $facture->initAsSpecimen(); + + // Charge le modele + $dir = DOL_DOCUMENT_ROOT . "/includes/modules/supplier_invoice/pdf/"; + $file = "pdf_".$modele.".modules.php"; + if (file_exists($dir.$file)) + { + $classname = "pdf_".$modele; + require_once($dir.$file); + + $obj = new $classname($db); + + if ($obj->write_file($facture,$langs) > 0) + { + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf"); + return; + } + else + { + $mesg='
| '.$langs->trans("Name")." | \n"; +print "".$langs->trans("Description")." | \n"; +print ''.$langs->trans("Status")." | \n"; +print ''.$langs->trans("Default")." | \n"; +print ''.$langs->trans("Info").' | '; +print "||
| $name"; + print " | \n\n"; + require_once($dir.$file); + $module = new $classname($db); + print $module->description; + print " | \n"; + + // Active + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") + { + print ''; + print img_picto($langs->trans("Enabled"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"),'on'); + } + print " | "; + } + else + { + print "\n"; + print ''.img_picto($langs->trans("Disabled"),'off').''; + print " | "; + } + + // Defaut + print ""; + if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'on').''; + } + print ' | '; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.=''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ' | '; + print ''; + print ''.img_object($langs->trans("Preview"),'order').''; + print ' | '; + + print "