Modif de fond des prelevements
This commit is contained in:
parent
262776d466
commit
d1313970f2
@ -32,54 +32,36 @@ if ($user->societe_id > 0)
|
||||
}
|
||||
|
||||
/*
|
||||
* Recherche
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
$page = $_GET["page"];
|
||||
$sortorder = $_GET["sortorder"];
|
||||
$sortfield = $_GET["sortfield"];
|
||||
if ($sortorder == "") $sortorder="DESC";
|
||||
if ($sortfield == "") $sortfield="p.datec";
|
||||
$sortorder = (empty($_GET["sortorder"])) ? "DESC" : $_GET["sortorder"];
|
||||
$sortfield = (empty($_GET["sortfield"])) ? "p.datec" : $_GET["sortfield"];
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.ref, p.amount,".$db->pdate("p.datec")." as datec";
|
||||
$sql .= " , f.facnumber, f.total_ttc";
|
||||
$sql .= " , s.nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||
$sql = "SELECT p.rowid, p.statut, p.ref, pl.amount,".$db->pdate("p.datec")." as datec";
|
||||
$sql .= " , s.nom, s.code_client";
|
||||
$sql .= " , pl.rowid as rowid_ligne, pl.statut as statut_ligne";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE s.idp = f.fk_soc";
|
||||
$sql .= " AND pf.fk_facture = f.rowid AND pf.fk_prelevement = p.rowid";
|
||||
$sql .= " WHERE pl.fk_prelevement_bons = p.rowid";
|
||||
$sql .= " AND s.idp = pl.fk_soc";
|
||||
|
||||
if ($_GET["search_bon"])
|
||||
{
|
||||
$sql .= " AND p.ref LIKE '%".$_GET["search_bon"]."%'";
|
||||
}
|
||||
|
||||
|
||||
if ($_GET["search_societe"])
|
||||
{
|
||||
$sel =urldecode($_GET["search_societe"]);
|
||||
$sql .= " AND s.nom LIKE '%".$sel."%'";
|
||||
}
|
||||
|
||||
if ($_GET["search_facture"])
|
||||
{
|
||||
$sql .= " AND f.facnumber LIKE '%".$_GET["search_facture"]."%'";
|
||||
}
|
||||
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -91,31 +73,29 @@ if ($result)
|
||||
$urladd = "&statut=".$_GET["statut"];
|
||||
$urladd .= "&search_bon=".$_GET["search_bon"];
|
||||
|
||||
print_barre_liste("Prélèvements", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
print_barre_liste("Lignes de prélèvements", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<tr class="liste_titre"><td>Ligne</td>';
|
||||
|
||||
print_liste_field_titre("Bon","liste.php","p.ref");
|
||||
print "<td>Facture</td>";
|
||||
|
||||
print_liste_field_titre("Société","liste.php","s.nom");
|
||||
print_liste_field_titre("Date","liste.php","p.datec","","",'align="center"');
|
||||
|
||||
print '<td align="right">Montant</td>';
|
||||
print_liste_field_titre("Code client","liste.php","s.code_client",'','','align="center"');
|
||||
|
||||
print '</tr><tr class="liste_titre">';
|
||||
|
||||
|
||||
print '<form action="liste.php" method="GET">';
|
||||
print '<td><input type="text" name="search_bon" value="'. $_GET["search_bon"].'" size="10"></td>';
|
||||
print '<td><input type="text" name="search_facture" value="'. $_GET["search_facture"].'" size="10"></td>';
|
||||
print '<td><input type="text" name="search_societe" value="'. $_GET["search_societe"].'" size="10"></td>';
|
||||
print '<form action="liste.php" method="GET"><td> </td>';
|
||||
print '<td><input type="text" name="search_bon" value="'. $_GET["search_bon"].'" size="8"></td>';
|
||||
print '<td><input type="text" name="search_code" value="'. $_GET["search_code"].'" size="8"></td>';
|
||||
print '<td><input type="text" name="search_societe" value="'. $_GET["search_societe"].'" size="12"></td>';
|
||||
print '<td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td>';
|
||||
print '<td> </td>';
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$var=True;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
@ -125,20 +105,19 @@ if ($result)
|
||||
|
||||
print "<tr $bc[$var]><td>";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/telephonie/ligne/fiche.php?id='.$obj->rowid.'">';
|
||||
print img_file();
|
||||
print '</a> ';
|
||||
print '<img border="0" src="./statut'.$obj->statut_ligne.'.png"></a> ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid_ligne.'">';
|
||||
print substr('000000'.$obj->rowid_ligne, -6);
|
||||
print '</a></td>';
|
||||
|
||||
print '<td><img border="0" src="./statut'.$obj->statut.'.png"></a> ';
|
||||
|
||||
print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
|
||||
|
||||
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.$obj->facnumber."</a></td>\n";
|
||||
|
||||
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.$obj->nom."</a></td>\n";
|
||||
|
||||
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
print '<td align="center">'.strftime("%d/%m/%Y",$obj->datec)."</td>\n";
|
||||
|
||||
print '<td align="right">'.price($obj->total_ttc)." euros</td>\n";
|
||||
|
||||
print '<td align="right">'.price($obj->amount)." euros</td>\n";
|
||||
print '<td align="center"><a href="fiche.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user