FIX export ledger

This commit is contained in:
Laurent Destailleur 2020-02-05 16:08:00 +01:00
parent fdfc45bbe9
commit e81bcbde31
2 changed files with 4 additions and 2 deletions

View File

@ -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',

View File

@ -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))