/[dolibarr]/dolibarr/htdocs/commande/commande.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/commande/commande.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by eldy, Thu Oct 13 23:22:21 2005 UTC revision 1.39 by eldy, Tue Oct 18 19:57:32 2005 UTC
# Line 19  Line 19 
19   * $Id$   * $Id$
20   * $Source$   * $Source$
21   */   */
22    
23  /**  /**
24          \file       htdocs/commande/commande.class.php          \file       htdocs/commande/commande.class.php
25          \ingroup    commande          \ingroup    commande
26          \brief      Fichier des classes de commandes          \brief      Fichier des classes de commandes
27          \version    $Revision$          \version    $Revision$
28  */  */
29    
30  require_once(DOL_DOCUMENT_ROOT."/product.class.php");  require_once(DOL_DOCUMENT_ROOT."/product.class.php");
31    
32  /**  /**
# Line 734  class Commande Line 736  class Commande
736           */           */
737          function update_line($rowid, $desc, $pu, $qty, $remise_percent=0, $tva_tx)          function update_line($rowid, $desc, $pu, $qty, $remise_percent=0, $tva_tx)
738          {          {
739                  dolibarr_syslog('Commande::UpdateLine');                  dolibarr_syslog("Commande::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent=0, $tva_tx");
740                  if ($this->brouillon)                  if ($this->brouillon)
741                  {                  {
742                          $this->db->begin();                          $this->db->begin();
743                          if (strlen(trim($qty))==0)                          
744                          {              // Nettoyage paramètres
745                                  $qty=1;                          $pu=price2num($pu);
746                          }                          if (strlen(trim($qty))==0) $qty=1;
747                          $remise = 0;                          $remise = 0;
748                          $price = ereg_replace(',','.',$pu);                          $price = $pu;
749                          $subprice = $price;                          $subprice = $price;
750                          if (trim(strlen($remise_percent)) > 0)                          $remise_percent=trim($remise_percent);
751                            if ($remise_percent > 0)
752                          {                          {
753                                  $remise = round(($pu * $remise_percent / 100), 2);                                  $remise = round(($pu * $remise_percent / 100), 2);
754                                  $price = $pu - $remise;                                  $price = $pu - $remise;
# Line 756  class Commande Line 759  class Commande
759                          }                          }
760    
761                          $sql = 'UPDATE '.MAIN_DB_PREFIX.'commandedet';                          $sql = 'UPDATE '.MAIN_DB_PREFIX.'commandedet';
762                          $sql.= " SET description='".addslashes($desc)."',price=$price,subprice=$subprice,";                          $sql.= " SET description='".addslashes($desc)."',price='$price',subprice='$subprice',";
763                          $sql.= " remise=$remise,remise_percent=$remise_percent,qty=$qty,tva_tx='".$tva_tx."'";                          $sql.= " remise=$remise,remise_percent=$remise_percent,qty=$qty,tva_tx='".$tva_tx."'";
764                          $sql.= ' WHERE rowid = '.$rowid;                          $sql.= ' WHERE rowid = '.$rowid;
765    

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26