diff --git a/htdocs/compta/fiche.php3 b/htdocs/compta/fiche.php3
index 5c2df661c93..27214e1f30c 100644
--- a/htdocs/compta/fiche.php3
+++ b/htdocs/compta/fiche.php3
@@ -186,11 +186,12 @@ if ($socid > 0)
if ($user->societe_id == 0)
{
- print "
idp\">Commercial | ";
+ print "idp\">Commercial | ";
+ print "idp\">Documents | ";
print "idp&action=add\">[Bookmark] | ";
print "[idp\">".translate("Facture")."] | ";
print "idp\">Notes | ";
- print "[idp&action=edit\">Editer] | ";
+ print "[idp&action=edit\">Editer] | ";
}
print "";
/*
@@ -234,34 +235,42 @@ if ($socid > 0)
$var=!$var;
$sql = "SELECT s.nom, s.idp, f.facnumber, f.amount, ".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND s.idp = $objsoc->idp ORDER BY f.datef DESC";
- if ( $db->query($sql) ) {
- $num = $db->num_rows(); $i = 0;
- if ($num > 0) {
- print "";
- print "| idp\">liste des factures ($num) |
";
- }
+ if ( $db->query($sql) )
+ {
+ $num = $db->num_rows(); $i = 0;
+ if ($num > 0)
+ {
+ print "";
+ print "| idp\">liste des factures ($num) |
";
+ }
- while ($i < $num && $i < 5) {
- $objp = $db->fetch_object( $i);
- $var=!$var;
- print "";
- print "| facid\">$objp->facnumber | \n";
- if ($objp->df > 0 ) {
- print "".strftime("%d %B %Y",$objp->df)." | \n";
- } else {
- print "!!! | \n";
- }
- print "".number_format($objp->amount, 2, ',', ' ')." | \n";
- $paye[1] = "payée";
- $paye[0] = "non payée";
- print "".$paye[$objp->paye]." | \n";
- print "
\n";
- $i++;
+ while ($i < $num && $i < 5)
+ {
+ $objp = $db->fetch_object( $i);
+ $var=!$var;
+ print "";
+ print "| facid\">$objp->facnumber | \n";
+ if ($objp->df > 0 )
+ {
+ print "".strftime("%d %B %Y",$objp->df)." | \n";
+ }
+ else
+ {
+ print "!!! | \n";
+ }
+ print "".number_format($objp->amount, 2, ',', ' ')." | \n";
+ $paye[1] = "payée";
+ $paye[0] = "non payée";
+ print "".$paye[$objp->paye]." | \n";
+ print "
\n";
+ $i++;
+ }
+ $db->free();
+ }
+ else
+ {
+ print $db->error();
}
- $db->free();
- } else {
- print $db->error();
- }
print "";
@@ -333,7 +342,7 @@ if ($socid > 0)
print "Fax | Email | ";
print "idp&action=addcontact\">Ajouter | ";
- $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec";
+ $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM llx_socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec";
$result = $db->query($sql);
$i = 0 ; $num = $db->num_rows();