[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/fourn/commande/ -> fiche.php (source)

   1  <?php
   2  /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   * Copyright (C) 2005      Eric Seigne <eric.seigne@ryxeo.com>
   5   *
   6   * This program is free software; you can redistribute it and/or modify
   7   * it under the terms of the GNU General Public License as published by
   8   * the Free Software Foundation; either version 2 of the License, or
   9   * (at your option) any later version.
  10   *
  11   * This program is distributed in the hope that it will be useful,
  12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14   * GNU General Public License for more details.
  15   *
  16   * You should have received a copy of the GNU General Public License
  17   * along with this program; if not, write to the Free Software
  18   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19   *
  20   * $Id: fiche.php,v 1.29.2.1 2005/12/25 01:39:31 eldy Exp $
  21   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/fourn/commande/fiche.php,v $
  22   */
  23  
  24  /**
  25          \file       htdocs/fourn/commande/fiche.php
  26          \ingroup    commande
  27          \brief      Fiche commande
  28          \version    $Revision: 1.29.2.1 $
  29  */
  30  
  31  require ("./pre.inc.php");
  32  require_once(DOL_DOCUMENT_ROOT."/project.class.php");
  33  require_once (DOL_DOCUMENT_ROOT."/propal.class.php");
  34  
  35  if (!$user->rights->fournisseur->commande->lire) accessforbidden();
  36  
  37  
  38  // Sécurité accés client
  39  $socidp=0;
  40  if ($user->societe_id > 0) 
  41  {
  42    $action = '';
  43    $socidp = $user->societe_id;
  44  }
  45  
  46  $mesg='';
  47  
  48  
  49  /*
  50   * Actions
  51   */    
  52  if ($_POST["action"] == 'classin') 
  53  {
  54    $commande = new CommandeFournisseur($db);
  55    $commande->fetch($_GET["id"]);
  56    $commande->classin($_POST["projetid"]);
  57  }
  58  /*
  59   *
  60   */
  61  if ($_GET["action"] == 'pdf') 
  62  {
  63    $commande = new CommandeFournisseur($db);
  64    $commande->fetch($_GET["id"]);
  65    $commande->generate_pdf();
  66  }
  67  
  68  if ($_POST["action"] == 'setremise' && $user->rights->commande->creer) 
  69  {
  70    $commande = new CommandeFournisseur($db);
  71    $commande->fetch($id);
  72  
  73    $commande->set_remise($user, $_POST["remise"]);
  74  } 
  75  
  76  /*
  77   *
  78   */
  79  if ($_POST["action"] == 'addligne' && $user->rights->fournisseur->commande->creer) 
  80  {
  81      $comf = new CommandeFournisseur($db);
  82      $comf->fetch($_GET["id"]);
  83  
  84      if ($_POST["p_idprod"] > 0)
  85      {
  86          $result = $comf->addline($_POST["desc"],
  87          $_POST["pu"],
  88          $_POST["pqty"],
  89          $_POST["tva_tx"],
  90          $_POST["p_idprod"],
  91          $_POST["premise"]);
  92      }
  93      else
  94      {
  95          $result = $comf->addline($_POST["desc"],
  96          $_POST["pu"],
  97          $_POST["qty"],
  98          $_POST["tva_tx"],
  99          0,
 100          $_POST["remise_percent"]);
 101      }
 102  
 103      if ($result >= 0)
 104      {
 105      Header("Location: fiche.php?id=".$_GET["id"]);
 106      exit;
 107  }
 108      else
 109      {   
 110          $mesg='<div class="error">'.$comf->error.'</div>';
 111      }
 112  }
 113  
 114  if ($_POST["action"] == 'updateligne' && $user->rights->commande->creer) 
 115  {
 116    $commande = new CommandeFournisseur($db,"",$_GET["id"]);
 117    if ($commande->fetch($_GET["id"]) )
 118      {
 119        $result = $commande->update_line($_POST["elrowid"],
 120                         $_POST["eldesc"],
 121                         $_POST["elprice"],
 122                         $_POST["elqty"],
 123                         $_POST["elremise_percent"]);
 124      }
 125    else
 126      {
 127        print "Erreur";
 128      }
 129  }
 130  
 131  if ($_GET["action"] == 'deleteline' && $user->rights->fournisseur->commande->creer) 
 132  {
 133    $comf = new CommandeFournisseur($db);
 134    $comf->fetch($_GET["id"]);
 135    $result = $comf->delete_line($_GET["lineid"]);
 136  }
 137  
 138  if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == 'yes' && $user->rights->fournisseur->commande->valider)
 139  {
 140      $commande = new CommandeFournisseur($db);
 141      $commande->fetch($_GET["id"]);
 142      $soc = new Societe($db);
 143      $soc->fetch($commande->soc_id);
 144      $result = $commande->valid($user);
 145      Header("Location: fiche.php?id=".$_GET["id"]);
 146      exit;
 147  }
 148  
 149  if ($_POST["action"] == 'confirm_approve' && $_POST["confirm"] == 'yes' && $user->rights->fournisseur->commande->approuver)
 150  {
 151      $commande = new CommandeFournisseur($db);
 152      $commande->fetch($_GET["id"]);
 153      $result = $commande->approve($user);
 154      Header("Location: fiche.php?id=".$_GET["id"]);
 155      exit;    
 156  }
 157  
 158  if ($_POST["action"] == 'confirm_refuse' && $_POST["confirm"] == 'yes' && $user->rights->fournisseur->commande->approuver)
 159  {
 160    $commande = new CommandeFournisseur($db);
 161    $commande->fetch($_GET["id"]);
 162    $result = $commande->refuse($user);
 163    Header("Location: fiche.php?id=".$_GET["id"]);
 164  }
 165  
 166  if ($_POST["action"] == 'confirm_commande' && $_POST["confirm"] == 'yes' && $user->rights->fournisseur->commande->commander)
 167  {
 168      $commande = new CommandeFournisseur($db);
 169      $commande->fetch($_GET["id"]);
 170      $result = $commande->commande($user, $_GET["datecommande"], $_GET["methode"]);
 171      Header("Location: fiche.php?id=".$_GET["id"]);
 172      exit;
 173  }
 174  
 175  
 176  if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user->rights->fournisseur->commande->creer )
 177  {
 178      $commande = new CommandeFournisseur($db);
 179      $commande->id = $_GET["id"];
 180      $commande->delete();
 181      Header("Location: index.php");
 182      exit;
 183  }
 184  
 185  if ($_POST["action"] == 'livraison' && $user->rights->fournisseur->commande->receptionner)
 186  {
 187      $commande = new CommandeFournisseur($db);
 188      $commande->fetch($_GET["id"]);
 189      
 190      $date_liv = mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 191      
 192      $result = $commande->Livraison($user, $date_liv, $_POST["type"]);
 193      Header("Location: fiche.php?id=".$_GET["id"]);
 194      exit;
 195  }
 196  
 197  
 198  if ($_POST["action"] == 'confirm_cancel' && $_POST["confirm"] == yes && $user->rights->fournisseur->commande->annuler)
 199  {
 200      $commande = new CommandeFournisseur($db);
 201      $commande->fetch($_GET["id"]);
 202      $result = $commande->cancel($user);
 203      Header("Location: fiche.php?id=".$_GET["id"]);
 204      exit;
 205  }
 206  
 207  /*
 208   * Créé une commande
 209   */
 210  if ($_GET["action"] == 'create')
 211  {
 212  
 213      $fourn = new Fournisseur($db);
 214      $fourn->fetch($_GET["socid"]);
 215  
 216      if ($fourn->create_commande($user) > 0)
 217      {
 218          $idc = $fourn->single_open_commande;
 219          Header("Location:fiche.php?id=".$idc);
 220          exit;
 221      }
 222      else
 223      {
 224          $mesg=$fourn->error;
 225      }
 226  }
 227  
 228  
 229  
 230  llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur");
 231  
 232  $html = new Form($db);
 233  
 234  /* *************************************************************************** */
 235  /*                                                                             */
 236  /* Mode vue et edition                                                         */
 237  /*                                                                             */
 238  /* *************************************************************************** */
 239    
 240  if ($_GET["id"] > 0)
 241  {
 242      $commande = new CommandeFournisseur($db);
 243      if ( $commande->fetch($_GET["id"]) == 0)
 244      {      
 245        $soc = new Societe($db);
 246        $soc->fetch($commande->soc_id);
 247        $author = new User($db);
 248        $author->id = $commande->user_author_id;
 249        $author->fetch();
 250        
 251        $h = 0;
 252        $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id;
 253        $head[$h][1] = $langs->trans("OrderCard");
 254        $a = $h;
 255        $h++;
 256  
 257        $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id;
 258        $head[$h][1] = $langs->trans("Note");
 259        $h++;
 260        
 261        $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$commande->id;
 262        $head[$h][1] = $langs->trans("OrderFollow");
 263        $h++;
 264  
 265        $title=$langs->trans("Order").": $commande->ref";
 266        dolibarr_fiche_head($head, $a, $title);      
 267        
 268        /*
 269         * Confirmation de la suppression de la commande
 270         *
 271         */
 272        if ($_GET["action"] == 'delete')
 273      {
 274        $html->form_confirm("fiche.php?id=$commande->id","Supprimer la commande","Etes-vous sûr de vouloir supprimer cette commande ?","confirm_delete");
 275        print '<br />';
 276      }
 277        
 278        /*
 279         * Confirmation de la validation
 280         *
 281         */
 282        if ($_GET["action"] == 'valid')
 283      {
 284        $html->form_confirm("fiche.php?id=$commande->id","Valider la commande","Etes-vous sûr de vouloir valider cette commande ?","confirm_valid");
 285        print '<br />';
 286      }
 287        /*
 288         * Confirmation de l'approbation
 289         *
 290         */
 291        if ($_GET["action"] == 'approve')
 292      {
 293        $html->form_confirm("fiche.php?id=$commande->id","Approuver la commande","Etes-vous sûr de vouloir approuver cette commande ?","confirm_approve");
 294        print '<br />';
 295      }
 296        /*
 297         * Confirmation de l'approbation
 298         *
 299         */
 300        if ($_GET["action"] == 'refuse')
 301      {
 302        $html->form_confirm("fiche.php?id=$commande->id","Refuser la commande","Etes-vous sûr de vouloir refuser cette commande ?","confirm_refuse");
 303        print '<br />';
 304      }
 305        /*
 306         * Confirmation de l'annulation
 307         *
 308         */
 309        if ($_GET["action"] == 'cancel')
 310      {
 311        $html->form_confirm("fiche.php?id=$commande->id",$langs->trans("Cancel"),"Etes-vous sûr de vouloir annuler cette commande ?","confirm_cancel");
 312        print '<br />';
 313      }
 314       
 315        /*
 316         * Confirmation de l'envoi de la commande
 317         *
 318         */
 319          if ($_GET["action"] == 'commande')
 320          {
 321        $date_com = mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
 322        $html->form_confirm("fiche.php?id=".$commande->id."&amp;datecommande=".$date_com."&amp;methode=".$_POST["methodecommande"],
 323                    "Envoi de la commande","Etes-vous sûr de vouloir confirmer cette commande en date du ".strftime("%d/%m/%Y",$date_com)." ?","confirm_commande");
 324            print '<br />';
 325          }
 326  
 327          /*
 328           *   Commande
 329           */
 330          print '<table class="border" width="100%">';
 331          print '<tr><td width="20%">'.$langs->trans("Supplier")."</td>";
 332          print '<td colspan="5">';
 333          print '<b><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id.'">';
 334          print img_object($langs->trans("ShowSupplier"),'company').' '.$soc->nom.'</a></b></td>';
 335          print '</tr>';
 336          
 337          print '<tr>';
 338          print '<td>'.$langs->trans("Status").'</td>';
 339          print '<td width="50%" colspan="5">';
 340          print '<img src="statut'.$commande->statut.'.png">&nbsp;';
 341          print $commande->statuts[$commande->statut];
 342          print "</td></tr>";
 343          
 344          if ($commande->methode_commande_id > 0)
 345          {
 346              print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
 347          
 348              if ($commande->date_commande)
 349              {
 350                  print dolibarr_print_date($commande->date_commande,"%A %d %B %Y")."\n";
 351              }
 352          
 353              print '</td><td width="50%" colspan="3">';
 354              if ($commande->methode_commande)
 355              {
 356                  print "Méthode : " .$commande->methode_commande;
 357              }
 358              print "</td></tr>";
 359          }
 360          
 361          // Auteur
 362          print '<tr><td>'.$langs->trans("Author").'</td><td colspan="2">'.$author->fullname.'</td>';
 363          print '<td colspan="3" width="50%">';
 364          print "&nbsp;</td></tr>";
 365  
 366          // Ligne de 3 colonnes
 367          print '<tr><td>'.$langs->trans("AmountHT").'</td>';
 368          print '<td align="right"><b>'.price($commande->total_ht).'</b></td>';
 369          print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td><td colspan="3">&nbsp;</td></tr>';
 370          print '<tr><td>'.$langs->trans("AmountVAT").'</td><td align="right">'.price($commande->total_tva).'</td>';
 371          print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td><td colspan="3">&nbsp;</td></tr>';
 372          
 373          print '<tr><td>'.$langs->trans("AmountTTC").'</td><td align="right">'.price($commande->total_ttc).'</td>';
 374          print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td><td colspan="3">&nbsp;</td></tr>';
 375          
 376          if ($commande->note)
 377          {
 378              print '<tr><td>'.$langs->trans("Note").'</td><td colspan="5">'.nl2br($commande->note)."</td></tr>";
 379          }
 380          
 381          print "</table>";
 382  
 383          if ($mesg) print $mesg;
 384          else print '<br>';
 385          
 386          /*
 387           * Lignes de commandes
 388           */
 389          print '<table class="noborder" width="100%">';      
 390          
 391          $sql = "SELECT l.ref, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice";
 392          $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
 393          $sql.= " WHERE l.fk_commande = $commande->id";
 394          $sql.= " ORDER BY l.rowid";
 395          
 396          $resql = $db->query($sql);
 397          if ($resql)
 398          {
 399              $num_lignes = $db->num_rows($resql);
 400              $i = 0; $total = 0;
 401          
 402              if ($num_lignes)
 403              {
 404                  print '<tr class="liste_titre">';
 405                  print '<td align="left">'.$langs->trans("Ref").'</td>';
 406                  print '<td>'.$langs->trans("Description").'</td>';
 407                  print '<td align="center">'.$langs->trans("VAT").'</td>';
 408                  print '<td align="center">'.$langs->trans("Qty").'</td>';
 409                  print '<td align="right">'.$langs->trans("Discount").'</td>';
 410                  print '<td align="right">'.$langs->trans("PriceU").'</td>';
 411                  print '<td>&nbsp;</td><td width="10%">&nbsp;</td>';
 412                  print "</tr>\n";
 413              }
 414              $var=false;
 415              while ($i < $num_lignes)
 416              {
 417                  $objp = $db->fetch_object($resql);
 418                  print "<tr $bc[$var]>";
 419                  print '<td><a href="'.DOL_URL_ROOT.'/fourn/product/fiche.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),'product').' '.$objp->ref.'</a></td>';
 420                  if ($objp->fk_product > 0)
 421                  {
 422                      print '<td>';
 423                      print '<a href="'.DOL_URL_ROOT.'/fourn/product/fiche.php?id='.$objp->fk_product.'">'.stripslashes(nl2br($objp->description)).'</a></td>';
 424                  }
 425                  else
 426                  {
 427                      print "<td>".stripslashes(nl2br($objp->description))."</td>\n";
 428                  }
 429                  print '<td align="center">'.$objp->tva_tx.'%</td>';
 430                  print '<td align="center">'.$objp->qty.'</td>';
 431                  if ($objp->remise_percent > 0)
 432                  {
 433                      print '<td align="right">'.$objp->remise_percent."%</td>\n";
 434                  }
 435                  else
 436                  {
 437                      print '<td>&nbsp;</td>';
 438                  }
 439                  print '<td align="right">'.price($objp->subprice)."</td>\n";
 440                  if ($commande->statut == 0  && $user->rights->fournisseur->commande->creer && $_GET["action"] <> 'valid')
 441                  {
 442                      print '<td>&nbsp;</td><td align="right"><a href="fiche.php?id='.$commande->id.'&amp;action=deleteline&amp;lineid='.$objp->rowid.'">';
 443                      print img_delete();
 444                      print '</a></td>';
 445                  }
 446                  else
 447                  {
 448                      print '<td>&nbsp;</td><td>&nbsp;</td>';
 449                  }
 450                  print "</tr>";
 451          
 452                  if ($_GET["action"] == 'editline' && $_GET["rowid"] == $objp->rowid)
 453                  {
 454                      print "<form action=\"fiche.php?id=$commande->id\" method=\"post\">";
 455                      print '<input type="hidden" name="action" value="updateligne">';
 456                      print '<input type="hidden" name="elrowid" value="'.$_GET["rowid"].'">';
 457                      print "<tr $bc[$var]>";
 458                      print '<td colspan="3"><textarea name="eldesc" cols="60" rows="2">'.stripslashes($objp->description).'</textarea></td>';
 459                      print '<td align="center"><input size="4" type="text" name="elqty" value="'.$objp->qty.'"></td>';
 460                      print '<td align="right"><input size="3" type="text" name="elremise_percent" value="'.$objp->remise_percent.'">&nbsp;%</td>';
 461                      print '<td align="right"><input size="8" type="text" name="elprice" value="'.price($objp->subprice).'"></td>';
 462                      print '<td align="right" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td>';
 463                      print '</tr>' . "\n";
 464                      print "</form>\n";
 465                  }
 466                  $i++;
 467                  $var=!$var;
 468              }
 469              $db->free();
 470          }
 471          else
 472          {
 473              print $db->error();
 474          }
 475      
 476          /*
 477           * Ajouter une ligne
 478           */
 479          if ($_GET["action"] <> 'valid' && $commande->statut == 0 && $user->rights->fournisseur->commande->creer)
 480          {
 481              print '<form action="fiche.php?id='.$commande->id.'" method="post">';
 482              print '<input type="hidden" name="action" value="addligne">';
 483              
 484              print '<tr class="liste_titre">';
 485              print '<td colspan="2">'.$langs->trans("Description").'</td>';
 486              print '<td align="center">'.$langs->trans("VAT").'</td>';
 487              print '<td align="center">'.$langs->trans("Qty").'</td>';
 488              print '<td align="right">'.$langs->trans("Discount").'</td>';
 489              print '<td align="right">'.$langs->trans("PriceU").'</td>';
 490              print '<td>&nbsp;</td><td>&nbsp;</td>'."</tr>\n";
 491              
 492              $var=false;
 493              print "<tr $bc[$var]>".'<td colspan="3">';
 494              $html->select_produits_fournisseurs($commande->fourn_id,'','p_idprod',$filtre);
 495              print '</td>';
 496              print '<td align="center"><input type="text" size="2" name="pqty" value="1"></td>';
 497              print '<td align="right"><input type="text" size="3" name="premise" value="0">%</td>';
 498              print '<td>&nbsp;</td>';
 499              print '<td align="center" colspan="3"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
 500              print "</tr>\n";
 501              
 502              print "</form>";
 503          }
 504          
 505          print "</table>";
 506          print '</div>';
 507  
 508          /**
 509           * Boutons actions
 510           */
 511          if ($user->societe_id == 0 && $commande->statut < 3 && $_GET["action"] <> 'valid')
 512          {
 513              print '<div class="tabsAction">';
 514          
 515              if ($commande->statut == 0 && $num_lignes > 0)
 516              {
 517                  if ($user->rights->fournisseur->commande->valider)
 518                  {
 519                      print '<a class="butAction" href="fiche.php?id='.$commande->id.'&amp;action=valid">'.$langs->trans("Valid").'</a>';
 520                  }
 521              }
 522          
 523              if ($commande->statut == 1)
 524              {
 525                  if ($user->rights->fournisseur->commande->annuler)
 526                  {
 527                      print '<a class="butAction" href="fiche.php?id='.$commande->id.'&amp;action=cancel">'.$langs->trans("CancelOrder").'</a>';
 528                  }
 529          
 530                  if ($user->rights->fournisseur->commande->approuver)
 531                  {
 532                      print '<a class="butAction" href="fiche.php?id='.$commande->id.'&amp;action=approve">'.$langs->trans("ApproveOrder").'</a>';
 533          
 534                      print '<a class="butActionDelete" href="fiche.php?id='.$commande->id.'&amp;action=refuse">'.$langs->trans("RefuseOrder").'</a>';
 535                  }
 536              }
 537          
 538              if ($commande->statut == 2)
 539              {
 540                  if ($user->rights->fournisseur->commande->approuver)
 541                  {
 542                      print '<a class="butActionDelete" href="fiche.php?id='.$commande->id.'&amp;action=refuse">'.$langs->trans("RefuseOrder").'</a>';
 543                  }
 544              }
 545          
 546              if ($commande->statut == 0)
 547              {
 548                  if ($user->rights->fournisseur->commande->creer)
 549                  {
 550                      print '<a class="butActionDelete" href="fiche.php?id='.$commande->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
 551                  }
 552              }
 553          
 554              print "</div>";
 555          }
 556  
 557          /*
 558           * Documents générés
 559           *
 560           */
 561          $file = $conf->commande->dir_output . "/" . $commande->ref . "/" . $commande->ref . ".pdf";
 562          $relativepath=$commande->ref . "/" . $commande->ref . ".pdf";
 563          
 564          $var=true;
 565          
 566          if (file_exists($file))
 567          {
 568              print_titre($langs->trans("Documents"));
 569              print '<table width="100%" class="border">';
 570          
 571              print "<tr $bc[$var]><td>".$langs->trans("Order")." PDF</td>";
 572              print '<td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>';
 573              print '<td align="right">'.filesize($file). ' bytes</td>';
 574              print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
 575              print '</tr>';
 576          
 577              print "</table>\n";
 578  
 579              print '</td><td valign="top" width="50%">';
 580          }
 581          
 582        /*
 583         *
 584         *
 585         */
 586        if ($_GET["action"] == 'classer')
 587      {        
 588        print '<form method="post" action="fiche.php?id='.$commande->id.'">';
 589        print '<input type="hidden" name="action" value="classin">';
 590        print '<table class="border">';
 591        print '<tr><td>Projet</td><td>';
 592          
 593        $proj = new Project($db);
 594        $html->select_array("projetid",$proj->liste_array($commande->soc_id));
 595          
 596        print "</td></tr>";
 597        print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Send").'"></td></tr></table></form>';
 598      }
 599        /*
 600         *
 601         *
 602         */
 603        if ( $user->rights->fournisseur->commande->commander && $commande->statut == 2)
 604      {
 605        /**
 606         * Commander
 607         */
 608        $form = new Form($db);
 609        
 610        print '<form action="fiche.php?id='.$commande->id.'&amp;action=commande" method="post">';
 611        print '<table class="noborder">';
 612        print '<tr class="liste_titre"><td colspan="2">Commander</td></tr>';
 613        print '<tr><td>Date commande</td><td>';
 614        print $form->select_date();
 615        print '</td></tr>';
 616  
 617        $commande->get_methodes_commande();
 618  
 619        print '<tr><td>Méthode de commande</td><td>';
 620  
 621        print $form->select_array("methodecommande",$commande->methodes_commande);
 622  
 623        print '</td></tr>';
 624        print '<tr><td>Commentaire</td><td><input size="30" type="text" name="commentaire"></td></tr>';
 625        print '<tr><td align="center" colspan="2"><input type="submit" class="button" name="'.$langs->trans("Activate").'"></td></tr>';
 626        print '</table>';
 627        print '</form>';      
 628      }
 629        /*
 630         *
 631         *
 632         */
 633        if ( $user->rights->fournisseur->commande->receptionner && ($commande->statut == 3 ||$commande->statut == 4 ))
 634      {
 635        /**
 636         * Réceptionner
 637         */
 638        $form = new Form($db);
 639        
 640        print '<form action="fiche.php?id='.$commande->id.'" method="post">';
 641        print '<input type="hidden" name="action" value="livraison">';
 642        print '<table class="noborder">';
 643        print '<tr class="liste_titre"><td colspan="2">Réceptionner</td></tr>';
 644        print '<tr><td>Date de livraison</td><td>';
 645        print $form->select_date();
 646        print "</td></tr>\n";
 647  
 648        print "<tr><td>Livraison</td><td>\n";
 649        $liv = array();
 650        $liv['par'] = "Partielle";
 651        $liv['tot'] = "Totale";
 652  
 653        print $form->select_array("type",$liv);
 654  
 655        print '</td></tr>';
 656        print '<tr><td>Commentaire</td><td><input size="30" type="text" name="commentaire"></td></tr>';
 657        print '<tr><td align="center" colspan="2"><input type="submit" class="button" name="'.$langs->trans("Activate").'"></td></tr>';
 658        print "</table>\n";
 659        print "</form>\n";      
 660      }
 661      }
 662    else
 663      {
 664        /* Commande non trouvée */
 665        print "Commande inexistante";
 666      }
 667  }  
 668  
 669  
 670  $db->close();
 671  
 672  llxFooter('$Date: 2005/12/25 01:39:31 $ - $Revision: 1.29.2.1 $');
 673  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics