Fix: Le lien sur la liste des factures fournisseurs depuis l'onglet fournisseur et le tri de cette liste ne fonctionnait pas.
This commit is contained in:
parent
b7866d9d30
commit
2a916d4c68
@ -33,6 +33,8 @@ require("../../facturefourn.class.php");
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
$socid = $_GET["socid"];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sécurité accés client
|
* Sécurité accés client
|
||||||
*/
|
*/
|
||||||
@ -64,11 +66,10 @@ $pagenext = $page + 1;
|
|||||||
/*
|
/*
|
||||||
* Recherche
|
* Recherche
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
if ($mode == 'search')
|
if ($_POST["mode"] == 'search')
|
||||||
{
|
{
|
||||||
if ($mode-search == 'soc')
|
if ($_POST["mode-search"] == 'soc')
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.idp FROM ".MAIN_DB_PREFIX."societe as s ";
|
$sql = "SELECT s.idp FROM ".MAIN_DB_PREFIX."societe as s ";
|
||||||
$sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
|
$sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
|
||||||
@ -130,17 +131,22 @@ if ($result)
|
|||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print_barre_liste("Liste des factures fournisseurs", $page, "index.php",'', $sortfield, $sortorder,'',$num);
|
if ($socid) {
|
||||||
|
$soc = new Societe($db);
|
||||||
|
$soc->fetch($socid);
|
||||||
|
}
|
||||||
|
|
||||||
|
print_barre_liste("Factures fournisseur".($socid?" $soc->nom":""),$page,"index.php","&socidp=$socidp",$sortfield,$sortorder,'',$num);
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Ref"),"index.php","facnumber","","","",$sortfield);
|
print_liste_field_titre($langs->trans("Ref"),"index.php","facnumber","&socid=$socid","","",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Date"),"index.php","fac.datef","","","",$sortfield);
|
print_liste_field_titre($langs->trans("Date"),"index.php","fac.datef","&socid=$socid","","",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Label"),"index.php","fac.libelle","","","",$sortfield);
|
print_liste_field_titre($langs->trans("Label"),"index.php","fac.libelle","&socid=$socid","","",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","","",$sortfield);
|
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","&socid=$socid","","",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("AmountHT"),"index.php","fac.total_ht","","",'align="right"',$sortfield);
|
print_liste_field_titre($langs->trans("AmountHT"),"index.php","fac.total_ht","&socid=$socid","",'align="right"',$sortfield);
|
||||||
print_liste_field_titre($langs->trans("AmountTTC"),"index.php","fac.total_ttc","","",'align="right"',$sortfield);
|
print_liste_field_titre($langs->trans("AmountTTC"),"index.php","fac.total_ttc","&socid=$socid","",'align="right"',$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Status"),"index.php","fk_statut,paye","","",'align="center"',$sortfield);
|
print_liste_field_titre($langs->trans("Status"),"index.php","fk_statut,paye","&socid=$socid","",'align="center"',$sortfield);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
|
|||||||
@ -162,7 +162,7 @@ if ( $societe->fetch($socid) )
|
|||||||
$sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut";
|
$sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||||
$sql .= " WHERE p.fk_soc =".$societe->id;
|
$sql .= " WHERE p.fk_soc =".$societe->id;
|
||||||
$sql .= " ORDER BY p.rowid DESC LIMIT 0,4";
|
$sql .= " ORDER BY p.rowid DESC LIMIT 4";
|
||||||
if ( $db->query($sql) )
|
if ( $db->query($sql) )
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -172,7 +172,7 @@ if ( $societe->fetch($socid) )
|
|||||||
{
|
{
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td colspan=\"2\"><a href=\"commande/liste.php?socid=$societe->id\">Dernières commandes</td></tr>";
|
print "<td colspan=\"2\"><a href=\"commande/liste.php?socid=$societe->id\">Dernières commandes ($num)</td></tr>";
|
||||||
}
|
}
|
||||||
while ($i < $num && $i < 5)
|
while ($i < $num && $i < 5)
|
||||||
{
|
{
|
||||||
@ -214,7 +214,7 @@ if ( $societe->fetch($socid) )
|
|||||||
*/
|
*/
|
||||||
$sql = "SELECT p.rowid,p.libelle,p.facnumber,".$db->pdate("p.datef")." as df, total_ttc as amount, paye";
|
$sql = "SELECT p.rowid,p.libelle,p.facnumber,".$db->pdate("p.datef")." as df, total_ttc as amount, paye";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as p WHERE p.fk_soc = $societe->id";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as p WHERE p.fk_soc = $societe->id";
|
||||||
$sql .= " ORDER BY p.datef DESC LIMIT 0,4";
|
$sql .= " ORDER BY p.datef DESC LIMIT 4";
|
||||||
if ( $db->query($sql) )
|
if ( $db->query($sql) )
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -224,7 +224,7 @@ if ( $societe->fetch($socid) )
|
|||||||
{
|
{
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print "<td colspan=\"4\"><a href=\"facture/index.php?socid=$societe->id\">Liste des factures fournisseurs ($num)</td></tr>";
|
print "<td colspan=\"4\"><a href=\"facture/index.php?socid=$societe->id\">Dernières factures fournisseurs ($num)</td></tr>";
|
||||||
}
|
}
|
||||||
while ($i < $num && $i < 5)
|
while ($i < $num && $i < 5)
|
||||||
{
|
{
|
||||||
@ -235,7 +235,7 @@ if ( $societe->fetch($socid) )
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print '<a href="facture/fiche.php?facid='.$obj->rowid.'">';
|
print '<a href="facture/fiche.php?facid='.$obj->rowid.'">';
|
||||||
print $obj->facnumber.'</a> '.substr($obj->libelle,0,40).'...</td>';
|
print $obj->facnumber.'</a> '.substr($obj->libelle,0,40).'...</td>';
|
||||||
print "<td align=\"right\" width=\"100\">".dolibarr_print_date($obj->df)."</td>";
|
print "<td align=\"right\" width=\"80\">".dolibarr_print_date($obj->df)."</td>";
|
||||||
print '<td align="right">'.$obj->amount.'</td>';
|
print '<td align="right">'.$obj->amount.'</td>';
|
||||||
$fac = new FactureFourn($db);
|
$fac = new FactureFourn($db);
|
||||||
print '<td align="center">'.$fac->LibStatut($obj->paye,$obj->statut).'</td>';
|
print '<td align="center">'.$fac->LibStatut($obj->paye,$obj->statut).'</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user