Skip to content
Snippets Groups Projects
Commit 9ea1f2c4 authored by Jean-François Ferry's avatar Jean-François Ferry
Browse files

Use MAIN_DOC_USE_TIMING on invoices (odt)

parent e1120dfe
No related branches found
No related tags found
No related merge requests found
......@@ -336,12 +336,24 @@ class doc_generic_invoice_odt extends ModelePDFFactures
{
//print "srctemplatepath=".$srctemplatepath; // Src filename
$newfile=basename($srctemplatepath);
$newfiletmp=preg_replace('/\.odt/i','',$newfile);
$newfiletmp=preg_replace('/\.od(t|s)/i','',$newfile);
$newfiletmp=preg_replace('/template_/i','',$newfiletmp);
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
$newfiletmp=$objectref.'_'.$newfiletmp;
// Get extension (ods or odt)
$newfileformat=substr($newfile, strrpos($newfile, '.')+1);
if ( ! empty($conf->global->MAIN_DOC_USE_TIMING))
{
$filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat;
}
else
{
$filename=$newfiletmp.'.'.$newfileformat;
}
$file=$dir.'/'.$filename;
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
$file=$dir.'/'.$newfiletmp.'.odt';
//print "newdir=".$dir;
//print "newfile=".$newfile;
//print "file=".$file;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment