From 0febb18214c5104a34fd3bca43a41c2b4355d265 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 2 Dec 2006 12:15:40 +0000 Subject: [PATCH] Ajoute le nom de l'auteur --- htdocs/commande/fiche.php | 315 +++++++++++++++++++------------------- 1 file changed, 158 insertions(+), 157 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2fce2ed26cb..cf33620ea6a 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2006 Regis Houssin @@ -24,10 +24,10 @@ */ /** - \file htdocs/commande/fiche.php - \ingroup commande - \brief Fiche commande - \version $Revision$ + \file htdocs/commande/fiche.php + \ingroup commande + \brief Fiche commande client + \version $Revision$ */ require('./pre.inc.php'); @@ -57,15 +57,15 @@ if (!$user->rights->commande->lire) accessforbidden(); $socid=0; if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; + $action = ''; + $socid = $user->societe_id; } // Récupération de l'id de projet $projetid = 0; if ($_GET["projetid"]) { - $projetid = $_GET["projetid"]; + $projetid = $_GET["projetid"]; } /* @@ -981,157 +981,158 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) } else { - /* *************************************************************************** */ - /* */ - /* Mode vue et edition */ - /* */ - /* *************************************************************************** */ - $id = $_GET['id']; - if ($id > 0) + /* *************************************************************************** */ + /* */ + /* Mode vue et edition */ + /* */ + /* *************************************************************************** */ + $id = $_GET['id']; + if ($id > 0) + { + if ($mesg) print $mesg.'
'; + + $commande = new Commande($db); + if ( $commande->fetch($_GET['id']) > 0) { - if ($mesg) print $mesg.'
'; - - $commande = new Commande($db); - if ( $commande->fetch($_GET['id']) > 0) + $soc = new Societe($db); + $soc->fetch($commande->socid); + + $author = new User($db); + $author->id = $commande->user_author_id; + $author->fetch(); + + $head = commande_prepare_head($commande); + dolibarr_fiche_head($head, 'order', $langs->trans("CustomerOrder")); + + /* + * Confirmation de la suppression de la commande + */ + if ($_GET['action'] == 'delete') + { + $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete'); + print '
'; + } + + /* + * Confirmation de la validation + */ + if ($_GET['action'] == 'valid') + { + // on vérifie si la facture est en numérotation provisoire + $ref = substr($commande->ref, 1, 4); + if ($ref == 'PROV') { - $soc = new Societe($db); - $soc->fetch($commande->socid); - - $author = new User($db); - $author->id = $commande->user_author_id; - $author->fetch(); - - $head = commande_prepare_head($commande); - dolibarr_fiche_head($head, 'order', $langs->trans("CustomerOrder")); - - /* - * Confirmation de la suppression de la commande - */ - if ($_GET['action'] == 'delete') - { - $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete'); - print '
'; - } - - /* - * Confirmation de la validation - */ - if ($_GET['action'] == 'valid') - { - // on vérifie si la facture est en numérotation provisoire - $ref = substr($commande->ref, 1, 4); - if ($ref == 'PROV') - { - $num = $commande->getNextNumRef($soc); - } - else - { - $num = $commande->ref; - } - - $text=$langs->trans('ConfirmValidateOrder',$num); - $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid'); - print '
'; - } - - /* - * Confirmation de la cloture - */ - if ($_GET['action'] == 'cloture') - { - //$numfa = commande_get_num($soc); - $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close'); - print '
'; - } - - /* - * Confirmation de l'annulation - */ - if ($_GET['action'] == 'annuler') - { - $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel'); - print '
'; - } - - /* - * Confirmation de la suppression d'une ligne produit - */ - if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) - { - $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); - print '
'; - } - - /* - * Commande - */ - $nbrow=8; - if ($conf->projet->enabled) $nbrow++; - - print ''; - - // Ref - print ''; - print ''; - print ''; - - // Ref commande client - print ''; - print ''; - - - // Société - print ''; - print ''; - print ''; - - // Ligne info remises tiers - print ''; - - // Date - print ''; - print ''; - print '
'.$langs->trans('Ref').''.$commande->ref.'
'; - print ''; - if ($_GET['action'] != 'RefCustomerOrder' && $commande->brouillon) print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print ''.img_edit($langs->trans('Edit')).'
'; - print '
'; - if ($user->rights->commande->creer && $_GET['action'] == 'RefCustomerOrder') - { - print '
'; - print ''; - print ''; - print ' '; - print '
'; - } - else - { - print $commande->ref_client; - } - print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - $absolute_discount=$soc->getCurrentDiscount(); - print '. '; - if ($absolute_discount) - { - if ($commande->statut > 0) - { - print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie)); - } - else - { - print '
'; - print $html->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$commande->id,0,'remise_id',$soc->id,$absolute_discount); - } - } - else print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; - print '
'.$langs->trans('Date').''.dolibarr_print_date($commande->date,'%A %d %B %Y').''.$langs->trans('Source').' : ' . $commande->sources[$commande->source] ; - if ($commande->source == 0) - { - // Si source = propal + $num = $commande->getNextNumRef($soc); + } + else + { + $num = $commande->ref; + } + + $text=$langs->trans('ConfirmValidateOrder',$num); + $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid'); + print '
'; + } + + /* + * Confirmation de la cloture + */ + if ($_GET['action'] == 'cloture') + { + //$numfa = commande_get_num($soc); + $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close'); + print '
'; + } + + /* + * Confirmation de l'annulation + */ + if ($_GET['action'] == 'annuler') + { + $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel'); + print '
'; + } + + /* + * Confirmation de la suppression d'une ligne produit + */ + if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) + { + $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); + print '
'; + } + + /* + * Commande + */ + $nbrow=8; + if ($conf->projet->enabled) $nbrow++; + + print ''; + + // Ref + print ''; + print ''; + print ''; + print ''; + + // Ref commande client + print ''; + print ''; + + + // Société + print ''; + print ''; + print ''; + + // Ligne info remises tiers + print ''; + + // Date + print ''; + print ''; + print '
'.$langs->trans('Ref').''.$commande->ref.''.$langs->trans('Author').' : '.$author->fullname.'
'; + print ''; + if ($_GET['action'] != 'RefCustomerOrder' && $commande->brouillon) print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print ''.img_edit($langs->trans('Edit')).'
'; + print '
'; + if ($user->rights->commande->creer && $_GET['action'] == 'RefCustomerOrder') + { + print '
'; + print ''; + print ''; + print ' '; + print '
'; + } + else + { + print $commande->ref_client; + } + print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Discounts').''; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $absolute_discount=$soc->getCurrentDiscount(); + print '. '; + if ($absolute_discount) + { + if ($commande->statut > 0) + { + print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie)); + } + else + { + print '
'; + print $html->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$commande->id,0,'remise_id',$soc->id,$absolute_discount); + } + } + else print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; + print '
'.$langs->trans('Date').''.dolibarr_print_date($commande->date,'%A %d %B %Y').''.$langs->trans('Source').' : ' . $commande->sources[$commande->source] ; + if ($commande->source == 0) + { + // Si source = propal $propal = new Propal($db); $propal->fetch($commande->propale_id); print ' -> '.$propal->ref.'';