diff --git a/htdocs/compta/commande.php b/htdocs/compta/commande.php index fc5ef9b17c1..70882ae2965 100644 --- a/htdocs/compta/commande.php +++ b/htdocs/compta/commande.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2005 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,12 +20,24 @@ * $Source$ * */ + +/** + \file htdocs/compta/commande.php + \ingroup commande + \brief Fiche commande + \version $Revision$ +*/ + require("./pre.inc.php"); +$langs->load("orders"); +$langs->load("companies"); +$langs->load("bills"); + $user->getrights('commande'); $user->getrights('facture'); -if (!$user->rights->commande->lire) accessforbidden(); +if (! $user->rights->commande->lire) accessforbidden(); require_once DOL_DOCUMENT_ROOT."/project.class.php"; require_once DOL_DOCUMENT_ROOT."/propal.class.php"; @@ -50,7 +62,10 @@ if ($_GET["action"] == 'facturee') $commande->classer_facturee(); } -llxHeader(); + +llxHeader('',$langs->trans("OrderCard"),"Commande"); + + $html = new Form($db); @@ -72,28 +87,28 @@ if ($_GET["id"] > 0) $author->fetch(); $head[0][0] = DOL_URL_ROOT.'/compta/commande.php?id='.$commande->id; - $head[0][1] = "Commande : $commande->ref"; + $head[0][1] = $langs->trans("Order").": ".$commande->ref; $h = 1; $a = 0; - dolibarr_fiche_head($head, $a); + dolibarr_fiche_head($head, $a, $soc->nom); /* * Commande */ - print ''; - print ""; - print "
Client"; + print ''; + print ""; + print ''; print '"; - print ""; + print ''; print "\n"; - print '"; - print ""; + print ''; - print '"; - print ''; + // Ligne de 3 colonnes + print ''; print ''; - print ''; - - print ''; + print ''; + print ''; print ''; print ''; @@ -169,14 +187,14 @@ if ($_GET["id"] > 0) if ($objp->fk_product > 0) { print ''; + print ''.img_object($langs->trans("ShowProduct"),"product").' '.stripslashes(nl2br($objp->description)).''; } else { - print "\n"; + print "\n"; } - print ''; - print ''; + print ''; + print ''; if ($objp->remise_percent > 0) { print '\n"; @@ -232,13 +250,14 @@ if ($_GET["id"] > 0) */ print "
".$langs->trans("Customer")."'; print ''.$soc->nom.''; print $commande->statuts[$commande->statut]; print "
Date
'.$langs->trans("Date").'".strftime("%A %d %B %Y",$commande->date)."Source : ' . $commande->sources[$commande->source] ; + print ''.$langs->trans("Source").' : ' . $commande->sources[$commande->source] ; if ($commande->source == 0) { /* Propale */ @@ -103,29 +118,32 @@ if ($_GET["id"] > 0) } print "
".$langs->trans("Author")."$author->fullname
'.$langs->trans("Author").''.$author->fullname.'Projet : '; + print ''; + if ($conf->projet->enabled) { + print $langs->trans("Project").' : '; if ($commande->projet_id > 0) { $projet = New Project($db); $projet->fetch($commande->projet_id); print ''.$projet->title.''; } + else + { + print 'Classer la commande'; + } + } print " 
'.$langs->trans("Amount").'
'.$langs->trans("AmountHT").''.price($commande->total_ht).''.$conf->monnaie.' HT'.$langs->trans("Note").'
'.$conf->monnaie.''.$langs->trans("Note").' :
'.nl2br($commande->note).'
'.$langs->trans("GlobalDiscount").''; - print $commande->remise_percent.' % '; - - print ''; - print nl2br($commande->note)." \n"; print '
'.$langs->trans("VAT").''.price($commande->total_tva).''; - print ''.stripslashes(nl2br($objp->description)).'".stripslashes(nl2br($objp->description))."".stripslashes(nl2br($objp->description))."'.$objp->tva_tx.' %'.$objp->qty.''.$objp->tva_tx.' %'.$objp->qty.''.$objp->remise_percent." %
"; } + /* * Factures associees */ $sql = "SELECT f.facnumber, f.total,".$db->pdate("f.datef")." as df, f.rowid as facid, f.fk_user_author, f.paye"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."co_fa as fp WHERE fp.fk_facture = f.rowid AND fp.fk_commande = ".$commande->id; - if ($db->query($sql) ) + if ($db->query($sql)) { $num_fac_asso = $db->num_rows(); $i = 0; $total = 0; @@ -294,31 +313,31 @@ if ($_GET["id"] > 0) } else { - print $db->error(); + dolibarr_print_error($db); } /* * * */ - print ''; + print '
'; + /* * Barre d'actions */ - if ($user->societe_id == 0 && !$commande->facturee) + if (! $user->societe_id && ! $commande->facturee) { - print "
\n"; + print "
\n"; if ($user->rights->facture->creer) { - print 'Facturer'; + print ''.$langs->trans("GenerateBill").''; } - if (!$commande->facturee && $num_fac_asso) + if ($num_fac_asso) { if ($user->rights->commande->creer) - print 'Classer comme facturée'; - + print ''.$langs->trans("ClassifyBilled").''; } print '
'; }