diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index aa496a17720..ba7272ef59e 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -88,10 +88,6 @@ if ($action == 'setdate' && $user->rights->banque->cheque) } } -/* - * Actions - */ - if ($action == 'setrefext' && $user->rights->banque->cheque) { $result = $object->fetch(GETPOST('id','int')); @@ -282,7 +278,7 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque) $langs->load("other"); - $file=$dir.get_exdir($object->number,2,1,0,$object,'cheque') . GETPOST('file'); + $file=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . GETPOST('file'); $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); @@ -655,7 +651,6 @@ else print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Payment"),$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; $i=1; $var=false; @@ -751,7 +746,7 @@ if ($action != 'new') if ($object->statut == 1) { $filename=dol_sanitizeFileName($object->ref); - $filedir=$dir.get_exdir($object->number,2,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref); + $filedir=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . dol_sanitizeFileName($object->ref); $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $formfile->show_documents('remisecheque', $filename, $filedir, $urlsource, 1, 1); diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index a51072fe2de..d526cb2f601 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -548,7 +548,7 @@ class RemiseCheque extends CommonObject // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charseSupprimert_output=$outputlangs->charset_output; - $result=$docmodel->write_file($conf->banque->dir_output.'/bordereau', $this->number, $outputlangs); + $result=$docmodel->write_file($this, $conf->banque->dir_output.'/bordereau', $this->number, $outputlangs); if ($result > 0) { //$outputlangs->charset_output=$sav_charset_output; diff --git a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php index d8a4823c785..a7baec4364f 100644 --- a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2009 Laurent Destailleur +/* Copyright (C) 2006 Rodolphe Quiedeville + * Copyright (C) 2009-2015 Laurent Destailleur * * 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 @@ -76,14 +76,15 @@ class BordereauChequeBlochet extends ModeleChequeReceipts } /** - * Fonction generant le rapport sur le disque + * Fonction to generate document on disk * - * @param string $_dir Directory - * @param string $number Number - * @param Translate $outputlangs Lang output object - * @return int 1=ok, 0=ko + * @param RemiseCheque $object Object RemiseCheque + * @param string $_dir Directory + * @param string $number Number + * @param Translate $outputlangs Lang output object + * @return int 1=ok, 0=ko */ - function write_file($_dir, $number, $outputlangs) + function write_file($object, $_dir, $number, $outputlangs) { global $user,$conf,$langs,$hookmanager; @@ -98,7 +99,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $outputlangs->load("products"); $outputlangs->load("compta"); - $dir = $_dir . "/".get_exdir($number,2,1,0,null,'cheque').$number; + $dir = $_dir . "/".get_exdir($number,0,1,0,$object,'cheque').$number; if (! is_dir($dir)) {