Ajoute le nom de l'auteur
This commit is contained in:
parent
be0d16a7f8
commit
0febb18214
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
||||||
@ -24,10 +24,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/commande/fiche.php
|
\file htdocs/commande/fiche.php
|
||||||
\ingroup commande
|
\ingroup commande
|
||||||
\brief Fiche commande
|
\brief Fiche commande client
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require('./pre.inc.php');
|
require('./pre.inc.php');
|
||||||
@ -57,15 +57,15 @@ if (!$user->rights->commande->lire) accessforbidden();
|
|||||||
$socid=0;
|
$socid=0;
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Récupération de l'id de projet
|
// Récupération de l'id de projet
|
||||||
$projetid = 0;
|
$projetid = 0;
|
||||||
if ($_GET["projetid"])
|
if ($_GET["projetid"])
|
||||||
{
|
{
|
||||||
$projetid = $_GET["projetid"];
|
$projetid = $_GET["projetid"];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -981,157 +981,158 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* *************************************************************************** */
|
/* *************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Mode vue et edition */
|
/* Mode vue et edition */
|
||||||
/* */
|
/* */
|
||||||
/* *************************************************************************** */
|
/* *************************************************************************** */
|
||||||
$id = $_GET['id'];
|
$id = $_GET['id'];
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
|
{
|
||||||
|
if ($mesg) print $mesg.'<br>';
|
||||||
|
|
||||||
|
$commande = new Commande($db);
|
||||||
|
if ( $commande->fetch($_GET['id']) > 0)
|
||||||
{
|
{
|
||||||
if ($mesg) print $mesg.'<br>';
|
$soc = new Societe($db);
|
||||||
|
$soc->fetch($commande->socid);
|
||||||
|
|
||||||
$commande = new Commande($db);
|
$author = new User($db);
|
||||||
if ( $commande->fetch($_GET['id']) > 0)
|
$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 '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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);
|
$num = $commande->getNextNumRef($soc);
|
||||||
$soc->fetch($commande->socid);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$num = $commande->ref;
|
||||||
|
}
|
||||||
|
|
||||||
$author = new User($db);
|
$text=$langs->trans('ConfirmValidateOrder',$num);
|
||||||
$author->id = $commande->user_author_id;
|
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid');
|
||||||
$author->fetch();
|
print '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
$head = commande_prepare_head($commande);
|
/*
|
||||||
dolibarr_fiche_head($head, 'order', $langs->trans("CustomerOrder"));
|
* 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 '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression de la commande
|
* Confirmation de l'annulation
|
||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'delete')
|
if ($_GET['action'] == 'annuler')
|
||||||
{
|
{
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete');
|
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel');
|
||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la validation
|
* Confirmation de la suppression d'une ligne produit
|
||||||
*/
|
*/
|
||||||
if ($_GET['action'] == 'valid')
|
if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
||||||
{
|
{
|
||||||
// on vérifie si la facture est en numérotation provisoire
|
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
|
||||||
$ref = substr($commande->ref, 1, 4);
|
print '<br>';
|
||||||
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');
|
* Commande
|
||||||
print '<br />';
|
*/
|
||||||
}
|
$nbrow=8;
|
||||||
|
if ($conf->projet->enabled) $nbrow++;
|
||||||
|
|
||||||
/*
|
print '<table class="border" width="100%">';
|
||||||
* 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 '<br />';
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
// Ref
|
||||||
* Confirmation de l'annulation
|
print '<tr><td width="18%">'.$langs->trans('Ref').'</td>';
|
||||||
*/
|
print '<td colspan="2">'.$commande->ref.'</td>';
|
||||||
if ($_GET['action'] == 'annuler')
|
print '<td align="right">'.$langs->trans('Author').' : '.$author->fullname.'</td>';
|
||||||
{
|
print '</tr>';
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel');
|
|
||||||
print '<br />';
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
// Ref commande client
|
||||||
* Confirmation de la suppression d'une ligne produit
|
print '<tr><td>';
|
||||||
*/
|
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||||
if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
|
print $langs->trans('RefCustomer').'</td><td align="left">';
|
||||||
{
|
print '</td>';
|
||||||
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
|
if ($_GET['action'] != 'RefCustomerOrder' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=RefCustomerOrder&id='.$commande->id.'">'.img_edit($langs->trans('Edit')).'</a></td>';
|
||||||
print '<br>';
|
print '</tr></table>';
|
||||||
}
|
print '</td><td colspan="3">';
|
||||||
|
if ($user->rights->commande->creer && $_GET['action'] == 'RefCustomerOrder')
|
||||||
/*
|
{
|
||||||
* Commande
|
print '<form action="fiche.php?id='.$id.'" method="post">';
|
||||||
*/
|
print '<input type="hidden" name="action" value="set_ref_client">';
|
||||||
$nbrow=8;
|
print '<input type="text" class="flat" size="20" name="ref_client" value="'.$commande->ref_client.'">';
|
||||||
if ($conf->projet->enabled) $nbrow++;
|
print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
|
print '</form>';
|
||||||
print '<table class="border" width="100%">';
|
}
|
||||||
|
else
|
||||||
// Ref
|
{
|
||||||
print '<tr><td width="18%">'.$langs->trans('Ref').'</td>';
|
print $commande->ref_client;
|
||||||
print '<td colspan="3">'.$commande->ref.'</td>';
|
}
|
||||||
print '</tr>';
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
// Ref commande client
|
|
||||||
print '<tr><td>';
|
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
|
||||||
print $langs->trans('RefCustomer').'</td><td align="left">';
|
|
||||||
print '</td>';
|
|
||||||
if ($_GET['action'] != 'RefCustomerOrder' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=RefCustomerOrder&id='.$commande->id.'">'.img_edit($langs->trans('Edit')).'</a></td>';
|
|
||||||
print '</tr></table>';
|
|
||||||
print '</td><td colspan="3">';
|
|
||||||
if ($user->rights->commande->creer && $_GET['action'] == 'RefCustomerOrder')
|
|
||||||
{
|
|
||||||
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="20" name="ref_client" value="'.$commande->ref_client.'">';
|
|
||||||
print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
|
||||||
print '</form>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $commande->ref_client;
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
|
|
||||||
// Société
|
// Société
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td>';
|
print '<tr><td>'.$langs->trans('Company').'</td>';
|
||||||
print '<td colspan="3">'.$soc->getNomUrl(1).'</td>';
|
print '<td colspan="3">'.$soc->getNomUrl(1).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Ligne info remises tiers
|
// Ligne info remises tiers
|
||||||
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';
|
||||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||||
$absolute_discount=$soc->getCurrentDiscount();
|
$absolute_discount=$soc->getCurrentDiscount();
|
||||||
print '. ';
|
print '. ';
|
||||||
if ($absolute_discount)
|
if ($absolute_discount)
|
||||||
{
|
{
|
||||||
if ($commande->statut > 0)
|
if ($commande->statut > 0)
|
||||||
{
|
{
|
||||||
print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie));
|
print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $html->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$commande->id,0,'remise_id',$soc->id,$absolute_discount);
|
print $html->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$commande->id,0,'remise_id',$soc->id,$absolute_discount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
|
else print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<tr><td>'.$langs->trans('Date').'</td>';
|
print '<tr><td>'.$langs->trans('Date').'</td>';
|
||||||
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>';
|
||||||
print '<td width="50%">'.$langs->trans('Source').' : ' . $commande->sources[$commande->source] ;
|
print '<td width="50%">'.$langs->trans('Source').' : ' . $commande->sources[$commande->source] ;
|
||||||
if ($commande->source == 0)
|
if ($commande->source == 0)
|
||||||
{
|
{
|
||||||
// Si source = propal
|
// Si source = propal
|
||||||
$propal = new Propal($db);
|
$propal = new Propal($db);
|
||||||
$propal->fetch($commande->propale_id);
|
$propal->fetch($commande->propale_id);
|
||||||
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>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user