--- /tmp/dsg/dolibarr/htdocs/accountancy/tpl/github_19.0.3_export_journal.tpl.php +++ /tmp/dsg/dolibarr/htdocs/accountancy/tpl/client_export_journal.tpl.php @@ -2,2 +2 @@ -/* Copyright (C) 2015-2022 Alexandre Spangaro - * Copyright (C) 2022 Lionel Vessiller +/* Copyright (C) 2015-2018 Alexandre Spangaro @@ -5 +3,0 @@ - * Copyright (C) 2022 Progiseize @@ -21,3 +18,0 @@ -// $formatexportset must be defined -// $downloadMode =0 for direct download or =1 to download after writing files or =-1 not to download files - @@ -25 +20,2 @@ -if (empty($conf) || !is_object($conf)) { +if (empty($conf) || !is_object($conf)) +{ @@ -30,5 +26,5 @@ -$code = getDolGlobalString('MAIN_INFO_ACCOUNTANT_CODE'); -$prefix = getDolGlobalString('ACCOUNTING_EXPORT_PREFIX_SPEC'); -$format = getDolGlobalString('ACCOUNTING_EXPORT_FORMAT'); -$nodateexport = getDolGlobalInt('ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME'); -$siren = getDolGlobalString('MAIN_INFO_SIREN'); +$code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE; +$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC; +$format = $conf->global->ACCOUNTING_EXPORT_FORMAT; +$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME; +$siren = $conf->global->MAIN_INFO_SIREN; @@ -39,3 +35 @@ -if (empty($downloadMode)) { - header('Content-Type: text/csv'); -} +header('Content-Type: text/csv'); @@ -46,3 +40,2 @@ -// Specific filename for FEC model export into the general ledger -if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountancyexport->getFormatCode($formatexportset) == 'fec2') - && $type_export == "general_ledger") { +if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger +{ @@ -50,2 +43,3 @@ - if (empty($search_date_end)) { - // TODO Get the max date into bookkeeping table + if (empty($search_date_end)) + { + // TODO Get the max date into bookeeping table @@ -56 +50 @@ - $fiscalmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $fiscalmonth = empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START; @@ -58,4 +52,3 @@ - if ($tmparray['mon'] < $fiscalmonth || $fiscalmonth == 1) { - $tmparray['mon'] = $fiscalmonth == 1 ? 12 : $fiscalmonth - 1; - } else { - $tmparray['mon'] = $fiscalmonth - 1; + if ($tmparray['mon'] <= $fiscalmonth) $tmparray['mon'] = $fiscalmonth; + else { + $tmparray['mon'] = $fiscalmonth; @@ -66 +59 @@ - $siren = str_replace(" ", "", $siren); + @@ -68,3 +61,3 @@ -} elseif ($accountancyexport->getFormatCode($formatexportset) == 'ciel' && $type_export == "general_ledger" && getDolGlobalString('ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME')) { - $completefilename = "XIMPORT.TXT"; -} else { +} +else +{ @@ -74,3 +67 @@ -if (empty($downloadMode)) { - header('Content-Disposition: attachment;filename=' . $completefilename); -} +header('Content-Disposition: attachment;filename='.$completefilename);