Fix: [ bug #248 ] Send by mail doesn't find the files in provider's

invoices
This commit is contained in:
Laurent Destailleur 2011-12-21 17:29:04 +01:00
parent decf7e682f
commit 2c12d99d42

View File

@ -677,7 +677,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
if ($result > 0) if ($result > 0)
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
$file = $conf->fournisseur->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf'; $file = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref.'/'.$ref.'.pdf';
if (is_readable($file)) if (is_readable($file))
{ {
@ -1831,7 +1831,7 @@ else
if ($action == 'presend') if ($action == 'presend')
{ {
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
$file = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref.'.pdf'; $file = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref.'/'.$ref.'.pdf';
print '<br>'; print '<br>';
print_titre($langs->trans('SendBillByMail')); print_titre($langs->trans('SendBillByMail'));