26@phan-var-force string $formatexportset
27@phan-var-force string $type_export
28@phan-var-force string $filename
29@phan-var-force int<-1,1> $downloadMode
33if (empty($conf) || !is_object($conf)) {
34 print
"Error, template page can't be called as URL";
41$nodateexport =
getDolGlobalInt(
'ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME');
44$date_export =
"_".dol_print_date(
dol_now(),
'%Y%m%d%H%M%S');
48if (empty($downloadMode)) {
49 header(
'Content-Type: text/csv');
52include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
56if ((substr($accountancyexport->getFormatCode($formatexportset), 0, 3) ==
'fec') && $type_export ==
"general_ledger") {
58 if (empty($search_date_end)) {
62 $datetouseforfilename = $search_date_end;
66 if ($tmparray[
'mon'] < $fiscalmonth || $fiscalmonth == 1) {
67 $tmparray[
'mon'] = $fiscalmonth == 1 ? 12 : $fiscalmonth - 1;
69 $tmparray[
'mon'] = $fiscalmonth - 1;
74 $siren = str_replace(
" ",
"", $siren);
75 $completefilename = $siren.
"FEC".$endaccountingperiod.
".txt";
76} elseif ($accountancyexport->getFormatCode($formatexportset) ==
'ciel' && $type_export ==
"general_ledger" &&
getDolGlobalString(
'ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME')) {
77 $completefilename =
"XIMPORT.TXT";
79 $completefilename = ($code ? $code.
"_" :
"").($prefix ? $prefix.
"_" :
"").$filename.($nodateexport ?
"" : $date_export).
".".$format;
82if (empty($downloadMode)) {
83 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.