272 |
|
|
273 |
print '<table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
274 |
|
|
275 |
print '<tr><td>'.$langs->trans('Ref').' :</td><td>Provisoire</td>'; |
print '<tr><td>'.$langs->trans('Ref').'</td><td>Provisoire</td>'; |
276 |
print '<td>'.$langs->trans('Comments').' :</td></tr>'; |
print '<td>'.$langs->trans('Comments').'</td></tr>'; |
277 |
|
|
278 |
$nbrow=4; |
$nbrow=4; |
279 |
if ($conf->projet->enabled) $nbrow++; |
if ($conf->projet->enabled) $nbrow++; |
|
print '<tr><td>'.$langs->trans('Customer').' :</td><td>'.$soc->nom_url.'</td><td rowspan="'.$nbrow.'">'; |
|
|
print '<textarea name="note" wrap="soft" cols="50" rows="4"></textarea></td></tr>'; |
|
280 |
|
|
281 |
print '<tr><td>'.$langs->trans('Date').' :</td><td>'; |
print '<tr><td>'.$langs->trans('Customer').'</td><td>'.$soc->nom_url.'</td>'; |
282 |
|
print '<td rowspan="'.$nbrow.'" valign="top"><textarea name="note" wrap="soft" cols="50" rows="4"></textarea></td>'; |
283 |
|
print '</tr>'; |
284 |
|
|
285 |
|
print '<tr><td>'.$langs->trans('RefCdeClient').'</td><td>'; |
286 |
|
print '<input type="text" name="ref_client" value=""></td>'; |
287 |
|
print '</tr>'; |
288 |
|
|
289 |
|
print '<tr><td>'.$langs->trans('Date').'</td><td>'; |
290 |
$html->select_date(); |
$html->select_date(); |
291 |
print '</td></tr>'; |
print '</td></tr>'; |
292 |
|
|
293 |
if ($conf->projet->enabled) |
if ($conf->projet->enabled) |
294 |
{ |
{ |
295 |
print '<tr><td>'.$langs->trans('Project').' :</td><td>'; |
print '<tr><td>'.$langs->trans('Project').'</td><td>'; |
296 |
$html->select_projects($soc->id,'','projetid'); |
$html->select_projects($soc->id,'','projetid'); |
297 |
print '</td></tr>'; |
print '</td></tr>'; |
298 |
} |
} |
299 |
|
|
300 |
print '<tr><td>'.$langs->trans('Source').' :</td><td>'; |
print '<tr><td>'.$langs->trans('Source').'</td><td>'; |
301 |
$html->select_array('source_id',$new_commande->sources,2); |
$html->select_array('source_id',$new_commande->sources,2); |
302 |
print '</td></tr>'; |
print '</td></tr>'; |
303 |
|
|
|
print '<tr><td>'.$langs->trans('RefCdeClient').' :</td><td>'; |
|
|
print '<input type="text" name="ref_client" value="">'; |
|
|
print '</td></tr>'; |
|
|
|
|
304 |
if ($propalid > 0) |
if ($propalid > 0) |
305 |
{ |
{ |
306 |
$amount = ($obj->price); |
$amount = ($obj->price); |
323 |
*/ |
*/ |
324 |
$NBLINES=8; |
$NBLINES=8; |
325 |
|
|
|
print '<tr><td colspan="3">'.$langs->trans('Services').'/'.$langs->trans('Products').'</td></tr>'; |
|
326 |
print '<tr><td colspan="3">'; |
print '<tr><td colspan="3">'; |
327 |
|
|
|
|
|
328 |
print '<table class="noborder">'; |
print '<table class="noborder">'; |
329 |
print '<tr><td>'.$langs->trans('ProductsAndServices').'</td><td>'.$langs->trans('Qty').'</td><td>'.$langs->trans('Discount').'</td></tr>'; |
print '<tr><td>'.$langs->trans('ProductsAndServices').'</td><td>'.$langs->trans('Qty').'</td><td>'.$langs->trans('Discount').'</td></tr>'; |
330 |
for ($i = 1 ; $i <= $NBLINES ; $i++) |
for ($i = 1 ; $i <= $NBLINES ; $i++) |
504 |
* Commande |
* Commande |
505 |
*/ |
*/ |
506 |
print '<table class="border" width="100%">'; |
print '<table class="border" width="100%">'; |
507 |
|
|
508 |
|
// Ref |
509 |
print '<tr><td width="15%">'.$langs->trans('Ref').'</td>'; |
print '<tr><td width="15%">'.$langs->trans('Ref').'</td>'; |
510 |
print '<td colspan="2">'.$commande->ref.'</td>'; |
print '<td colspan="2">'.$commande->ref.'</td>'; |
511 |
print '<td>'.$langs->trans('Source').' : ' . $commande->sources[$commande->source] ; |
print '<td width="50%">'.$langs->trans('Source').' : ' . $commande->sources[$commande->source] ; |
512 |
if ($commande->source == 0) |
if ($commande->source == 0) |
513 |
{ |
{ |
514 |
/* Propale */ |
// Si source = propal |
515 |
$propal = new Propal($db); |
$propal = new Propal($db); |
516 |
$propal->fetch($commande->propale_id); |
$propal->fetch($commande->propale_id); |
517 |
print ' -> <a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id.'">'.$propal->ref.'</a>'; |
print ' -> <a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id.'">'.$propal->ref.'</a>'; |
518 |
} |
} |
519 |
print '</td></tr>'; |
print '</td></tr>'; |
520 |
|
|
521 |
|
// Société |
522 |
print '<tr><td>'.$langs->trans('Customer').'</td>'; |
print '<tr><td>'.$langs->trans('Customer').'</td>'; |
523 |
print '<td colspan="3">'; |
print '<td colspan="3">'; |
524 |
print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; |
print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; |
525 |
print '</tr>'; |
print '</tr>'; |
526 |
|
|
527 |
print '<tr><td>'.$langs->trans('Status').'</td>'; |
$nbrow=7; |
|
print '<td colspan="2">'.$commande->statuts[$commande->statut].'</td>'; |
|
|
$nbrow=6; |
|
528 |
if ($conf->projet->enabled) $nbrow++; |
if ($conf->projet->enabled) $nbrow++; |
529 |
|
|
530 |
|
// Ref commande client |
531 |
|
print '<tr><td>'; |
532 |
|
print '<table class="nobordernopadding" width="100%"><tr><td nowrap>'; |
533 |
|
print $langs->trans('RefCdeClient').'</td><td align="left">'; |
534 |
|
print '</td>'; |
535 |
|
if ($_GET['action'] != 'refcdeclient') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refcdeclient&id='.$commande->id.'">'.img_edit($langs->trans('Edit')).'</a></td>'; |
536 |
|
print '</tr></table>'; |
537 |
|
print '</td><td colspan="2">'; |
538 |
|
if ($user->rights->commande->creer && $_GET['action'] == 'refcdeclient') |
539 |
|
{ |
540 |
|
print '<form action="fiche.php?id='.$id.'" method="post">'; |
541 |
|
print '<input type="hidden" name="action" value="set_ref_client">'; |
542 |
|
print '<input type="text" class="flat" size="20" name="ref_client" value="'.$commande->ref_client.'">'; |
543 |
|
print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">'; |
544 |
|
print '</form>'; |
545 |
|
} |
546 |
|
else |
547 |
|
{ |
548 |
|
print $commande->ref_client; |
549 |
|
} |
550 |
|
print '</td>'; |
551 |
print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('Note').' :<br>'; |
print '<td rowspan="'.$nbrow.'" valign="top">'.$langs->trans('Note').' :<br>'; |
552 |
if ($commande->brouillon == 1 && $user->rights->commande->creer) |
if ($commande->brouillon == 1 && $user->rights->commande->creer) |
553 |
{ |
{ |
554 |
print '<form action="fiche.php?id='.$id.'" method="post">'; |
print '<form action="fiche.php?id='.$id.'" method="post">'; |
555 |
print '<input type="hidden" name="action" value="setnote">'; |
print '<input type="hidden" name="action" value="setnote">'; |
556 |
print '<textarea name="note" style="width:95%;height:80%">'.$commande->note.'</textarea><br>'; |
print '<textarea name="note" rows="5" style="width:95%;">'.$commande->note.'</textarea><br>'; |
557 |
print '<center><input type="submit" class="button" value="'.$langs->trans('Save').'"></center>'; |
print '<center><input type="submit" class="button" value="'.$langs->trans('Save').'"></center>'; |
558 |
print '</form>'; |
print '</form>'; |
559 |
} |
} |
561 |
{ |
{ |
562 |
print nl2br($commande->note); |
print nl2br($commande->note); |
563 |
} |
} |
564 |
print '</td></tr>'; |
print '</td>'; |
565 |
|
print '</tr>'; |
566 |
|
|
567 |
|
print '<tr><td>'.$langs->trans('Status').'</td>'; |
568 |
|
print '<td colspan="2">'.$commande->statuts[$commande->statut].'</td>'; |
569 |
|
print '</tr>'; |
570 |
|
|
571 |
print '<tr><td>'.$langs->trans('Date').'</td>'; |
print '<tr><td>'.$langs->trans('Date').'</td>'; |
572 |
print '<td colspan="2">'.dolibarr_print_date($commande->date,'%A %d %B %Y').'</td>'; |
print '<td colspan="2">'.dolibarr_print_date($commande->date,'%A %d %B %Y').'</td>'; |
598 |
print '<tr><td height="10"> </td><td colspan="2"> </td></tr>'; |
print '<tr><td height="10"> </td><td colspan="2"> </td></tr>'; |
599 |
} |
} |
600 |
|
|
|
|
|
|
|
|
601 |
// Lignes de 3 colonnes |
// Lignes de 3 colonnes |
|
print '<tr><td>'.$langs->trans('RefCdeClient').' :</td><td align="left">'; |
|
|
if ($commande->brouillon == 1 && $user->rights->commande->creer) |
|
|
{ |
|
|
print '<form action="fiche.php?id='.$id.'" method="post">'; |
|
|
print '<input type="hidden" name="action" value="set_ref_client">'; |
|
|
print '<input type="text" class="flat" size="25" name="ref_client" value="'.$commande->ref_client.'">'; |
|
|
print '</td><td><input type="submit" class="button" value="'.$langs->trans('Save').'">'; |
|
|
print '</form>'; |
|
|
} |
|
|
else |
|
|
{ |
|
|
print $commande->ref_client.'</td><td> '; |
|
|
} |
|
|
print '</td></tr>'; |
|
|
|
|
|
print '<tr><td>'.$langs->trans('AmountHT').'</td>'; |
|
|
print '<td align="right"><b>'.price($commande->total_ht).'</b></td>'; |
|
|
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
|
602 |
|
|
603 |
print '<tr><td>'.$langs->trans('GlobalDiscount').'</td><td align="right">'; |
print '<tr><td>'; |
604 |
if ($commande->brouillon == 1 && $user->rights->commande->creer) |
print '<table class="nobordernopadding" width="100%"><tr><td>'; |
605 |
|
print $langs->trans('GlobalDiscount').'</td><td align="right">'; |
606 |
|
print '</td>'; |
607 |
|
if ($_GET['action'] != 'setdiscount') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=setdiscount&id='.$commande->id.'">'.img_edit($langs->trans('Edit')).'</a></td>'; |
608 |
|
print '</tr></table>'; |
609 |
|
print '</td>'; |
610 |
|
if ($user->rights->commande->creer && $_GET['action'] == 'setdiscount') |
611 |
{ |
{ |
612 |
|
print '<td align="right">'; |
613 |
print '<form action="fiche.php?id='.$id.'" method="post">'; |
print '<form action="fiche.php?id='.$id.'" method="post">'; |
614 |
print '<input type="hidden" name="action" value="setremise">'; |
print '<input type="hidden" name="action" value="setremise">'; |
615 |
print '<input type="text" class="flat" name="remise" size="3" value="'.$commande->remise_percent.'">%'; |
print '<input type="text" class="flat" name="remise" size="3" value="'.$commande->remise_percent.'">%'; |
616 |
print '</td><td><input type="submit" class="button" value="'.$langs->trans('Save').'">'; |
print '</td><td><input type="submit" class="button" value="'.$langs->trans('Modify').'">'; |
617 |
print '</form>'; |
print '</form>'; |
618 |
|
print '</td>'; |
619 |
} |
} |
620 |
else |
else |
621 |
{ |
{ |
622 |
print $commande->remise_percent.'%</td><td> '; |
print '<td align="right">'.$commande->remise_percent.'</td><td>%</td>'; |
623 |
} |
} |
624 |
print '</td></tr>'; |
print '</tr>'; |
625 |
|
|
626 |
|
// Total HT |
627 |
|
print '<tr><td>'.$langs->trans('TotalHT').'</td>'; |
628 |
|
print '<td align="right"><b>'.price($commande->total_ht).'</b></td>'; |
629 |
|
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
630 |
|
|
631 |
print '<tr><td>'.$langs->trans('VAT').'</td><td align="right">'.price($commande->total_tva).'</td>'; |
// Total TVA |
632 |
|
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td align="right">'.price($commande->total_tva).'</td>'; |
633 |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
634 |
|
|
635 |
|
// Total TTC |
636 |
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td align="right">'.price($commande->total_ttc).'</td>'; |
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td align="right">'.price($commande->total_ttc).'</td>'; |
637 |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>'; |
638 |
|
|
827 |
if ($user->societe_id == 0 && $commande->statut < 3 && $_GET['action'] == '') |
if ($user->societe_id == 0 && $commande->statut < 3 && $_GET['action'] == '') |
828 |
{ |
{ |
829 |
print '<div class="tabsAction">'; |
print '<div class="tabsAction">'; |
830 |
|
|
831 |
if ($conf->expedition->enabled && $commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer) |
if ($conf->expedition->enabled && $commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer) |
832 |
{ |
{ |
833 |
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/commande.php?id='.$_GET['id'].'">'.$langs->trans('Send').'</a>'; |
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/commande.php?id='.$_GET['id'].'">'.$langs->trans('Send').'</a>'; |