diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 2788526de051245023f33a547b8e8ba353e0f418..861de271dabaccfd61a42941497aecc6f7ce15cb 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -30,6 +30,8 @@
 class BookKeeping
 {
 	var $db;
+	var $error;
+
 	var $id;
 	var $doc_date;
 	var $doc_type;
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 97d52124c0175cf78a476bb9bf41064707b115c6..d2f204c6b8cee469818b17834cd08ba6122c9d8f 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -58,8 +58,10 @@ if ($user->societe_id > 0)
 
 $action = GETPOST('action');
 
+
+
 /*
- * View
+ * Actions
  */
 
 $year_current = strftime("%Y", dol_now());
@@ -152,9 +154,6 @@ if ($result) {
 	dol_print_error($db);
 }
 
-/*
- * Actions
-*/
 // Bookkeeping Write
 if ($action == 'writebookkeeping') {
 	$now = dol_now();
@@ -237,9 +236,16 @@ if ($action == 'writebookkeeping') {
 	}
 }
 
-// export csv
 
-if ($action == 'export_csv') {
+/*
+ * View
+ */
+
+$companystatic = new Societe($db);
+
+// export csv
+if ($action == 'export_csv')
+{
 	$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
 
 	header('Content-Type: text/csv');