From 1df5ac2c549edf087ea5f7599b46964c51f65cf5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 May 2011 20:31:16 +0000 Subject: [PATCH] Add error message if setup no complete. --- htdocs/cashdesk/tpl/facturation1.tpl.php | 20 ++++++++++++---- htdocs/cashdesk/tpl/liste_articles.tpl.php | 27 ++++++++++++++-------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 52f11764d31..7b16fe6f3f5 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -29,7 +29,7 @@ $Id$
trans("Article"); ?> -
+ @@ -42,12 +42,22 @@ $Id$ onchange="javascript: setSource('REF');" onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value);" onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/> -
diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 98397d6827a..7e8a757efd3 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -38,36 +38,43 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ORDER BY id'; dol_syslog($request); $res = $db->query ($request); - if ( $db->num_rows($res) ) { + if (! $res) + { + dol_print_error($db); + exit; + } + + if ( $db->num_rows($res) ) + { $ret=array(); $i=0; - + /** add Ditto for MultiPrix*/ $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY']; $societe = new Societe($db); $societe->fetch($thirdpartyid); - /** end add Ditto */ - + /** end add Ditto */ + while ( $tab = $db->fetch_array($res) ) { foreach ( $tab as $cle => $valeur ) { $ret[$i][$cle] = $valeur; } - + /** add Ditto for MultiPrix*/ if($conf->global->PRODUIT_MULTIPRICES) { $product = new Product($db, $ret[$i]['id']); - + if(isset($product->multiprices[$societe->price_level])) { $ret[$i]['price'] = $product->multiprices_ttc[$societe->price_level]; } - } - /** end add Ditto */ - - + } + /** end add Ditto */ + + $i++; } $tab = $ret;