2
0
forked from Wavyzz/dolibarr

Fix: uniformize code

This commit is contained in:
Regis Houssin
2010-12-15 07:12:28 +00:00
parent 9aaf440b0d
commit 502bb75d2c
14 changed files with 234 additions and 243 deletions

View File

@@ -1066,7 +1066,8 @@ class Commande extends CommonObject
$this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->fk_delivery_address = $obj->fk_adresse_livraison;
$this->propale_id = $obj->fk_source;
$this->lignes = array();
$this->lines = array();
if ($this->statut == 0) $this->brouillon = 1;
@@ -1196,7 +1197,6 @@ class Commande extends CommonObject
*/
function fetch_lines($only_product=0)
{
$this->lignes=array(); // deprecated
$this->lines=array();
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.fk_commande, l.description, l.price, l.qty, l.tva_tx,';
@@ -1257,8 +1257,8 @@ class Commande extends CommonObject
$line->date_start = $this->db->jdate($objp->date_start);
$line->date_end = $this->db->jdate($objp->date_end);
$this->lignes[$i] = $line; // For backward compatibility
$this->lines[$i] = $line;
$i++;
}
$this->db->free($result);
@@ -1281,9 +1281,9 @@ class Commande extends CommonObject
function getNbOfProductsLines()
{
$nb=0;
foreach($this->lines as $ligne)
foreach($this->lines as $line)
{
if ($ligne->fk_product_type == 0) $nb++;
if ($line->fk_product_type == 0) $nb++;
}
return $nb;
}