27@phan-var-force string $formatexportset
28@phan-var-force string $type_export
29@phan-var-force string $filename
30@phan-var-force int<-1,1> $downloadMode
44 print
"Error, template page can't be called as URL";
51$nodateexport =
getDolGlobalInt(
'ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME');
54$date_export =
"_".dol_print_date(
dol_now(),
'%Y%m%d%H%M%S');
58if (empty($downloadMode)) {
59 header(
'Content-Type: text/csv');
62include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
66if ((substr($accountancyexport->getFormatCode($formatexportset), 0, 3) ==
'fec') && $type_export ==
"general_ledger") {
68 if (empty($search_date_end)) {
72 $datetouseforfilename = $search_date_end;
76 if ($tmparray[
'mon'] < $fiscalmonth || $fiscalmonth == 1) {
77 $tmparray[
'mon'] = $fiscalmonth == 1 ? 12 : $fiscalmonth - 1;
79 $tmparray[
'mon'] = $fiscalmonth - 1;
84 $siren = str_replace(
" ",
"", $siren);
85 $completefilename = $siren.
"FEC".$endaccountingperiod.
".txt";
86} elseif ($accountancyexport->getFormatCode($formatexportset) ==
'ciel' && $type_export ==
"general_ledger" &&
getDolGlobalString(
'ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME')) {
87 $completefilename =
"XIMPORT.TXT";
89 $completefilename = ($code ? $code.
"_" :
"").($prefix ? $prefix.
"_" :
"").$filename.($nodateexport ?
"" : $date_export).
".".$format;
92if (empty($downloadMode)) {
93 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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...