From 5dd8d1c4ef0d471788f9815bd4cf44f22795e2d8 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Tue, 27 Jun 2017 17:56:45 +0200
Subject: [PATCH] Rename button to make clear for user that the export is not
 the real journal but a temporary situation.

---
 htdocs/accountancy/journal/bankjournal.php      |  2 +-
 htdocs/accountancy/journal/purchasesjournal.php |  6 +++---
 htdocs/accountancy/journal/sellsjournal.php     | 16 ++++++++--------
 htdocs/langs/en_US/accountancy.lang             |  1 +
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 86931ed31c0..10467294052 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -752,7 +752,7 @@ if (empty($action) || $action == 'view') {
 
 	print '<div class="tabsAction tabsActionNoBottom">';
 	print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
-	print '<input type="button" class="butAction" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
+	print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
 	print '</div>';
 
 	// TODO Avoid using js. We can use a direct link with $param
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 06e681285b2..c3ed681308c 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -109,7 +109,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
 }
 if ($date_start && $date_end)
 	$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
-if ($in_bookkeeping == 'yes')    
+if ($in_bookkeeping == 'yes')
 	$sql .= " AND (f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab  WHERE ab.doc_type='supplier_invoice') )";
 $sql .= " ORDER BY f.datef";
 
@@ -467,7 +467,7 @@ if ($action == 'export_csv') {
 				print '"' . $journal_label . '"' ;
 				print "\n";
 			}
-			
+
 		}
 	}
 
@@ -513,7 +513,7 @@ if (empty($action) || $action == 'view') {
 	else {
 	    print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
 	}
-	print '<input type="button" class="butAction" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
+	print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
 	print '</div>';
 
 	print '
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index 720e020f7c8..c77d9305d12 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -114,7 +114,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
 $sql .= " AND fd.product_type IN (0,1)";
 if ($date_start && $date_end)
 	$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
-if ($in_bookkeeping == 'yes')    
+if ($in_bookkeeping == 'yes')
 	$sql .= " AND (f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab  WHERE ab.doc_type='customer_invoice') )";
 $sql .= " ORDER BY f.datef";
 
@@ -408,7 +408,7 @@ if ($action == 'export_csv') {
 
 	$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
 	$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
-	
+
 
 	include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
 
@@ -424,7 +424,7 @@ if ($action == 'export_csv') {
 			$invoicestatic->ref = $val["ref"];
 
 			$date = dol_print_date($val["date"], 'day');
-		
+
 			foreach ( $tabttc[$key] as $k => $mt ) {
 				print '"' . $key . '"' . $sep;
                 print '"' . $date . '"' . $sep;
@@ -445,7 +445,7 @@ if ($action == 'export_csv') {
 			foreach ( $tabht[$key] as $k => $mt ) {
 				$accountingaccount = new AccountingAccount($db);
 				$accountingaccount->fetch(null, $k, true);
-				
+
 
 				if ($mt) {
 					print '"' . $key . '"' . $sep;
@@ -466,9 +466,9 @@ if ($action == 'export_csv') {
 
 			// VAT
 			foreach ( $tabtva[$key] as $k => $mt ) {
-			
-			
-			
+
+
+
 				if ($mt) {
 					print '"' . $key . '"' . $sep;
                     print '"' . $date . '"' . $sep;
@@ -523,7 +523,7 @@ if (empty($action) || $action == 'view') {
 	else {
 	   print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
 	}
-	print '<input type="button" class="butAction" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
+	print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
 	print '</div>';
 
 	print '
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index f9ec68a1689..bcbac85c17d 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -221,6 +221,7 @@ ErrorAccountingJournalIsAlreadyUse=This journal is already use
 ## Export
 Exports=Exports
 Export=Export
+ExportDraftJournal=Export draft journal
 Modelcsv=Model of export
 OptionsDeactivatedForThisExportModel=For this export model, options are deactivated
 Selectmodelcsv=Select a model of export
-- 
GitLab