25if (empty($conf) || !is_object($conf)) {
26 print
"Error, template page can't be called as URL";
33$nodateexport =
getDolGlobalInt(
'ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME');
36$date_export =
"_".dol_print_date(
dol_now(),
'%Y%m%d%H%M%S');
39if (empty($downloadMode)) {
40 header(
'Content-Type: text/csv');
43include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
47if (($accountancyexport->getFormatCode($formatexportset) ==
'fec' || $accountancyexport->getFormatCode($formatexportset) ==
'fec2')
48 && $type_export ==
"general_ledger") {
50 if (empty($search_date_end)) {
54 $datetouseforfilename = $search_date_end;
58 if ($tmparray[
'mon'] < $fiscalmonth || $fiscalmonth == 1) {
59 $tmparray[
'mon'] = $fiscalmonth == 1 ? 12 : $fiscalmonth - 1;
61 $tmparray[
'mon'] = $fiscalmonth - 1;
66 $siren = str_replace(
" ",
"", $siren);
67 $completefilename = $siren.
"FEC".$endaccountingperiod.
".txt";
68} elseif ($accountancyexport->getFormatCode($formatexportset) ==
'ciel' && $type_export ==
"general_ledger" &&
getDolGlobalString(
'ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME')) {
69 $completefilename =
"XIMPORT.TXT";
71 $completefilename = ($code ? $code.
"_" :
"").($prefix ? $prefix.
"_" :
"").$filename.($nodateexport ?
"" : $date_export).
".".$format;
74if (empty($downloadMode)) {
75 header(
'Content-Disposition: attachment;filename=' . $completefilename);
Manage the different format accountancy export.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.