Suppliers list
This commit is contained in:
parent
26c63f3ea4
commit
98299f88e8
@ -64,8 +64,14 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="fac.datef,fac.rowid";
|
||||
|
||||
$month = GETPOST('month','int');
|
||||
$year = GETPOST('year','int');
|
||||
$search_ref = GETPOST("search_ref","int");
|
||||
$search_ref_supplier = GETPOST("search_ref_supplier","alpha");
|
||||
$search_label = GETPOST("search_label","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");
|
||||
$month = GETPOST("month","int");
|
||||
$year = GETPOST("year","int");
|
||||
|
||||
|
||||
/*
|
||||
@ -93,8 +99,17 @@ 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
|
||||
@ -132,14 +147,14 @@ if (GETPOST('filtre') && GETPOST('filtre') != -1) // GETPOST('filtre') may be a
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST("search_ref"))
|
||||
if ($search_ref)
|
||||
{
|
||||
if (is_numeric(GETPOST("search_ref"))) $sql .= natural_search(array('fac.rowid', 'fac.ref'), GETPOST('search_ref'));// For backward compatibility
|
||||
else $sql .= natural_search('fac.ref', GETPOST("search_ref"));
|
||||
if (is_numeric($search_ref)) $sql .= natural_search(array('fac.rowid', 'fac.ref'), $search_ref);// For backward compatibility
|
||||
else $sql .= natural_search('fac.ref', $search_ref);
|
||||
}
|
||||
if (GETPOST("search_ref_supplier"))
|
||||
if (search_ref_supplier)
|
||||
{
|
||||
$sql .= natural_search('fac.ref_supplier', GETPOST('search_ref_supplier'));
|
||||
$sql .= natural_search('fac.ref_supplier', $search_ref_supplier);
|
||||
}
|
||||
if ($month > 0)
|
||||
{
|
||||
@ -152,24 +167,24 @@ else if ($year > 0)
|
||||
{
|
||||
$sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
if (GETPOST("search_libelle"))
|
||||
if ($search_label)
|
||||
{
|
||||
$sql .= natural_search('fac.libelle', GETPOST('search_libelle'));
|
||||
$sql .= natural_search('fac.libelle', $search_label);
|
||||
}
|
||||
|
||||
if (GETPOST("search_societe"))
|
||||
if ($search_company)
|
||||
{
|
||||
$sql .= natural_search('s.nom', GETPOST('search_societe'));
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
|
||||
if (GETPOST("search_montant_ht"))
|
||||
if ($search_amount_no_tax)
|
||||
{
|
||||
$sql .= " AND fac.total_ht = '".$db->escape(price2num(GETPOST("search_montant_ht")))."'";
|
||||
$sql .= " AND fac.total_ht = '".$db->escape(price2num($search_amount_no_tax))."'";
|
||||
}
|
||||
|
||||
if (GETPOST("search_montant_ttc"))
|
||||
if ($search_amount_all_tax)
|
||||
{
|
||||
$sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'";
|
||||
$sql .= " AND fac.total_ttc = '".$db->escape(price2num($search_amount_all_tax))."'";
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
@ -195,14 +210,14 @@ if ($resql)
|
||||
}
|
||||
|
||||
$param='&socid='.$socid;
|
||||
if ($month) $param.='&month='.urlencode($month);
|
||||
if ($year) $param.='&year=' .urlencode($year);
|
||||
if (GETPOST("search_ref")) $param.='&search_ref='.urlencode(GETPOST("search_ref"));
|
||||
if (GETPOST("search_ref_supplier")) $param.='&search_ref_supplier'.urlencode(GETPOST("search_ref_supplier"));
|
||||
if (GETPOST("search_libelle")) $param.='&search_libelle='.urlencode(GETPOST("search_libelle"));
|
||||
if (GETPOST("search_societe")) $param.='&search_societe='.urlencode(GETPOST("search_societe"));
|
||||
if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht"));
|
||||
if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc"));
|
||||
if ($month) $param.='&month='.urlencode($month);
|
||||
if ($year) $param.='&year=' .urlencode($year);
|
||||
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
|
||||
if ($search_ref_supplier) $param.='&search_ref_supplier'.urlencode($search_ref_supplier);
|
||||
if ($search_label) $param.='&search_label='.urlencode($search_label);
|
||||
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);
|
||||
if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre"));
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
@ -218,17 +233,18 @@ if ($resql)
|
||||
if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"fac.total_ht","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"fac.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.GETPOST("search_ref").'">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref_supplier" value="'.GETPOST("search_ref_supplier").'">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref_supplier" value="'.$search_ref_supplier.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" colspan="1" align="center">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
@ -239,10 +255,10 @@ if ($resql)
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" size="16" type="text" name="search_libelle" value="'.GETPOST("search_libelle").'">';
|
||||
print '<input class="flat" size="16" type="text" name="search_label" value="'.$search_label.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="8" name="search_societe" value="'.GETPOST("search_societe").'">';
|
||||
print '<input class="flat" type="text" size="8" name="search_company" value="'.$search_company.'">';
|
||||
print '</td>';
|
||||
if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS))
|
||||
{
|
||||
@ -250,13 +266,15 @@ if ($resql)
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="8" name="search_montant_ht" value="'.GETPOST("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 '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="8" name="search_montant_ttc" value="'.GETPOST("search_montant_ttc").'">';
|
||||
print '</td><td class="liste_titre" align="center">';
|
||||
$liststatus=array('paye:0'=>$langs->trans("Unpayed"), 'paye:1'=>$langs->trans("Payed"));
|
||||
print $form->selectarray('filtre', $liststatus, GETPOST('filtre'), 1);
|
||||
print '<input type="image" class="liste_titre" align="right" 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><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 '<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 '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -312,6 +330,8 @@ if ($resql)
|
||||
//print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am);
|
||||
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center"> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
@ -325,6 +345,7 @@ if ($resql)
|
||||
print '<td class="liste_total" align="right">'.price($total).'</td>';
|
||||
print '<td class="liste_total" align="right">'.price($total_ttc).'</td>';
|
||||
print '<td class="liste_total" align="center"> </td>';
|
||||
print '<td class="liste_total" align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user