Fix: Corrections bugs divers sur factures fournisseurs, Look: Mise au format onglet de la fiche facture fournisseur, New: Possibilité de tri et affichage statut facture fournisseur
This commit is contained in:
parent
5a6237dd47
commit
591340a02e
@ -1353,9 +1353,9 @@ else
|
|||||||
if ($month > 0)
|
if ($month > 0)
|
||||||
$sql .= " AND date_format(f.datef, '%m') = $month";
|
$sql .= " AND date_format(f.datef, '%m') = $month";
|
||||||
|
|
||||||
if ($filtre)
|
if ($_GET["filtre"])
|
||||||
{
|
{
|
||||||
$filtrearr = split(",", $filtre);
|
$filtrearr = split(",", $_GET["filtre"]);
|
||||||
foreach ($filtrearr as $fil)
|
foreach ($filtrearr as $fil)
|
||||||
{
|
{
|
||||||
$filt = split(":", $fil);
|
$filt = split(":", $fil);
|
||||||
@ -1404,7 +1404,7 @@ else
|
|||||||
print_liste_field_titre("Montant TTC",$PHP_SELF,"f.total_ttc","","&socidp=$socidp");
|
print_liste_field_titre("Montant TTC",$PHP_SELF,"f.total_ttc","","&socidp=$socidp");
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print_liste_field_titre("Reçu",$PHP_SELF,"am","","&socidp=$socidp");
|
print_liste_field_titre("Reçu",$PHP_SELF,"am","","&socidp=$socidp");
|
||||||
print '</td><td align="right">';
|
print '</td><td align="center">';
|
||||||
print_liste_field_titre("Statut",$PHP_SELF,"fk_statut,paye","","&socidp=$socidp");
|
print_liste_field_titre("Statut",$PHP_SELF,"fk_statut,paye","","&socidp=$socidp");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -424,5 +424,23 @@ class FactureFourn
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoi un libellé du statut
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Function LibStatut($paye,$statut)
|
||||||
|
{
|
||||||
|
if (! $paye)
|
||||||
|
{
|
||||||
|
if ($statut == 0) return 'Brouillon (à valider)';
|
||||||
|
if ($statut == 3) return 'Annulée';
|
||||||
|
return 'Validée (à payer)';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 'Payée';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -420,6 +420,7 @@ else
|
|||||||
$authorfullname=$author->fullname;
|
$authorfullname=$author->fullname;
|
||||||
}
|
}
|
||||||
print "<tr><td>Auteur</td><td colspan=\"4\">$authorfullname</td>";
|
print "<tr><td>Auteur</td><td colspan=\"4\">$authorfullname</td>";
|
||||||
|
print "<tr><td>Statut:</td><td colspan=\"4\">".$fac->LibStatut($fac->paye,$fac->statut)."</td></tr>";
|
||||||
|
|
||||||
print "<tr>".'<td> </td><td>Total HT</td><td align="right"><b>'.price($fac->total_ht)."</b></td>";
|
print "<tr>".'<td> </td><td>Total HT</td><td align="right"><b>'.price($fac->total_ht)."</b></td>";
|
||||||
print '<td align="right">TVA</td><td align="right">'.price($fac->total_tva)."</td></tr>";
|
print '<td align="right">TVA</td><td align="right">'.price($fac->total_tva)."</td></tr>";
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require("../../contact.class.php");
|
require("../../contact.class.php");
|
||||||
|
require("../../facturefourn.class.php");
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
@ -34,12 +35,6 @@ if ($user->societe_id > 0)
|
|||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'note')
|
|
||||||
{
|
|
||||||
$sql = "UPDATE societe SET note='$note' WHERE idp=$socid";
|
|
||||||
$result = $db->query($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$fac = new FactureFourn($db);
|
$fac = new FactureFourn($db);
|
||||||
@ -94,7 +89,7 @@ if ($sortfield == "")
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT s.idp as socid, s.nom, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, s.prefix_comm, fac.total_ht, fac.total_ttc, fac.paye, fac.libelle, ".$db->pdate("fac.datef")." as datef, fac.rowid as facid, fac.facnumber";
|
$sql = "SELECT s.idp as socid, s.nom, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, s.prefix_comm, fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle, ".$db->pdate("fac.datef")." as datef, fac.rowid as facid, fac.facnumber";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac ";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac ";
|
||||||
$sql .= " WHERE fac.fk_soc = s.idp";
|
$sql .= " WHERE fac.fk_soc = s.idp";
|
||||||
|
|
||||||
@ -102,6 +97,15 @@ if ($socid)
|
|||||||
{
|
{
|
||||||
$sql .= " AND s.idp = $socid";
|
$sql .= " AND s.idp = $socid";
|
||||||
}
|
}
|
||||||
|
if ($_GET["filtre"])
|
||||||
|
{
|
||||||
|
$filtrearr = split(",", $_GET["filtre"]);
|
||||||
|
foreach ($filtrearr as $fil)
|
||||||
|
{
|
||||||
|
$filt = split(":", $fil);
|
||||||
|
$sql .= " AND " . $filt[0] . " = " . $filt[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit+1, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit+1, $offset);
|
||||||
|
|
||||||
@ -116,23 +120,27 @@ if ($result)
|
|||||||
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
print '<TR class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<TD>Numéro</TD>';
|
print '<td>';
|
||||||
print '<TD>';
|
print_liste_field_titre("Numéro",$PHP_SELF,"facnumber");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
print_liste_field_titre("Date",$PHP_SELF,"fac.datef");
|
print_liste_field_titre("Date",$PHP_SELF,"fac.datef");
|
||||||
print '</TD>';
|
print '</td>';
|
||||||
print '<TD>Libellé</TD>';
|
print '<td>Libellé</TD>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
|
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<TD align="right">';
|
print '<td align="right">';
|
||||||
print_liste_field_titre("Montant HT",$PHP_SELF,"fac.total_ht");
|
print_liste_field_titre("Montant HT",$PHP_SELF,"fac.total_ht");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<TD align="right">';
|
print '<td align="right">';
|
||||||
print_liste_field_titre("Montant TTC",$PHP_SELF,"fac.total_ttc");
|
print_liste_field_titre("Montant TTC",$PHP_SELF,"fac.total_ttc");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center">Payé</td>';
|
print '<td align="center">';
|
||||||
print "</TR>\n";
|
print_liste_field_titre("Statut",$PHP_SELF,"fk_statut,paye");
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
@ -145,15 +153,48 @@ if ($result)
|
|||||||
print "<td>".strftime("%d %b %Y",$obj->datef)."</td>\n";
|
print "<td>".strftime("%d %b %Y",$obj->datef)."</td>\n";
|
||||||
print '<td>'.stripslashes("$obj->libelle").'</td>';
|
print '<td>'.stripslashes("$obj->libelle").'</td>';
|
||||||
print "<td><a href=\"../fiche.php?socid=$obj->socid\">$obj->nom</A></td>\n";
|
print "<td><a href=\"../fiche.php?socid=$obj->socid\">$obj->nom</A></td>\n";
|
||||||
print '<TD align="right">'.price($obj->total_ht).'</td>';
|
print '<td align="right">'.price($obj->total_ht).'</td>';
|
||||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||||
print '<TD align="center">'.($obj->paye||$obj->total_ht==0?"":"<a class=\"impayee\" href=\"\">").($obj->total_ht==0?"brouillon":$yn[$obj->paye]).($obj->paye||$obj->total_ht==0?"":"</a>").'</TD>';
|
// Affiche statut de la facture
|
||||||
|
if ($obj->paye)
|
||||||
|
{
|
||||||
|
$class = "normal";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($obj->fk_statut == 0)
|
||||||
|
{
|
||||||
|
$class = "normal";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$class = "impayee";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! $obj->paye)
|
||||||
|
{
|
||||||
|
if ($obj->fk_statut == 0)
|
||||||
|
{
|
||||||
|
print '<td align="center">brouillon</td>';
|
||||||
|
}
|
||||||
|
elseif ($obj->fk_statut == 3)
|
||||||
|
{
|
||||||
|
print '<td align="center">annulée</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center"><a class="'.$class.'" href="'.$PHP_SELF.'?filtre=paye:0,fk_statut:1">'.($obj->am?"commencé":"impayée").'</a></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="center">payée</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
print "</TR>\n";
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</TABLE>";
|
print "</table>";
|
||||||
$db->free();
|
$db->free();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user