From e81bcbde318831703531bca1aa45a27bb90cdf97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 16:08:00 +0100 Subject: [PATCH] FIX export ledger --- htdocs/accountancy/class/accountancyexport.class.php | 2 +- htdocs/accountancy/tpl/export_journal.tpl.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index d945513f952..46d3feae5b2 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -125,7 +125,7 @@ class AccountancyExport * @param int $type Format id * @return string Format code */ - private static function getFormatCode($type) + public static function getFormatCode($type) { $formatcode = array( self::$EXPORT_TYPE_CONFIGURABLE => 'csv', diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index 0dec55630d3..4537c497ff6 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -34,8 +34,10 @@ $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); header('Content-Type: text/csv'); +include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; +$accountancyexport = new AccountancyExport($db); -if ($this->getFormatCode($formatexportset) == "fec" && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger +if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $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))