29 |
*/ |
*/ |
30 |
|
|
31 |
require("./pre.inc.php"); |
require("./pre.inc.php"); |
32 |
|
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); |
33 |
|
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); |
34 |
|
|
35 |
$user->getrights('facture'); |
$user->getrights('facture'); |
36 |
if (!$user->rights->facture->lire) |
if (!$user->rights->facture->lire) |
40 |
$langs->load("banks"); |
$langs->load("banks"); |
41 |
$langs->load("withdrawals"); |
$langs->load("withdrawals"); |
42 |
|
|
|
require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); |
|
|
|
|
43 |
// Sécurité accés client |
// Sécurité accés client |
44 |
if ($user->societe_id > 0) |
if ($user->societe_id > 0) |
45 |
{ |
{ |
61 |
if ($result > 0) |
if ($result > 0) |
62 |
{ |
{ |
63 |
Header("Location: prelevement.php?facid=".$fact->id); |
Header("Location: prelevement.php?facid=".$fact->id); |
64 |
|
exit; |
65 |
} |
} |
66 |
else |
else |
67 |
{ |
{ |
100 |
$fac = New Facture($db); |
$fac = New Facture($db); |
101 |
if ( $fac->fetch($_GET["facid"], $user->societe_id) > 0) |
if ( $fac->fetch($_GET["facid"], $user->societe_id) > 0) |
102 |
{ |
{ |
|
|
|
103 |
if ($mesg) print $mesg.'<br>'; |
if ($mesg) print $mesg.'<br>'; |
104 |
|
|
105 |
$soc = new Societe($db, $fac->socidp); |
$soc = new Societe($db, $fac->socidp); |
106 |
$soc->fetch($fac->socidp); |
$soc->fetch($fac->socidp); |
|
$author = new User($db); |
|
|
$author->id = $fac->user_author; |
|
|
$author->fetch(); |
|
107 |
|
|
108 |
$h = 0; |
$author = new User($db); |
109 |
$head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$fac->id; |
if ($fac->user_author) |
|
$head[$h][1] = $langs->trans("CardBill"); |
|
|
$h++; |
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$fac->id; |
|
|
$head[$h][1] = $langs->trans('Contact'); |
|
|
$h++; |
|
|
|
|
|
if ($conf->use_preview_tabs) |
|
|
{ |
|
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id; |
|
|
$head[$h][1] = $langs->trans("Preview"); |
|
|
$h++; |
|
|
} |
|
|
|
|
|
if ($fac->mode_reglement_code == 'PRE') |
|
110 |
{ |
{ |
111 |
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id; |
$author->id = $fac->user_author; |
112 |
$head[$h][1] = $langs->trans("StandingOrders"); |
$author->fetch(); |
|
$hselected = $h; |
|
|
$h++; |
|
113 |
} |
} |
114 |
|
|
115 |
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$fac->id; |
$head = facture_prepare_head($fac); |
|
$head[$h][1] = $langs->trans("Note"); |
|
|
$h++; |
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$fac->id; |
|
|
$head[$h][1] = $langs->trans("Info"); |
|
|
$h++; |
|
116 |
|
|
117 |
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); |
dolibarr_fiche_head($head, 2, $langs->trans('Bill').' : '.$fac->ref); |
118 |
|
|
119 |
/* |
/* |
120 |
* Facture |
* Facture |
121 |
*/ |
*/ |
122 |
print '<table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
123 |
|
|
124 |
|
// Reference du facture |
125 |
|
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">'; |
126 |
|
print $fac->ref; |
127 |
|
print "</td></tr>"; |
128 |
|
|
129 |
// Societe |
// Societe |
130 |
print '<tr><td>'.$langs->trans("Company").'</td>'; |
print '<tr><td width="20%">'.$langs->trans("Company").'</td>'; |
131 |
print '<td colspan="5">'; |
print '<td colspan="5">'; |
132 |
print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; |
print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; |
133 |
print '</tr>'; |
print '</tr>'; |