diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index a80cb00f2d3..3253a79fcd8 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -47,6 +47,31 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); + +$search_ref = GETPOST('search_ref','alpha'); +$search_ref_supplier = GETPOST('search_ref_supplier','alpha'); +$search_company = GETPOST('search_company','alpha'); +$search_amount_no_tax = GETPOST('search_amount_no_tax','alpha'); +$search_amount_all_tax = GETPOST('search_amount_all_tax','alpha'); + +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield="f.date_lim_reglement"; +if (! $sortorder) $sortorder="ASC"; + +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_ref_supplier=""; + $search_company=""; + $search_amount_no_tax=""; + $search_amount_all_tax=""; +} /* * View @@ -61,31 +86,6 @@ $title=$langs->trans("BillsSuppliersUnpaid"); $facturestatic=new FactureFournisseur($db); $companystatic=new Societe($db); - -/*************************************************************************** -* * -* Mode Liste * -* * -***************************************************************************/ - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); - -$search_ref = GETPOST('search_ref','alpha'); -$search_ref_supplier = GETPOST('search_ref_supplier','alpha'); -$search_societe = GETPOST('search_societe','alpha'); -$search_montant_ht = GETPOST('search_montant_ht','int'); -$search_montant_ttc = GETPOST('search_montant_ttc','int'); - - -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortfield) $sortfield="f.date_lim_reglement"; -if (! $sortorder) $sortorder="ASC"; - if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.rowid as socid, s.nom as name,"; @@ -124,19 +124,19 @@ if ($user->rights->fournisseur->facture->lire) $sql .= " AND f.ref_supplier LIKE '%".$search_ref_supplier."%'"; } - if ($search_societe) + if ($search_company) { - $sql .= " AND s.nom LIKE '%".$search_societe."%'"; + $sql .= " AND s.nom LIKE '%".$search_company."%'"; } - if ($search_montant_ht) + if ($search_amount_no_tax) { - $sql .= " AND f.total_ht = '".$search_montant_ht."'"; + $sql .= " AND f.total_ht = '".$search_amount_no_tax."'"; } - if ($search_montant_ttc) + if ($search_amount_all_tax) { - $sql .= " AND f.total_ttc = '".$search_montant_ttc."'"; + $sql .= " AND f.total_ttc = '".$search_amount_all_tax."'"; } if (dol_strlen(GETPOST('sf_re')) > 0) @@ -165,9 +165,9 @@ if ($user->rights->fournisseur->facture->lire) if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_ref_supplier) $param.='&search_ref_supplier='.urlencode($search_ref_supplier); - if ($search_societe) $param.='&search_societe='.urlencode($search_societe); - if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); - if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); + if ($search_company) $param.='&search_company='.urlencode($search_company); + if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); + if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); $param.=($option?"&option=".$option:""); if (! empty($late)) $param.='&late='.urlencode($late); @@ -209,15 +209,15 @@ if ($user->rights->fournisseur->facture->lire) print '