dolibarr/htdocs/compta/facture/impayees.php

439 lines
17 KiB
PHP
Raw Normal View History

2005-01-18 11:02:26 +01:00
<?php
2005-01-31 16:14:59 +01:00
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
2008-09-06 00:37:21 +02:00
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
2014-01-30 11:44:31 +01:00
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
2012-12-30 15:11:07 +01:00
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
2005-01-18 11:02:26 +01:00
*
* 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
* the Free Software Foundation; either version 3 of the License, or
2005-01-18 11:02:26 +01:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2011-08-01 00:21:57 +02:00
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2005-01-18 11:02:26 +01:00
*/
/**
* \file htdocs/compta/facture/impayees.php
* \ingroup facture
2009-08-19 19:07:48 +02:00
* \brief Page to list and build liste of unpaid invoices
*/
2005-01-18 11:02:26 +01:00
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
2005-01-18 11:02:26 +01:00
2009-01-21 17:53:50 +01:00
2005-01-18 11:02:26 +01:00
$langs->load("bills");
2011-11-11 16:10:50 +01:00
$id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int'));
$action = GETPOST('action','alpha');
$option = GETPOST('option');
// Security check
2008-02-25 21:03:21 +01:00
if ($user->societe_id) $socid=$user->societe_id;
2011-11-11 16:10:50 +01:00
$result = restrictedArea($user,'facture',$id,'');
2005-01-18 11:02:26 +01:00
2014-01-30 11:44:31 +01:00
$diroutputpdf=$conf->facture->dir_output . '/unpaid/temp';
if (! $user->rights->societe->client->voir || $socid) $diroutputpdf.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user
2005-01-18 11:02:26 +01:00
/*
2008-09-06 00:37:21 +02:00
* Action
*/
2005-01-18 11:02:26 +01:00
if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_search'))
2005-01-18 11:02:26 +01:00
{
if (is_array($_POST['toGenerate']))
{
2013-01-07 00:14:38 +01:00
$arrayofinclusion=array();
foreach($_POST['toGenerate'] as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/');
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC);
// liste les fichiers
$files = array();
$factures_bak = $factures ;
foreach($_POST['toGenerate'] as $basename){
foreach($factures as $facture){
if(strstr($facture["name"],$basename)){
2011-09-08 21:40:49 +02:00
$files[] = $conf->facture->dir_output.'/'.$basename.'/'.$facture["name"];
}
}
}
2009-01-21 17:53:50 +01:00
// Define output language (Here it is not used because we do only merging existing PDF)
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
// Create empty PDF
$pdf=pdf_getInstance();
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
2012-09-15 10:01:35 +02:00
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
2009-01-21 17:53:50 +01:00
2008-09-06 00:37:21 +02:00
// Add all others
foreach($files as $file)
{
// Charge un document PDF depuis un fichier.
2009-01-21 17:53:50 +01:00
$pagecount = $pdf->setSourceFile($file);
for ($i = 1; $i <= $pagecount; $i++)
{
$tplidx = $pdf->importPage($i);
$s = $pdf->getTemplatesize($tplidx);
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
$pdf->useTemplate($tplidx);
}
}
2009-01-21 17:53:50 +01:00
2008-09-06 00:37:21 +02:00
// Create output dir if not exists
dol_mkdir($diroutputpdf);
2008-09-06 00:37:21 +02:00
// Save merged file
2009-08-19 19:07:48 +02:00
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
2009-01-21 17:53:50 +01:00
if ($pagecount)
2008-10-21 23:27:20 +02:00
{
2012-04-30 15:01:25 +02:00
$now=dol_now();
$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
2010-09-01 12:22:11 +02:00
$pdf->Output($file,'F');
2009-01-21 17:53:50 +01:00
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
2008-10-21 23:27:20 +02:00
}
2009-01-21 17:53:50 +01:00
else
2008-10-21 23:27:20 +02:00
{
$mesg='<div class="error">'.$langs->trans('NoPDFAvailableForChecked').'</div>';
}
2009-01-21 17:53:50 +01:00
}
else
{
2009-04-09 22:22:51 +02:00
$mesg='<div class="error">'.$langs->trans('InvoiceNotChecked').'</div>' ;
}
}
// Remove file
2013-01-10 08:27:12 +01:00
if ($action == 'remove_file')
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("other");
$upload_dir = $diroutputpdf;
$file = $upload_dir . '/' . GETPOST('file');
2013-01-10 08:27:12 +01:00
$ret=dol_delete_file($file,0,0,0,'');
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
$action='';
}
2008-09-06 00:37:21 +02:00
/*
* View
*/
$form = new Form($db);
$formfile = new FormFile($db);
2009-08-19 19:07:48 +02:00
$title=$langs->trans("BillsCustomersUnpaid");
if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid");
2008-09-06 00:37:21 +02:00
llxHeader('',$title);
?>
2011-11-11 16:10:50 +01:00
<script type="text/javascript">
2011-11-12 09:23:54 +01:00
$(document).ready(function() {
$("#checkall").click(function() {
$(".checkformerge").attr('checked', true);
});
2011-11-12 09:23:54 +01:00
$("#checknone").click(function() {
$(".checkformerge").attr('checked', false);
});
});
2008-09-06 00:37:21 +02:00
</script>
<?php
$now=dol_now();
2011-11-11 16:10:50 +01:00
$search_ref = GETPOST("search_ref");
$search_societe = GETPOST("search_societe");
$search_montant_ht = GETPOST("search_montant_ht");
$search_montant_ttc = GETPOST("search_montant_ttc");
$late = GETPOST("late");
2010-11-20 14:08:44 +01:00
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if ($page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
2008-09-06 00:37:21 +02:00
if (! $sortfield) $sortfield="f.date_lim_reglement";
if (! $sortorder) $sortorder="ASC";
$limit = $conf->liste_limit;
$sql = "SELECT s.nom, s.rowid as socid";
2013-03-25 13:04:03 +01:00
$sql.= ", f.rowid as facid, f.facnumber, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp";
2010-05-08 21:49:29 +02:00
$sql.= ", f.datef as df, f.date_lim_reglement as datelimite";
$sql.= ", f.paye as paye, f.fk_statut, f.type";
$sql.= ", sum(pf.amount) as am";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ",".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid=pf.fk_facture ";
$sql.= " WHERE f.fk_soc = s.rowid";
2012-02-01 11:32:55 +01:00
$sql.= " AND f.entity = ".$conf->entity;
2011-12-03 15:30:58 +01:00
$sql.= " AND f.type IN (0,1,3) AND f.fk_statut = 1";
$sql.= " AND f.paye = 0";
2011-11-22 02:15:58 +01:00
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
2012-08-16 20:11:48 +02:00
if (! empty($socid)) $sql .= " AND s.rowid = ".$socid;
if (GETPOST('filtre'))
{
2012-08-16 20:11:48 +02:00
$filtrearr = explode(",", GETPOST('filtre'));
foreach ($filtrearr as $fil)
{
$filt = explode(":", $fil);
$sql .= " AND " . $filt[0] . " = " . $filt[1];
}
}
if ($search_ref) $sql .= " AND f.facnumber LIKE '%".$db->escape($search_ref)."%'";
if ($search_societe) $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'";
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
2014-01-30 11:44:31 +01:00
$sql.= " GROUP BY s.nom, s.rowid, f.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type ";
2011-11-22 02:15:58 +01:00
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " ORDER BY ";
$listfield=explode(',',$sortfield);
foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.",";
$sql.= " f.facnumber DESC";
//$sql .= $db->plimit($limit+1,$offset);
2011-11-22 02:15:58 +01:00
$resql = $db->query($sql);
if ($resql)
{
2011-11-22 02:15:58 +01:00
$num = $db->num_rows($resql);
2012-08-16 20:11:48 +02:00
if (! empty($socid))
{
$soc = new Societe($db);
$soc->fetch($socid);
}
2009-01-09 23:52:45 +01:00
$param="";
2012-08-16 20:11:48 +02:00
$param.=(! empty($socid)?"&amp;socid=".$socid:"");
$param.=(! empty($option)?"&amp;option=".$option:"");
2011-11-11 16:10:50 +01:00
if ($search_ref) $param.='&amp;search_ref='.urlencode($search_ref);
if ($search_societe) $param.='&amp;search_societe='.urlencode($search_societe);
if ($search_montant_ht) $param.='&amp;search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_ttc) $param.='&amp;search_montant_ttc='.urlencode($search_montant_ttc);
if ($late) $param.='&amp;late='.urlencode($late);
2009-01-21 17:53:50 +01:00
2009-01-09 23:52:45 +01:00
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param);
2009-01-21 17:53:50 +01:00
2012-08-16 20:11:48 +02:00
$titre=(! empty($socid)?$langs->trans("BillsCustomersUnpaidForCompany",$soc->nom):$langs->trans("BillsCustomersUnpaid"));
if ($option == 'late') $titre.=' ('.$langs->trans("Late").')';
else $titre.=' ('.$langs->trans("All").')';
2009-01-21 17:53:50 +01:00
$link='';
2009-08-19 19:07:48 +02:00
if (empty($option)) $link='<a href="'.$_SERVER["PHP_SELF"].'?option=late">'.$langs->trans("ShowUnpaidLateOnly").'</a>';
elseif ($option == 'late') $link='<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("ShowUnpaidAll").'</a>';
print_fiche_titre($titre,$link);
//print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',0); // We don't want pagination on this page
2011-07-13 16:41:02 +02:00
dol_htmloutput_mesg($mesg);
2009-01-21 17:53:50 +01:00
print '<form id="form_generate_pdf" method="POST" action="'.$_SERVER["PHP_SELF"].'?sortfield='. $sortfield .'&sortorder='. $sortorder .'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($late) print '<input type="hidden" name="late" value="'.dol_escape_htmltag($late).'">';
$i = 0;
print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
2013-07-14 21:02:00 +02:00
print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder);
2009-04-09 22:22:51 +02:00
print_liste_field_titre($langs->trans("Merge"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre
print '<tr class="liste_titre">';
2009-04-09 22:22:51 +02:00
// Ref
print '<td class="liste_titre">';
2011-11-11 16:10:50 +01:00
print '<input class="flat" size="10" type="text" name="search_ref" value="'.$search_ref.'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'"></td>';
2012-08-16 20:11:48 +02:00
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'"></td>';
2013-07-14 21:02:00 +02:00
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>';
print '<td class="liste_titre" align="center">';
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
print '</td>';
print "</tr>\n";
if ($num > 0)
{
$var=True;
$total_ht=0;
2012-08-16 20:11:48 +02:00
$total_tva=0;
$total_ttc=0;
2009-08-19 19:16:47 +02:00
$total_paid=0;
2011-12-03 15:21:33 +01:00
2011-11-11 16:10:50 +01:00
$facturestatic=new Facture($db);
while ($i < $num)
{
2011-11-22 02:15:58 +01:00
$objp = $db->fetch_object($resql);
2011-12-03 15:21:33 +01:00
$date_limit=$db->jdate($objp->datelimite);
$var=!$var;
2012-08-05 21:59:45 +02:00
print "<tr ".$bc[$var].">";
$classname = "impayee";
print '<td class="nowrap">';
2009-01-21 17:53:50 +01:00
$facturestatic->id=$objp->facid;
$facturestatic->ref=$objp->facnumber;
$facturestatic->type=$objp->type;
2009-01-21 17:53:50 +01:00
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
2009-04-09 22:22:51 +02:00
// Ref
print '<td class="nobordernopadding nowrap">';
print $facturestatic->getNomUrl(1);
print '</td>';
2009-01-21 17:53:50 +01:00
2009-04-09 22:22:51 +02:00
// Warning picto
print '<td width="20" class="nobordernopadding nowrap">';
2011-12-03 15:21:33 +01:00
if ($date_limit < ($now - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
print '</td>';
2009-01-21 17:53:50 +01:00
2009-04-09 22:22:51 +02:00
// PDF Picto
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
2011-07-13 16:41:02 +02:00
$filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
2012-09-15 09:02:20 +02:00
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
2011-07-13 16:41:02 +02:00
print '</td>';
2009-01-21 17:53:50 +01:00
2009-04-09 22:22:51 +02:00
print '</tr></table>';
2009-01-21 17:53:50 +01:00
print "</td>\n";
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df),'day').'</td>'."\n";
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite),'day').'</td>'."\n";
2011-01-06 13:46:25 +01:00
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,28).'</a></td>';
print '<td align="right">'.price($objp->total_ht).'</td>';
print '<td align="right">'.price($objp->total_tva);
$tx1=price2num($objp->localtax1);
$tx2=price2num($objp->localtax2);
2013-03-25 13:04:03 +01:00
$revenuestamp=price2num($objp->revenuestamp);
if (! empty($tx1) || ! empty($tx2) || ! empty($revenuestamp)) print '+'.price($tx1 + $tx2 + $revenuestamp);
print '</td>';
print '<td align="right">'.price($objp->total_ttc).'</td>';
print '<td align="right">';
$cn=$facturestatic->getSumCreditNotesUsed();
if (! empty($objp->am)) print price($objp->am);
if (! empty($objp->am) && ! empty($cn)) print '+';
if (! empty($cn)) print price($cn);
print '</td>';
// Remain to receive
2013-07-14 21:02:00 +02:00
print '<td align="right">'.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):'&nbsp;').'</td>';
// Status of invoice
print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am);
print '</td>';
2009-04-09 22:22:51 +02:00
// Checkbox
print '<td align="center">';
2012-09-15 09:02:20 +02:00
if (! empty($formfile->numoffiles))
print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
else
print '&nbsp;';
2009-04-09 22:22:51 +02:00
print '</td>' ;
print "</tr>\n";
$total_ht+=$objp->total_ht;
2013-03-25 13:04:03 +01:00
$total_tva+=($objp->total_tva + $tx1 + $tx2 + $revenuestamp);
$total_ttc+=$objp->total_ttc;
$total_paid+=$objp->am + $cn;
$i++;
}
print '<tr class="liste_total">';
2011-11-11 16:10:50 +01:00
print '<td colspan="4" align="left">'.$langs->trans("Total").'</td>';
print '<td align="right"><b>'.price($total_ht).'</b></td>';
print '<td align="right"><b>'.price($total_tva).'</b></td>';
print '<td align="right"><b>'.price($total_ttc).'</b></td>';
print '<td align="right"><b>'.price($total_paid).'</b></td>';
print '<td align="right"><b>'.price($total_ttc - $total_paid).'</b></td>';
2009-07-30 00:34:58 +02:00
print '<td align="center">&nbsp;</td>';
2013-07-30 18:36:13 +02:00
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
}
2005-01-18 11:02:26 +01:00
print "</table>";
2009-01-21 17:53:50 +01:00
/*
* Show list of available documents
*/
$filedir=$diroutputpdf;
$genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->lire;
print '<br>';
print '<input type="hidden" name="option" value="'.$option.'">';
// We disable multilang because we concat already existing pdf.
$formfile->show_documents('unpaid','',$filedir,$urlsource,$genallowed,$delallowed,'',1,1,0,48,1,$param,$langs->trans("PDFMerge"),$langs->trans("PDFMerge"));
2009-01-21 17:53:50 +01:00
print '</form>';
2011-11-22 02:15:58 +01:00
$db->free($resql);
2005-01-18 11:02:26 +01:00
}
2011-11-22 02:15:58 +01:00
else dol_print_error($db,'');
2005-01-18 11:02:26 +01:00
2012-02-18 03:29:20 +01:00
llxFooter();
2012-08-16 20:11:48 +02:00
$db->close();
2005-01-18 11:02:26 +01:00
?>