diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php
index 856670e18e23b98fe9eba953dbc5b975e0c3f896..6ba6c05208ac7918739820744134a691f71fe790 100644
--- a/htdocs/accountancy/admin/export.php
+++ b/htdocs/accountancy/admin/export.php
@@ -4,7 +4,7 @@
  * Copyright (C) 2014	   Florian Henry		<florian.henry@open-concept.pro>
  * Copyright (C) 2014      Marcos García        <marcosgdf@gmail.com>
  * Copyright (C) 2014	   Juanjo Menent		<jmenent@2byte.es>
- * Copyright (C) 2015       Jean-François Ferry		<jfefe@aternatik.fr>
+ * Copyright (C) 2015      Jean-François Ferry	<jfefe@aternatik.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -43,8 +43,12 @@ if (!$user->admin)
 
 $action = GETPOST('action', 'alpha');
 
-// Other parameters ACCOUNTING_EXPORT_*
-$list = array (
+// Parameters ACCOUNTING_EXPORT_*
+$main_option = array (
+		'ACCOUNTING_EXPORT_PREFIX_SPEC'
+);
+
+$model_option = array (
 		'ACCOUNTING_EXPORT_SEPARATORCSV',
 		'ACCOUNTING_EXPORT_DATE',
 		'ACCOUNTING_EXPORT_PIECE',
@@ -60,10 +64,18 @@ $list = array (
 if ($action == 'update') {
 	$error = 0;
 
+	$format = GETPOST('format', 'alpha');
 	$modelcsv = GETPOST('modelcsv', 'int');
+	
+	if (! empty($format)) {
+		if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', $format, 'chaine', 0, '', $conf->entity)) {
+			$error ++;
+		}
+	} else {
+		$error ++;
+	}
 
 	if (! empty($modelcsv)) {
-
 		if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
 			$error ++;
 		}
@@ -71,7 +83,15 @@ if ($action == 'update') {
 		$error ++;
 	}
 
-	foreach ( $list as $constname ) {
+	foreach ($main_option as $constname) {
+		$constvalue = GETPOST($constname, 'alpha');
+
+		if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
+			$error ++;
+		}
+	}
+
+	foreach ($model_option as $constname) {
 		$constvalue = GETPOST($constname, 'alpha');
 
 		if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
@@ -106,9 +126,67 @@ print '<input type="hidden" name="action" value="update">';
 
 dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron');
 
-print '<table class="noborder" width="100%">';
 $var = true;
 
+/*
+ * Main Options
+ */
+print '<table class="noborder" width="100%">';
+print '<tr class="liste_titre">';
+print '<td colspan="3">' . $langs->trans('MainOptions') . '</td>';
+print "</tr>\n";
+
+$var = ! $var;
+
+print '<tr ' . $bc[$var] . '>';
+print '<td width="50%">' . $langs->trans("Selectformat") . '</td>';
+if (! $conf->use_javascript_ajax)
+{
+	print '<td class="nowrap">';
+	print $langs->trans("NotAvailableWhenAjaxDisabled");
+	print "</td>";
+}
+else
+{
+	print '<td>';
+	$listformat=array(
+		'csv'=>$langs->trans("csv"),
+		'txt'=>$langs->trans("txt")
+	);
+	print $form->selectarray("format",$listformat,$conf->global->ACCOUNTING_EXPORT_FORMAT,0);
+
+	print '</td>';
+}
+print "</td></tr>";
+
+$num = count($main_option);
+if ($num)
+{
+	foreach ($main_option as $key) {
+		$var = ! $var;
+
+		print '<tr ' . $bc[$var] . ' class="value">';
+
+		// Param
+		$label = $langs->trans($key);
+		print '<td width="50%">' . $label . '</td>';
+
+		// Value
+		print '<td>';
+		print '<input type="text" size="20" name="' . $key . '" value="' . $conf->global->$key . '">';
+		print '</td></tr>';
+	}
+}
+
+print "</table>\n";
+
+print "<br>\n";
+
+/*
+ * Export model
+ */
+print '<table class="noborder" width="100%">';
+
 print '<tr class="liste_titre">';
 print '<td colspan="2">' . $langs->trans("Modelcsv") . '</td>';
 print '</tr>';
@@ -143,8 +221,8 @@ print "<br>\n";
  *  Parameters
  */
 
-$num = count($list);
-if ($num)
+$num2 = count($model_option);
+if ($num2)
 {
 	print '<table class="noborder" width="100%">';
 	print '<tr class="liste_titre">';
@@ -152,7 +230,7 @@ if ($num)
 	print "</tr>\n";
 	if ($conf->global->ACCOUNTING_EXPORT_MODELCSV > 1) print '<tr><td colspan="2" bgcolor="red"><b>' . $langs->trans('OptionsDeactivatedForThisExportModel') . '</b></td></tr>';
 
-	foreach ( $list as $key ) {
+	foreach ($model_option as $key) {
 		$var = ! $var;
 
 		print '<tr ' . $bc[$var] . ' class="value">';
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 250d90016795b8330ab41bcadd2ac4d96d2dc9d2..3034297de7b0123a88ce1935dd6d9b84562b8b6b 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -16,7 +16,7 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * GNU General Public License fr more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -25,7 +25,7 @@
 /**
  *	\file		htdocs/accountancy/journal/bankjournal.php
  *	\ingroup	Accounting Expert
- *	\brief		Page with sells journal
+ *	\brief		Page with bank journal
  */
 
 require '../../main.inc.php';
@@ -66,6 +66,8 @@ $date_endday = GETPOST('date_endday');
 $date_endyear = GETPOST('date_endyear');
 $action = GETPOST('action');
 
+$now = dol_now();
+
 // Security check
 if ($user->societe_id > 0)
 	accessforbidden();
@@ -421,10 +423,9 @@ if ($action == 'writeBookKeeping')
 if ($action == 'export_csv')
 {
 	$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
-	$bank_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
+	$journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
 
-	header('Content-Type: text/csv');
-	header('Content-Disposition: attachment;filename=journal_banque.csv');
+	include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
 
 	$companystatic = new Client($db);
 
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 8d0502ad57c55290798e9cc3e770cd99fb1beb15..a5ba24b871f8db6cd2583a165ada6e60b7fc5a8e 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2010	Jean Heimburger		<jean@tiaris.info>
  * Copyright (C) 2011		Juanjo Menent		<jmenent@2byte.es>
  * Copyright (C) 2012		Regis Houssin		<regis@dolibarr.fr>
- * Copyright (C) 2013-2014  Alexandre Spangaro	<aspangaro.dolibarr@gmail.com>
+ * Copyright (C) 2013-2015  Alexandre Spangaro	<aspangaro.dolibarr@gmail.com>
  * Copyright (C) 2013-2014  Olivier Geffroy		<jeff@jeffinfo.com>
  * Copyright (C) 2013-2014  Florian Henry	    <florian.henry@open-concept.pro>
  *
@@ -52,6 +52,8 @@ $date_endmonth = GETPOST('date_endmonth');
 $date_endday = GETPOST('date_endday');
 $date_endyear = GETPOST('date_endyear');
 
+$now = dol_now();
+
 // Security check
 if ($user->societe_id > 0)
 	accessforbidden();
@@ -156,7 +158,6 @@ if ($result) {
 
 // Bookkeeping Write
 if ($action == 'writebookkeeping') {
-	$now = dol_now();
 
 	foreach ( $tabfac as $key => $val ) {
 		foreach ( $tabttc[$key] as $k => $mt ) {
@@ -246,15 +247,10 @@ $companystatic = new Fournisseur($db);
 if ($action == 'export_csv')
 {
 	$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
-	$purchase_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
-
-	header('Content-Type: text/csv');
-	if ($conf->global->EXPORT_PREFIX_SPEC)
-		$filename=$conf->global->EXPORT_PREFIX_SPEC."_"."journal_achats.csv";
-	else
-		$filename="journal_achats.csv";
-	header('Content-Disposition: attachment;filename='.$filename);
-
+	$journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
+	
+	include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
+	
 	if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) 	// Model Cegid Expert Export
 	{
 		$sep = ";";
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index 60fd24600674b38b317d814882ac5231b922cc4a..c0fe6e84f963881aa64b84efa331dbceab6aa80b 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -54,6 +54,8 @@ $date_endmonth = GETPOST('date_endmonth');
 $date_endday = GETPOST('date_endday');
 $date_endyear = GETPOST('date_endyear');
 
+$now = dol_now();
+
 // Security check
 if ($user->societe_id > 0)
 	accessforbidden();
@@ -191,7 +193,6 @@ if ($result) {
 // Bookkeeping Write
 if ($action == 'writebookkeeping')
 {
-	$now = dol_now();
 
 	foreach ($tabfac as $key => $val)
 	{
@@ -275,14 +276,9 @@ if ($action == 'writebookkeeping')
 if ($action == 'export_csv')
 {
 	$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
-	$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
+	$journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
 
-	header('Content-Type: text/csv');
-	if ($conf->global->EXPORT_PREFIX_SPEC)
-		$filename=$conf->global->EXPORT_PREFIX_SPEC."_"."journal_ventes.csv";
-	else
-		$filename="journal_ventes.csv";
-	header('Content-Disposition: attachment;filename='.$filename);
+	include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
 
 	$companystatic = new Client($db);
 
diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php
new file mode 100644
index 0000000000000000000000000000000000000000..c1ac19912ae76bd90aedcb20fe44b850c7a3f0ac
--- /dev/null
+++ b/htdocs/accountancy/tpl/export_journal.tpl.php
@@ -0,0 +1,28 @@
+<?php
+/* Copyright (C) 2015  Alexandre Spangaro	<aspangaro.dolibarr@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+ 
+$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
+$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
+	
+$date_export = dol_print_date($now, '%Y%m%d%H%M%S');
+
+header('Content-Type: text/csv');
+if ($prefix)
+	$filename = $prefix . "_" . "journal_" . $journal . $date_export . "." . $format;
+else
+	$filename = "journal_" . $journal . $date_export . "." . $format;
+header('Content-Disposition: attachment;filename='.$filename);
\ No newline at end of file
diff --git a/htdocs/accountancy/tpl/index.html b/htdocs/accountancy/tpl/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
index 8b64acf2ce8e5fa9499eb31502264c1dd6d38f2e..53b0eb4a6b6ae8afde80479950a85b62996578f8 100644
--- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
+++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
@@ -23,3 +23,5 @@ INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXP
 
 ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
 ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);
+
+UPDATE llx_const SET name = __ENCRYPT('ACCOUNTING_EXPORT_PREFIX_SPEC')__ WHERE __DECRYPT('name')__ = 'EXPORT_PREFIX_SPEC';