diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 0e5d27dd316..f13d2df07b8 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -572,7 +572,7 @@ function show_stats_for_company($product, $socid)
print '
| ';
print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("RecurringInvoiceTemplate").'';
print ' | ';
- print $product->stats_facture['customers'];
+ print $product->stats_facturerec['customers'];
print ' | ';
print $product->stats_facturerec['nb'];
print ' | ';
@@ -599,6 +599,27 @@ function show_stats_for_company($product, $socid)
print ' | ';
print '
';
}
+ // Supplier template invoices
+ /* TODO
+ if (isModEnabled("invoice") && $user->hasRight('fournisseur', 'facture', 'lire')) {
+ $nblines++;
+ $ret = $product->load_stats_facture_fournisseurrec($socid);
+ if ($ret < 0) {
+ dol_print_error($db);
+ }
+ $langs->load("bills");
+ print '| ';
+ print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("RecurringInvoiceTemplate").'';
+ print ' | ';
+ print $product->stats_facturefournrec['customers'];
+ print ' | ';
+ print $product->stats_facturefournrec['nb'];
+ print ' | ';
+ print $product->stats_facturefournrec['qty'];
+ print ' | ';
+ print '
';
+ }
+ */
// Shipments
if (isModEnabled('shipping') && $user->hasRight('shipping', 'lire')) {
diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php
index c52f98d2b91..12c80b596da 100644
--- a/htdocs/core/lib/website2.lib.php
+++ b/htdocs/core/lib/website2.lib.php
@@ -187,6 +187,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
$tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n";
$tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
$tplcontent .= "ob_start();\n";
+ $tplcontent .= "try {\n";
$tplcontent .= "// END PHP ?>\n";
if (getDolGlobalString('WEBSITE_FORCE_DOCTYPE_HTML5')) {
$tplcontent .= "\n";
@@ -313,13 +314,14 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
$tplcontent .= preg_replace('/<\/?html>/ims', '', $objectpage->htmlheader)."\n";
$tplcontent .= ''."\n";
- $tplcontent .= ''."\n";
+ $tplcontent .= ''."\n";
$tplcontent .= ''."\n";
$tplcontent .= $objectpage->content."\n";
$tplcontent .= ''."\n";
$tplcontent .= '