20 if (empty($conf) || !is_object($conf))
22 print "Error, template page can't be called as URL";
26 $code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE;
27 $prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
28 $format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
29 $nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
30 $siren = $conf->global->MAIN_INFO_SIREN;
32 $date_export =
"_".dol_print_date(
dol_now(),
'%Y%m%d%H%M%S');
35 header(
'Content-Type: text/csv');
37 include_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountancyexport.class.php';
40 if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export ==
"general_ledger")
43 if (empty($search_date_end))
48 $datetouseforfilename = $search_date_end;
50 $fiscalmonth = empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START;
52 if ($tmparray[
'mon'] <= $fiscalmonth) $tmparray[
'mon'] = $fiscalmonth;
54 $tmparray[
'mon'] = $fiscalmonth;
60 $completefilename = $siren.
"FEC".$endaccountingperiod.
".txt";
62 $completefilename = ($code ? $code.
"_" :
"").($prefix ? $prefix.
"_" :
"").$filename.($nodateexport ?
"" : $date_export).
".".$format;
65 header(
'Content-Disposition: attachment;filename='.$completefilename);
dol_now($mode= 'auto')
Return date for now.
dol_getdate($timestamp, $fast=false, $forcetimezone= '')
Return an array with locale date info.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Manage the different format accountancy export.