This commit is contained in:
Rodolphe Quiedeville 2005-09-06 10:24:22 +00:00
parent 0f3b33b501
commit 46d2e704a0

View File

@ -191,47 +191,53 @@ if ($_GET["facid"] > 0)
$fac = New Facture($db); $fac = New Facture($db);
if ( $fac->fetch($_GET["facid"], $user->societe_id) > 0) if ( $fac->fetch($_GET["facid"], $user->societe_id) > 0)
{ {
$soc = new Societe($db, $fac->socidp); $soc = new Societe($db, $fac->socidp);
$soc->fetch($fac->socidp); $soc->fetch($fac->socidp);
$author = new User($db); if (!$soc->perm_read)
$author->id = $fac->user_author; {
$author->fetch(); print "Lecture non authorisée";
}
$h = 0; if ($soc->perm_read)
{
$author = new User($db);
$author->id = $fac->user_author;
$author->fetch();
$head[$h][0] = DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$soc->id; $h = 0;
$head[$h][1] = $langs->trans("Fiche client");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/telephonie/client/factures.php?id='.$soc->id; $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$soc->id;
$head[$h][1] = $langs->trans("Factures"); $head[$h][1] = $langs->trans("Fiche client");
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/telephonie/client/facture.php?facid='.$fac->id; $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/factures.php?id='.$soc->id;
$head[$h][1] = $langs->trans("CardBill"); $head[$h][1] = $langs->trans("Factures");
$hselected = $h; $h++;
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); $head[$h][0] = DOL_URL_ROOT.'/telephonie/client/facture.php?facid='.$fac->id;
$head[$h][1] = $langs->trans("CardBill");
$hselected = $h;
$h++;
/* dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref");
* Facture
*/
print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans("Company").'</td>';
print '<td colspan="3">';
print '<b><a href="fiche.php?id='.$soc->id.'">'.$soc->nom.'</a></b></td>';
print "<td>Conditions de réglement</td><td>" . $fac->cond_reglement ."</td></tr>"; /*
* Facture
*/
print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans("Company").'</td>';
print '<td colspan="3">';
print '<b><a href="fiche.php?id='.$soc->id.'">'.$soc->nom.'</a></b></td>';
print '<tr><td>'.$langs->trans("Date").'</td>'; print "<td>Conditions de réglement</td><td>" . $fac->cond_reglement ."</td></tr>";
print "<td colspan=\"3\">".dolibarr_print_date($fac->date,"%A %d %B %Y")."</td>\n";
print '<td>'.$langs->trans("DateClosing").'</td><td>' . dolibarr_print_date($fac->date_lim_reglement,"%A %d %B %Y");
print "</td></tr>";
print '<tr>'; print '<tr><td>'.$langs->trans("Date").'</td>';
print "<td colspan=\"3\">".dolibarr_print_date($fac->date,"%A %d %B %Y")."</td>\n";
print '<td>'.$langs->trans("DateClosing").'</td><td>' . dolibarr_print_date($fac->date_lim_reglement,"%A %d %B %Y");
print "</td></tr>";
print '<tr>';
// Projet // Projet
if ($conf->projet->enabled) if ($conf->projet->enabled)
@ -729,12 +735,16 @@ if ($_GET["facid"] > 0)
print '<br>'; print '<br>';
} }
}
} }
else else
{ {
/* Facture non trouvée */ /* Facture non trouvée */
print $langs->trans("ErrorBillNotFound",$_GET["facid"]); print $langs->trans("ErrorBillNotFound",$_GET["facid"]);
} }
} }
$db->close(); $db->close();