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 '