Merge pull request #5462 from defrance/patch-10

Add : new param accounting export
This commit is contained in:
Laurent Destailleur 2016-07-14 20:09:48 +02:00 committed by GitHub
commit 7d73c45208

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,12 +17,12 @@
*/
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
$date_export = dol_print_date($now, '%Y%m%d%H%M%S');
header('Content-Type: text/csv');
if ($prefix)
$filename = $prefix . "_" . "journal_" . $journal . $date_export . "." . $format;
else
$filename = "journal_" . $journal . $date_export . "." . $format;
header('Content-Disposition: attachment;filename=' . $filename);
$filename = ($prefix?$prefix . "_":""). "journal_" . $journal . ($nodateexport?"":$date_export) . "." . $format;
header('Content-Disposition: attachment;filename=' . $filename);