26 |
\version $Revision$ |
\version $Revision$ |
27 |
*/ |
*/ |
28 |
|
|
29 |
|
|
30 |
|
// Code identique a /expedition/fiche.php |
31 |
|
|
32 |
require("./pre.inc.php"); |
require("./pre.inc.php"); |
33 |
|
|
34 |
$user->getrights('commande'); |
$user->getrights('commande'); |
65 |
/* */ |
/* */ |
66 |
/* *************************************************************************** */ |
/* *************************************************************************** */ |
67 |
|
|
68 |
llxHeader('','Fiche commande',''); |
llxHeader('',$langs->trans("OrderCard")); |
69 |
|
|
70 |
$html = new Form($db); |
$html = new Form($db); |
71 |
|
|
107 |
$h++; |
$h++; |
108 |
} |
} |
109 |
|
|
110 |
|
$head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id; |
111 |
|
$head[$h][1] = $langs->trans("Info"); |
112 |
|
$h++; |
113 |
|
|
114 |
dolibarr_fiche_head($head, $hselected, $langs->trans("Order").": $commande->ref"); |
dolibarr_fiche_head($head, $hselected, $langs->trans("Order").": $commande->ref"); |
115 |
|
|
116 |
/* |
/* |
123 |
print "<br />"; |
print "<br />"; |
124 |
} |
} |
125 |
|
|
126 |
|
// Onglet expedition |
127 |
print '<table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
128 |
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>'; |
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>'; |
129 |
print '<td width="30%">'; |
print '<td width="30%">'; |
154 |
|
|
155 |
print '</table>'; |
print '</table>'; |
156 |
|
|
157 |
|
/** |
158 |
/* |
* Lignes de commandes avec quantité livrées et reste à livrer |
|
* Lignes de commandes |
|
159 |
* |
* |
160 |
*/ |
*/ |
161 |
echo '<br><table class="liste" width="100%">'; |
echo '<br><table class="liste" width="100%">'; |
174 |
$i = 0; $total = 0; |
$i = 0; $total = 0; |
175 |
|
|
176 |
print '<tr class="liste_titre">'; |
print '<tr class="liste_titre">'; |
177 |
print '<td>'.$langs->trans("Products").'</td>'; |
print '<td>'.$langs->trans("Description").'</td>'; |
178 |
print '<td align="center">Quan. Commandée</td>'; |
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>'; |
179 |
print '<td align="center">Quan. livrée</td>'; |
print '<td align="center">'.$langs->trans("QtyShipped").'</td>'; |
180 |
print '<td align="center">Reste à livrer</td>'; |
print '<td align="center">'.$langs->trans("KeepToShip").'</td>'; |
181 |
if ($conf->stock->enabled) |
if ($conf->stock->enabled) |
182 |
{ |
{ |
183 |
print '<td align="center">Stock</td>'; |
print '<td align="center">'.$langs->trans("Stock").'</td>'; |
184 |
} |
} |
185 |
print "</tr>\n"; |
print "</tr>\n"; |
186 |
|
|
194 |
print "<tr $bc[$var]>"; |
print "<tr $bc[$var]>"; |
195 |
if ($objp->fk_product > 0) |
if ($objp->fk_product > 0) |
196 |
{ |
{ |
|
|
|
197 |
$product = new Product($db); |
$product = new Product($db); |
198 |
$product->fetch($objp->fk_product); |
$product->fetch($objp->fk_product); |
|
|
|
199 |
print '<td>'; |
print '<td>'; |
200 |
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'.stripslashes(nl2br($objp->description)).'</a></td>'; |
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'; |
201 |
|
print img_object($langs->trans("Product"),"product").' '.$product->ref.'</a>'; |
202 |
|
print $product->libelle?' - '.$product->libelle:''; |
203 |
|
print '</td>'; |
204 |
} |
} |
205 |
else |
else |
206 |
{ |
{ |
244 |
{ |
{ |
245 |
print $langs->trans("None").'<br>'; |
print $langs->trans("None").'<br>'; |
246 |
} |
} |
247 |
|
|
248 |
} |
} |
249 |
else |
else |
250 |
{ |
{ |
251 |
dolibarr_print_error($db); |
dolibarr_print_error($db); |
252 |
} |
} |
253 |
|
|
254 |
|
print '</div>'; |
255 |
|
|
256 |
|
|
257 |
/* |
/* |
258 |
* |
* Boutons Actions |
259 |
* |
*/ |
260 |
*/ |
if ($user->societe_id == 0) |
261 |
if ($reste_a_livrer_total > 0 && $commande->brouillon == 0) |
{ |
262 |
|
print '<div class="tabsAction">'; |
263 |
|
|
264 |
|
if (! $conf->stock->enabled && $reste_a_livrer_total > 0 && $commande->brouillon == 0 && $user->rights->expedition->creer) |
265 |
|
{ |
266 |
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/fiche.php?action=create&commande_id='.$_GET["id"].'">'.$langs->trans("NewSending").'</a>'; |
267 |
|
} |
268 |
|
|
269 |
|
print "</div>"; |
270 |
|
|
271 |
|
} |
272 |
|
|
273 |
|
|
274 |
|
/** |
275 |
|
* Formulaire nouvelle expedition depuis un entrepot |
276 |
|
*/ |
277 |
|
if ($conf->stock->enabled && $reste_a_livrer_total > 0 && $commande->brouillon == 0 && $user->rights->expedition->creer) |
278 |
{ |
{ |
279 |
print '<form method="post" action="fiche.php">'; |
|
280 |
|
print '<form method="GET" action="'.DOL_URL_ROOT.'/expedition/fiche.php">'; |
281 |
print '<input type="hidden" name="action" value="create">'; |
print '<input type="hidden" name="action" value="create">'; |
282 |
|
print '<input type="hidden" name="id" value="'.$commande->id.'">'; |
283 |
print '<input type="hidden" name="commande_id" value="'.$commande->id.'">'; |
print '<input type="hidden" name="commande_id" value="'.$commande->id.'">'; |
284 |
print '<br /><table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
285 |
|
|
286 |
$entrepot = new Entrepot($db); |
$entrepot = new Entrepot($db); |
287 |
$langs->load("stocks"); |
$langs->load("stocks"); |
288 |
|
|
289 |
print '<tr><td colspan="2">'.$langs->trans("NewSending").'</td></tr>'; |
print '<tr>'; |
290 |
|
print '<td>'.$langs->trans("Warehouse").'</td>'; |
|
print '<tr><td width="20%">'.$langs->trans("Warehouse").'</td>'; |
|
291 |
print '<td>'; |
print '<td>'; |
292 |
$html->select_array("entrepot_id",$entrepot->list_array()); |
$html->select_array("entrepot_id",$entrepot->list_array()); |
293 |
if (sizeof($entrepot->list_array()) <= 0) |
if (sizeof($entrepot->list_array()) <= 0) |
302 |
print '</td></tr>'; |
print '</td></tr>'; |
303 |
*/ |
*/ |
304 |
|
|
305 |
|
print '<tr><td align="center" colspan="2">'; |
306 |
|
print '<input type="submit" class="button" named="save" value="'.$langs->trans("NewSending").'">'; |
307 |
|
print '</td></tr>'; |
308 |
|
|
309 |
print "</table><br>"; |
print "</table><br>"; |
310 |
print "</form>\n"; |
print "</form>\n"; |
311 |
} |
} |
344 |
$db->free($resql); |
$db->free($resql); |
345 |
} |
} |
346 |
else { |
else { |
347 |
dolibarr_print_date($db); |
dolibarr_print_error($db); |
348 |
} |
} |
349 |
|
|
350 |
} |
} |
352 |
print "</table>"; |
print "</table>"; |
353 |
} |
} |
354 |
|
|
|
print '</div>'; |
|
|
|
|
|
/* |
|
|
* Boutons Actions |
|
|
*/ |
|
|
if ($user->societe_id == 0) |
|
|
{ |
|
|
print '<div class="tabsAction">'; |
|
|
|
|
|
if ($user->rights->expedition->creer && $reste_a_livrer_total > 0 && $commande->brouillon == 0) |
|
|
{ |
|
|
print '<a class="tabAction" href="fiche.php?action=create&commande_id='.$commande->id.'">'.$langs->trans("CreateSending").'</a>'; |
|
|
} |
|
|
|
|
|
if ($user->rights->commande->creer && $reste_a_livrer_total == 0 && $commande->statut < 3) |
|
|
{ |
|
|
print '<a class="tabAction" href="commande.php?id='.$commande->id.'&action=cloture">'.$langs->trans("Close").'</a>'; |
|
|
} |
|
|
|
|
|
print "</div>"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
355 |
/* |
/* |
356 |
* Déjà livr |
* Déjà livr |
357 |
*/ |
*/ |
379 |
while ($i < $num) |
while ($i < $num) |
380 |
{ |
{ |
381 |
$objp = $db->fetch_object($resql); |
$objp = $db->fetch_object($resql); |
382 |
print "<TR $bc[$var]>"; |
print "<tr $bc[$var]>"; |
383 |
if ($objp->fk_product > 0) |
if ($objp->fk_product > 0) |
384 |
{ |
{ |
385 |
print '<td>'; |
print '<td>'; |
398 |
} |
} |
399 |
} |
} |
400 |
else { |
else { |
401 |
dolibarr_print_date($db); |
dolibarr_print_error($db); |
402 |
} |
} |
403 |
} |
} |
404 |
else |
else |