From af1305a0a878a1cc5dd9ca4c20a8557f033f9ce6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 1 Nov 2018 07:24:48 +0100 Subject: [PATCH] Fix Specific finename for FEC export only available on general ledger export --- htdocs/accountancy/bookkeeping/balance.php | 1 + htdocs/accountancy/class/accountancyexport.class.php | 1 + htdocs/accountancy/journal/bankjournal.php | 1 + htdocs/accountancy/journal/expensereportsjournal.php | 1 + htdocs/accountancy/journal/purchasesjournal.php | 1 + htdocs/accountancy/journal/sellsjournal.php | 1 + htdocs/accountancy/tpl/export_journal.tpl.php | 3 +-- 7 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 9feb2a7c234..9b9598074cb 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -151,6 +151,7 @@ if ($action == 'export_csv') $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'balance'; + $type_export = 'balance'; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; $result = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter); diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 7b832976e89..5d76a7155d6 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -218,6 +218,7 @@ class AccountancyExport // Define name of file to save $filename = 'general_ledger-'.$this->getFormatCode($conf->global->ACCOUNTING_EXPORT_MODELCSV); + $type_export = 'general_ledger'; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 3b86835e927..da974af644e 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -750,6 +750,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'journal'; + $type_export = 'journal'; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; // CSV header line diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 9c39016f008..182be61d61c 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -429,6 +429,7 @@ $userstatic = new User($db); $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'journal'; + $type_export = 'journal'; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; // Model Cegid Expert Export diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index beb9891276f..034348fbee8 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -586,6 +586,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'journal'; + $type_export = 'journal'; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; $companystatic = new Fournisseur($db); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index ee7d45d6c66..b4a364cd912 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -547,6 +547,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'journal'; + $type_export = 'journal'; 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 index d0d902770c0..ca3c9c49ea0 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -35,9 +35,8 @@ $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); header('Content-Type: text/csv'); -if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11") // Specific filename for FEC model export +if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11" && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger { - // FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle if (empty($search_date_end)) {