diff --git a/htdocs/comm/fiche.php3 b/htdocs/comm/fiche.php3 index 1cee4156615..9c943f5bc8f 100644 --- a/htdocs/comm/fiche.php3 +++ b/htdocs/comm/fiche.php3 @@ -113,12 +113,6 @@ if ($action == 'stcomm') { } } } -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - /* * Recherche diff --git a/htdocs/compta/config.php3 b/htdocs/compta/config.php3 new file mode 100644 index 00000000000..695c38cfbed --- /dev/null +++ b/htdocs/compta/config.php3 @@ -0,0 +1,95 @@ + + * + * $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("./pre.inc.php3"); + +llxHeader(); + +$db = new Db(); + +if ($action == 'add') { + +} +/* + * + * Mode creation + * + * + * + */ + +if ($action == 'create') { + + +} else { + + /* + * + * Liste + * + * + */ + print_barre_liste("Comptes comptable",$page,$PHP_SELF); + + $sql = "SELECT number, label"; + $sql .= " FROM llx_compta_account"; + $sql .= " ORDER BY number"; + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows(); + + $i = 0; + print ""; + print ''; + print "\n"; + + if ($num > 0) { + $var=True; + while ($i < $num) { + $objp = $db->fetch_object( $i); + $var=!$var; + + print ""; + print ''; + print ''; + + print "\n"; + $i++; + } + } + + print "
Numéro"; + print_liste_field_titre("Libellé",$PHP_SELF,"label"); + print "
'.$objp->number.''.$objp->label.'
"; + $db->free(); + } else { + print $db->error(); + } + + + +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 10fc58e7590..061acb2f34c 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -25,7 +25,9 @@ llxHeader(); $db = new Db(); - +$yn[1] = "oui"; +$yn[0] = "non"; + if ($action == 'valid') { $sql = "UPDATE llx_facture set fk_statut = 1 WHERE rowid = $facid ;"; $result = $db->query( $sql); @@ -462,9 +464,6 @@ if ($action == 'create') { print "".price($objp->amount)."\n"; - $yn[1] = "oui"; - $yn[0] = "non"; - $total = $total + $objp->amount; $subtotal = $subtotal + $objp->amount; print "".$yn[$objp->paye]."\n"; diff --git a/htdocs/compta/ligne.php3 b/htdocs/compta/ligne.php3 new file mode 100644 index 00000000000..97f48cdf24b --- /dev/null +++ b/htdocs/compta/ligne.php3 @@ -0,0 +1,127 @@ + + * + * $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("./pre.inc.php3"); + +llxHeader(); + +$db = new Db(); + +$sql = "SELECT rowid, number, label FROM llx_compta_account ORDER BY number"; +if ( $db->query($sql) ) { + $num = $db->num_rows(); + $i = 0; + $options = ""; + while ($i < $num) { + $obj = $db->fetch_object($i); + $options .= "\n"; $i++; + } + $db->free(); + +} + + + + +if ($action == 'add') { + + $sql = "INSERT INTO llx_compta (datec, fk_compta_account, label, amount)"; + $sql .= " VALUES (now(),$number, '$label',$amount)"; + + $db->query($sql); + +} +/* + * + * Mode creation + * + * + * + */ + +if ($action == 'create') { + // + +} else { + + /* + * + * Liste + * + * + */ + print_barre_liste("Comptes comptable",$page,$PHP_SELF); + + + print ""; + print ''; + print ""; + print "\n"; + + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + + $sql = "SELECT ca.number, c.label, c.amount"; + $sql .= " FROM llx_compta_account as ca, llx_compta as c WHERE c.fk_compta_account = ca.rowid"; + $sql .= " ORDER BY ca.number"; + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows(); + $i = 0; + if ($num > 0) { + $var=True; + while ($i < $num) { + $objp = $db->fetch_object( $i); + $var=!$var; + + print ""; + print ''; + print ''; + print ''; + + print "\n"; + $i++; + } + } + + + $db->free(); + } else { + print $db->error(); + } + print "
Numéro"; + print_liste_field_titre("Libellé",$PHP_SELF,"label"); + print "Montant
'.$objp->number.''.$objp->label.''.price($objp->amount).'
"; +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index 815e8640fc5..5448f47dd4a 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -35,7 +35,7 @@ function llxHeader($head = "") { $menu->add("/compta/facture.php3","Factures"); $menu->add_submenu("paiement.php3","Paiements"); - $menu->add_submenu("fac.php3","admin fac"); + // $menu->add_submenu("fac.php3","admin fac"); $menu->add("ca.php3","Chiffres d'affaires"); @@ -50,10 +50,17 @@ function llxHeader($head = "") { $menu->add("bank/index.php3","Bank"); - $menu->add("voyage/index.php3","Voyages"); + if ($conf->voyage) { - $menu->add_submenu("voyage/index.php3","Voyages"); - $menu->add_submenu("voyage/reduc.php3","Reduc"); + $menu->add("voyage/index.php3","Voyages"); + + $menu->add_submenu("voyage/index.php3","Voyages"); + $menu->add_submenu("voyage/reduc.php3","Reduc"); + } + + $menu->add("ligne.php3","Compta"); + $menu->add_submenu("ligne.php3","Lignes"); + $menu->add_submenu("config.php3","Configuration"); left_menu($menu->liste); diff --git a/htdocs/conf/conf.class.php3.sample b/htdocs/conf/conf.class.php3.sample index 0a5a2edb09b..b167cdc4dc3 100644 --- a/htdocs/conf/conf.class.php3.sample +++ b/htdocs/conf/conf.class.php3.sample @@ -46,6 +46,7 @@ class Conf { $this->css = "theme/dolibarr/dolibarr.css"; + $this->voyage = 0; } } diff --git a/htdocs/fourn/fiche.php3 b/htdocs/fourn/fiche.php3 index 66769f701d0..eab50268124 100644 --- a/htdocs/fourn/fiche.php3 +++ b/htdocs/fourn/fiche.php3 @@ -21,7 +21,6 @@ */ require("./pre.inc.php3"); require("../contact.class.php3"); -require("../societe.class.php3"); llxHeader(); $db = new Db(); @@ -31,24 +30,10 @@ if ($sortorder == "") { if ($sortfield == "") { $sortfield="nom"; } -$bc[0]="bgcolor=\"#c0f0c0\""; -$bc[1]="bgcolor=\"#b0e0b0\""; -$bc2[0]="bgcolor=\"#c9f000\""; -$bc2[1]="bgcolor=\"#b9e000\""; - - -$yn["t"] = "oui"; -$yn["f"] = "non"; -$yn["1"] = "oui"; -$yn["0"] = "non"; - -$deacmeth["b"] = "robots"; -$deacmeth["m"] = "manuelle"; if ($action == 'attribute_prefix') { $societe = new Societe($db, $socid); $societe->attribute_prefix($db, $socid); - //$prefix_attrib = soc_attribute_prefix($db, $socid); } if ($action == 'recontact') { @@ -85,12 +70,6 @@ if ($action == 'stcomm') { } } } -if ($page == -1) { $page = 0 ; } -$limit = 26; -$offset = $limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - /* * Recherche diff --git a/mysql/data/data_dev.sql b/mysql/data/data_dev.sql index 8e027e2b194..efcf3b3cace 100644 --- a/mysql/data/data_dev.sql +++ b/mysql/data/data_dev.sql @@ -223,4 +223,9 @@ insert into llx_service values (14,now(),now(),'RAUDC2','R delete from llx_propal; delete from llx_propaldet; delete from llx_facture; -delete from llx_paiement; \ No newline at end of file +delete from llx_paiement; + + +delete from llx_compta_account; +insert into llx_compta_account (datec, number, label, fk_user_author) values (now(),'431000','URSSAF',1); +insert into llx_compta_account (datec, number, label, fk_user_author) values (now(),'654000','Clients',1); \ No newline at end of file diff --git a/mysql/tables/Makefile b/mysql/tables/Makefile index ea1d0c720da..b7bc538286a 100644 --- a/mysql/tables/Makefile +++ b/mysql/tables/Makefile @@ -37,6 +37,8 @@ create: $(MYSQL) $(BASE) < llx_bank_categ.sql $(MYSQL) $(BASE) < llx_bank_class.sql $(MYSQL) $(BASE) < llx_bookmark.sql + $(MYSQL) $(BASE) < llx_compta.sql + $(MYSQL) $(BASE) < llx_compta_account.sql $(MYSQL) $(BASE) < llx_fa_pr.sql $(MYSQL) $(BASE) < llx_facture.sql $(MYSQL) $(BASE) < llx_facture_fourn.sql diff --git a/mysql/tables/drop.sql b/mysql/tables/drop.sql index d0bf84f1023..29e848a6ba2 100644 --- a/mysql/tables/drop.sql +++ b/mysql/tables/drop.sql @@ -77,6 +77,10 @@ drop table if exists llx_bank_class; drop table if exists llx_bookmark; +drop table if exists llx_compta; + +drop table if exists llx_compta_account; + drop table if exists llx_fa_pr; drop table if exists llx_facture; diff --git a/mysql/tables/llx_compta.sql b/mysql/tables/llx_compta.sql new file mode 100644 index 00000000000..3de6647fa17 --- /dev/null +++ b/mysql/tables/llx_compta.sql @@ -0,0 +1,37 @@ +-- =================================================================== +-- Copyright (C) 2000-2002 Rodolphe Quiedeville +-- +-- $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. +-- +-- =================================================================== + + +create table llx_compta +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + datec datetime, + datev date, -- date de valeur + amount real NOT NULL default 0, + label varchar(255), + fk_compta_account integer, + fk_user_author integer, + fk_user_valid integer, + valid tinyint default 0, + note text + +); diff --git a/mysql/tables/llx_compta_account.sql b/mysql/tables/llx_compta_account.sql new file mode 100644 index 00000000000..b38d4cfb760 --- /dev/null +++ b/mysql/tables/llx_compta_account.sql @@ -0,0 +1,33 @@ +-- =================================================================== +-- Copyright (C) 2000-2002 Rodolphe Quiedeville +-- +-- $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. +-- +-- =================================================================== + + +create table llx_compta_account +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + datec datetime, + number varchar(12), + label varchar(255), + fk_user_author integer, + note text + +);