From e88a3758b1de88b6ceca119e39bc5b6dbbc69518 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Sun, 16 Dec 2007 15:31:46 +0000
Subject: [PATCH] Fix: Gestion erreur plus complete

---
 htdocs/compta/facture.php | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 67e59699957..81a342800ef 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -115,10 +115,13 @@ if (($_POST['action'] == 'confirm_deleteproductline' && $_POST['confirm'] == 'ye
 				$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs",$conf);
 				$outputlangs->setDefaultLang($_REQUEST['lang_id']);
 			}
-			facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs);
-
-			Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$_GET['facid']);
-			exit;
+			
+			$result=facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs);
+			if ($result > 0)
+			{
+				Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$_GET['facid']);
+				exit;
+			}
 		}
 		else
 		{
@@ -1146,6 +1149,8 @@ if ($_REQUEST['action'] == 'builddoc')	// En get ou en post
     }
 }
 
+
+
 llxHeader('',$langs->trans('Bill'),'HelpInvoice');
 
 $html = new Form($db);
-- 
GitLab