diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php index 8e5928e24b0..9ccfe0a739c 100644 --- a/htdocs/cashdesk/affContenu.php +++ b/htdocs/cashdesk/affContenu.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,7 +19,7 @@ require ('classes/Facturation.class.php'); -// Si nouvelle vente, réinitialisation des données (destruction de l'objet et vidage de la table contenant la liste des articles) +// Si nouvelle vente, reinitialisation des donnees (destruction de l'objet et vidage de la table contenant la liste des articles) if ( $_GET['id'] == 'NOUV' ) { unset ($_SESSION['serObjFacturation']); @@ -27,7 +28,7 @@ if ( $_GET['id'] == 'NOUV' ) { } -// Récupération, s'il existe, de l'objet contenant les infos de la vente en cours ... +// Recuperation, s'il existe, de l'objet contenant les infos de la vente en cours ... if ( isset ($_SESSION['serObjFacturation']) ) { $obj_facturation = unserialize ($_SESSION['serObjFacturation']); @@ -45,6 +46,7 @@ if ( isset ($_SESSION['serObjFacturation']) ) {
- * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -32,7 +33,7 @@ if ( $_SESSION['uid'] <= 0 ) { - + @@ -41,7 +42,7 @@ if ( $_SESSION['uid'] <= 0 ) { - + diff --git a/htdocs/cashdesk/classes/Auth.class.php b/htdocs/cashdesk/classes/Auth.class.php index 97bf1cbc612..c08e8ac27da 100644 --- a/htdocs/cashdesk/classes/Auth.class.php +++ b/htdocs/cashdesk/classes/Auth.class.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -90,22 +91,34 @@ /** * Authentification d'un demandeur - * @return (int) 0 = Ok; -1 = login incorrect; -2 = login ok, mais compte désactivé; -10 = aucune entrée trouvée dans la base + * @return (int) 0 = Ok; -1 = login incorrect; -2 = login ok, mais compte d�sactiv�; -10 = aucune entr�e trouv�e dans la base */ protected function verif_utilisateurs () { - $sql = new Sql ($this->host, $this->user, $this->pass, $this->base); - - // Vérification des informations dans la base + global $conf, $db; + + //var_dump($conf->db); + //$sql = new Sql ($conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name); + $sql = $db; + + // Verification des informations dans la base $res = $sql->query ($this->sql); + $num = $sql->num_rows ($res); - if ( $sql->numRows ($res) ) { + if ( $num ) { - $tab = $sql->fetchFirst ($res); + // fetchFirst + $ret=array(); + $tab = mysql_fetch_array($res); + foreach ( $tab as $cle => $valeur ) + { + $ret[$cle] = $valeur; + } + $tab=$ret; if ( ($tab['pass_crypted'] == md5 ($this->passwd)) || (($tab['pass'] == $this->passwd) && ($tab['pass'] != ''))) { - // On vérifie que le compte soit bien actif + // On verifie que le compte soit bien actif if ( $tab['statut'] ) { $this->reponse(0); diff --git a/htdocs/cashdesk/classes/Facturation.class.php b/htdocs/cashdesk/classes/Facturation.class.php index 5b9ff5b566e..bca191ecd77 100644 --- a/htdocs/cashdesk/classes/Facturation.class.php +++ b/htdocs/cashdesk/classes/Facturation.class.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -16,94 +17,101 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - class Facturation { +class Facturation { - /** - * Attributs "volatiles" : réinitialisés après chaque traitement d'un article - *

Attributs "volatiles" : réinitialisés après chaque traitement d'un article

+ /** + * Attributs "volatiles" : r�initialis�s apr�s chaque traitement d'un article + *

Attributs "volatiles" : r�initialis�s apr�s chaque traitement d'un article

* @var int $id => 'rowid' du produit dans llx_product * @var string $ref => 'ref' du produit dans llx_product - * @var int $qte => Quantité pour le produit en cours de traitement - * @var int $stock => Stock théorique pour le produit en cours de traitement + * @var int $qte => Quantit� pour le produit en cours de traitement + * @var int $stock => Stock th�orique pour le produit en cours de traitement * @var int $remise_percent => Remise en pourcent sur le produit en cours * @var int $montant_remise => Remise en pourcent sur le produit en cours * @var int $prix => Prix HT du produit en cours * @var int $tva => 'rowid' du taux de tva dans llx_c_tva */ - protected $id; - protected $ref; - protected $qte; - protected $stock; - protected $remise_percent; - protected $montant_remise; - protected $prix; - protected $tva; + protected $id; + protected $ref; + protected $qte; + protected $stock; + protected $remise_percent; + protected $montant_remise; + protected $prix; + protected $tva; - /** - * Attributs persistants : utilisés pour toute la durée de la vente (jusqu'à validation ou annulation) - * @var string $num_facture => Numéro de la facture (de la forme FAYYMM-XXXX) - * @var string $mode_reglement => Mode de réglement (ESP, CB ou CHQ) - * @var int $montant_encaisse => Montant encaissé en cas de réglement en espèces - * @var int $montant_rendu => Monnaie rendue en cas de réglement en espèces - * @var int $paiement_le => Date de paiement en cas de paiement différé + /** + * Attributs persistants : utilis�s pour toute la dur�e de la vente (jusqu'� validation ou annulation) + * @var string $num_facture => Num�ro de la facture (de la forme FAYYMM-XXXX) + * @var string $mode_reglement => Mode de r�glement (ESP, CB ou CHQ) + * @var int $montant_encaisse => Montant encaiss� en cas de r�glement en esp�ces + * @var int $montant_rendu => Monnaie rendue en cas de r�glement en esp�ces + * @var int $paiement_le => Date de paiement en cas de paiement diff�r� * * @var int $prix_total_ht => Prix total hors taxes * @var int $montant_tva => Montant total de la TVA, tous taux confondus * @var int $prix_total_ttc => Prix total TTC */ - protected $num_facture; - protected $mode_reglement; - protected $montant_encaisse; - protected $montant_rendu; - protected $paiement_le; + protected $num_facture; + protected $mode_reglement; + protected $montant_encaisse; + protected $montant_rendu; + protected $paiement_le; - protected $prix_total_ht; - protected $montant_tva; - protected $prix_total_ttc; + protected $prix_total_ht; + protected $montant_tva; + protected $prix_total_ttc; - public function __construct () { + public function __construct () { - $this->raz(); - $this->raz_pers(); - } + $this->raz(); + $this->raz_pers(); + } - // Méthodes de traitement des données + // Methodes de traitement des donnees - /** + /** * Ajout d'un article au panier */ - public function ajoutArticle () { - global $conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base; - - $sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); + public function ajoutArticle () { +// global $conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base; +// $sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); - $tab_tva = $sql->fetchFirst ( $sql->query ('SELECT taux FROM '.MAIN_DB_PREFIX.'c_tva WHERE rowid = '.$this->tva().';') ); + global $sql; + $resql=$sql->query ('SELECT taux FROM '.MAIN_DB_PREFIX.'c_tva WHERE rowid = '.$this->tva()); + + $tab_tva = mysql_fetch_array($resql); + $ret=array(); + foreach ( $tab_tva as $cle => $valeur ) + { + $ret[$cle] = $valeur; + } + $tab_tva=$ret; +// var_dump($tab_tva);exit; + + // TODO Mettre methode de calcul arrondi TVA de Dolibarr + + // Calcul du total ht sans remise + $total_ht = ( $this->qte * $this->prix() ); + // Calcul du montant de la remise + if ( $this->remise_percent() ) { + + $remise_percent = $this->remise_percent(); + + } else { + + $remise_percent = 0; + + } + $montant_remise = $total_ht * $remise_percent / 100; + $this->montant_remise ($montant_remise); + // Calcul du total ttc + $total_ttc = ($total_ht - $montant_remise) * (($tab_tva['taux'] / 100) + 1); - // TODO Mettre methode de calcul arrondi TVA de Dolibarr - - // Calcul du total ht sans remise - $total_ht = ( $this->qte * $this->prix() ); - // Calcul du montant de la remise - if ( $this->remise_percent() ) { - - $remise_percent = $this->remise_percent(); - - } else { - - $remise_percent = 0; - - } - $montant_remise = $total_ht * $remise_percent / 100; - $this->montant_remise ($montant_remise); - // Calcul du total ttc - $total_ttc = ($total_ht - $montant_remise) * (($tab_tva['taux'] / 100) + 1); - - - $sql->query(' - INSERT INTO '.MAIN_DB_PREFIX.'tmp_caisse ( + $sql->query('INSERT INTO '.MAIN_DB_PREFIX.'tmp_caisse ( fk_article, qte, fk_tva, @@ -120,381 +128,389 @@ '.price2num($total_ht).', '.price2num($total_ttc).')'); - $this->raz(); + $this->raz(); - } + } - /** - * Suppression du panier d'un article identifié par son id dans la table llx_tmp_caisse + /** + * Suppression du panier d'un article identifi� par son id dans la table llx_tmp_caisse */ - public function supprArticle ($aArticle) { - global $conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base; + public function supprArticle ($aArticle) { +// global $conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base; +// $sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); - $sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); + global $sql; + $sql->query('DELETE FROM '.MAIN_DB_PREFIX.'tmp_caisse WHERE id = '.$aArticle.' LIMIT 1'); - $sql->query('DELETE FROM '.MAIN_DB_PREFIX.'tmp_caisse WHERE id = '.$aArticle.' LIMIT 1'); + } - } - - /** + /** * Calcul du total HT, total TTC et montants TVA */ - public function calculTotaux () { - global $conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base; + public function calculTotaux () { +// global $conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base; +// $sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); - $sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); - - // Incrémentation des compteurs - $res = $sql->query ('SELECT remise, total_ht, total_ttc, taux FROM '.MAIN_DB_PREFIX.'tmp_caisse as c + global $sql; + $res = $sql->query ('SELECT remise, total_ht, total_ttc, taux FROM '.MAIN_DB_PREFIX.'tmp_caisse as c LEFT JOIN '.MAIN_DB_PREFIX.'c_tva as t ON c.fk_tva = t.rowid ORDER BY id'); - $total_ht=0; - $total_ttc=0; + $total_ht=0; + $total_ttc=0; - if ( $sql->numRows($res) ) { + if ( $sql->num_rows($res) ) { - $tab = $sql->fetchAll($res); - - for ( $i = 0; $i < count($tab); $i++ ) { - - // Total HT - $remise = $tab[$i]['remise']; - $total_ht += ($tab[$i]['total_ht']); - $total_ttc += ($tab[$i]['total_ttc']); + $ret=array(); $i=0; + while ( $tab = mysql_fetch_array($res) ) + { + foreach ( $tab as $cle => $valeur ) + { + $ret[$i][$cle] = $valeur; } + $i++; + } + $tab=$ret; + + for ( $i = 0; $i < count($tab); $i++ ) { - $this->prix_total_ttc = $total_ttc; - $this->prix_total_ht = $total_ht; - - $this->montant_tva = $total_ttc - $total_ht; - //print $this->prix_total_ttc.'eeee'; exit; + // Total HT + $remise = $tab[$i]['remise']; + $total_ht += ($tab[$i]['total_ht']); + $total_ttc += ($tab[$i]['total_ttc']); } + $this->prix_total_ttc = $total_ttc; + $this->prix_total_ht = $total_ht; + + $this->montant_tva = $total_ttc - $total_ht; + //print $this->prix_total_ttc.'eeee'; exit; } - /** - * Réinitialisation des attributs + } + + /** + * R�initialisation des attributs */ - public function raz () { + public function raz () { - $this->id ('RESET'); - $this->ref ('RESET'); - $this->qte ('RESET'); - $this->stock ('RESET'); - $this->remise_percent ('RESET'); - $this->montant_remise ('RESET'); - $this->prix ('RESET'); - $this->tva ('RESET'); + $this->id ('RESET'); + $this->ref ('RESET'); + $this->qte ('RESET'); + $this->stock ('RESET'); + $this->remise_percent ('RESET'); + $this->montant_remise ('RESET'); + $this->prix ('RESET'); + $this->tva ('RESET'); - } + } - /** - * Réinitialisation des attributs persistants + /** + * R�initialisation des attributs persistants */ - public function raz_pers () { + public function raz_pers () { - $this->num_facture ('RESET'); - $this->mode_reglement ('RESET'); - $this->montant_encaisse ('RESET'); - $this->montant_rendu ('RESET'); - $this->paiement_le ('RESET'); + $this->num_facture ('RESET'); + $this->mode_reglement ('RESET'); + $this->montant_encaisse ('RESET'); + $this->montant_rendu ('RESET'); + $this->paiement_le ('RESET'); - $this->prix_total_ht ('RESET'); - $this->montant_tva ('RESET'); - $this->prix_total_ttc ('RESET'); + $this->prix_total_ht ('RESET'); + $this->montant_tva ('RESET'); + $this->prix_total_ttc ('RESET'); - } + } - // Méthodes de modification des attributs protégés - public function id ( $aId=null ) { + // Methodes de modification des attributs proteges + public function id ( $aId=null ) { - if ( !$aId ) { + if ( !$aId ) { - return $this->id; + return $this->id; - } else if ( $aId == 'RESET' ) { + } else if ( $aId == 'RESET' ) { - $this->id = NULL; + $this->id = NULL; - } else { + } else { - $this->id = $aId; - - } - - } - - public function ref ( $aRef=null ) { - - if ( !$aRef ) { - - return $this->ref; - - } else if ( $aRef == 'RESET' ) { - - $this->ref = NULL; - - } else { - - $this->ref = $aRef; - - } - - } - - public function qte ( $aQte=null ) { - - if ( !$aQte ) { - - return $this->qte; - - } else if ( $aQte == 'RESET' ) { - - $this->qte = NULL; - - } else { - - $this->qte = $aQte; - - } - - } - - public function stock ( $aStock=null ) { - - if ( !$aStock ) { - - return $this->stock; - - } else if ( $aStock == 'RESET' ) { - - $this->stock = NULL; - - } else { - - $this->stock = $aStock; - - } - - } - - public function remise_percent ( $aRemisePercent=null ) { - - if ( !$aRemisePercent ) { - - return $this->remise_percent; - - } else if ( $aRemisePercent == 'RESET' ) { - - $this->remise_percent = NULL; - - } else { - - $this->remise_percent = $aRemisePercent; - - } - - } - - public function montant_remise ( $aMontantRemise=null ) { - - if ( !$aMontantRemise ) { - - return $this->montant_remise; - - } else if ( $aMontantRemise == 'RESET' ) { - - $this->montant_remise = NULL; - - } else { - - $this->montant_remise = $aMontantRemise; - - } - - } - - public function prix ( $aPrix=null ) { - - if ( !$aPrix ) { - - return $this->prix; - - } else if ( $aPrix == 'RESET' ) { - - $this->prix = NULL; - - } else { - - $this->prix = $aPrix; - - } - - } - - public function tva ( $aTva=null ) { - - if ( !$aTva ) { - - return $this->tva; - - } else if ( $aTva == 'RESET' ) { - - $this->tva = NULL; - - } else { - - $this->tva = $aTva; - - } - - } - - public function num_facture ( $aNumFacture=null ) { - - if ( !$aNumFacture ) { - - return $this->num_facture; - - } else if ( $aNumFacture == 'RESET' ) { - - $this->num_facture = NULL; - - } else { - - $this->num_facture = $aNumFacture; - - } - - } - - public function mode_reglement ( $aModeReglement=null ) { - - if ( !$aModeReglement ) { - - return $this->mode_reglement; - - } else if ( $aModeReglement == 'RESET' ) { - - $this->mode_reglement = NULL; - - } else { - - $this->mode_reglement = $aModeReglement; - - } - - } - - public function montant_encaisse ( $aMontantEncaisse=null ) { - - if ( !$aMontantEncaisse ) { - - return $this->montant_encaisse; - - } else if ( $aMontantEncaisse == 'RESET' ) { - - $this->montant_encaisse = NULL; - - } else { - - $this->montant_encaisse = $aMontantEncaisse; - - } - - } - - public function montant_rendu ( $aMontantRendu=null ) { - - if ( !$aMontantRendu ) { - - return $this->montant_rendu; - } else if ( $aMontantRendu == 'RESET' ) { - - $this->montant_rendu = NULL; - - } else { - - $this->montant_rendu = $aMontantRendu; - - } - - } - - public function paiement_le ( $aPaiementLe=null ) { - - if ( !$aPaiementLe ) { - - return $this->paiement_le; - - } else if ( $aPaiementLe == 'RESET' ) { - - $this->paiement_le = NULL; - - } else { - - $this->paiement_le = $aPaiementLe; - - } - - } - - public function prix_total_ht ( $aTotalHt=null ) { - - if ( !$aTotalHt ) { - - return $this->prix_total_ht; - - } else if ( $aTotalHt == 'RESET' ) { - - $this->prix_total_ht = NULL; - - } else { - - $this->prix_total_ht = $aTotalHt; - - } - - } - - public function montant_tva ( $aMontantTva=null ) { - - if ( !$aMontantTva ) { - - return $this->montant_tva; - - } else if ( $aMontantTva == 'RESET' ) { - - $this->montant_tva = NULL; - - } else { - - $this->montant_tva = $aMontantTva; - - } - - } - - public function prix_total_ttc ( $aTotalTtc=null ) { - - if ( !$aTotalTtc ) { - - return $this->prix_total_ttc; - - } else if ( $aTotalTtc == 'RESET' ) { - - $this->prix_total_ttc = NULL; - - } else { - - $this->prix_total_ttc = $aTotalTtc; - - } + $this->id = $aId; } } + public function ref ( $aRef=null ) { + + if ( !$aRef ) { + + return $this->ref; + + } else if ( $aRef == 'RESET' ) { + + $this->ref = NULL; + + } else { + + $this->ref = $aRef; + + } + + } + + public function qte ( $aQte=null ) { + + if ( !$aQte ) { + + return $this->qte; + + } else if ( $aQte == 'RESET' ) { + + $this->qte = NULL; + + } else { + + $this->qte = $aQte; + + } + + } + + public function stock ( $aStock=null ) { + + if ( !$aStock ) { + + return $this->stock; + + } else if ( $aStock == 'RESET' ) { + + $this->stock = NULL; + + } else { + + $this->stock = $aStock; + + } + + } + + public function remise_percent ( $aRemisePercent=null ) { + + if ( !$aRemisePercent ) { + + return $this->remise_percent; + + } else if ( $aRemisePercent == 'RESET' ) { + + $this->remise_percent = NULL; + + } else { + + $this->remise_percent = $aRemisePercent; + + } + + } + + public function montant_remise ( $aMontantRemise=null ) { + + if ( !$aMontantRemise ) { + + return $this->montant_remise; + + } else if ( $aMontantRemise == 'RESET' ) { + + $this->montant_remise = NULL; + + } else { + + $this->montant_remise = $aMontantRemise; + + } + + } + + public function prix ( $aPrix=null ) { + + if ( !$aPrix ) { + + return $this->prix; + + } else if ( $aPrix == 'RESET' ) { + + $this->prix = NULL; + + } else { + + $this->prix = $aPrix; + + } + + } + + public function tva ( $aTva=null ) { + + if ( !$aTva ) { + + return $this->tva; + + } else if ( $aTva == 'RESET' ) { + + $this->tva = NULL; + + } else { + + $this->tva = $aTva; + + } + + } + + public function num_facture ( $aNumFacture=null ) { + + if ( !$aNumFacture ) { + + return $this->num_facture; + + } else if ( $aNumFacture == 'RESET' ) { + + $this->num_facture = NULL; + + } else { + + $this->num_facture = $aNumFacture; + + } + + } + + public function mode_reglement ( $aModeReglement=null ) { + + if ( !$aModeReglement ) { + + return $this->mode_reglement; + + } else if ( $aModeReglement == 'RESET' ) { + + $this->mode_reglement = NULL; + + } else { + + $this->mode_reglement = $aModeReglement; + + } + + } + + public function montant_encaisse ( $aMontantEncaisse=null ) { + + if ( !$aMontantEncaisse ) { + + return $this->montant_encaisse; + + } else if ( $aMontantEncaisse == 'RESET' ) { + + $this->montant_encaisse = NULL; + + } else { + + $this->montant_encaisse = $aMontantEncaisse; + + } + + } + + public function montant_rendu ( $aMontantRendu=null ) { + + if ( !$aMontantRendu ) { + + return $this->montant_rendu; + } else if ( $aMontantRendu == 'RESET' ) { + + $this->montant_rendu = NULL; + + } else { + + $this->montant_rendu = $aMontantRendu; + + } + + } + + public function paiement_le ( $aPaiementLe=null ) { + + if ( !$aPaiementLe ) { + + return $this->paiement_le; + + } else if ( $aPaiementLe == 'RESET' ) { + + $this->paiement_le = NULL; + + } else { + + $this->paiement_le = $aPaiementLe; + + } + + } + + public function prix_total_ht ( $aTotalHt=null ) { + + if ( !$aTotalHt ) { + + return $this->prix_total_ht; + + } else if ( $aTotalHt == 'RESET' ) { + + $this->prix_total_ht = NULL; + + } else { + + $this->prix_total_ht = $aTotalHt; + + } + + } + + public function montant_tva ( $aMontantTva=null ) { + + if ( !$aMontantTva ) { + + return $this->montant_tva; + + } else if ( $aMontantTva == 'RESET' ) { + + $this->montant_tva = NULL; + + } else { + + $this->montant_tva = $aMontantTva; + + } + + } + + public function prix_total_ttc ( $aTotalTtc=null ) { + + if ( !$aTotalTtc ) { + + return $this->prix_total_ttc; + + } else if ( $aTotalTtc == 'RESET' ) { + + $this->prix_total_ttc = NULL; + + } else { + + $this->prix_total_ttc = $aTotalTtc; + + } + + } + +} + ?> diff --git a/htdocs/cashdesk/classes/Mysql.class.php b/htdocs/cashdesk/classes/Mysql.class.php index d31fb97a920..813caa15e4e 100644 --- a/htdocs/cashdesk/classes/Mysql.class.php +++ b/htdocs/cashdesk/classes/Mysql.class.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -22,23 +23,23 @@ require_once ('Sql.interface.php'); class Sql implements intSql { /** - * Constructeur : initialise la connection à la base de données - * @param $aHost Domaine ou adresse IP du serveur de base de données (ex : localhost ou db.monsite.fr) - * @param $aUser Utilisateur de la base de données - * @param $aPass Mot de passe de l'utilisateur de la base de données - * @param $aBase Nom de la base de données à utiliser + * Constructeur : initialise la connection � la base de donn�es + * @param $aHost Domaine ou adresse IP du serveur de base de donn�es (ex : localhost ou db.monsite.fr) + * @param $aUser Utilisateur de la base de donn�es + * @param $aPass Mot de passe de l'utilisateur de la base de donn�es + * @param $aBase Nom de la base de donn�es � utiliser */ public function __construct ($aHost, $aUser, $aPass, $aBase) { - + $db = mysql_connect ($aHost, $aUser, $aPass); mysql_select_db ($aBase, $db); } /** - * Destructeur : ferme la connection à la base de données + * Destructeur : ferme la connection � la base de donn�es */ - // Désactivation pour cause bug avec 1and1 + // D�sactivation pour cause bug avec 1and1 // public function __destruct () { // // mysql_close (); @@ -46,9 +47,9 @@ class Sql implements intSql { // } /** - * Effectue une requête sur la base de données, et renvoi la ressource correspondante - * @param $aRequete Requête SQL (ex : SELECT nom, prenom FROM table1 WHERE id = 127) - * @return Ressource vers la requête venant d'être effectuée + * Effectue une requ�te sur la base de donn�es, et renvoi la ressource correspondante + * @param $aRequete Requ�te SQL (ex : SELECT nom, prenom FROM table1 WHERE id = 127) + * @return Ressource vers la requ�te venant d'�tre effectu�e */ public function query ($aRequete) { dolibarr_syslog("cashdesk query sql=".$aRequete, LOG_DEBUG); @@ -57,33 +58,31 @@ class Sql implements intSql { } /** - * Renvoi le nombre de résultats d'une requête - * @param $aRes Ressource d'une requête effectuée précédemment - * @return Entier : nombre de résultats de la requête + * Renvoi le nombre de r�sultats d'une requ�te + * @param $aRes Ressource d'une requ�te effectu�e pr�c�demment + * @return Entier : nombre de r�sultats de la requ�te */ - public function numRows ($aRes) { + public function num_rows ($aRes) { return mysql_num_rows($aRes); } /** - * Enregistre tous les résultats d'une requête dans un tableau à deux dimensions - * @param $aRes Ressource d'une requête effectuée précédemment - * @return Tableau à deux dimensions : $tab[indice_resultat(integer)][indice_champ(integer) / nom_champ(string)] + * Enregistre tous les r�sultats d'une requ�te dans un tableau � deux dimensions + * @param $aRes Ressource d'une requ�te effectu�e pr�c�demment + * @return Tableau � deux dimensions : $tab[indice_resultat(integer)][indice_champ(integer) / nom_champ(string)] */ - public function fetchAll ($aRes) { - - $i = 0; - while ( $tab = mysql_fetch_array($aRes) ) { - - foreach ( $tab as $cle => $valeur ) { + public function fetch_array ($aRes) { + $ret=array(); $i=0; + while ( $tab = mysql_fetch_array($aRes) ) + { + foreach ( $tab as $cle => $valeur ) + { $ret[$i][$cle] = $valeur; - } $i++; - } return $ret; @@ -91,22 +90,21 @@ class Sql implements intSql { } /** - * Enregistre seulement le premier résultat d'une requête dans un tableau à une dimension - * @param $aRes Ressource d'une requête effectuée précédemment - * @return Tableau à une dimension : $tab[indice_champ(integer) / nom_champ(string)] + * Enregistre seulement le premier r�sultat d'une requ�te dans un tableau � une dimension + * @param $aRes Ressource d'une requ�te effectu�e pr�c�demment + * @return Tableau � une dimension : $tab[indice_champ(integer) / nom_champ(string)] */ - public function fetchFirst ($aRes) { + public function fetchFirst ($aRes) + { + $ret=array(); $tab = mysql_fetch_array($aRes); - - foreach ( $tab as $cle => $valeur ) { - + foreach ( $tab as $cle => $valeur ) + { $ret[$cle] = $valeur; - } return $ret; - } } diff --git a/htdocs/cashdesk/classes/Sql.interface.php b/htdocs/cashdesk/classes/Sql.interface.php index da746bf24e2..718e48a5e4a 100644 --- a/htdocs/cashdesk/classes/Sql.interface.php +++ b/htdocs/cashdesk/classes/Sql.interface.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -18,16 +19,16 @@ interface intSql { - // Envoie une requête et retourne le pointeur vers le résultat + // Envoie une requ�te et retourne le pointeur vers le r�sultat public function query ($aRequete); - // Renvoie le nombre de résultats contenus dans la ressource - public function numRows ($aRes); + // Renvoie le nombre de r�sultats contenus dans la ressource + public function num_rows ($aRes); - // Parcours tous les résultats de la ressource et les enregistre dans un tableau à 2 dimensions : $tab[ligne][nom_champ/indice] - public function fetchAll ($aRes); + // Parcours tous les r�sultats de la ressource et les enregistre dans un tableau � 2 dimensions : $tab[ligne][nom_champ/indice] + public function fetch_array ($aRes); - // Enregistre seulement le premier résultat de la ressource dans un tableau à 1 dimension : $tab[nom_champ/indice] + // Enregistre seulement le premier r�sultat de la ressource dans un tableau � 1 dimension : $tab[nom_champ/indice] public function fetchFirst ($aRes); } diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 0a5ea276a54..9dd14462b52 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -16,11 +17,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// Récupération de la liste des articles +// Recuperation de la liste des articles if ( $_GET['filtre'] ) { // Avec filtre - $tab_designations = $sql->fetchAll ( $sql->query ( + $ret=array(); $i=0; + $resql=$sql->query ( 'SELECT '.MAIN_DB_PREFIX.'product.rowid, ref, label, tva_tx FROM '.MAIN_DB_PREFIX.'product LEFT JOIN '.MAIN_DB_PREFIX.'product_stock ON '.MAIN_DB_PREFIX.'product.rowid = '.MAIN_DB_PREFIX.'product_stock.fk_product @@ -29,22 +31,36 @@ if ( $_GET['filtre'] ) { AND fk_entrepot = '.$conf_fkentrepot.' AND ref LIKE \'%'.$_GET['filtre'].'%\' OR label LIKE \'%'.$_GET['filtre'].'%\' - ORDER BY label - ;')); - + ORDER BY label'); + while ( $tab = mysql_fetch_array($resql) ) + { + foreach ( $tab as $cle => $valeur ) + { + $ret[$i][$cle] = $valeur; + } + $i++; + } + $tab_designations=$ret; } else { // Sans filtre - $tab_designations = $sql->fetchAll ( $sql->query (' - SELECT '.MAIN_DB_PREFIX.'product.rowid, ref, label, tva_tx + $ret=array(); $i=0; + $resql=$sql->query ('SELECT '.MAIN_DB_PREFIX.'product.rowid, ref, label, tva_tx FROM '.MAIN_DB_PREFIX.'product LEFT JOIN '.MAIN_DB_PREFIX.'product_stock ON '.MAIN_DB_PREFIX.'product.rowid = '.MAIN_DB_PREFIX.'product_stock.fk_product WHERE envente = 1 AND fk_product_type = 0 AND fk_entrepot = '.$conf_fkentrepot.' - ORDER BY label - ;')); - + ORDER BY label'); + while ( $tab = mysql_fetch_array($resql) ) + { + foreach ( $tab as $cle => $valeur ) + { + $ret[$i][$cle] = $valeur; + } + $i++; + } + $tab_designations=$ret; } $nbr_enreg = count ($tab_designations); @@ -53,35 +69,46 @@ if ( $nbr_enreg > 1 ) { if ( $nbr_enreg > $conf_taille_listes ) { - $top_liste_produits = '----- '.$conf_taille_listes.' produits affichés sur un total de '.$nbr_enreg.' -----'; + $top_liste_produits = '----- '.$conf_taille_listes.' produits affiches sur un total de '.$nbr_enreg.' -----'; } else { - $top_liste_produits = '----- '.$nbr_enreg.' produits affichés sur un total de '.$nbr_enreg.' -----'; + $top_liste_produits = '----- '.$nbr_enreg.' produits affiches sur un total de '.$nbr_enreg.' -----'; } } else if ( $nbr_enreg == 1 ) { - $top_liste_produits = '----- 1 article trouvé -----'; + $top_liste_produits = '----- 1 article trouve -----'; } else { - $top_liste_produits = '----- Aucun article trouvé -----'; + $top_liste_produits = '----- Aucun article trouve -----'; } -// Récupération des taux de tva +// Recuperation des taux de tva global $mysoc; $request="SELECT t.rowid, t.taux FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays = p.rowid AND t.active = 1 AND p.code = '".$mysoc->pays_code."'"; //print $request; -$tab_tva = $sql->fetchAll ($sql->query ($request)); + +$ret=array(); $i=0; +$res=$sql->query ($request); +while ( $tab = $sql->fetch_array($res) ) +{ + foreach ( $tab as $cle => $valeur ) + { + $ret[$i][$cle] = $valeur; + } + $i++; +} +$tab_tva = $ret; -// Réinitialisation du mode de paiement, en cas de retour aux achats après validation +// Reinitialisation du mode de paiement, en cas de retour aux achats apres validation $obj_facturation->mode_reglement ('RESET'); $obj_facturation->montant_encaisse ('RESET'); $obj_facturation->montant_rendu ('RESET'); diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index f21e71821a5..2ac6b7813a9 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -32,11 +33,21 @@ OR label LIKE '%".$_GET['code']."%' ORDER BY label"); - if ( $nbr = $sql->numRows($res) ) { + if ( $nbr = $sql->num_rows($res) ) { $resultat = '
    '; - $tab = $sql->fetchAll($res); + $ret=array(); $i=0; + while ( $tab = mysql_fetch_array($res) ) + { + foreach ( $tab as $cle => $valeur ) + { + $ret[$i][$cle] = $valeur; + } + $i++; + } + $tab=$ret; + for ( $i = 0; $i < count ($tab); $i++ ) { $resultat .= ' @@ -56,7 +67,7 @@ echo ('
      -
    • '.htmlentities ('Aucun résultat').'
    • +
    • '.htmlentities ('Aucun r�sultat').'
    '); diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 498e9ecc051..d70d8d4a576 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,107 +16,115 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - require ('../master.inc.php'); - require ('include/environnement.php'); - require ('classes/Facturation.class.php'); - $obj_facturation = unserialize ($_SESSION['serObjFacturation']); - unset ($_SESSION['serObjFacturation']); +require ('../master.inc.php'); +require ('include/environnement.php'); +require ('classes/Facturation.class.php'); - switch ( $_GET['action'] ) { +$obj_facturation = unserialize ($_SESSION['serObjFacturation']); +unset ($_SESSION['serObjFacturation']); - default: - if ( $_POST['hdnSource'] != 'NULL' ) { - // Récupération des données en fonction de la source (liste déroulante ou champ texte) ... - if ( $_POST['hdnSource'] == 'LISTE' ) { +switch ( $_GET['action'] ) { - $res = $sql->query('SELECT fk_product, ref, stock_propale, stock_commande, price, reel, tva_tx + default: + if ( $_POST['hdnSource'] != 'NULL' ) { + + // Recuperation des donnees en fonction de la source (liste d�roulante ou champ texte) ... + if ( $_POST['hdnSource'] == 'LISTE' ) { + + $res = $sql->query('SELECT fk_product, ref, stock_propale, stock_commande, price, reel, tva_tx FROM '.MAIN_DB_PREFIX.'product LEFT JOIN '.MAIN_DB_PREFIX.'product_stock ON '.MAIN_DB_PREFIX.'product.rowid = '.MAIN_DB_PREFIX.'product_stock.fk_product WHERE fk_product = '.$_POST['selProduit'].' ;'); - } else if ( $_POST['hdnSource'] == 'REF' ) { + } else if ( $_POST['hdnSource'] == 'REF' ) { - $res = $sql->query('SELECT fk_product, ref, stock_propale, stock_commande, price, reel, tva_tx + $res = $sql->query('SELECT fk_product, ref, stock_propale, stock_commande, price, reel, tva_tx FROM '.MAIN_DB_PREFIX.'product LEFT JOIN '.MAIN_DB_PREFIX.'product_stock ON '.MAIN_DB_PREFIX.'product.rowid = '.MAIN_DB_PREFIX.'product_stock.fk_product WHERE ref = \''.$_POST['txtRef'].'\' ;'); + } + + + + // ... et enregistrement dans l'objet + if ( $sql->num_rows ($res) ) { + + $ret=array(); + $tab = mysql_fetch_array($res); + foreach ( $tab as $cle => $valeur ) + { + $ret[$cle] = $valeur; + } + $tab = $ret; + + $obj_facturation->id( $tab['fk_product'] ); + $obj_facturation->ref( $tab['ref'] ); + $obj_facturation->stock( $tab['reel'] - $tab['stock_propale'] - $tab['stock_commande'] ); + $obj_facturation->prix( $tab['price'] ); + $obj_facturation->tva( $tab['tva_tx'] ); + + // Definition du filtre pour n'afficher que le produit concern� + if ( $_POST['hdnSource'] == 'LISTE' ) { + + $filtre = $tab['ref']; + + } else if ( $_POST['hdnSource'] == 'REF' ) { + + $filtre = $_POST['txtRef'];; + } - - // ... et enregistrement dans l'objet - if ( $sql->numRows ($res) ) { - - $tab = $sql->fetchFirst($res); - - $obj_facturation->id( $tab['fk_product'] ); - $obj_facturation->ref( $tab['ref'] ); - $obj_facturation->stock( $tab['reel'] - $tab['stock_propale'] - $tab['stock_commande'] ); - $obj_facturation->prix( $tab['price'] ); - $obj_facturation->tva( $tab['tva_tx'] ); - - // Définition du filtre pour n'afficher que le produit concerné - if ( $_POST['hdnSource'] == 'LISTE' ) { - - $filtre = $tab['ref']; - - } else if ( $_POST['hdnSource'] == 'REF' ) { - - $filtre = $_POST['txtRef'];; - - } - - - $redirection = 'affIndex.php?menu=facturation&filtre='.$filtre; - - } else { - - $obj_facturation->raz(); - - if ( $_POST['hdnSource'] == 'REF' ) { - - $redirection = 'affIndex.php?menu=facturation&filtre='.$_POST['txtRef']; - - } else { - - $redirection = 'affIndex.php?menu=facturation'; - - } - - } + $redirection = 'affIndex.php?menu=facturation&filtre='.$filtre; } else { - $redirection = 'affIndex.php?menu=facturation'; + $obj_facturation->raz(); + + if ( $_POST['hdnSource'] == 'REF' ) { + + $redirection = 'affIndex.php?menu=facturation&filtre='.$_POST['txtRef']; + + } else { + + $redirection = 'affIndex.php?menu=facturation'; + + } } - break; - - case 'ajout_article'; - $obj_facturation->qte($_POST['txtQte']); - $obj_facturation->tva($_POST['selTva']); - $obj_facturation->remise_percent($_POST['txtRemise']); - $obj_facturation->ajoutArticle(); + } else { $redirection = 'affIndex.php?menu=facturation'; - break; - case 'suppr_article': - $obj_facturation->supprArticle($_GET['suppr_id']); + } - $redirection = 'affIndex.php?menu=facturation'; - break; + break; - } + case 'ajout_article'; + $obj_facturation->qte($_POST['txtQte']); + $obj_facturation->tva($_POST['selTva']); + $obj_facturation->remise_percent($_POST['txtRemise']); + $obj_facturation->ajoutArticle(); + + $redirection = 'affIndex.php?menu=facturation'; + break; + + case 'suppr_article': + $obj_facturation->supprArticle($_GET['suppr_id']); + + $redirection = 'affIndex.php?menu=facturation'; + break; + +} - $_SESSION['serObjFacturation'] = serialize ($obj_facturation); - - header ('Location: '.$redirection); +$_SESSION['serObjFacturation'] = serialize ($obj_facturation); + +header ('Location: '.$redirection); ?> diff --git a/htdocs/cashdesk/include/environnement.php b/htdocs/cashdesk/include/environnement.php index 0370a057b79..88ec14e38ba 100644 --- a/htdocs/cashdesk/include/environnement.php +++ b/htdocs/cashdesk/include/environnement.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2008 Jeremie Ollivier * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,20 +26,20 @@ dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id() $conf_db_type = $dolibarr_main_db_type; -// Paramètres de connexion à la base +// Parametres de connexion a la base $conf_db_host = $dolibarr_main_db_host; $conf_db_user = $dolibarr_main_db_user; $conf_db_pass = $dolibarr_main_db_pass; $conf_db_base = $dolibarr_main_db_name; -// Paramètres généraux +// Parametres generaux $conf_url_racine = $dolibarr_main_url_root.'/cashdesk'; // Identifiant unique correspondant au tiers generique pour la vente $conf_fksoc = $conf->global->CASHDESK_ID_THIRDPARTY; // Identifiant unique correspondant au compte caisse / liquide $conf_fkaccount = $conf->global->CASHDESK_ID_BANKACCOUNT > 0?$conf->global->CASHDESK_ID_BANKACCOUNT:$_SESSION["CASHDESK_ID_BANKACCOUNT"]; -// Identifiant unique correspondant à l'entrepôt associé à la caisse +// Identifiant unique correspondant a l'entrepot associe a la caisse $conf_fkentrepot = $conf->global->CASHDESK_ID_WAREHOUSE > 0?$conf->global->CASHDESK_ID_WAREHOUSE:$_SESSION["CASHDESK_ID_WAREHOUSE"]; // Check if setup ok @@ -47,13 +47,14 @@ if (empty($conf_fksoc)) dolibarr_print_error("Setup of CashDesk module not if ($conf->bank->enabled && empty($conf_fkaccount)) dolibarr_print_error("Setup of CashDesk module not complete. Bank account not defined."); if ($conf->stock->enabled && empty($conf_fkentrepot)) dolibarr_print_error("Setup of CashDesk module not complete. Warehous not defined."); -// Paramètres d'affichage -$conf_taille_listes = 200; // Nombre max de lignes à afficher dans les listes -$conf_nbr_car_listes = 60; // Nombre max de caractères par ligne dans les listes +// 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 $new_conf_db_type=$conf_db_type; if (eregi('mysql',$new_conf_db_type)) $new_conf_db_type='Mysql'; require ('classes/'.$new_conf_db_type.'.class.php'); -$sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); +//$sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); +$sql=$db; ?> diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index cdd8b549dc0..306dc360722 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,39 +16,49 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - include('../master.inc.php'); - require ('include/environnement.php'); - require ('classes/Auth.class.php'); - $username = $_POST['txtUsername']; - $password = $_POST['pwdPassword']; +include('../master.inc.php'); +require ('include/environnement.php'); +require ('classes/Auth.class.php'); + +$username = $_POST['txtUsername']; +$password = $_POST['pwdPassword']; - $auth = new Auth ($conf_db_host,$conf_db_user, $conf_db_pass, $conf_db_base ); +$auth = new Auth ($conf_db_host,$conf_db_user, $conf_db_pass, $conf_db_base ); - $retour = $auth->verif ($username, $password); +$retour = $auth->verif ($username, $password); - if ( $retour >= 0 ) { +if ( $retour >= 0 ) { - $db = mysql_connect ($conf_db_host,$conf_db_user, $conf_db_pass); - mysql_select_db ($conf_db_base, $db); + // $db = mysql_connect ($conf_db_host,$conf_db_user, $conf_db_pass); + // mysql_select_db ($conf_db_base, $db); - $tab = $sql->fetchFirst ($sql->query ( - "SELECT rowid, name, firstname + $res=$sql->query ( + "SELECT rowid, name, firstname FROM ".MAIN_DB_PREFIX."user - WHERE login = '".$username."'")); - - $_SESSION['uid'] = $tab['rowid']; - $_SESSION['uname'] = $username; - $_SESSION['nom'] = $tab['name']; - $_SESSION['prenom'] = $tab['firstname']; - - header ('Location: affIndex.php?menu=facturation&id=NOUV'); - - } else { - - header ('Location: index.php?err='.$retour.'&user='.$username); + WHERE login = '".$username."'"); + $ret=array(); + $tab = mysql_fetch_array($res); + foreach ( $tab as $cle => $valeur ) + { + $ret[$cle] = $valeur; } + $tab = $ret; + + $_SESSION['uid'] = $tab['rowid']; + $_SESSION['uname'] = $username; + $_SESSION['nom'] = $tab['name']; + $_SESSION['prenom'] = $tab['firstname']; + + header ('Location: affIndex.php?menu=facturation&id=NOUV'); + +} else { + + header ('Location: index.php?err='.$retour.'&user='.$username); + +} + ?> diff --git a/htdocs/cashdesk/liste_articles.php b/htdocs/cashdesk/liste_articles.php index f819836bdc7..26cfa75583c 100644 --- a/htdocs/cashdesk/liste_articles.php +++ b/htdocs/cashdesk/liste_articles.php @@ -1,6 +1,7 @@ - * +/* Copyright (C) 2007-2008 Jeremie Ollivier + * Copyright (C) 2008 Laurent Destailleur + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -16,9 +17,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - require ('templates/liste_articles.tpl.php'); +require ('templates/liste_articles.tpl.php'); - $obj_facturation->prix_total_ht ($lst_total_ht); - $obj_facturation->prix_total_ttc ($lst_total_ttc); +$obj_facturation->prix_total_ht ($lst_total_ht); +$obj_facturation->prix_total_ttc ($lst_total_ttc); ?> diff --git a/htdocs/cashdesk/templates/liste_articles.tpl.php b/htdocs/cashdesk/templates/liste_articles.tpl.php index 3bd74964ecd..45704bbe8c9 100644 --- a/htdocs/cashdesk/templates/liste_articles.tpl.php +++ b/htdocs/cashdesk/templates/liste_articles.tpl.php @@ -1,4 +1,4 @@ -