diff --git a/htdocs/compta/voyage/bilan.php b/htdocs/compta/voyage/bilan.php deleted file mode 100644 index fdc5d836dba..00000000000 --- a/htdocs/compta/voyage/bilan.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php"); -require("./reduc.class.php"); - - -llxHeader(); - -if ($action == 'add') { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc) "; - $sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reduc);"; - - $result = $db->query($sql); - if ($result) { - $rowid = $db->last_insert_id(MAIN_DB_PREFIX."voyage"); - - } else { - print $db->error(); - print "

$sql"; - } - -} -if ($action == 'del') { - /* $sql = "DELETE FROM ".MAIN_DB_PREFIX."voyage WHERE rowid = $rowid"; - *$result = $db->query($sql); - */ -} - -if ($vline) { - $viewline = $vline; -} else { - $viewline = 20; -} - -$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."voyage_reduc;"; -$result = $db->query($sql); -if ($result) { - $var=True; - $num = $db->num_rows(); - $i = 0; - $options = ""; - while ($i < $num) { - $obj = $db->fetch_object($result); - $options .= "\n"; $i++; - } - $db->free(); -} - - -print_titre("Bilan des reductions"); -/* - * Cartes - * - */ -$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."voyage_reduc"; - -$result = $db->query($sql); -if ($result) { - $cartes= array(); - $i = 0; - while ($i < $num) { - $obj = $db->fetch_object($result); - $cartes[$i] = $obj->rowid; - $i++; - } - $db->free; -} -/* - * - */ - -for ($j = 0 ; $j < sizeof($cartes) ; $j++) { - - $reduc = new Reduc($db); - $reduc->fetch($cartes[$j]); - - print ""; - print ""; - print ''; - print ''; - print ''; - print "\n"; - - print ''; - print ''; - - /* - * - */ - $sql = "SELECT b.rowid,".$db->pdate("b.date_depart")." as date_depart,".$db->pdate("b.date_arrivee")." as date_arrivee, b.amount, b.depart, b.arrivee , b.reduction"; - $sql .= " FROM ".MAIN_DB_PREFIX."voyage as b WHERE fk_reduc=".$reduc->id." ORDER BY b.date_depart ASC"; - - $result = $db->query($sql); - if ($result) { - - print ""; - print ''; - print ""; - print ""; - print "\n"; - - - $var=True; - $num = $db->num_rows(); - $i = 0; - $total = 0; - $total_reduc = 0; - - while ($i < $num) { - $objp = $db->fetch_object($result); - $total = $total + $objp->amount; - $total_reduc = $total_reduc + $objp->reduction; - $time = time(); - - $var=!$var; - - print ""; - print "\n"; - - print ""; - - print "\n"; - print "\n"; - - print ""; - - - $i++; - } - $db->free(); - - - print ""; - print "\n"; - - print ""; - print "\n"; - - print ""; - print "\n"; - - - - print "
'.$langs->trans("Description").'Montant 
'.$reduc->label.''.$reduc->price.' 
Date'.$langs->trans("Description").'MontantRéduction
".strftime("%d %b %y %H:%M",$objp->date_depart)."
\n"; - print "".strftime("%d %b %y %H:%M",$objp->date_arrivee)."
$objp->depart
$objp->arrivee
".price($objp->amount)."".price($objp->reduction)."
Total :".price($total)."".price($total_reduc)."
Carte :".price($reduc->price)."
Gain :".price($total_reduc - $reduc->price)."
"; - } else { - print "

