Fix: Le champ total ht des objets specimen etait mal alimentés
This commit is contained in:
parent
256c479c88
commit
585a1b615f
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2006 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-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
*
|
*
|
||||||
@ -19,7 +19,6 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2280,6 +2279,9 @@ class Commande extends CommonObject
|
|||||||
$ligne->subprice=100;
|
$ligne->subprice=100;
|
||||||
$ligne->price=100;
|
$ligne->price=100;
|
||||||
$ligne->tva_tx=19.6;
|
$ligne->tva_tx=19.6;
|
||||||
|
$ligne->total_ht=100;
|
||||||
|
$ligne->total_ttc=119.6;
|
||||||
|
$ligne->total_tva=19.6;
|
||||||
$prodid = rand(1, $num_prods);
|
$prodid = rand(1, $num_prods);
|
||||||
$ligne->produit_id=$prodids[$prodid];
|
$ligne->produit_id=$prodids[$prodid];
|
||||||
$this->lignes[$xnbp]=$ligne;
|
$this->lignes[$xnbp]=$ligne;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
@ -1143,26 +1143,7 @@ class Facture extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->fetch_lines();
|
$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
|
// 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++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// On met a jour table des ventes
|
// On met a jour table des ventes
|
||||||
// On crée ici une denormalisation pas forcement utilisé !!!
|
// 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
|
// Classe la société rattachée comme client
|
||||||
$result=$this->client->set_as_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)
|
if($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL)
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/mouvementstock.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product/stock/mouvementstock.class.php");
|
||||||
@ -1208,7 +1189,7 @@ class Facture extends CommonObject
|
|||||||
}
|
}
|
||||||
$mouvP = new MouvementStock($this->db);
|
$mouvP = new MouvementStock($this->db);
|
||||||
// on décompte le stock du produit principal
|
// 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);
|
$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)
|
function set_draft($userid)
|
||||||
{
|
{
|
||||||
@ -2757,6 +2738,9 @@ class Facture extends CommonObject
|
|||||||
$ligne->subprice=100;
|
$ligne->subprice=100;
|
||||||
$ligne->price=100;
|
$ligne->price=100;
|
||||||
$ligne->tva_tx=19.6;
|
$ligne->tva_tx=19.6;
|
||||||
|
$ligne->total_ht=100;
|
||||||
|
$ligne->total_ttc=119.6;
|
||||||
|
$ligne->total_tva=19.6;
|
||||||
$prodid = rand(1, $num_prods);
|
$prodid = rand(1, $num_prods);
|
||||||
$ligne->produit_id=$prodids[$prodid];
|
$ligne->produit_id=$prodids[$prodid];
|
||||||
$this->lignes[$xnbp]=$ligne;
|
$this->lignes[$xnbp]=$ligne;
|
||||||
|
|||||||
@ -1443,4 +1443,16 @@ function migrate_delete_old_files($db,$langs,$conf)
|
|||||||
return $result;
|
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 (...)
|
||||||
|
*/
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -2064,6 +2064,9 @@ class Propal extends CommonObject
|
|||||||
$ligne->subprice=100;
|
$ligne->subprice=100;
|
||||||
$ligne->price=100;
|
$ligne->price=100;
|
||||||
$ligne->tva_tx=19.6;
|
$ligne->tva_tx=19.6;
|
||||||
|
$ligne->total_ht=100;
|
||||||
|
$ligne->total_ttc=119.6;
|
||||||
|
$ligne->total_tva=19.6;
|
||||||
$prodid = rand(1, $num_prods);
|
$prodid = rand(1, $num_prods);
|
||||||
$ligne->produit_id=$prodids[$prodid];
|
$ligne->produit_id=$prodids[$prodid];
|
||||||
$this->lignes[$xnbp]=$ligne;
|
$this->lignes[$xnbp]=$ligne;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user