dolibarr-bugtrack
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-bugtrack] [bug #33583] Error in class commande/class/commande.


From: Florian HENRY
Subject: [Dolibarr-bugtrack] [bug #33583] Error in class commande/class/commande.class.php from DOLIBARR_3_0_BRANCH method nb_expedition
Date: Fri, 17 Jun 2011 13:44:12 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0

URL:
  <http://savannah.nongnu.org/bugs/?33583>

                 Summary: Error in class commande/class/commande.class.php
from DOLIBARR_3_0_BRANCH method nb_expedition
                 Project: Dolibarr
            Submitted by: fhenry
            Submitted on: ven. 17 juin 2011 13:44:11 GMT
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Hello,

With the version 3.0 extract from DOLIBARR_3_0_BRANCH of the CVS, when I
validate an order I've got an SQL error. 
It come from the method 
function nb_expedition()
        {
        $sql = 'SELECT count(*)';
        $sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e,';
        $sql.= ' '.MAIN_DB_PREFIX."element_element as el ON el.fk_target =
e.rowid AND el.targettype = 'shipping'";
        $sql.= " WHERE el.fk_source = ".$this->id;

        $resql = $this->db->query($sql);
        if ($resql)
        {
            $row = $this->db->fetch_row($resql);
            return $row[0];
        }
        else dol_print_error($this->db);
        }
of the class commande/class/commande.class.php

In the comment it's write this method should be depreciated but as it is still
call at least please correct the SQL with the correct statement :

function nb_expedition()
        {
        $sql = 'SELECT count(*)';
        $sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e ';
        $sql.= ' INNER JOIN '.MAIN_DB_PREFIX."element_element as el ON
el.fk_target = e.rowid AND el.targettype = 'shipping'";
        $sql.= " WHERE el.fk_source = ".$this->id;

        $resql = $this->db->query($sql);
        if ($resql)
        {
            $row = $this->db->fetch_row($resql);
            return $row[0];
        }
        else dol_print_error($this->db);
        }

Kind regards

HENRY Florian




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?33583>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]