Fix preversion for cash desk module
This commit is contained in:
parent
c2cb3e3c7a
commit
3ad5d6b566
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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']) ) {
|
||||
<div class="liste_articles"><?php include ('liste_articles.php'); ?></div>
|
||||
|
||||
<div class="principal"><?php
|
||||
|
||||
if ( $_GET['menu'] ) {
|
||||
|
||||
include ($_GET['menu'].'.php');
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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 ) {
|
||||
|
||||
<meta name="robots" content="none" />
|
||||
|
||||
<meta name="author" content="Jérémie Ollivier - jeremie.o@laposte.net" />
|
||||
<meta name="author" content="Jeremie Ollivier - jeremie.o@laposte.net" />
|
||||
<meta name="Generator" content="Kwrite, Gimp, Inkscape" />
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
|
||||
@ -41,7 +42,7 @@ if ( $_SESSION['uid'] <= 0 ) {
|
||||
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
<!-- Import des fichiers nécessaires à JsCalendar -->
|
||||
<!-- Import des fichiers necessaires a JsCalendar -->
|
||||
<style type="text/css">
|
||||
@import url(include/jscalendar/calendar-blue.css);
|
||||
</style>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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<EFBFBD>sactiv<EFBFBD>; -10 = aucune entr<EFBFBD>e trouv<EFBFBD>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);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
* <p>Attributs "volatiles" : réinitialisés après chaque traitement d'un article</p>
|
||||
/**
|
||||
* Attributs "volatiles" : r<EFBFBD>initialis<EFBFBD>s apr<EFBFBD>s chaque traitement d'un article
|
||||
* <p>Attributs "volatiles" : r<EFBFBD>initialis<EFBFBD>s apr<EFBFBD>s chaque traitement d'un article</p>
|
||||
* @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<EFBFBD> pour le produit en cours de traitement
|
||||
* @var int $stock => Stock th<EFBFBD>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<EFBFBD>s pour toute la dur<EFBFBD>e de la vente (jusqu'<EFBFBD> validation ou annulation)
|
||||
* @var string $num_facture => Num<EFBFBD>ro de la facture (de la forme FAYYMM-XXXX)
|
||||
* @var string $mode_reglement => Mode de r<EFBFBD>glement (ESP, CB ou CHQ)
|
||||
* @var int $montant_encaisse => Montant encaiss<EFBFBD> en cas de r<EFBFBD>glement en esp<EFBFBD>ces
|
||||
* @var int $montant_rendu => Monnaie rendue en cas de r<EFBFBD>glement en esp<EFBFBD>ces
|
||||
* @var int $paiement_le => Date de paiement en cas de paiement diff<EFBFBD>r<EFBFBD>
|
||||
*
|
||||
* @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<EFBFBD> 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<EFBFBD>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<EFBFBD>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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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 <EFBFBD> la base de donn<EFBFBD>es
|
||||
* @param $aHost Domaine ou adresse IP du serveur de base de donn<EFBFBD>es (ex : localhost ou db.monsite.fr)
|
||||
* @param $aUser Utilisateur de la base de donn<EFBFBD>es
|
||||
* @param $aPass Mot de passe de l'utilisateur de la base de donn<EFBFBD>es
|
||||
* @param $aBase Nom de la base de donn<EFBFBD>es <EFBFBD> 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 <EFBFBD> la base de donn<EFBFBD>es
|
||||
*/
|
||||
// Désactivation pour cause bug avec 1and1
|
||||
// D<EFBFBD>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<EFBFBD>te sur la base de donn<EFBFBD>es, et renvoi la ressource correspondante
|
||||
* @param $aRequete Requ<EFBFBD>te SQL (ex : SELECT nom, prenom FROM table1 WHERE id = 127)
|
||||
* @return Ressource vers la requ<EFBFBD>te venant d'<EFBFBD>tre effectu<EFBFBD>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<EFBFBD>sultats d'une requ<EFBFBD>te
|
||||
* @param $aRes Ressource d'une requ<EFBFBD>te effectu<EFBFBD>e pr<EFBFBD>c<EFBFBD>demment
|
||||
* @return Entier : nombre de r<EFBFBD>sultats de la requ<EFBFBD>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<EFBFBD>sultats d'une requ<EFBFBD>te dans un tableau <EFBFBD> deux dimensions
|
||||
* @param $aRes Ressource d'une requ<EFBFBD>te effectu<EFBFBD>e pr<EFBFBD>c<EFBFBD>demment
|
||||
* @return Tableau <EFBFBD> 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<EFBFBD>sultat d'une requ<EFBFBD>te dans un tableau <EFBFBD> une dimension
|
||||
* @param $aRes Ressource d'une requ<EFBFBD>te effectu<EFBFBD>e pr<EFBFBD>c<EFBFBD>demment
|
||||
* @return Tableau <EFBFBD> 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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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<EFBFBD>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<EFBFBD>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<EFBFBD>sultats de la ressource et les enregistre dans un tableau <20> 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<EFBFBD>sultat de la ressource dans un tableau <20> 1 dimension : $tab[nom_champ/indice]
|
||||
public function fetchFirst ($aRes);
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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');
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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 = '<ul class="dhtml_bloc">';
|
||||
|
||||
$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 ('
|
||||
<ul class="dhtml_bloc">
|
||||
<li class="dhtml_defaut">'.htmlentities ('Aucun résultat').'</li>
|
||||
<li class="dhtml_defaut">'.htmlentities ('Aucun r<EFBFBD>sultat').'</li>
|
||||
</ul>
|
||||
');
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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<72>
|
||||
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);
|
||||
?>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
* 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;
|
||||
?>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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);
|
||||
|
||||
?>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<!--Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
<!--Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
|
||||
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
|
||||
@ -20,15 +20,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
<p class="titre">Panier</p>
|
||||
|
||||
<?php
|
||||
// Récupération du contenu de la vente
|
||||
$res = $sql->query (
|
||||
'SELECT id, ref, label, qte, price, remise_percent, remise, total_ht, total_ttc FROM '.MAIN_DB_PREFIX.'tmp_caisse as c
|
||||
// Recuperation du contenu de la vente
|
||||
$res = $sql->query ('SELECT id, ref, label, qte, price, remise_percent, remise, total_ht, total_ttc FROM '.MAIN_DB_PREFIX.'tmp_caisse as c
|
||||
LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON c.fk_article = p.rowid
|
||||
ORDER BY id');
|
||||
|
||||
if ( $sql->numRows($res) ) {
|
||||
if ( $sql->num_rows($res) ) {
|
||||
|
||||
$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++ ) {
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<!--Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
<!--Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
|
||||
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
|
||||
@ -103,16 +103,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
66750 SAINT CYPRIEN</p>
|
||||
|
||||
<?php
|
||||
// Récupération et affichage de la date et de l'heure
|
||||
// R<EFBFBD>cup<EFBFBD>ration et affichage de la date et de l'heure
|
||||
$date = date ('d/m/Y');
|
||||
$heure = date ('H:i');
|
||||
echo ('<p class="date_heure">Le '.$date.' à '.$heure.'</p>');
|
||||
echo ('<p class="date_heure">Le '.$date.' <EFBFBD> '.$heure.'</p>');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="liste_articles">
|
||||
<tr class="titres"><th>Code</th><th>Label</th><th>Qté</th><th>Remise (%)</th><th>Tot HT</th></tr>
|
||||
<tr class="titres"><th>Code</th><th>Label</th><th>Qt<EFBFBD></th><th>Remise (%)</th><th>Tot HT</th></tr>
|
||||
|
||||
<?php
|
||||
|
||||
@ -122,9 +122,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON c.fk_article = p.rowid
|
||||
ORDER BY id');
|
||||
|
||||
if ( $sql->numRows($res) ) {
|
||||
if ( $sql->num_rows($res) ) {
|
||||
|
||||
$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++ ) {
|
||||
|
||||
@ -167,6 +176,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
</script>
|
||||
|
||||
<a class="lien" href="#" onclick="javascript: window.close(); return(false);">Fermer cette fenêtre</a>
|
||||
<a class="lien" href="#" onclick="javascript: window.close(); return(false);">Fermer cette fen<EFBFBD>tre</a>
|
||||
|
||||
</body>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Jérémie Ollivier <jeremie.o@laposte.net>
|
||||
*
|
||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
* Copyright (C) 2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -15,129 +16,137 @@
|
||||
* 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:
|
||||
switch ( $_GET['action'] ) {
|
||||
|
||||
$redirection = 'affIndex.php?menu=validation';
|
||||
break;
|
||||
default:
|
||||
|
||||
case 'valide_achat':
|
||||
$redirection = 'affIndex.php?menu=validation';
|
||||
break;
|
||||
|
||||
// Récupération du dernier numéro de facture
|
||||
$res = $sql->query (
|
||||
"SELECT facnumber
|
||||
case 'valide_achat':
|
||||
|
||||
// R<>cup<75>ration du dernier num<75>ro de facture
|
||||
$res = $sql->query (
|
||||
"SELECT facnumber
|
||||
FROM ".MAIN_DB_PREFIX."facture
|
||||
WHERE facnumber LIKE 'FA%'
|
||||
ORDER BY rowid DESC");
|
||||
|
||||
if ( $sql->numRows ($res) ) {
|
||||
|
||||
$tab_num_facture = $sql->fetchFirst ( $res );
|
||||
|
||||
$tab = explode ('-', $tab_num_facture['facnumber']);
|
||||
$num_txt = $tab[1];
|
||||
$num = $num_txt + 1;
|
||||
|
||||
// Formatage du numéro sur quatre caractères
|
||||
if ( $num < 1000 ) { $num = '0'.$num; }
|
||||
if ( $num < 100 ) { $num = '0'.$num; }
|
||||
if ( $num < 10 ) { $num = '0'.$num; }
|
||||
|
||||
$obj_facturation->num_facture ('FA'.date('ym').'-'.$num);
|
||||
|
||||
} else {
|
||||
|
||||
$obj_facturation->num_facture ( 'FA'.date('ym').'-0001' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
$obj_facturation->mode_reglement ($_POST['hdnChoix']);
|
||||
|
||||
// Si paiement autre qu'en espèces, montant encaissé = prix total
|
||||
$mode_reglement = $obj_facturation->mode_reglement();
|
||||
if ( $mode_reglement != 'ESP' ) {
|
||||
|
||||
$montant = $obj_facturation->prix_total_ttc();
|
||||
|
||||
} else {
|
||||
|
||||
$montant = $_POST['txtEncaisse'];
|
||||
|
||||
}
|
||||
|
||||
if ( $mode_reglement != 'DIF') {
|
||||
|
||||
$obj_facturation->montant_encaisse ($montant);
|
||||
|
||||
//Détermination de la somme rendue
|
||||
$total = $obj_facturation->prix_total_ttc ();
|
||||
$encaisse = $obj_facturation->montant_encaisse();
|
||||
|
||||
$obj_facturation->montant_rendu ( $encaisse - $total );
|
||||
|
||||
} else {
|
||||
|
||||
$obj_facturation->paiement_le ($_POST['txtDatePaiement']);
|
||||
if ( $sql->num_rows ($res) ) {
|
||||
|
||||
$ret=array();
|
||||
$tab = mysql_fetch_array($res);
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$cle] = $valeur;
|
||||
}
|
||||
|
||||
$tab_num_facture = $ret;
|
||||
|
||||
$redirection = 'affIndex.php?menu=validation';
|
||||
break;
|
||||
$tab = explode ('-', $tab_num_facture['facnumber']);
|
||||
$num_txt = $tab[1];
|
||||
$num = $num_txt + 1;
|
||||
|
||||
case 'retour':
|
||||
// Formatage du num<75>ro sur quatre caract<63>res
|
||||
if ( $num < 1000 ) { $num = '0'.$num; }
|
||||
if ( $num < 100 ) { $num = '0'.$num; }
|
||||
if ( $num < 10 ) { $num = '0'.$num; }
|
||||
|
||||
$redirection = 'affIndex.php?menu=facturation';
|
||||
break;
|
||||
$obj_facturation->num_facture ('FA'.date('ym').'-'.$num);
|
||||
|
||||
case 'valide_facture':
|
||||
} else {
|
||||
|
||||
// Récupération de la date et de l'heure
|
||||
$date = date ('Y-m-d');
|
||||
$heure = date ('H:i:s');
|
||||
$obj_facturation->num_facture ( 'FA'.date('ym').'-0001' );
|
||||
|
||||
// Récupération du mode de réglement et création de la note privée ...
|
||||
$note = '';
|
||||
}
|
||||
|
||||
switch ( $obj_facturation->mode_reglement() ) {
|
||||
|
||||
case 'ESP':
|
||||
$mode_reglement = 4;
|
||||
$obj_facturation->mode_reglement ($_POST['hdnChoix']);
|
||||
|
||||
$note .= 'Réglement en espèces'."\n";
|
||||
$note .= 'Somme encaissée : '.$obj_facturation->montant_encaisse()." euro\n";
|
||||
$note .= 'Somme rendue : '.$obj_facturation->montant_rendu()." euro\n";
|
||||
$note .= "\n";
|
||||
$note .= '--------------------------------------'."\n\n";
|
||||
break;
|
||||
// Si paiement autre qu'en esp<73>ces, montant encaiss<73> = prix total
|
||||
$mode_reglement = $obj_facturation->mode_reglement();
|
||||
if ( $mode_reglement != 'ESP' ) {
|
||||
|
||||
case 'CB':
|
||||
$mode_reglement = 6;
|
||||
break;
|
||||
$montant = $obj_facturation->prix_total_ttc();
|
||||
|
||||
case 'CHQ':
|
||||
$mode_reglement = 7;
|
||||
break;
|
||||
} else {
|
||||
|
||||
}
|
||||
$montant = $_POST['txtEncaisse'];
|
||||
|
||||
// ... on termine la note
|
||||
$note .= addslashes ($_POST['txtaNotes']);
|
||||
}
|
||||
|
||||
// Si paiement différé ...
|
||||
if ( $obj_facturation->mode_reglement() == 'DIF' ) {
|
||||
if ( $mode_reglement != 'DIF') {
|
||||
|
||||
// ... ajout d'une facture sans mode de réglement, avec la date d'échéance
|
||||
$sql->query (
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."facture (
|
||||
$obj_facturation->montant_encaisse ($montant);
|
||||
|
||||
//D<>termination de la somme rendue
|
||||
$total = $obj_facturation->prix_total_ttc ();
|
||||
$encaisse = $obj_facturation->montant_encaisse();
|
||||
|
||||
$obj_facturation->montant_rendu ( $encaisse - $total );
|
||||
|
||||
} else {
|
||||
|
||||
$obj_facturation->paiement_le ($_POST['txtDatePaiement']);
|
||||
|
||||
}
|
||||
|
||||
$redirection = 'affIndex.php?menu=validation';
|
||||
break;
|
||||
|
||||
case 'retour':
|
||||
|
||||
$redirection = 'affIndex.php?menu=facturation';
|
||||
break;
|
||||
|
||||
case 'valide_facture':
|
||||
|
||||
// R<>cup<75>ration de la date et de l'heure
|
||||
$date = date ('Y-m-d');
|
||||
$heure = date ('H:i:s');
|
||||
|
||||
// R<>cup<75>ration du mode de r<>glement et cr<63>ation de la note priv<69>e ...
|
||||
$note = '';
|
||||
|
||||
switch ( $obj_facturation->mode_reglement() ) {
|
||||
|
||||
case 'ESP':
|
||||
$mode_reglement = 4;
|
||||
|
||||
$note .= 'Reglement en especes'."\n";
|
||||
$note .= 'Somme encaissee : '.$obj_facturation->montant_encaisse()." euro\n";
|
||||
$note .= 'Somme rendue : '.$obj_facturation->montant_rendu()." euro\n";
|
||||
$note .= "\n";
|
||||
$note .= '--------------------------------------'."\n\n";
|
||||
break;
|
||||
|
||||
case 'CB':
|
||||
$mode_reglement = 6;
|
||||
break;
|
||||
|
||||
case 'CHQ':
|
||||
$mode_reglement = 7;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// ... on termine la note
|
||||
$note .= addslashes ($_POST['txtaNotes']);
|
||||
|
||||
// Si paiement differe ...
|
||||
if ( $obj_facturation->mode_reglement() == 'DIF' ) {
|
||||
|
||||
// ... ajout d'une facture sans mode de r<>glement, avec la date d'<27>ch<63>ance
|
||||
$sql->query (
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."facture (
|
||||
facnumber,
|
||||
type,
|
||||
ref_client,
|
||||
@ -198,21 +207,28 @@
|
||||
);");
|
||||
|
||||
|
||||
// Récupération de l'id de la facture nouvellement créée
|
||||
$tab_id_facture = $sql->fetchFirst ( $sql->query (
|
||||
"SELECT rowid
|
||||
// Recuperation de l'id de la facture nouvellement creee
|
||||
$resql=$sql->query ("SELECT rowid
|
||||
FROM ".MAIN_DB_PREFIX."facture
|
||||
WHERE 1
|
||||
ORDER BY rowid DESC") );
|
||||
ORDER BY rowid DESC");
|
||||
|
||||
$ret=array();
|
||||
$tab = mysql_fetch_array($resql);
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$cle] = $valeur;
|
||||
}
|
||||
$tab_id_facture=$ret;
|
||||
|
||||
$id = $tab_id_facture['rowid'];
|
||||
$id = $tab_id_facture['rowid'];
|
||||
|
||||
|
||||
// Sinon ...
|
||||
} else {
|
||||
} else {
|
||||
|
||||
// ... ajout d'une facture et d'un paiement
|
||||
$sql->query ("INSERT INTO ".MAIN_DB_PREFIX."facture (
|
||||
// ... ajout d'une facture et d'un paiement
|
||||
$sql->query ("INSERT INTO ".MAIN_DB_PREFIX."facture (
|
||||
facnumber,
|
||||
type,
|
||||
ref_client,
|
||||
@ -274,22 +290,31 @@
|
||||
;");
|
||||
|
||||
|
||||
// Récupération de l'id de la facture nouvellement créée
|
||||
$tab_id_facture = $sql->fetchFirst ( $sql->query (
|
||||
"SELECT rowid
|
||||
// Recuperation de l'id de la facture nouvellement creee
|
||||
$resql=$sql->query (
|
||||
"SELECT rowid
|
||||
FROM ".MAIN_DB_PREFIX."facture
|
||||
WHERE 1
|
||||
ORDER BY rowid DESC") );
|
||||
ORDER BY rowid DESC");
|
||||
|
||||
$ret=array();
|
||||
$tab = mysql_fetch_array($resql);
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$cle] = $valeur;
|
||||
}
|
||||
|
||||
$id = $tab_id_facture['rowid'];
|
||||
$tab_id_facture = $tab;
|
||||
|
||||
$id = $tab_id_facture['rowid'];
|
||||
|
||||
|
||||
|
||||
// Ajout d'une opération sur le compte de caisse, uniquement si le paiement est en espèces
|
||||
if ( $obj_facturation->mode_reglement() == 'ESP' ) {
|
||||
// Ajout d'une op<6F>ration sur le compte de caisse, uniquement si le paiement est en esp<73>ces
|
||||
if ( $obj_facturation->mode_reglement() == 'ESP' ) {
|
||||
|
||||
$sql->query (
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."bank (
|
||||
$sql->query (
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."bank (
|
||||
datec,
|
||||
datev,
|
||||
dateo,
|
||||
@ -316,21 +341,30 @@
|
||||
)
|
||||
;");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Récupération de l'id de l'opération nouvellement créée
|
||||
$tab_id_operation = $sql->fetchFirst ( $sql->query (
|
||||
"SELECT rowid
|
||||
// Recuperation de l'id de l'operation nouvellement creee
|
||||
$resql=$sql->query (
|
||||
"SELECT rowid
|
||||
FROM ".MAIN_DB_PREFIX."bank
|
||||
WHERE 1
|
||||
ORDER BY rowid DESC") );
|
||||
ORDER BY rowid DESC");
|
||||
|
||||
$id_op = $tab_id_operation['rowid'];
|
||||
$ret=array();
|
||||
$tab = mysql_fetch_array($resql);
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$cle] = $valeur;
|
||||
}
|
||||
|
||||
$tab_id_operation = $tab;
|
||||
|
||||
$id_op = $tab_id_operation['rowid'];
|
||||
|
||||
|
||||
// Ajout d'un nouveau paiement
|
||||
$sql->query (
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."paiement (
|
||||
// Ajout d'un nouveau paiement
|
||||
$sql->query (
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."paiement (
|
||||
fk_facture,
|
||||
datec,
|
||||
datep,
|
||||
@ -361,18 +395,27 @@
|
||||
)");
|
||||
|
||||
|
||||
// Récupération de l'id du paiement nouvellement créé
|
||||
$tab_id_paiement = $sql->fetchFirst ( $sql->query (
|
||||
"SELECT rowid
|
||||
// R<>cup<75>ration de l'id du paiement nouvellement cr<63>
|
||||
$resql=$sql->query (
|
||||
"SELECT rowid
|
||||
FROM ".MAIN_DB_PREFIX."paiement
|
||||
WHERE 1
|
||||
ORDER BY rowid DESC") );
|
||||
ORDER BY rowid DESC");
|
||||
|
||||
$ret=array();
|
||||
$tab = mysql_fetch_array($resql);
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$cle] = $valeur;
|
||||
}
|
||||
|
||||
$id_paiement = $tab_id_paiement['rowid'];
|
||||
$tab_id_paiement = $tab;
|
||||
|
||||
$id_paiement = $tab_id_paiement['rowid'];
|
||||
|
||||
|
||||
$sql->query (
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (
|
||||
$sql->query (
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (
|
||||
fk_paiement,
|
||||
fk_facture,
|
||||
amount
|
||||
@ -385,11 +428,11 @@
|
||||
)
|
||||
;");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Ajout d'un réglement tva
|
||||
$sql->query (
|
||||
"INSERT INTO llx_facture_tva_sum (
|
||||
// Ajout d'un r<>glement tva
|
||||
$sql->query (
|
||||
"INSERT INTO llx_facture_tva_sum (
|
||||
fk_facture,
|
||||
amount,
|
||||
tva_tx
|
||||
@ -403,48 +446,74 @@
|
||||
;");
|
||||
|
||||
|
||||
// Récupération de la liste des articles du panier
|
||||
$tab_liste = $sql->fetchAll ( $sql->query ('
|
||||
// Recuperation de la liste des articles du panier
|
||||
$res=$sql->query ('
|
||||
SELECT fk_article, qte, fk_tva, remise_percent, remise, total_ht, total_ttc, reel
|
||||
FROM '.MAIN_DB_PREFIX.'tmp_caisse
|
||||
LEFT JOIN '.MAIN_DB_PREFIX.'product_stock ON '.MAIN_DB_PREFIX.'tmp_caisse.fk_article = '.MAIN_DB_PREFIX.'product_stock.fk_product
|
||||
WHERE 1') );
|
||||
WHERE 1');
|
||||
$ret=array(); $i=0;
|
||||
while ( $tab = mysql_fetch_array($res) )
|
||||
{
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$i][$cle] = $valeur;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count ($tab_liste); $i++) {
|
||||
$tab_liste = $ret;
|
||||
|
||||
// Récupération de l'article
|
||||
$tab_article = $sql->fetchFirst ( $sql->query (
|
||||
'SELECT label, tva_tx, price
|
||||
for ($i = 0; $i < count ($tab_liste); $i++) {
|
||||
|
||||
// Recuperation de l'article
|
||||
$res = $sql->query (
|
||||
'SELECT label, tva_tx, price
|
||||
FROM '.MAIN_DB_PREFIX.'product
|
||||
WHERE rowid = '.$tab_liste[$i]['fk_article']) );
|
||||
WHERE rowid = '.$tab_liste[$i]['fk_article']);
|
||||
$ret=array();
|
||||
$tab = mysql_fetch_array($res);
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$cle] = $valeur;
|
||||
}
|
||||
$tab_article = $ret;
|
||||
|
||||
$tab_tva = $sql->fetchFirst ( $sql->query (
|
||||
'SELECT taux
|
||||
$res = $sql->query (
|
||||
'SELECT taux
|
||||
FROM '.MAIN_DB_PREFIX.'c_tva
|
||||
WHERE rowid = '.$tab_liste[$i]['fk_tva']) );
|
||||
WHERE rowid = '.$tab_liste[$i]['fk_tva']);
|
||||
$ret=array();
|
||||
$tab = mysql_fetch_array($res);
|
||||
foreach ( $tab as $cle => $valeur )
|
||||
{
|
||||
$ret[$cle] = $valeur;
|
||||
}
|
||||
$tab_tva = $ret;
|
||||
|
||||
|
||||
// Calcul du montant de la TVA
|
||||
$montant_tva = $tab_liste[$i]['total_ttc'] - $tab_liste[$i]['total_ht'];
|
||||
|
||||
// Calcul du montant de la TVA
|
||||
$montant_tva = $tab_liste[$i]['total_ttc'] - $tab_liste[$i]['total_ht'];
|
||||
|
||||
// Calcul de la position de l'article dans la liste
|
||||
$position = $i + 1;
|
||||
// Calcul de la position de l'article dans la liste
|
||||
$position = $i + 1;
|
||||
|
||||
|
||||
$reel = $tab_liste[$i]['reel'];
|
||||
$qte = $tab_liste[$i]['qte'];
|
||||
$stock = $reel - $qte;
|
||||
$reel = $tab_liste[$i]['reel'];
|
||||
$qte = $tab_liste[$i]['qte'];
|
||||
$stock = $reel - $qte;
|
||||
|
||||
// Mise à jour du stock
|
||||
$sql->query (
|
||||
'UPDATE '.MAIN_DB_PREFIX.'product_stock
|
||||
// Mise <20> jour du stock
|
||||
$sql->query (
|
||||
'UPDATE '.MAIN_DB_PREFIX.'product_stock
|
||||
SET reel = '.$stock."
|
||||
WHERE fk_product = ".$tab_liste[$i]['fk_article']."
|
||||
LIMIT 1");
|
||||
|
||||
|
||||
// Ajout d'une entrée dans le détail de la facture
|
||||
$sql->query (
|
||||
'INSERT INTO '.MAIN_DB_PREFIX.'facturedet (
|
||||
// Ajout d'une entr<74>e dans le d<>tail de la facture
|
||||
$sql->query (
|
||||
'INSERT INTO '.MAIN_DB_PREFIX.'facturedet (
|
||||
fk_facture,
|
||||
fk_product,
|
||||
description,
|
||||
@ -487,14 +556,14 @@
|
||||
0,
|
||||
".$position.")");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$redirection = 'affIndex.php?menu=validation_ok&facid='.$id; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr
|
||||
break;
|
||||
$redirection = 'affIndex.php?menu=validation_ok&facid='.$id; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['serObjFacturation'] = serialize ($obj_facturation);
|
||||
$_SESSION['serObjFacturation'] = serialize ($obj_facturation);
|
||||
|
||||
header ('Location: '.$redirection);
|
||||
header ('Location: '.$redirection);
|
||||
?>
|
||||
|
||||
@ -397,11 +397,10 @@ class DoliDb
|
||||
|
||||
|
||||
/**
|
||||
\brief Renvoie les donn<EFBFBD>es dans un tableau.
|
||||
\param resultset Curseur de la requete voulue
|
||||
\return array
|
||||
* \brief Renvoie les donnees dans un tableau.
|
||||
* \param resultset Curseur de la requete voulue
|
||||
* \return array
|
||||
*/
|
||||
|
||||
function fetch_array($resultset=0)
|
||||
{
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
@ -410,11 +409,10 @@ class DoliDb
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Renvoie les donn<EFBFBD>es comme un tableau.
|
||||
\param resultset Curseur de la requete voulue
|
||||
\return array
|
||||
* \brief Renvoie les donnees comme un tableau.
|
||||
* \param resultset Curseur de la requete voulue
|
||||
* \return array
|
||||
*/
|
||||
|
||||
function fetch_row($resultset=0)
|
||||
{
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
|
||||
Loading…
Reference in New Issue
Block a user