Skip to content

Commit

Permalink
Fix: Generated doc in wrong dir
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 6, 2011
1 parent 5311001 commit 0317ae7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/class/html.formfile.class.php
Expand Up @@ -128,7 +128,7 @@ function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm
/**
* Show the box with list of available documents for object
* @param modulepart propal, facture, facture_fourn, ...
* @param filename Sub dir to scan (Example: '9/9', 'FA9999'). Use '' if filedir already complete)
* @param filename Sub dir to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if filedir already complete)
* @param filedir Dir to scan
* @param urlsource Url of origin page (for return)
* @param genallowed Generation is allowed (1/0 or array of formats)
Expand Down Expand Up @@ -161,7 +161,7 @@ function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$d
$forcenomultilang=0;
}

$filename = dol_sanitizeFileName($filename);
//$filename = dol_sanitizeFileName($filename); //Must be sanitized before calling show_documents
$headershown=0;
$showempty=0;
$i=0;
Expand Down
15 changes: 7 additions & 8 deletions htdocs/fourn/facture/fiche.php
Expand Up @@ -1402,13 +1402,13 @@
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax1).'</td>';
print '<td align="right">'.price($fac->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax2).'</td>';
print '<td align="right">'.price($fac->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
}
Expand Down Expand Up @@ -1794,16 +1794,15 @@
* Documents generes
*/

$facfournref=dol_sanitizeFileName($fac->ref);
$file=$conf->fournisseur->dir_output.'/facture/'. $facfournref . '/' . $facfournref . '.pdf';
$relativepath = $facfournref.'/'.$facfournref.'.pdf';
$filedir = $conf->fournisseur->dir_output . '/facture/' . $facfournref;
$ref=dol_sanitizeFileName($fac->ref);
$subdir = get_exdir($fac->id,2).$ref;
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($fac->id,2).$ref;
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
$genallowed=$user->rights->fournisseur->facture->creer;
$delallowed=$user->rights->fournisseur->facture->supprimer;

print '<br>';
$somethingshown=$formfile->show_documents('facture_fournisseur',$facfournref,$filedir,$urlsource,$genallowed,$delallowed,$fac->modelpdf);
$somethingshown=$formfile->show_documents('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$fac->modelpdf);

$object=$fac;

Expand Down Expand Up @@ -1840,7 +1839,7 @@
if ($_GET['action'] == 'presend')
{
$ref = dol_sanitizeFileName($fac->ref);
$file = $conf->fournisseur->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
$file = $conf->fournisseur->facture->dir_output.'/'.get_exdir($fac->id,2).$ref.'.pdf';

print '<br>';
print_titre($langs->trans('SendBillByMail'));
Expand Down
Expand Up @@ -133,7 +133,7 @@ function write_file($object,$outputlangs='')
else
{
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->fournisseur->dir_output . "/facture/" . $objectref;
$dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$objectref;
$file = $dir . "/" . $objectref . ".pdf";
}

Expand Down Expand Up @@ -382,6 +382,7 @@ function write_file($object,$outputlangs='')
*/
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{
global $conf,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);

$tab2_top = $posy;
Expand Down

0 comments on commit 0317ae7

Please sign in to comment.