diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index dbe65acb973..04cc27df026 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * @@ -19,7 +19,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -2280,6 +2279,9 @@ class Commande extends CommonObject $ligne->subprice=100; $ligne->price=100; $ligne->tva_tx=19.6; + $ligne->total_ht=100; + $ligne->total_ttc=119.6; + $ligne->total_tva=19.6; $prodid = rand(1, $num_prods); $ligne->produit_id=$prodids[$prodid]; $this->lignes[$xnbp]=$ligne; diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 75f913171d9..78a7b34fd04 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Marc Barilley / Ocebo @@ -1143,26 +1143,7 @@ class Facture extends CommonObject { $this->fetch_lines(); -/* La vérif qu'une remise n'est pas utilisée 2 fois est faite au moment de l'insertion de ligne - foreach($this->lignes as $i => $line) - { - // For each line, we check if it's a discount and, if a discount, - // we check it is not already affected to another invoice - if ($line->fk_remise_except) - { - $discount=new DiscountAbsolute($this->db); - $result=$discount->fetch($line->fk_remise_except); - if ($result > 0) - { - - } - else - { - $this->error=$discount->error; - $error++; - } - } -*/ + // La vérif qu'une remise n'est pas utilisée 2 fois est faite au moment de l'insertion de ligne // On met a jour table des ventes // On crée ici une denormalisation pas forcement utilisé !!! @@ -1183,7 +1164,7 @@ class Facture extends CommonObject // Classe la société rattachée comme client $result=$this->client->set_as_client(); - //Si activé on décrémente le produit principal et ses composants à la validation de facture + // Si activé on décrémente le produit principal et ses composants à la validation de facture if($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL) { require_once(DOL_DOCUMENT_ROOT."/product/stock/mouvementstock.class.php"); @@ -1208,7 +1189,7 @@ class Facture extends CommonObject } $mouvP = new MouvementStock($this->db); // on décompte le stock du produit principal - $entrepot_id = "1"; //Todo: ajouter possibilité de choisir l'entrepot + $entrepot_id = "1"; // TODO ajouter possibilité de choisir l'entrepot $result=$mouvP->livraison($user, $this->lignes[$i]->fk_product, $entrepot_id, $this->lignes[$i]->qty); } } @@ -1235,8 +1216,8 @@ class Facture extends CommonObject } /** - * - * + * \brief Set draft status + * \param userid Id user setting */ function set_draft($userid) { @@ -2757,6 +2738,9 @@ class Facture extends CommonObject $ligne->subprice=100; $ligne->price=100; $ligne->tva_tx=19.6; + $ligne->total_ht=100; + $ligne->total_ttc=119.6; + $ligne->total_tva=19.6; $prodid = rand(1, $num_prods); $ligne->produit_id=$prodids[$prodid]; $this->lignes[$xnbp]=$ligne; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 47c11f9b822..1415cd7e284 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1443,4 +1443,16 @@ function migrate_delete_old_files($db,$langs,$conf) return $result; } + +/* A faire egalement: Modif statut paye et fk_facture des factures payés completement + +On recherche facture incorrecte: +select f.rowid, f.total_ttc as t1, sum(pf.amount) as t2 from llx_facture as f, llx_paiement_facture as pf where pf.fk_facture=f.rowid and f.fk_statut in(2,3) and paye=0 and close_code is null group by f.rowid +having f.total_ttc = sum(pf.amount) + +On les corrige: +update llx_facture set paye=1, fk_statut=2 where close_code is null +and rowid in (...) +*/ + ?> diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 2dd9ed86f0d..1d1f0fc4b03 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -2064,6 +2064,9 @@ class Propal extends CommonObject $ligne->subprice=100; $ligne->price=100; $ligne->tva_tx=19.6; + $ligne->total_ht=100; + $ligne->total_ttc=119.6; + $ligne->total_tva=19.6; $prodid = rand(1, $num_prods); $ligne->produit_id=$prodids[$prodid]; $this->lignes[$xnbp]=$ligne;