47 |
} |
} |
48 |
|
|
49 |
|
|
50 |
$facture = new Facture($db); |
$fac = new Facture($db); |
51 |
$facture->fetch($_GET["facid"]); |
$fac->fetch($_GET["facid"]); |
52 |
|
|
53 |
|
|
54 |
/******************************************************************************/ |
/******************************************************************************/ |
57 |
|
|
58 |
if ($_POST["action"] == 'update' && $user->rights->facture->creer) |
if ($_POST["action"] == 'update' && $user->rights->facture->creer) |
59 |
{ |
{ |
60 |
$facture->update_note($_POST["note"]); |
$fac->update_note($_POST["note"]); |
61 |
} |
} |
62 |
|
|
63 |
|
|
68 |
|
|
69 |
llxHeader(); |
llxHeader(); |
70 |
|
|
71 |
|
$html = new Form($db); |
72 |
|
|
73 |
if ($_GET["facid"]) |
if ($_GET["facid"]) |
74 |
{ |
{ |
75 |
$soc = new Societe($db, $facture->socidp); |
$soc = new Societe($db, $fac->socidp); |
76 |
$soc->fetch($facture->socidp); |
$soc->fetch($fac->socidp); |
77 |
|
|
78 |
|
$h=0; |
79 |
|
|
80 |
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$fac->id; |
81 |
|
$head[$h][1] = $langs->trans("CardBill"); |
82 |
|
$h++; |
83 |
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id; |
84 |
|
$head[$h][1] = $langs->trans("Preview"); |
85 |
|
$h++; |
86 |
|
|
87 |
|
if ($fac->mode_reglement_code == 'PRE') |
88 |
|
{ |
89 |
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id; |
90 |
|
$head[$h][1] = $langs->trans("StandingOrders"); |
91 |
|
$h++; |
92 |
|
} |
93 |
|
|
94 |
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$fac->id; |
95 |
|
$head[$h][1] = $langs->trans("Note"); |
96 |
|
$hselected = $h; |
97 |
|
$h++; |
98 |
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$fac->id; |
99 |
|
$head[$h][1] = $langs->trans("Info"); |
100 |
|
$h++; |
101 |
|
|
102 |
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); |
103 |
|
|
104 |
|
|
105 |
|
print '<table class="border" width="100%">'; |
106 |
|
|
107 |
|
print '<tr><td>'.$langs->trans("Company").'</td>'; |
108 |
|
print '<td colspan="3">'; |
109 |
|
print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; |
110 |
|
|
111 |
|
// Dates |
112 |
|
print '<tr><td>'.$langs->trans("Date").'</td>'; |
113 |
|
print '<td>'.dolibarr_print_date($fac->date,"%A %d %B %Y").'</td>'; |
114 |
|
print '<td>'.$langs->trans("DateClosing").'</td><td>' . dolibarr_print_date($fac->date_lim_reglement,"%A %d %B %Y"); |
115 |
|
if ($fac->paye == 0 && $fac->date_lim_reglement < (time() - $warning_delay)) print img_warning($langs->trans("Late")); |
116 |
|
print "</td></tr>"; |
117 |
|
|
118 |
|
// Conditions et modes de réglement |
119 |
|
print '<tr><td>'.$langs->trans("PaymentConditions").'</td><td>'; |
120 |
|
$html->form_conditions_reglement($_SERVER["PHP_SELF"]."?facid=$fac->id",$fac->cond_reglement_id,"none"); |
121 |
|
print '</td>'; |
122 |
|
print '<td width="25%">'.$langs->trans("PaymentMode").'</td><td width="25%">'; |
123 |
|
$html->form_modes_reglement($_SERVER["PHP_SELF"]."?facid=$fac->id",$fac->mode_reglement_id,"none"); |
124 |
|
print '</td></tr>'; |
125 |
|
|
126 |
|
print '<tr><td valign="top" colspan="4">'.$langs->trans("Note").' :</td></tr>'; |
127 |
|
|
128 |
|
print '<tr><td valign="top" colspan="4">'.($fac->note?nl2br($fac->note):" ")."</td></tr>"; |
129 |
|
|
130 |
|
if ($_GET["action"] == 'edit') |
131 |
|
{ |
132 |
|
print '<form method="post" action="note.php?facid='.$fac->id.'">'; |
133 |
|
print '<input type="hidden" name="action" value="update">'; |
134 |
|
print '<tr><td valign="top" colspan="4"><textarea name="note" cols="80" rows="8">'.$fac->note."</textarea></td></tr>"; |
135 |
|
print '<tr><td align="center" colspan="4"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>'; |
136 |
|
print '</form>'; |
137 |
|
} |
138 |
|
|
139 |
|
print "</table>"; |
140 |
|
|
141 |
|
|
142 |
|
/* |
143 |
|
* Actions |
144 |
|
*/ |
145 |
|
print '</div>'; |
146 |
|
print '<div class="tabsAction">'; |
147 |
|
|
148 |
|
if ($user->rights->facture->creer && $_GET["action"] <> 'edit') |
149 |
|
{ |
150 |
|
print "<a class=\"tabAction\" href=\"note.php?facid=$fac->id&action=edit\">".$langs->trans('Edit')."</a>"; |
151 |
|
} |
152 |
|
|
153 |
|
print "</div>"; |
154 |
|
|
155 |
|
|
|
$h=0; |
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$facture->id; |
|
|
$head[$h][1] = $langs->trans("CardBill"); |
|
|
$h++; |
|
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$facture->id; |
|
|
$head[$h][1] = $langs->trans("Preview"); |
|
|
$h++; |
|
|
|
|
|
if ($facture->mode_reglement == 3) |
|
|
{ |
|
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$facture->id; |
|
|
$head[$h][1] = $langs->trans("StandingOrders"); |
|
|
$h++; |
|
|
} |
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$facture->id; |
|
|
$head[$h][1] = $langs->trans("Note"); |
|
|
$hselected = $h; |
|
|
$h++; |
|
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$facture->id; |
|
|
$head[$h][1] = $langs->trans("Info"); |
|
|
$h++; |
|
|
|
|
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $facture->ref"); |
|
|
|
|
|
|
|
|
print '<table class="border" width="100%">'; |
|
|
|
|
|
print '<tr><td>'.$langs->trans("Company").'</td>'; |
|
|
print '<td colspan="3">'; |
|
|
print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; |
|
|
|
|
|
print '<tr><td>'.$langs->trans("Date").'</td>'; |
|
|
print '<td>'.dolibarr_print_date($facture->date,"%A %d %B %Y")."</td>\n"; |
|
|
print '<td width="25%">'.$langs->trans("DateClosing").'</td><td width="25%">'.dolibarr_print_date($facture->date_lim_reglement,"%A %d %B %Y") ."</td></tr>"; |
|
|
|
|
|
// Conditions et modes de réglement |
|
|
print '<tr><td>'.$langs->trans("PaymentConditions").'</td><td>'. $facture->cond_reglement . '</td>'; |
|
|
print '<td>'.$langs->trans("PaymentMode").'</td><td>'. $facture->mode_reglement . '</td></tr>'; |
|
|
|
|
|
print '<tr><td valign="top" colspan="4">'.$langs->trans("Note").' :</td></tr>'; |
|
|
|
|
|
print '<tr><td valign="top" colspan="4">'.($facture->note?nl2br($facture->note):" ")."</td></tr>"; |
|
|
|
|
|
if ($_GET["action"] == 'edit') |
|
|
{ |
|
|
print '<form method="post" action="note.php?facid='.$facture->id.'">'; |
|
|
print '<input type="hidden" name="action" value="update">'; |
|
|
print '<tr><td valign="top" colspan="4"><textarea name="note" cols="80" rows="8">'.$facture->note."</textarea></td></tr>"; |
|
|
print '<tr><td align="center" colspan="4"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>'; |
|
|
print '</form>'; |
|
|
} |
|
|
|
|
|
print "</table>"; |
|
|
|
|
|
|
|
|
/* |
|
|
* Actions |
|
|
*/ |
|
|
print '</div>'; |
|
|
print '<div class="tabsAction">'; |
|
|
|
|
|
if ($user->rights->facture->creer && $_GET["action"] <> 'edit') |
|
|
{ |
|
|
print "<a class=\"tabAction\" href=\"note.php?facid=$facture->id&action=edit\">".$langs->trans('Edit')."</a>"; |
|
|
} |
|
|
|
|
|
print "</div>"; |
|
|
|
|
|
|
|
156 |
} |
} |
157 |
|
|
158 |
$db->close(); |
$db->close(); |