[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dolibarr-dev] Error in invoice clone
From: |
Sébastien |
Subject: |
[Dolibarr-dev] Error in invoice clone |
Date: |
Tue, 03 Sep 2013 10:44:47 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 |
Hi,
When i clone invoice with object in
htdocs/compta/facture/class/facture.class.php the invoice lines aren't
cloned.
The clone lines are referenced from origin invoice.
Add this function to class Facture (~ line 129) :
function __clone()
{
// Force a copy of this->lines, otherwise it will point to same
object.
for($i=0; $i < count($this->lines); $i++){
$this->lines[$i] = clone $this->lines[$i];
}
}
In french :
Lorsque l'on clone une facture via la classe facture dans compta
(fichier htdocs/compta/facture/class/facture.class.php), les lignes de
la facture ne sont pas clonés mais simplement copiées par référence.
Il suffit d'ajouter la fonction pour cloner les lignes et cela fonctionne !
Probléme constaté sur la version 3.3.1 et a l'air d'être toujours
présent dans la version 3.4.0
Cordialement,
Sébastien
- [Dolibarr-dev] Error in invoice clone,
Sébastien <=