diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 5603bd6417d..3d792e343f0 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -49,7 +49,7 @@ $result = restrictedArea($user,'facture',$id,''); * Action */ -if ($action == "builddoc" && $user->rights->facture->lire) +if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_search')) { if (is_array($_POST['toGenerate'])) { @@ -149,14 +149,14 @@ if ($action == 'remove_file') * View */ +$form = new Form($db); +$formfile = new FormFile($db); + $title=$langs->trans("BillsCustomersUnpaid"); if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid"); llxHeader('',$title); -$form = new Form($db); -$formfile = new FormFile($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'))."%'"; $sql.= " GROUP BY s.nom, s.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.rowid, f.fk_statut, f.type "; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; @@ -271,10 +265,13 @@ if ($resql) dol_htmloutput_mesg($mesg); + print '
'; + print ''; + if ($late) print ''; + $i = 0; print ''; print ''; - 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); @@ -289,17 +286,16 @@ if ($resql) print "\n"; // Lignes des champs de filtre - print ''; print ''; // Ref print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print "\n"; - print ''; if ($num > 0) { @@ -321,9 +316,6 @@ if ($resql) $facturestatic=new Facture($db); - print ''; - print ''; - while ($i < $num) { $objp = $db->fetch_object($resql); @@ -426,17 +418,13 @@ if ($resql) * Show list of available documents */ $filedir=$diroutputpdf; - if ($search_ref) print ''; - if ($search_societe) print ''; - if ($search_montant_ht) print ''; - if ($search_montant_ttc) print ''; - if ($late) print ''; $genallowed=$user->rights->facture->lire; $delallowed=$user->rights->facture->lire; print '
'; print ''; - $formfile->show_documents('unpaid','',$filedir,$urlsource,$genallowed,$delallowed,'',1,0,0,48,1,$param,$langs->trans("PDFMerge"),$langs->trans("PDFMerge")); + // 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")); print ''; $db->free($resql);
'; print '     '; @@ -309,7 +305,6 @@ if ($resql) if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '