From 7b6dcc73c8dbc745aef69728250855e815888dd0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Nov 2009 07:31:06 +0000 Subject: [PATCH] Fix: bad verification --- htdocs/cashdesk/classes/Facturation.class.php | 23 +++++++++++++++---- htdocs/cashdesk/facturation.php | 2 +- htdocs/cashdesk/include/environnement.php | 4 +--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/htdocs/cashdesk/classes/Facturation.class.php b/htdocs/cashdesk/classes/Facturation.class.php index a5d3000bcdc..91822f0c337 100644 --- a/htdocs/cashdesk/classes/Facturation.class.php +++ b/htdocs/cashdesk/classes/Facturation.class.php @@ -93,9 +93,17 @@ class Facturation { dol_syslog("ajoutArticle sql=".$sql); $resql = $db->query($sql); - $obj = $db->fetch_object($resql); - $vat_rate=$obj->taux; - //var_dump($vat_rate);exit; + if ($resql) + { + $obj = $db->fetch_object($resql); + $vat_rate=$obj->taux; + //var_dump($vat_rate);exit; + } + else + { + dol_print_error($db); + } + // Define part of HT, VAT, TTC $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remise_percent(),$vat_rate,0,'HT',0); @@ -124,7 +132,7 @@ class Facturation { $sql.= ", total_ht"; $sql.= ", total_ttc"; $sql.= ") VALUES ("; - $sql.= ", ".$this->id(); + $sql.= $this->id(); $sql.= ", ".$this->qte(); $sql.= ", ".$this->tva(); $sql.= ", ".$remise_percent; @@ -134,7 +142,12 @@ class Facturation { $sql.= ")"; dol_syslog("ajoutArticle sql=".$sql); - $db->query($sql); + $result = $db->query($sql); + + if (!$result) + { + dol_print_error($db); + } $this->raz(); diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 2a95d0761d8..f85a0817487 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -123,7 +123,7 @@ $sql.= " AND t.active = 1"; $sql.= " AND p.code = '".$mysoc->pays_code."'"; //print $request; -$res=$db->query ($sql); +$res = $db->query($sql); if ($res) { while ( $tab = $db->fetch_array($res) ) diff --git a/htdocs/cashdesk/include/environnement.php b/htdocs/cashdesk/include/environnement.php index 8259d18147e..60dda7f948d 100644 --- a/htdocs/cashdesk/include/environnement.php +++ b/htdocs/cashdesk/include/environnement.php @@ -57,13 +57,11 @@ if ($conf->banque->enabled && (empty($conf_fkaccount_cash) || empty($conf_fkacco { $error.= '
Setup of CashDesk module not complete. Bank account not defined
'; } -// TODO: ajouter gestion stock -/* if ($conf->stock->enabled && empty($conf_fkentrepot)) { $error.= '
Setup of CashDesk module not complete. Warehouse not defined
'; } -*/ + // Parametres d'affichage $conf_taille_listes = 200; // Nombre max de lignes a afficher dans les listes $conf_nbr_car_listes = 60; // Nombre max de caracteres par ligne dans les listes