Unpayed suppliers invoices list

This commit is contained in:
aspangaro 2014-11-02 08:33:39 +01:00
parent 98299f88e8
commit e48350fdc1
2 changed files with 50 additions and 51 deletions

View File

@ -47,6 +47,31 @@ if ($user->societe_id > 0)
$socid = $user->societe_id; $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 * View
@ -61,31 +86,6 @@ $title=$langs->trans("BillsSuppliersUnpaid");
$facturestatic=new FactureFournisseur($db); $facturestatic=new FactureFournisseur($db);
$companystatic=new Societe($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) if ($user->rights->fournisseur->facture->lire)
{ {
$sql = "SELECT s.rowid as socid, s.nom as name,"; $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."%'"; $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) 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) $param.='&search_ref='.urlencode($search_ref);
if ($search_ref_supplier) $param.='&search_ref_supplier='.urlencode($search_ref_supplier); if ($search_ref_supplier) $param.='&search_ref_supplier='.urlencode($search_ref_supplier);
if ($search_societe) $param.='&search_societe='.urlencode($search_societe); if ($search_company) $param.='&search_company='.urlencode($search_company);
if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax);
if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
$param.=($option?"&option=".$option:""); $param.=($option?"&option=".$option:"");
if (! empty($late)) $param.='&late='.urlencode($late); if (! empty($late)) $param.='&late='.urlencode($late);
@ -209,15 +209,15 @@ if ($user->rights->fournisseur->facture->lire)
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'">'; print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">';
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="8" name="search_montant_ht" value="'.$search_montant_ht.'">'; print '<input class="flat" type="text" size="8" name="search_amount_no_tax" value="'.$search_amount_no_tax.'">';
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="8" name="search_montant_ttc" value="'.$search_montant_ttc.'">'; print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
print '</td><td class="liste_titre" colspan="2" align="right">'; print '</td><td class="liste_titre" colspan="2" 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 '<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 '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</tr>\n"; print "</td></tr>\n";
if ($num > 0) if ($num > 0)
{ {

View File

@ -73,6 +73,17 @@ $search_amount_all_tax = GETPOST("search_amount_all_tax","alpha");
$month = GETPOST("month","int"); $month = GETPOST("month","int");
$year = GETPOST("year","int"); $year = GETPOST("year","int");
if (GETPOST("button_removefilter"))
{
$search_ref="";
$search_ref_supplier="";
$search_label="";
$search_company="";
$search_amount_no_tax="";
$search_amount_all_tax="";
$year="";
$month="";
}
/* /*
* Actions * Actions
@ -99,18 +110,6 @@ if ($mode == 'search')
} }
} }
if (GETPOST("button_removefilter"))
{
$search_ref="";
$search_ref_supplier="";
$search_label="";
$search_company="";
$search_amount_no_tax="";
$search_amount_all_tax="";
$year="";
$month="";
}
/* /*
* View * View
*/ */