Skip to content

Commit

Permalink
Fix: Update request
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 19, 2011
1 parent a2cd3e5 commit 7457986
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -812,7 +812,7 @@ function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlo
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;

$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
Expand Down Expand Up @@ -1345,15 +1345,17 @@ function loadExpeditions($filtre_statut=-1)
*/
function nb_expedition()
{
$sql = 'SELECT count(*) FROM '.MAIN_DB_PREFIX.'expedition as e';
$sql .=" WHERE e.fk_commande = ".$this->id;

$resql = $this->db->query($sql);
if ($resql)
{
$row = $this->db->fetch_row($resql);
return $row[0];
}
$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];
}
}

/**
Expand Down

0 comments on commit 7457986

Please sign in to comment.