".$db->error(); - - } -} - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/compta/voyage/index.php b/htdocs/compta/voyage/index.php deleted file mode 100644 index 8f4529386a6..00000000000 --- a/htdocs/compta/voyage/index.php +++ /dev/null @@ -1,147 +0,0 @@ - - * Copyright (C) 2004 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($action == 'add') { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc, reduction) "; - $sql .= " VALUES ('$date_depart','$date_arrivee',$amount,'$depart','$arrivee',$reducid, $reduc);"; - - $result = $db->query($sql); - if ($result) { - $rowid = $db->last_insert_id(MAIN_DB_PREFIX."voyage"); - - } else { - print $db->error(); - print "

$sql"; - } - -} -if ($action == 'del') { - /* $sql = "DELETE FROM ".MAIN_DB_PREFIX."voyage WHERE rowid = $rowid"; - *$result = $db->query($sql); - */ -} - -if ($vline) { - $viewline = $vline; -} else { - $viewline = 20; -} - -$sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."voyage_reduc;"; -$result = $db->query($sql); -if ($result) { - $var=True; - $num = $db->num_rows(); - $i = 0; - $options = ""; - while ($i < $num) { - $obj = $db->fetch_object($result); - $options .= "\n"; $i++; - } - $db->free(); -} - - -print_titre("Voyages"); - - -$sql = "SELECT b.rowid,".$db->pdate("b.date_depart")." as date_depart,".$db->pdate("b.date_arrivee")." as date_arrivee, b.amount, b.reduction,b.depart, b.arrivee "; -$sql .= " FROM ".MAIN_DB_PREFIX."voyage as b ORDER BY b.date_depart ASC"; - -$result = $db->query($sql); -if ($result) { - - print "

"; - print ''; - print ""; - print ""; - print ""; - print ''; - print ""; - print ""; - print "\n"; - - - $var=True; - $num = $db->num_rows(); - $i = 0; $total = 0; - - $sep = 0; - - while ($i < $num) { - $objp = $db->fetch_object($result); - $total = $total + $objp->amount; - $time = time(); - - $var=!$var; - - print ""; - print "\n"; - - print ""; - - print "\n"; - print "\n"; - print ""; - print ""; - - - $i++; - } - $db->free(); - - print ""; - print ""; - print ""; - - print ""; - - print ""; - print ""; - - print ""; - - print ''; - - print ''; - print "
Date'.$langs->trans("Description").'MontantRéduction
".strftime("%d %b %y %H:%M",$objp->date_depart)."
\n"; - print "".strftime("%d %b %y %H:%M",$objp->date_arrivee)."
$objp->depart - $objp->arrivee".price($objp->amount)."".price($objp->reduction)."rowid\">[Del]

"; - print "

"; - print "
trans("Add")."\"
Réduction'.$langs->trans("Currency".$conf->monnaie).' 
"; -} else { - print "

".$db->error(); - -} - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/compta/voyage/pre.inc.php b/htdocs/compta/voyage/pre.inc.php deleted file mode 100644 index 8923355074f..00000000000 --- a/htdocs/compta/voyage/pre.inc.php +++ /dev/null @@ -1,52 +0,0 @@ - - * Copyright (C) 2005 Laurent Destailleur - * - * $Id$ - * $Source$ - * - * 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ -require("../../main.inc.php"); - -function llxHeader($head = "") { - global $user, $conf, $langs; - - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add("index.php",$langs->trans("Trips")); - - $menu->add_submenu("index.php",$langs->trans("Trips")); - $menu->add_submenu("bilan.php","Bilan"); - $menu->add_submenu("reduc.php","Reduc"); - $menu->add_submenu("voyage.php",$langs->trans("Trip")); - - $menu->add("/compta/facture.php",$langs->trans("Bills")); - - $menu->add("/compta/bank/index.php",$langs->trans("Bank")); - - left_menu($menu->liste); - -} - -?> diff --git a/htdocs/compta/voyage/reduc.class.php b/htdocs/compta/voyage/reduc.class.php deleted file mode 100644 index 6bc47b570c3..00000000000 --- a/htdocs/compta/voyage/reduc.class.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * $Id$ - * $Source$ - * - * 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -class Reduc { - var $id; - var $price; - var $label; - - function Reduc($DB, $rowid=0) { - global $config; - - $this->db = $DB; - $this->rowid = $rowid; - - return 1; - } - - function fetch($id) { - $sql = "SELECT b.rowid,".$this->db->pdate("b.date_debut")." as debut,".$this->db->pdate("b.date_fin")." as fin, b.amount, b.label "; - $sql .= " FROM ".MAIN_DB_PREFIX."voyage_reduc as b WHERE rowid = $id"; - - $result = $this->db->query($sql); - - if ($result) { - if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result); - - $this->id = $obj->rowid; - $this->price = $obj->amount; - $this->label = $obj->label; - } - $this->db->free(); - } - } - - -} - -?> diff --git a/htdocs/compta/voyage/reduc.php b/htdocs/compta/voyage/reduc.php deleted file mode 100644 index e305d05fb06..00000000000 --- a/htdocs/compta/voyage/reduc.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Copyright (C) 2004 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -print_titre ("Abonnement de réduction"); - -print ""; -print ""; -print ''; -print ""; -print "\n"; - - -$sql = "SELECT b.rowid,".$db->pdate("b.date_debut")." as debut,".$db->pdate("b.date_fin")." as fin, b.amount, b.label "; -$sql .= " FROM ".MAIN_DB_PREFIX."voyage_reduc as b "; - -$result = $db->query($sql); -if ($result) { - $var=True; - $num = $db->num_rows(); - $i = 0; $total = 0; - - $sep = 0; - - while ($i < $num) { - $objp = $db->fetch_object($result); - $total = $total + $objp->amount; - $time = time(); - - $var=!$var; - - print ""; - print "\n"; - print ""; - print "\n"; - print ""; - - $i++; - } - $db->free(); -} - -print ""; -print "\n"; - - -print "
Date'.$langs->trans("Description").'Montant
".strftime("%d %b %y",$objp->debut)." au ".strftime("%d %b %y",$objp->fin)."$objp->label".price($objp->amount)."
".$langs->trans("TotalHT").":".price($total)."
"; - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/compta/voyage/voyage.php b/htdocs/compta/voyage/voyage.php deleted file mode 100644 index 7eec2c8c6ff..00000000000 --- a/htdocs/compta/voyage/voyage.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/core/conf.class.php b/htdocs/core/conf.class.php index 242b6114462..d60eb6fa863 100644 --- a/htdocs/core/conf.class.php +++ b/htdocs/core/conf.class.php @@ -260,14 +260,12 @@ class Conf $this->mantis->db->name=defined('PHPMANTIS_DBNAME')?PHPMANTIS_DBNAME:''; // Module propal if (! defined("PROPALE_NEW_FORM_NB_PRODUCT")) define("PROPALE_NEW_FORM_NB_PRODUCT", 4); - // Module voyage - $this->voyage->enabled=0; // Module oscommerce 1 $this->boutique->livre->enabled=defined("BOUTIQUE_LIVRE")?BOUTIQUE_LIVRE:0; $this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0; /* - * Modification de quelques variable de conf en fonction des Constantes + * Set some default values */ // System tools diff --git a/htdocs/pre.inc.php b/htdocs/pre.inc.php index 8d1d80fe7b2..06f3b9fa523 100644 --- a/htdocs/pre.inc.php +++ b/htdocs/pre.inc.php @@ -111,13 +111,6 @@ function llxHeader($head = '', $title='', $help_url='') $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); } - if (! empty($conf->voyage->enabled) && $user->societe_id == 0) - { - $menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages"); - $menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages",1); - $menu->add(DOL_URL_ROOT."/compta/voyage/reduc.php","Reduc",1); - } - if (! empty($conf->domaine->enabled)) { $menu->add(DOL_URL_ROOT."/domain/index.php", "Domaines"); diff --git a/mysql/tables/llx_voyage.sql b/mysql/tables/llx_voyage.sql deleted file mode 100644 index 8f03ca8a99f..00000000000 --- a/mysql/tables/llx_voyage.sql +++ /dev/null @@ -1,44 +0,0 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- --- 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 --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- insert into llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc) --- values ('2002-04-21 12:05','2002-04-21 15:25',26.8,'Paris','Auray',1) - --- insert into llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc) --- values ('2002-04-23 15:42','2002-04-23 19:10',26.8,'Auray','Paris',1) --- --- $Id$ --- =================================================================== - -create table llx_voyage -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, - - dateo date, -- date operation - date_depart datetime, -- date du voyage - date_arrivee datetime, -- date du voyage - amount real NOT NULL DEFAULT 0, -- prix du billet - reduction real NOT NULL DEFAULT 0, -- montant de la reduction obtenue - depart varchar(255), - arrivee varchar(255), - fk_type smallint, -- Train, Avion, Bateaux - fk_reduc integer, - distance integer, -- distance en kilometre - dossier varchar(50), -- numero de dossier - note text -)type=innodb; diff --git a/mysql/tables/llx_voyage_reduc.sql b/mysql/tables/llx_voyage_reduc.sql deleted file mode 100644 index d09703e70f1..00000000000 --- a/mysql/tables/llx_voyage_reduc.sql +++ /dev/null @@ -1,33 +0,0 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- --- 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 --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- =================================================================== - -create table llx_voyage_reduc -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, - datev date, -- date de valeur - date_debut date, -- date operation - date_fin date, - amount real NOT NULL DEFAULT 0, - label varchar(255), - numero varchar(255), - fk_type smallint, -- Train, Avion, Bateaux - note text -)type=innodb;